public class HashGroup extends UnaryOperator
tupleCounter| Constructor and Description |
|---|
HashGroup(Operator operator,
StorageManager sm,
int[] slots,
int buffers)
Constructs a new hash grouping operator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Cleanup after the sort.
|
protected java.lang.String |
generatePartitionFileName(int i)
Helper method to generate a partition file name.
|
protected void |
initTempFiles()
Initialises the temporary files, according to the number
of buffers.
|
protected java.util.List<Tuple> |
innerGetNext()
The inner method to retrieve tuples.
|
protected java.util.List<Tuple> |
innerProcessTuple(Tuple tuple,
int inOp)
Operator class abstract interface -- never called.
|
protected Relation |
setOutputRelation()
Operator class abstract interface -- sets the ouput relation of
this sort operator.
|
void |
setup()
Sets up this external sort operator.
|
getInputOperatorallDone, getInputOperator, getMultiNext, getNext, getNumberOfInputs, getOutputRelation, prefix, processTuple, setInputs, toString, toString, toStringSingle, tuplespublic HashGroup(Operator operator, StorageManager sm, int[] slots, int buffers) throws EngineException
operator - the input operator.sm - the storage manager.slots - the indexes of the grouping keys.buffers - the number of buffers to be used for grouping.EngineException - thrown whenever the grouping operator
cannot be properly initialized.protected void initTempFiles()
throws StorageManagerException
StorageManagerException - thrown whenever the temporary
files cannot be initialised.public void setup()
throws EngineException
setup in class OperatorEngineException - thrown whenever there is something wrong with
setting this operator uppublic void cleanup()
throws EngineException
cleanup in class OperatorEngineException - whenever the operator cannot clean up
after itself.protected java.util.List<Tuple> innerGetNext() throws EngineException
innerGetNext in class OperatorEngineException - thrown whenever the next iteration is not
possible.protected java.util.List<Tuple> innerProcessTuple(Tuple tuple, int inOp) throws EngineException
innerProcessTuple in class Operatortuple - the tuple to be processed.inOp - the index of the input operator the tuple to be
processed belongs to.EngineException - thrown whenever there is something wrong
with processing the tuple.protected Relation setOutputRelation() throws EngineException
setOutputRelation in class OperatorEngineException - whenever the output relation of this
operator cannot be set.protected java.lang.String generatePartitionFileName(int i)
i - the partition number for which it generated a file
name.