mirror of
https://gitee.com/BDWare/agent-backend
synced 2025-01-10 01:44:14 +00:00
optimize build.gradle
This commit is contained in:
parent
db5e8451b0
commit
a3149bec5c
@ -36,6 +36,9 @@ dependencies {
|
|||||||
implementation project(":mockjava")
|
implementation project(":mockjava")
|
||||||
implementation project(":front-base")
|
implementation project(":front-base")
|
||||||
implementation 'io.prometheus:simpleclient_httpserver:0.12.0'
|
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'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ public class CMActions implements OnHashCallback {
|
|||||||
ret.has("result") ? ret.get("result").toString() : "");
|
ret.has("result") ? ret.get("result").toString() : "");
|
||||||
}
|
}
|
||||||
LOGGER.debug("result of request " + cReq.getRequestID() + ": " + ret);
|
LOGGER.debug("result of request " + cReq.getRequestID() + ": " + ret);
|
||||||
resultCallback.onResult(ret.toString());
|
resultCallback.onResult(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -369,8 +369,7 @@ public class CMActions implements OnHashCallback {
|
|||||||
ret.put("data", str);
|
ret.put("data", str);
|
||||||
String costTime = (System.currentTimeMillis() - start) + "";
|
String costTime = (System.currentTimeMillis() - start) + "";
|
||||||
ret.put("executeTime", costTime);
|
ret.put("executeTime", costTime);
|
||||||
String retStr = JsonUtil.toJson(ret);
|
resultCallback.onResult(ret);
|
||||||
resultCallback.onResult(retStr);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
rb.onResult(generator.generate(targetPath));
|
rb.onResult(generator.generate(targetPath));
|
||||||
@ -380,7 +379,7 @@ public class CMActions implements OnHashCallback {
|
|||||||
Map<String, String> ret = new HashMap<>();
|
Map<String, String> ret = new HashMap<>();
|
||||||
ret.put("action", "onGenerateReadme");
|
ret.put("action", "onGenerateReadme");
|
||||||
ret.put("data", bo.toString());
|
ret.put("data", bo.toString());
|
||||||
resultCallback.onResult(JsonUtil.toJson(ret));
|
resultCallback.onResult(ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1932,6 +1931,4 @@ public class CMActions implements OnHashCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -245,7 +245,7 @@ public class MasterWSAction {
|
|||||||
}
|
}
|
||||||
ret.put("data", str);
|
ret.put("data", str);
|
||||||
ret.put("executionTime", (System.currentTimeMillis() - curr) + "");
|
ret.put("executionTime", (System.currentTimeMillis() - curr) + "");
|
||||||
rc.onResult(JsonUtil.toJson(ret));
|
rc.onResult(ret);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodeSize);
|
nodeSize);
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package org.bdware.server.action.p2p;
|
package org.bdware.server.action.p2p;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.bdware.heartbeat.HeartBeatUtil;
|
import org.bdware.heartbeat.HeartBeatUtil;
|
||||||
@ -114,9 +113,7 @@ public class AliveCheckClientAction {
|
|||||||
int lastSeq = meta.getLastExeSeq();
|
int lastSeq = meta.getLastExeSeq();
|
||||||
request.put("lastExe", lastSeq + "");
|
request.put("lastExe", lastSeq + "");
|
||||||
request.put("master", masterPubkey);
|
request.put("master", masterPubkey);
|
||||||
String[] members =
|
request.put("members", meta.joinMembers(","));
|
||||||
meta.getMembers();
|
|
||||||
request.put("members", StringUtils.join(members, ","));
|
|
||||||
NetworkManager.instance.sendToNodeCenter(
|
NetworkManager.instance.sendToNodeCenter(
|
||||||
JsonUtil.toJson(request));
|
JsonUtil.toJson(request));
|
||||||
MasterElectTimeRecorder.findMasterCrash =
|
MasterElectTimeRecorder.findMasterCrash =
|
||||||
|
@ -2,7 +2,6 @@ package org.bdware.server.action.p2p;
|
|||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonPrimitive;
|
import com.google.gson.JsonPrimitive;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.bdware.sc.*;
|
import org.bdware.sc.*;
|
||||||
@ -74,13 +73,12 @@ public class MasterClientTCPAction {
|
|||||||
request.put("lastExe", lastSeq + "");
|
request.put("lastExe", lastSeq + "");
|
||||||
request.put("master", "null"); // 不管之前master是哪个,NC处是null,所有节点重选
|
request.put("master", "null"); // 不管之前master是哪个,NC处是null,所有节点重选
|
||||||
if (null != uniNumber) request.put("uniNumber", uniNumber);
|
if (null != uniNumber) request.put("uniNumber", uniNumber);
|
||||||
String members =
|
|
||||||
StringUtils.join(
|
String members = CMActions.manager
|
||||||
CMActions.manager
|
.multiContractRecorder
|
||||||
.multiContractRecorder
|
.getMultiContractMeta(contractID)
|
||||||
.getMultiContractMeta(contractID)
|
.joinMembers(",");
|
||||||
.getMembers(),
|
|
||||||
",");
|
|
||||||
request.put("members", members);
|
request.put("members", members);
|
||||||
NetworkManager.instance.sendToNodeCenter(JsonUtil.toJson(request));
|
NetworkManager.instance.sendToNodeCenter(JsonUtil.toJson(request));
|
||||||
LOGGER.info("认为合约 " + contractID + " 的master崩溃 当前master为null 向NC发送重选信息");
|
LOGGER.info("认为合约 " + contractID + " 的master崩溃 当前master为null 向NC发送重选信息");
|
||||||
|
@ -353,7 +353,7 @@ public class CMHttpHandler extends SimpleChannelInboundHandler<HttpObject> {
|
|||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||||
LOGGER.warn("catch exception in " + this + ": " + cause.getClass().getSimpleName());
|
LOGGER.warn("catch exception in " + this + ": " + cause.getClass().getSimpleName());
|
||||||
LOGGER.debug(ExceptionUtil.exceptionToString(cause));
|
cause.printStackTrace();
|
||||||
// ctx.close();
|
// ctx.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user