optimize build.gradle

This commit is contained in:
CaiHQ 2021-12-21 17:48:30 +08:00
parent db5e8451b0
commit a3149bec5c
6 changed files with 15 additions and 20 deletions

View File

@ -36,6 +36,9 @@ dependencies {
implementation project(":mockjava")
implementation project(":front-base")
implementation 'io.prometheus:simpleclient_httpserver:0.12.0'
implementation 'org.knowhowlab.osgi:sigar:1.6.5_01'
implementation 'io.grpc:grpc-all:1.41.0'
implementation 'org.apache.velocity:velocity-engine-core:2.3'
testImplementation 'junit:junit:4.13.2'
}

View File

@ -222,7 +222,7 @@ public class CMActions implements OnHashCallback {
ret.has("result") ? ret.get("result").toString() : "");
}
LOGGER.debug("result of request " + cReq.getRequestID() + ": " + ret);
resultCallback.onResult(ret.toString());
resultCallback.onResult(ret);
}
@Override
@ -369,8 +369,7 @@ public class CMActions implements OnHashCallback {
ret.put("data", str);
String costTime = (System.currentTimeMillis() - start) + "";
ret.put("executeTime", costTime);
String retStr = JsonUtil.toJson(ret);
resultCallback.onResult(retStr);
resultCallback.onResult(ret);
}
};
rb.onResult(generator.generate(targetPath));
@ -380,7 +379,7 @@ public class CMActions implements OnHashCallback {
Map<String, String> ret = new HashMap<>();
ret.put("action", "onGenerateReadme");
ret.put("data", bo.toString());
resultCallback.onResult(JsonUtil.toJson(ret));
resultCallback.onResult(ret);
}
}
@ -1932,6 +1931,4 @@ public class CMActions implements OnHashCallback {
}
}

View File

@ -245,7 +245,7 @@ public class MasterWSAction {
}
ret.put("data", str);
ret.put("executionTime", (System.currentTimeMillis() - curr) + "");
rc.onResult(JsonUtil.toJson(ret));
rc.onResult(ret);
}
},
nodeSize);

View File

@ -1,7 +1,6 @@
package org.bdware.server.action.p2p;
import com.google.gson.JsonObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bdware.heartbeat.HeartBeatUtil;
@ -114,9 +113,7 @@ public class AliveCheckClientAction {
int lastSeq = meta.getLastExeSeq();
request.put("lastExe", lastSeq + "");
request.put("master", masterPubkey);
String[] members =
meta.getMembers();
request.put("members", StringUtils.join(members, ","));
request.put("members", meta.joinMembers(","));
NetworkManager.instance.sendToNodeCenter(
JsonUtil.toJson(request));
MasterElectTimeRecorder.findMasterCrash =

View File

@ -2,7 +2,6 @@ package org.bdware.server.action.p2p;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bdware.sc.*;
@ -74,13 +73,12 @@ public class MasterClientTCPAction {
request.put("lastExe", lastSeq + "");
request.put("master", "null"); // 不管之前master是哪个NC处是null所有节点重选
if (null != uniNumber) request.put("uniNumber", uniNumber);
String members =
StringUtils.join(
CMActions.manager
.multiContractRecorder
.getMultiContractMeta(contractID)
.getMembers(),
",");
String members = CMActions.manager
.multiContractRecorder
.getMultiContractMeta(contractID)
.joinMembers(",");
request.put("members", members);
NetworkManager.instance.sendToNodeCenter(JsonUtil.toJson(request));
LOGGER.info("认为合约 " + contractID + " 的master崩溃 当前master为null 向NC发送重选信息");

View File

@ -353,7 +353,7 @@ public class CMHttpHandler extends SimpleChannelInboundHandler<HttpObject> {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
LOGGER.warn("catch exception in " + this + ": " + cause.getClass().getSimpleName());
LOGGER.debug(ExceptionUtil.exceptionToString(cause));
cause.printStackTrace();
// ctx.close();
}
}