feat: more default router function

This commit is contained in:
CaiHQ 2022-07-09 09:30:54 +08:00
parent 4ef2806c20
commit e336865cc1
4 changed files with 7 additions and 12 deletions

View File

@ -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<JsonElement, Integer> map = new ConcurrentHashMap<>(); // <结果出现次数>

View File

@ -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();

View File

@ -1,8 +1,5 @@
package org.bdware.sc.bean;
public enum DefaultRouteRule {
byRequester,
byArgHash,
byTarget,
byFunc;
byRequester, byArgHash, byJsonPropHash, byShardingIDTree, byFunc;
}

View File

@ -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();