Search in sources :

Example 1 with InputStreamsDiscoveredException

use of org.apache.samza.coordinator.InputStreamsDiscoveredException in project samza by apache.

the class ClusterBasedJobCoordinator method getInputRegexMonitor.

private Optional<StreamRegexMonitor> getInputRegexMonitor(JobModel jobModel, Config config, SystemAdmins systemAdmins) {
    StreamMetadataCache streamMetadataCache = new StreamMetadataCache(systemAdmins, 0, SystemClock.instance());
    return new StreamRegexMonitorFactory(streamMetadataCache, this.metrics).build(jobModel, config, (initialInputSet, newInputStreams, regexesMonitored) -> {
        if (hasDurableStores) {
            LOG.error("New input system-streams discovered. Failing the job. New input streams: {}" + " Existing input streams: {}", newInputStreams, initialInputSet);
            state.status = SamzaApplicationState.SamzaAppStatus.FAILED;
        }
        coordinatorException = new InputStreamsDiscoveredException("New input streams discovered: " + newInputStreams);
    });
}
Also used : StreamMetadataCache(org.apache.samza.system.StreamMetadataCache) InputStreamsDiscoveredException(org.apache.samza.coordinator.InputStreamsDiscoveredException) StreamRegexMonitorFactory(org.apache.samza.coordinator.StreamRegexMonitorFactory)

Aggregations

InputStreamsDiscoveredException (org.apache.samza.coordinator.InputStreamsDiscoveredException)1 StreamRegexMonitorFactory (org.apache.samza.coordinator.StreamRegexMonitorFactory)1 StreamMetadataCache (org.apache.samza.system.StreamMetadataCache)1