public void run()

in uReplicator-Worker/src/main/java/com/uber/stream/ureplicator/worker/WorkerStarter.java [56:101]


  public void run() throws Exception {
    Properties helixProps = null;
    try {
      helixProps = WorkerUtils.loadAndValidateHelixProps(workerConf.getHelixConfigFile());
    } catch (Exception e) {
      LOGGER.error(
          "uReplicator Worker failed to start because of load helix config file throws exception",
          e);
      System.exit(1);
    }

    if (workerConf.getFederatedEnabled()) {
      try {
        LOGGER.info("Starting manager-worker listener");
        managerWorkerHelixHandler = new ManagerWorkerHelixHandler(workerConf, helixProps,
            workerInstance);
        managerWorkerHelixHandler.start();
      } catch (Throwable e) {
        LOGGER.error("Caught exception while starting manager-worker listener.", e);
        throw e;
      }
    } else {
      LOGGER.info("Starting worker instance, federated_enabled : {}",
          workerConf.getFederatedEnabled());
      String helixClusterName = helixProps
          .getProperty(Constants.HELIX_CLUSTER_NAME, Constants.DEFAULT_HELIX_CLUSTER_NAME);
      try {
        controllerWorkerHelixHandler = new ControllerWorkerHelixHandler(helixProps,
            helixClusterName, workerInstance);
        controllerWorkerHelixHandler.start();
      } catch (Throwable e) {
        LOGGER.error("Caught exception while starting worker instance.", e);
        throw e;
      }
    }

    runRestApplication();

    // wait until shutdown
    try {
      shutdownLatch.await();
      LOGGER.info("Shutting down worker finished");
    } catch (InterruptedException e) {
      LOGGER.info("Shutting down worker due to interrupted exception");
    }
  }