@Override public BoxedUnit apply(Exception exception, ExponentialSleepStrategy.RetryLoop loop) { if (loop.sleepCount() < maxRetries) { LOG.warn(String.format("Fetching newest offset for: %s threw an exception. Retrying.", ssp), exception); } else { LOG.error(String.format("Fetching newest offset for: %s threw an exception.", ssp), exception); loop.done(); throw new SamzaException("Exception while trying to get newest offset", exception); } return null; } }).get();
@Override public BoxedUnit apply(Exception exception, ExponentialSleepStrategy.RetryLoop loop) { if (loop.sleepCount() < maxRetries) { LOG.warn(String.format("Fetching newest offset for: %s threw an exception. Retrying.", ssp), exception); } else { LOG.error(String.format("Fetching newest offset for: %s threw an exception.", ssp), exception); loop.done(); throw new SamzaException("Exception while trying to get newest offset", exception); } return null; } }).get();
@Override public BoxedUnit apply(Exception exception, ExponentialSleepStrategy.RetryLoop loop) { if (loop.sleepCount() < MAX_RETRIES_ON_EXCEPTION) { LOG.warn(String.format("Fetching systemstreampartition counts for: %s threw an exception. Retrying.", streamNames), exception); } else { LOG.error(String.format("Fetching systemstreampartition counts for: %s threw an exception.", streamNames), exception); loop.done(); throw new SamzaException(exception); } return null; } }).get();
@Override public Map<String, SystemStreamMetadata> apply(ExponentialSleepStrategy.RetryLoop loop) { Map<String, SystemStreamMetadata> allMetadata = new HashMap<>(); streamNames.forEach(streamName -> { Map<Partition, SystemStreamMetadata.SystemStreamPartitionMetadata> partitionMetadata = new HashMap<>(); List<PartitionInfo> partitionInfos = metadataConsumer.partitionsFor(streamName); LOG.debug("Stream {} has partitions {}", streamName, partitionInfos); partitionInfos.forEach(partitionInfo -> { partitionMetadata.put(new Partition(partitionInfo.partition()), dummySspm); }); allMetadata.put(streamName, new SystemStreamMetadata(streamName, partitionMetadata)); }); loop.done(); return allMetadata; } };
@Override public BoxedUnit apply(Exception exception, ExponentialSleepStrategy.RetryLoop loop) { if (loop.sleepCount() < MAX_RETRIES_ON_EXCEPTION) { LOG.warn( String.format("Fetching system stream metadata for: %s threw an exception. Retrying.", streamNames), exception); } else { LOG.error(String.format("Fetching system stream metadata for: %s threw an exception.", streamNames), exception); loop.done(); throw new SamzaException(exception); } return null; } };
@Override public Map<String, SystemStreamMetadata> apply(ExponentialSleepStrategy.RetryLoop loop) { Map<String, SystemStreamMetadata> allMetadata = new HashMap<>(); streamNames.forEach(streamName -> { Map<Partition, SystemStreamMetadata.SystemStreamPartitionMetadata> partitionMetadata = new HashMap<>(); List<PartitionInfo> partitionInfos = metadataConsumer.partitionsFor(streamName); LOG.debug("Stream {} has partitions {}", streamName, partitionInfos); partitionInfos.forEach(partitionInfo -> { partitionMetadata.put(new Partition(partitionInfo.partition()), dummySspm); }); allMetadata.put(streamName, new SystemStreamMetadata(streamName, partitionMetadata)); }); loop.done(); return allMetadata; } };
@Override public BoxedUnit apply(Exception exception, ExponentialSleepStrategy.RetryLoop loop) { if (loop.sleepCount() < MAX_RETRIES_ON_EXCEPTION) { LOG.warn(String.format("Fetching systemstreampartition counts for: %s threw an exception. Retrying.", streamNames), exception); } else { LOG.error(String.format("Fetching systemstreampartition counts for: %s threw an exception.", streamNames), exception); loop.done(); throw new SamzaException(exception); } return null; } }).get();
@Override public BoxedUnit apply(Exception exception, ExponentialSleepStrategy.RetryLoop loop) { if (loop.sleepCount() < MAX_RETRIES_ON_EXCEPTION) { LOG.warn( String.format("Fetching system stream metadata for: %s threw an exception. Retrying.", streamNames), exception); } else { LOG.error(String.format("Fetching system stream metadata for: %s threw an exception.", streamNames), exception); loop.done(); throw new SamzaException(exception); } return null; } };
@Override public BoxedUnit apply(Exception exception, ExponentialSleepStrategy.RetryLoop loop) { if (loop.sleepCount() < MAX_RETRIES_ON_EXCEPTION) { LOG.warn( String.format("Fetching system stream metadata for: %s threw an exception. Retrying.", streamNames), exception); } else { LOG.error(String.format("Fetching system stream metadata for: %s threw an exception.", streamNames), exception); loop.done(); throw new SamzaException(exception); } return null; } };
@Override public Map<String, SystemStreamMetadata> apply(ExponentialSleepStrategy.RetryLoop loop) { Map<String, SystemStreamMetadata> allMetadata = new HashMap<>(); streamNames.forEach(streamName -> { Map<Partition, SystemStreamMetadata.SystemStreamPartitionMetadata> partitionMetadata = new HashMap<>(); List<PartitionInfo> partitionInfos = metadataConsumer.partitionsFor(streamName); LOG.debug("Stream {} has partitions {}", streamName, partitionInfos); partitionInfos.forEach(partitionInfo -> { partitionMetadata.put(new Partition(partitionInfo.partition()), dummySspm); }); allMetadata.put(streamName, new SystemStreamMetadata(streamName, partitionMetadata)); }); loop.done(); return allMetadata; } };
@Override public BoxedUnit apply(Exception exception, ExponentialSleepStrategy.RetryLoop loop) { if (loop.sleepCount() < MAX_RETRIES_ON_EXCEPTION) { LOG.warn(String.format("Fetching systemstreampartition counts for: %s threw an exception. Retrying.", streamNames), exception); } else { LOG.error(String.format("Fetching systemstreampartition counts for: %s threw an exception.", streamNames), exception); loop.done(); throw new SamzaException(exception); } return null; } }).get();
@Override public String apply(ExponentialSleepStrategy.RetryLoop loop) { String result = fetchNewestOffset(ssp); loop.done(); return result; } };
@Override public Map<String, SystemStreamMetadata> apply(ExponentialSleepStrategy.RetryLoop loop) { Map<String, SystemStreamMetadata> metadata = fetchSystemStreamMetadata(streamNames); loop.done(); return metadata; } };
@Override public String apply(ExponentialSleepStrategy.RetryLoop loop) { String result = fetchNewestOffset(ssp); loop.done(); return result; } };
@Override public Map<String, SystemStreamMetadata> apply(ExponentialSleepStrategy.RetryLoop loop) { Map<String, SystemStreamMetadata> metadata = fetchSystemStreamMetadata(streamNames); loop.done(); return metadata; } };
@Override public Map<String, SystemStreamMetadata> apply(ExponentialSleepStrategy.RetryLoop loop) { Map<String, SystemStreamMetadata> metadata = fetchSystemStreamMetadata(streamNames); loop.done(); return metadata; } };