use of org.apache.samza.coordinator.RunIdGenerator in project samza by apache.
the class LocalApplicationRunner method initializeRunId.
private void initializeRunId() {
if (!isAppModeBatch) {
LOG.info("Not BATCH mode and hence not generating run id");
return;
}
if (!coordinationUtils.isPresent()) {
LOG.warn("Coordination utils not present. Aborting run id generation. Will continue execution without a run id.");
return;
}
try {
MetadataStore metadataStore = getMetadataStoreForRunID();
runIdGenerator = Optional.of(new RunIdGenerator(coordinationUtils.get(), metadataStore));
runId = runIdGenerator.flatMap(RunIdGenerator::getRunId);
} catch (Exception e) {
LOG.warn("Failed to generate run id. Will continue execution without a run id.", e);
}
}
Aggregations