List of usage examples for java.util Collections emptyListIterator
@SuppressWarnings("unchecked") public static <T> ListIterator<T> emptyListIterator()
From source file:Main.java
public static ListIterator getMy() { String nullFlag = null;//from w w w .jav a 2s. c om if (nullFlag == null) { return Collections.emptyListIterator(); } return null; }
From source file:org.apache.storm.kafka.spout.KafkaSpout.java
@Override public void open(Map<String, Object> conf, TopologyContext context, SpoutOutputCollector collector) { initialized = false;/* ww w .j a v a2 s . co m*/ this.context = context; // Spout internals this.collector = collector; numUncommittedOffsets = 0; // Offset management firstPollOffsetStrategy = kafkaSpoutConfig.getFirstPollOffsetStrategy(); // Retries management retryService = kafkaSpoutConfig.getRetryService(); tupleListener = kafkaSpoutConfig.getTupleListener(); if (isAtLeastOnce()) { // Only used if the spout commits offsets for acked tuples commitTimer = new Timer(TIMER_DELAY_MS, kafkaSpoutConfig.getOffsetsCommitPeriodMs(), TimeUnit.MILLISECONDS); } refreshSubscriptionTimer = new Timer(TIMER_DELAY_MS, kafkaSpoutConfig.getPartitionRefreshPeriodMs(), TimeUnit.MILLISECONDS); offsetManagers = new HashMap<>(); emitted = new HashSet<>(); waitingToEmit = Collections.emptyListIterator(); tupleListener.open(conf, context); LOG.info("Kafka Spout opened with the following configuration: {}", kafkaSpoutConfig); }