@Test (expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Could not create one or more reporters.*") public void testStartUpFailsDueToMetricReporterFailure() { GobblinTaskRunnerTest.this.gobblinTaskRunnerFailedReporter.start(); }
public void start() throws ContainerHealthCheckException { logger.info(String.format("Starting %s in container %s", this.helixInstanceName, this.taskRunnerId)); addShutdownHook(); connectHelixManagerWithRetry(); TaskRunnerSuiteBase suite; try { suite = initTaskRunnerSuiteBase(); synchronized (this) { this.taskStateModelFactory = createTaskStateModelFactory(suite.getTaskFactoryMap()); } } catch (Exception e) { throw new RuntimeException(e); } this.metricsCollection = suite.getMetricsCollection(); this.services.addAll(suite.getServices()); this.services.addAll(getServices()); if (this.services.isEmpty()) { this.serviceManager = null; } else { this.serviceManager = new ServiceManager(services); } addInstanceTags(); initMetricReporter(); if (this.containerHealthEventBus != null) { logger.info("Registering GobblinTaskRunner with ContainerHealthCheckEventBus.."); this.containerHealthEventBus.register(this); } if (this.serviceManager != null) { this.serviceManager.startAsync(); started = true; this.serviceManager.awaitStopped(); } else { started = true; } if (this.isContainerExitOnHealthCheckFailureEnabled && GobblinTaskRunner.this.isHealthCheckFailed()) { logger.error("GobblinTaskRunner finished due to health check failure."); throw new ContainerHealthCheckException(); } }
GobblinTaskRunner implements StandardMetricsBridge { public void start() throws ContainerHealthCheckException { logger.info(String.format("Starting %s in container %s", this.helixInstanceName, this.taskRunnerId)); addShutdownHook(); connectHelixManagerWithRetry(); TaskRunnerSuiteBase suite; try { suite = initTaskRunnerSuiteBase(); synchronized (this) { this.taskStateModelFactory = createTaskStateModelFactory(suite.getTaskFactoryMap()); } } catch (Exception e) { throw new RuntimeException(e); } this.metricsCollection = suite.getMetricsCollection(); this.services.addAll(suite.getServices()); this.services.addAll(getServices()); if (this.services.isEmpty()) { this.serviceManager = null; } else { this.serviceManager = new ServiceManager(services); } addInstanceTags(); initMetricReporter(); if (this.containerHealthEventBus != null) { logger.info("Registering GobblinTaskRunner with ContainerHealthCheckEventBus.."); this.containerHealthEventBus.register(this); } if (this.serviceManager != null) { this.serviceManager.startAsync(); started = true; this.serviceManager.awaitStopped(); } else { started = true; } if (this.isContainerExitOnHealthCheckFailureEnabled && GobblinTaskRunner.this.isHealthCheckFailed()) { logger.error("GobblinTaskRunner finished due to health check failure."); throw new ContainerHealthCheckException(); } } }
GobblinTaskRunner implements StandardMetricsBridge { public void start() throws ContainerHealthCheckException { logger.info(String.format("Starting %s in container %s", this.helixInstanceName, this.taskRunnerId)); addShutdownHook(); connectHelixManagerWithRetry(); TaskRunnerSuiteBase suite; try { suite = initTaskRunnerSuiteBase(); synchronized (this) { this.taskStateModelFactory = createTaskStateModelFactory(suite.getTaskFactoryMap()); } } catch (Exception e) { throw new RuntimeException(e); } this.metricsCollection = suite.getMetricsCollection(); this.services.addAll(suite.getServices()); this.services.addAll(getServices()); if (this.services.isEmpty()) { this.serviceManager = null; } else { this.serviceManager = new ServiceManager(services); } addInstanceTags(); initMetricReporter(); if (this.containerHealthEventBus != null) { logger.info("Registering GobblinTaskRunner with ContainerHealthCheckEventBus.."); this.containerHealthEventBus.register(this); } if (this.serviceManager != null) { this.serviceManager.startAsync(); started = true; this.serviceManager.awaitStopped(); } else { started = true; } if (this.isContainerExitOnHealthCheckFailureEnabled && GobblinTaskRunner.this.isHealthCheckFailed()) { logger.error("GobblinTaskRunner finished due to health check failure."); throw new ContainerHealthCheckException(); } } GobblinTaskRunner(String applicationName,
      String helixInstanceName,
      String applicationId,
      String taskRunnerId,
      Config config,
      Optional<Path> appWorkDirOptional); }
GobblinTaskRunner implements StandardMetricsBridge { public void start() throws ContainerHealthCheckException { logger.info(String.format("Starting %s in container %s", this.helixInstanceName, this.taskRunnerId)); addShutdownHook(); connectHelixManagerWithRetry(); TaskRunnerSuiteBase suite; try { suite = initTaskRunnerSuiteBase(); synchronized (this) { this.taskStateModelFactory = createTaskStateModelFactory(suite.getTaskFactoryMap()); } } catch (Exception e) { throw new RuntimeException(e); } this.metricsCollection = suite.getMetricsCollection(); this.services.addAll(suite.getServices()); this.services.addAll(getServices()); if (this.services.isEmpty()) { this.serviceManager = null; } else { this.serviceManager = new ServiceManager(services); } addInstanceTags(); initMetricReporter(); if (this.containerHealthEventBus != null) { logger.info("Registering GobblinTaskRunner with ContainerHealthCheckEventBus.."); this.containerHealthEventBus.register(this); } if (this.serviceManager != null) { this.serviceManager.startAsync(); started = true; this.serviceManager.awaitStopped(); } else { started = true; } if (this.isContainerExitOnHealthCheckFailureEnabled && GobblinTaskRunner.this.isHealthCheckFailed()) { logger.error("GobblinTaskRunner finished due to health check failure."); throw new ContainerHealthCheckException(); } } GobblinTaskRunner(String applicationName,
      String helixInstanceName,
      String applicationId,
      String taskRunnerId,
      Config config,
      Optional<Path> appWorkDirOptional); void start(); synchronized void stop(); @Override Collection<StandardMetrics> getStandardMetricsCollection(); @Subscribe void handleContainerHealthCheckFailureEvent(ContainerHealthCheckFailureEvent event); static Options buildOptions(); static void printUsage(Options options); static void main(String[] args); }
GobblinTaskRunner implements StandardMetricsBridge { public void start() throws ContainerHealthCheckException { logger.info(String.format("Starting %s in container %s", this.helixInstanceName, this.taskRunnerId)); addShutdownHook(); connectHelixManagerWithRetry(); TaskRunnerSuiteBase suite; try { suite = initTaskRunnerSuiteBase(); synchronized (this) { this.taskStateModelFactory = createTaskStateModelFactory(suite.getTaskFactoryMap()); } } catch (Exception e) { throw new RuntimeException(e); } this.metricsCollection = suite.getMetricsCollection(); this.services.addAll(suite.getServices()); this.services.addAll(getServices()); if (this.services.isEmpty()) { this.serviceManager = null; } else { this.serviceManager = new ServiceManager(services); } addInstanceTags(); initMetricReporter(); if (this.containerHealthEventBus != null) { logger.info("Registering GobblinTaskRunner with ContainerHealthCheckEventBus.."); this.containerHealthEventBus.register(this); } if (this.serviceManager != null) { this.serviceManager.startAsync(); started = true; this.serviceManager.awaitStopped(); } else { started = true; } if (this.isContainerExitOnHealthCheckFailureEnabled && GobblinTaskRunner.this.isHealthCheckFailed()) { logger.error("GobblinTaskRunner finished due to health check failure."); throw new ContainerHealthCheckException(); } } GobblinTaskRunner(String applicationName,
      String helixInstanceName,
      String applicationId,
      String taskRunnerId,
      Config config,
      Optional<Path> appWorkDirOptional); void start(); synchronized void stop(); @Override Collection<StandardMetrics> getStandardMetricsCollection(); @Subscribe void handleContainerHealthCheckFailureEvent(ContainerHealthCheckFailureEvent event); static Options buildOptions(); static void printUsage(Options options); static void main(String[] args); static final String CLUSTER_APP_WORK_DIR; }