This is an automated email from the ASF dual-hosted git repository.

xbli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new d7fff776be Allow PintoHelixResourceManager subclasses to be used in 
the controller starter by providing an overridable PinotHelixResouceManager 
object creator function (#13495)
d7fff776be is described below

commit d7fff776befae80b29252a096c448fcf27d3f052
Author: 9aman <[email protected]>
AuthorDate: Fri Jun 28 21:07:52 2024 +0530

    Allow PintoHelixResourceManager subclasses to be used in the controller 
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]>
---
 .../org/apache/pinot/controller/BaseControllerStarter.java | 14 +++++++++++++-
 .../controller/helix/core/PinotHelixResourceManager.java   |  9 +++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/BaseControllerStarter.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/BaseControllerStarter.java
index 2b8ea555bd..d8e4547a77 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/BaseControllerStarter.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/BaseControllerStarter.java
@@ -243,7 +243,7 @@ public abstract class BaseControllerStarter implements 
ServiceStartable {
       _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());
@@ -297,6 +297,18 @@ public abstract class BaseControllerStarter implements 
ServiceStartable {
             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;
   }
diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
index fc646c2ad3..2b835faaae 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
@@ -354,6 +354,15 @@ public class PinotHelixResourceManager {
     return _helixClusterName;
   }
 
+  /**
+   * Get the data directory path.
+   *
+   * @return Data directory path
+   */
+  public String getDataDir() {
+    return _dataDir;
+  }
+
   /**
    * Get the segment deletion manager.
    *


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to