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. *