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.
|
getOperatorID
getEstimatedCardinality, hasNext, next, setEstimatedCardinality
private 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()
Exchange
public void open() throws DbException, TransactionAbortedException
DbIterator
open
in interface DbIterator
open
in class Operator
DbException
- when there are problems opening/accessing the database.TransactionAbortedException
public void rewind() throws DbException, TransactionAbortedException
DbIterator
DbException
- when rewind is unsupported.TransactionAbortedException
public void close()
Operator
close
in interface DbIterator
close
in class Operator
public TupleDesc getTupleDesc()
DbIterator
getTupleDesc
in interface DbIterator
getTupleDesc
in class Operator
java.util.Iterator<Tuple> getTuples() throws java.lang.InterruptedException
java.lang.InterruptedException
protected Tuple fetchNext() throws DbException, TransactionAbortedException
Operator
next
and hasNext
.fetchNext
in class Operator
DbException
TransactionAbortedException
public DbIterator[] getChildren()
getChildren
in class Operator
public void setChildren(DbIterator[] children)
Operator
setChildren
in class Operator
children
- the DbIterators which are to be set as the children(child) of
this operator