Skip to content

Commit

Permalink
Add ClusterInstanceRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Dec 17, 2024
1 parent 22144c1 commit 08956c1
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

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;
Expand All @@ -36,7 +35,6 @@
/**
* Compute node instance context.
*/
@RequiredArgsConstructor
@Getter
@ThreadSafe
public final class ComputeNodeInstanceContext {
Expand All @@ -47,13 +45,20 @@ public final class ComputeNodeInstanceContext {

private final EventBusContext eventBusContext;

private final ClusterInstanceRegistry clusterInstanceRegistry;

@Getter(AccessLevel.NONE)
private final AtomicReference<WorkerIdGenerator> workerIdGenerator = new AtomicReference<>();

@Getter(AccessLevel.NONE)
private final AtomicReference<LockContext<?>> lockContext = new AtomicReference<>();

private final ClusterInstanceRegistry clusterInstanceRegistry = new ClusterInstanceRegistry();
public ComputeNodeInstanceContext(final ComputeNodeInstance instance, final ModeConfiguration modeConfiguration, final EventBusContext eventBusContext) {
this.instance = instance;
this.modeConfiguration = modeConfiguration;
this.eventBusContext = eventBusContext;
clusterInstanceRegistry = new ClusterInstanceRegistry();
}

/**
* Initialize compute node instance context.
Expand Down

0 comments on commit 08956c1

Please sign in to comment.