From 385df687654e73dc075db658b2a3f65d84822860 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 17 Dec 2024 22:57:03 +0800 Subject: [PATCH] Use @RequiredArgsConstructor on ComputeNodeInstanceContext --- .../instance/ComputeNodeInstanceContext.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstanceContext.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstanceContext.java index 47ed9440cd88c..8f733d3c0e14a 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstanceContext.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstanceContext.java @@ -19,6 +19,7 @@ import lombok.AccessLevel; import lombok.Getter; +import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.infra.config.mode.ModeConfiguration; import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions; import org.apache.shardingsphere.infra.instance.workerid.WorkerIdGenerator; @@ -36,30 +37,25 @@ /** * Compute node instance context. */ +@RequiredArgsConstructor @Getter @ThreadSafe public final class ComputeNodeInstanceContext { private final ComputeNodeInstance instance; + private final ModeConfiguration modeConfiguration; + + private final EventBusContext eventBusContext; + @Getter(AccessLevel.NONE) private final AtomicReference workerIdGenerator = new AtomicReference<>(); - private final ModeConfiguration modeConfiguration; - @Getter(AccessLevel.NONE) private final AtomicReference> lockContext = new AtomicReference<>(); - private final EventBusContext eventBusContext; - private final Collection allClusterInstances = new CopyOnWriteArrayList<>(); - public ComputeNodeInstanceContext(final ComputeNodeInstance instance, final ModeConfiguration modeConfig, final EventBusContext eventBusContext) { - this.instance = instance; - this.modeConfiguration = modeConfig; - this.eventBusContext = eventBusContext; - } - /** * Initialize compute node instance context. *