fix: MultiPointCooperationExecutor

This commit is contained in:
CaiHQ 2022-02-18 11:14:10 +08:00
parent 90a1145578
commit 579024ad56

View File

@ -87,7 +87,7 @@ public class MultiPointCooperationExecutor extends AbstractContextContractExecut
"[sendRequests] get cmNode " "[sendRequests] get cmNode "
+ node.substring(0, 5) + node.substring(0, 5)
+ " not null " + " not null "
+ "org.bdware.consistency.plugin.ra.RequestAllExecutor 发送请求给 " + "RequestAllExecutor 发送请求给 "
+ node.substring(0, 5)); + node.substring(0, 5));
networkManager.sendToAgent(node, sendStr); networkManager.sendToAgent(node, sendStr);
} }
@ -137,9 +137,9 @@ public class MultiPointCooperationExecutor extends AbstractContextContractExecut
// List<String> nodes = info.members; // List<String> nodes = info.members;
int validNode = 0; int validNode = 0;
for (String node : nodes) { for (String node : nodes) {
if (networkManager.hasAgentConnection(node) if (networkManager.hasAgentConnection(node)) {
&& masterServerRecoverMechAction.getRecoverStatusMap().get(node).get(contractID) //&& masterServerRecoverMechAction.getRecoverStatusMap().get(node).get(contractID)
== RecoverFlag.Fine) { // == RecoverFlag.Fine
validNode++; validNode++;
} }
} }
@ -151,7 +151,7 @@ public class MultiPointCooperationExecutor extends AbstractContextContractExecut
@Override @Override
public void execute(String requestID, ContractRequest req, ResultCallback rc, OnHashCallback hcb) { public void execute(String requestID, ContractRequest req, ResultCallback rc, OnHashCallback hcb) {
LOGGER.info("[org.bdware.consistency.plugin.sharding.MultiPointCooperationExecutor] execute " + JsonUtil.toJson(req)); LOGGER.info("[MultiPointCooperationExecutor] execute " + JsonUtil.toJson(req));
// 获得action 函数名 // 获得action 函数名
LOGGER.info("action is : " + req.getAction()); LOGGER.info("action is : " + req.getAction());
req.setContractID(cmActions.getManager().getContractIDByName(req.getContractID())); req.setContractID(cmActions.getManager().getContractIDByName(req.getContractID()));
@ -208,13 +208,12 @@ public class MultiPointCooperationExecutor extends AbstractContextContractExecut
private int getJoinCount(JoinInfo joinInfo, String contractID) { private int getJoinCount(JoinInfo joinInfo, String contractID) {
if (joinInfo == null) return resultCount; if (joinInfo == null) return resultCount;
if (joinInfo.joinCount.isJsonPrimitive() && joinInfo.joinCount.getAsJsonPrimitive().isNumber()) { if (joinInfo != null) return joinInfo.joinCount;
return joinInfo.joinCount.getAsJsonPrimitive().getAsInt();
}
try { try {
ContractRequest cr = new ContractRequest(); ContractRequest cr = new ContractRequest();
cr.setContractID(contractID); cr.setContractID(contractID);
cr.setAction(joinInfo.joinCount.getAsString()); cr.setAction("TODO");
//TODO Arg需要好好设计一下 //TODO Arg需要好好设计一下
//TODO 又好用又简单的那种设计 //TODO 又好用又简单的那种设计
//TODO //TODO