You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/04/12 16:38:14 UTC

[GitHub] [incubator-pinot] jackjlli commented on a change in pull request #4109: Fixing PerfBenchmarkDriver

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

 ##########
 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:
   In my opinion `_helixResourceManager` shouldn't even be instantiated here. Looking through the code, it only does the following steps:
   * create tenants
   * add table
   * add segment
   
   All these behaviors should be done by sending requests to controller. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org