List of usage examples for org.apache.solr.client.solrj.io Tuple Tuple
public Tuple()
From source file:com.dennisgove.streaming.expressions.kafka.KafkaTopicConsumerStream.java
License:Apache License
/** * Returns the next record off the topic in Tuple form. Will wait until at least one record is read from * from the topic, or the stream is closed. *//*from www .j a v a 2s . com*/ @Override public Tuple read() throws IOException { // Get next set of available records, keep repeating until we get something while (tupleList.isEmpty()) { // if we're closed then return EOF if (!isOpen.get()) { Tuple eof = new Tuple(); eof.EOF = true; return eof; } // wait at most 1s loadTupleList(1000); } // At this point we will absolutely have a tuple. Tuple tuple = tupleList.pop(); if (tuple.EOF) { tuple.put("__kafkaRecordCount__", recordsRead); } else { recordsRead += 1; } return tuple; }