Skip to content

Commit

Permalink
[controller] VeniceHelixAdmin: only initialise RepushOrchestrator & C…
Browse files Browse the repository at this point in the history
…ompactionManager if log compaction is enabled
  • Loading branch information
Whitney Deng committed Dec 12, 2024
1 parent 7eec4be commit 759c2ae
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public class VeniceHelixAdmin implements Admin, StoreCleaner {
private int defaultMaxRecordSizeBytes;

private DataRecoveryManager dataRecoveryManager;
private final CompactionManager compactionManager;
private CompactionManager compactionManager;
private ParticipantStoreClientsManager participantStoreClientsManager;
protected final PubSubTopicRepository pubSubTopicRepository;

Expand Down Expand Up @@ -607,13 +607,15 @@ public VeniceHelixAdmin(
dataRecoveryManager =
new DataRecoveryManager(this, icProvider, pubSubTopicRepository, participantStoreClientsManager);

// TODO extends interchangeable with implements?
// Implementation of the interface RepushOrchestrator depends on the configuration. (see RepushOrchestrator docs)
Class<? extends RepushOrchestrator> repushOrchestratorClass =
ReflectUtils.loadClass(multiClusterConfigs.getRepushOrchestratorClassName());
RepushOrchestrator repushOrchestrator =
ReflectUtils.callConstructor(repushOrchestratorClass, new Class[0], new Object[0]);
compactionManager = new CompactionManager(repushOrchestrator);
if (multiClusterConfigs.isLogCompactionEnabled()) {
// TODO extends interchangeable with implements?
// Implementation of the interface RepushOrchestrator depends on the configuration. (see RepushOrchestrator docs)
Class<? extends RepushOrchestrator> repushOrchestratorClass =
ReflectUtils.loadClass(multiClusterConfigs.getRepushOrchestratorClassName());
RepushOrchestrator repushOrchestrator =
ReflectUtils.callConstructor(repushOrchestratorClass, new Class[0], new Object[0]);
compactionManager = new CompactionManager(repushOrchestrator);
}

List<ClusterLeaderInitializationRoutine> initRoutines = new ArrayList<>();
initRoutines.add(
Expand Down

0 comments on commit 759c2ae

Please sign in to comment.