From cc27876d1c2d29afa384d2d45656539925439639 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 17 Dec 2024 23:01:02 +0800 Subject: [PATCH] Use @RequiredArgsConstructor on ComputeNodeInstanceContext (#34091) --- .../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. *