diff --git a/src/main/base/org/bdware/sc/ComponedContractResult.java b/src/main/base/org/bdware/sc/ComponedContractResult.java index 7942b2d..5da7838 100644 --- a/src/main/base/org/bdware/sc/ComponedContractResult.java +++ b/src/main/base/org/bdware/sc/ComponedContractResult.java @@ -45,10 +45,8 @@ public class ComponedContractResult { LOGGER.info("加入一个节点的执行结果是Error!该节点下线!"); return; } - ContractResult cr2; try { - cr2 = JsonUtil.fromJson(obj.get("data").getAsString(), ContractResult.class); if (cr2.status == ContractResult.Status.Error && cr2.result.getAsString().equals(EXPIRED_REQ)) { @@ -122,7 +120,7 @@ public class ComponedContractResult { } public ContractResult mergeFinalResult() { - LOGGER.info("mergeFinalResult"); +// LOGGER.info("mergeFinalResult"); Map map = new ConcurrentHashMap<>(); // <结果,出现次数> diff --git a/src/main/base/org/bdware/sc/conn/SocketGet.java b/src/main/base/org/bdware/sc/conn/SocketGet.java index 6c98fcb..e58cd3f 100644 --- a/src/main/base/org/bdware/sc/conn/SocketGet.java +++ b/src/main/base/org/bdware/sc/conn/SocketGet.java @@ -165,13 +165,12 @@ public class SocketGet { public void asyncGet(String pkgName, String method, String arg, ResultCallback cb) { try { - long id = random.nextLong(); - if (!r.waitObj.containsKey(id) && null != cb) { + long id; + for (id = random.nextLong(); r.waitObj.containsKey(id); id = random.nextLong()) ; + if (cb != null) { r.waitObj.put(id, cb); - } else { - LOGGER.warn("id conflict! " + id); + r.sleep(id, cb); } - r.sleep(id, cb); request(pkgName, method, arg, id); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/entry/org/bdware/sc/bean/DefaultRouteRule.java b/src/main/entry/org/bdware/sc/bean/DefaultRouteRule.java index cb7ee57..09df8a2 100644 --- a/src/main/entry/org/bdware/sc/bean/DefaultRouteRule.java +++ b/src/main/entry/org/bdware/sc/bean/DefaultRouteRule.java @@ -1,8 +1,5 @@ package org.bdware.sc.bean; public enum DefaultRouteRule { - byRequester, - byArgHash, - byTarget, - byFunc; + byRequester, byArgHash, byJsonPropHash, byShardingIDTree, byFunc; } diff --git a/src/main/entry/org/bdware/sc/bean/RouteInfo.java b/src/main/entry/org/bdware/sc/bean/RouteInfo.java index 674f093..987d643 100644 --- a/src/main/entry/org/bdware/sc/bean/RouteInfo.java +++ b/src/main/entry/org/bdware/sc/bean/RouteInfo.java @@ -11,6 +11,7 @@ public class RouteInfo implements Serializable { // The signature of RouteFunction is // function myFunc(requester, sourceArg) public String funcName; + public String param; public static RouteInfo create(AnnotationNode annotationNode, ContractNode contractNode) { RouteInfo info = new RouteInfo();