use of org.apache.samza.container.ContainerHeartbeatClient in project samza by apache.
the class LocalContainerRunner method startContainerHeartbeatMonitor.
private void startContainerHeartbeatMonitor() {
String coordinatorUrl = System.getenv(ShellCommandConfig.ENV_COORDINATOR_URL());
String executionEnvContainerId = System.getenv(ShellCommandConfig.ENV_EXECUTION_ENV_CONTAINER_ID());
if (executionEnvContainerId != null) {
log.info("Got execution environment container id: {}", executionEnvContainerId);
containerHeartbeatMonitor = new ContainerHeartbeatMonitor(() -> {
container.shutdown();
containerRunnerException = new SamzaException("Container shutdown due to expired heartbeat");
}, new ContainerHeartbeatClient(coordinatorUrl, executionEnvContainerId));
containerHeartbeatMonitor.start();
} else {
containerHeartbeatMonitor = null;
log.warn("executionEnvContainerId not set. Container heartbeat monitor will not be started");
}
}
Aggregations