jackjlli commented on a change in pull request #4109: Fixing PerfBenchmarkDriver
URL: https://github.com/apache/incubator-pinot/pull/4109#discussion_r275038898
 
 

 ##########
 File path: 
pinot-tools/src/main/java/org/apache/pinot/tools/perf/PerfBenchmarkDriver.java
 ##########
 @@ -237,18 +239,31 @@ private void startServer()
 
   private void startHelixResourceManager()
       throws Exception {
-    _helixResourceManager = new PinotHelixResourceManager(getControllerConf());
-    _helixResourceManager.start();
-
-    // Create broker tenant.
-    Tenant brokerTenant = new 
TenantBuilder(_brokerTenantName).setRole(TenantRole.BROKER).setTotalInstances(1).build();
-    _helixResourceManager.createBrokerTenant(brokerTenant);
-
-    // Create server tenant.
-    Tenant serverTenant =
-        new 
TenantBuilder(_serverTenantName).setRole(TenantRole.SERVER).setTotalInstances(1).setOfflineInstances(1)
-            .build();
-    _helixResourceManager.createServerTenant(serverTenant);
+    if (_conf.shouldStartController()) {
+      // helix resource manager is already available at this time if 
controller is started
+      _helixResourceManager = _controllerStarter.getHelixResourceManager();
+    } else {
+      // When starting server only, we need to change the controller port to 
avoid registering controller helix
+      // participant with the same host and port.
+      ControllerConf controllerConf = getControllerConf();
+      
controllerConf.setControllerPort(Integer.toString(_conf.getControllerPort() + 
1));
 
 Review comment:
   I see. Thanks for the explanation! Can you add some comments on 
`_helixResourceManager` to explain a bit why it's needed here? I'm sure we're 
not the last one who had question on it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to