Skip to content

Commit

Permalink
Allow PintoHelixResourceManager subclasses to be used in the controll…
Browse files Browse the repository at this point in the history
…er starter by providing an overridable PinotHelixResouceManager object creator function (#13495)

* Allow PintoHelixResourceManager subclasses to be used in the controller starter
by providing an overridable PinotHelixResouceManager object creator function

---------

Co-authored-by: Aman Khanchandani <[email protected]>
Co-authored-by: Xiaotian (Jackie) Jiang <[email protected]>
  • Loading branch information
3 people authored Jun 28, 2024
1 parent 8747331 commit d7fff77
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public void init(PinotConfiguration pinotConfiguration)
_adminApp = createControllerAdminApp();
// Do not use this before the invocation of {@link PinotHelixResourceManager::start()}, which happens in {@link
// ControllerStarter::start()}
_helixResourceManager = new PinotHelixResourceManager(_config);
_helixResourceManager = createHelixResourceManager();
// This executor service is used to do async tasks from multiget util or table rebalancing.
_executorService =
Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("async-task-thread-%d").build());
Expand Down Expand Up @@ -297,6 +297,18 @@ private void setupHelixClusterConstraints() {
MAX_STATE_TRANSITIONS_PER_INSTANCE, constraintItem);
}

/**
* Creates an instance of PinotHelixResourceManager.
* <p>
* This method can be overridden by subclasses to instantiate the object
* with subclasses of PinotHelixResourceManager.
* By default, it returns a new PinotHelixResourceManager using the current configuration.
*
* @return A new instance of PinotHelixResourceManager.
*/
protected PinotHelixResourceManager createHelixResourceManager() {
return new PinotHelixResourceManager(_config);
}
public PinotHelixResourceManager getHelixResourceManager() {
return _helixResourceManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,15 @@ public String getHelixClusterName() {
return _helixClusterName;
}

/**
* Get the data directory path.
*
* @return Data directory path
*/
public String getDataDir() {
return _dataDir;
}

/**
* Get the segment deletion manager.
*
Expand Down

0 comments on commit d7fff77

Please sign in to comment.