This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new cc27876d1c2 Use @RequiredArgsConstructor on ComputeNodeInstanceContext
(#34091)
cc27876d1c2 is described below
commit cc27876d1c2d29afa384d2d45656539925439639
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Dec 17 23:01:02 2024 +0800
Use @RequiredArgsConstructor on ComputeNodeInstanceContext (#34091)
---
.../infra/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 47ed9440cd8..8f733d3c0e1 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 @@ package org.apache.shardingsphere.infra.instance;
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 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* 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> workerIdGenerator = new
AtomicReference<>();
- private final ModeConfiguration modeConfiguration;
-
@Getter(AccessLevel.NONE)
private final AtomicReference<LockContext<?>> lockContext = new
AtomicReference<>();
- private final EventBusContext eventBusContext;
-
private final Collection<ComputeNodeInstance> 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.
*