mirror of
https://gitee.com/BDWare/agent-backend
synced 2025-01-10 09:54:11 +00:00
feat: add logs
This commit is contained in:
parent
aba4d8dad3
commit
b3ef7bbe7d
@ -47,7 +47,7 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor {
|
|||||||
2,
|
2,
|
||||||
TimeUnit.SECONDS);
|
TimeUnit.SECONDS);
|
||||||
ContractManager.threadPool.submit(() -> {
|
ContractManager.threadPool.submit(() -> {
|
||||||
LOGGER.warn(
|
LOGGER.info(
|
||||||
"[SelfAdaptiveShardingExecutor " + meta.getContractID() + "] starting service...");
|
"[SelfAdaptiveShardingExecutor " + meta.getContractID() + "] starting service...");
|
||||||
while (running) {
|
while (running) {
|
||||||
LOGGER.info("checking blocks to be executed, latest block=" +
|
LOGGER.info("checking blocks to be executed, latest block=" +
|
||||||
@ -102,16 +102,18 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor {
|
|||||||
|
|
||||||
public void execute(String blockStr) {
|
public void execute(String blockStr) {
|
||||||
Block block = JsonUtil.fromJson(blockStr, Block.class);
|
Block block = JsonUtil.fromJson(blockStr, Block.class);
|
||||||
|
if (!toExecuted.containsKey(block.prevHash) &&
|
||||||
|
!executedBlocks.contains(block.hash) &&
|
||||||
|
block.isValid()) {
|
||||||
LOGGER.info(String.format(
|
LOGGER.info(String.format(
|
||||||
"[SelfAdaptiveShardingExecutor %s] receive block %s -> %s, %d transactions, timestamp %d",
|
"[SelfAdaptiveShardingExecutor %s] receive block %s -> %s," +
|
||||||
|
" %d transactions, timestamp=%d, size=%d",
|
||||||
meta.getContractID(),
|
meta.getContractID(),
|
||||||
block.hash,
|
block.hash,
|
||||||
block.prevHash,
|
block.prevHash,
|
||||||
block.requests.length,
|
block.requests.length,
|
||||||
block.timestamp));
|
block.timestamp,
|
||||||
if (!toExecuted.containsKey(block.prevHash) &&
|
blockStr.length()));
|
||||||
!executedBlocks.contains(block.hash) &&
|
|
||||||
block.isValid()) {
|
|
||||||
toExecuted.put(block.prevHash, block);
|
toExecuted.put(block.prevHash, block);
|
||||||
synchronized (flag) {
|
synchronized (flag) {
|
||||||
flag.notify();
|
flag.notify();
|
||||||
|
Loading…
Reference in New Issue
Block a user