From aba4d8dad37d14db87269a651ffec3db17b2249f Mon Sep 17 00:00:00 2001 From: "Frank.R.Wu" Date: Wed, 17 Nov 2021 21:25:48 +0800 Subject: [PATCH] feat: update SelfAdaptiveShardingExecutor add logs in SelfAdaptiveShardingExecutor --- .../trustedmodel/SelfAdaptiveShardingExecutor.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bdware/server/trustedmodel/SelfAdaptiveShardingExecutor.java b/src/main/java/org/bdware/server/trustedmodel/SelfAdaptiveShardingExecutor.java index 9ac7b9c..ec6c0f1 100644 --- a/src/main/java/org/bdware/server/trustedmodel/SelfAdaptiveShardingExecutor.java +++ b/src/main/java/org/bdware/server/trustedmodel/SelfAdaptiveShardingExecutor.java @@ -47,8 +47,11 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor { 2, TimeUnit.SECONDS); ContractManager.threadPool.submit(() -> { + LOGGER.warn( + "[SelfAdaptiveShardingExecutor " + meta.getContractID() + "] starting service..."); while (running) { - LOGGER.debug("latest block=" + this.b.prevHash + ", to be executed size=" + toExecuted.size()); + LOGGER.info("checking blocks to be executed, latest block=" + + this.b.prevHash + ", to be executed size=" + toExecuted.size()); LOGGER.debug("executed: " + JsonUtil.toJson(executedBlocks) + "\n\t" + JsonUtil.toJson(executedTxs)); while (!toExecuted.isEmpty()) { String key = this.b.prevHash; @@ -75,6 +78,7 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor { public void close() { this.future.cancel(false); this.running = false; + LOGGER.info("destruct executor of contract " + meta.getContractID()); } @Override @@ -128,6 +132,11 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor { LOGGER.debug("result of request " + request.getRequestID() + ": " + ret); executedTxs.put(request.getRequestID(), true); } + LOGGER.info(String.format( + "[SelfAdaptiveShardingExecutor %s] execute %d transactions of block %s", + meta.getContractID(), + block.requests.length, + block.hash)); this.b = new Block(block.hash); executedBlocks.add(block.hash); }