public boolean getNext(KafkaETLKey key, BytesWritable value) throws IOException { if (!hasMore()) return false; boolean gotNext = get(key, value); Iterator<ByteBufferMessageSet> iter = _response.iterator(); while (!gotNext && _response != null && iter.hasNext()) { ByteBufferMessageSet msgSet = iter.next(); if (hasError(msgSet)) return false; _messageIt = (Iterator<Message>) msgSet.iterator(); gotNext = get(key, value); } return gotNext; }
public boolean hasMore() { return _messageIt != null && _messageIt.hasNext() || _response != null && _response.iterator().hasNext() || _offset < _offsetRange[1]; }