public class CollectConsumer extends Consumer
Exchange.ParallelOperatorID| Modifier and Type | Field and Description |
|---|---|
private CollectProducer |
child
The child of a CollectConsumer must be a paired CollectProducer.
|
private java.util.ArrayList<TupleBag> |
innerBuffer |
private int |
innerBufferIndex
innerBufferIndex and innerBuffer are used to buffer
all the TupleBags this operator has received.
|
private static long |
serialVersionUID |
private SocketInfo[] |
sourceWorkers |
private TupleDesc |
td |
private java.util.Iterator<Tuple> |
tuples |
private java.util.BitSet |
workerEOS |
private java.util.HashMap<java.lang.String,java.lang.Integer> |
workerIdToIndex |
operatorID| Constructor and Description |
|---|
CollectConsumer(CollectProducer child,
Exchange.ParallelOperatorID operatorID,
SocketInfo[] workers)
If a child is provided, the TupleDesc is the child's TD
|
CollectConsumer(TupleDesc td,
Exchange.ParallelOperatorID operatorID,
SocketInfo[] workers)
If there's no child operator, a TupleDesc is needed
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this iterator.
|
protected Tuple |
fetchNext()
Returns the next Tuple in the iterator, or null if the iteration is
finished.
|
DbIterator[] |
getChildren() |
java.lang.String |
getName()
Return the name of the exchange, used only to display the operator in the
operator tree
|
TupleDesc |
getTupleDesc()
Returns the TupleDesc associated with this DbIterator.
|
(package private) java.util.Iterator<Tuple> |
getTuples() |
void |
open()
Opens the iterator.
|
void |
rewind()
Resets the iterator to the start.
|
void |
setChildren(DbIterator[] children)
Set the children(child) of this operator.
|
getOperatorIDgetEstimatedCardinality, hasNext, next, setEstimatedCardinalityprivate static final long serialVersionUID
private transient java.util.Iterator<Tuple> tuples
private transient int innerBufferIndex
private transient java.util.ArrayList<TupleBag> innerBuffer
private TupleDesc td
private final java.util.BitSet workerEOS
private final SocketInfo[] sourceWorkers
private final java.util.HashMap<java.lang.String,java.lang.Integer> workerIdToIndex
private CollectProducer child
public CollectConsumer(TupleDesc td, Exchange.ParallelOperatorID operatorID, SocketInfo[] workers)
public CollectConsumer(CollectProducer child, Exchange.ParallelOperatorID operatorID, SocketInfo[] workers)
public java.lang.String getName()
Exchangepublic void open()
throws DbException,
TransactionAbortedException
DbIteratoropen in interface DbIteratoropen in class OperatorDbException - when there are problems opening/accessing the database.TransactionAbortedExceptionpublic void rewind()
throws DbException,
TransactionAbortedException
DbIteratorDbException - when rewind is unsupported.TransactionAbortedExceptionpublic void close()
Operatorclose in interface DbIteratorclose in class Operatorpublic TupleDesc getTupleDesc()
DbIteratorgetTupleDesc in interface DbIteratorgetTupleDesc in class Operatorjava.util.Iterator<Tuple> getTuples() throws java.lang.InterruptedException
java.lang.InterruptedExceptionprotected Tuple fetchNext() throws DbException, TransactionAbortedException
Operatornext
and hasNext.fetchNext in class OperatorDbExceptionTransactionAbortedExceptionpublic DbIterator[] getChildren()
getChildren in class Operatorpublic void setChildren(DbIterator[] children)
OperatorsetChildren in class Operatorchildren - the DbIterators which are to be set as the children(child) of
this operator