From b3ef7bbe7deefa52d76a6fa0866d43208999534e Mon Sep 17 00:00:00 2001 From: "Frank.R.Wu" Date: Thu, 18 Nov 2021 00:14:03 +0800 Subject: [PATCH] feat: add logs --- .../SelfAdaptiveShardingExecutor.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/bdware/server/trustedmodel/SelfAdaptiveShardingExecutor.java b/src/main/java/org/bdware/server/trustedmodel/SelfAdaptiveShardingExecutor.java index ec6c0f1..309c040 100644 --- a/src/main/java/org/bdware/server/trustedmodel/SelfAdaptiveShardingExecutor.java +++ b/src/main/java/org/bdware/server/trustedmodel/SelfAdaptiveShardingExecutor.java @@ -47,7 +47,7 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor { 2, TimeUnit.SECONDS); ContractManager.threadPool.submit(() -> { - LOGGER.warn( + LOGGER.info( "[SelfAdaptiveShardingExecutor " + meta.getContractID() + "] starting service..."); while (running) { LOGGER.info("checking blocks to be executed, latest block=" + @@ -102,16 +102,18 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor { public void execute(String blockStr) { Block block = JsonUtil.fromJson(blockStr, Block.class); - LOGGER.info(String.format( - "[SelfAdaptiveShardingExecutor %s] receive block %s -> %s, %d transactions, timestamp %d", - meta.getContractID(), - block.hash, - block.prevHash, - block.requests.length, - block.timestamp)); if (!toExecuted.containsKey(block.prevHash) && !executedBlocks.contains(block.hash) && block.isValid()) { + LOGGER.info(String.format( + "[SelfAdaptiveShardingExecutor %s] receive block %s -> %s," + + " %d transactions, timestamp=%d, size=%d", + meta.getContractID(), + block.hash, + block.prevHash, + block.requests.length, + block.timestamp, + blockStr.length())); toExecuted.put(block.prevHash, block); synchronized (flag) { flag.notify();