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