Package edu.caltech.nanodb.queryeval
Interface TupleProcessor
-
- All Known Implementing Classes:
CommandResult.ResultCollector
,DeleteCommand.TupleRemover
,DumpCommand.TupleExporter
,InsertCommand.TupleInserter
,PrettyTuplePrinter
,TuplePrinter
,TupleSender
,UpdateCommand.TupleUpdater
public interface TupleProcessor
This interface allows us to decouple the implementation of the query evaluation loop from the operations performed on each tuple generated by the evaluator. Different commands can implement this interface in different ways to perform various operations; for example, the DELETE command can provide a processor that deletes each tuple produced by the query evaluation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
finish()
This function is called when all tuples have been produced and passed to the tuple processor.void
process(Tuple tuple)
Processes a single tuple generated from evaluating a query plan.void
setSchema(Schema schema)
This method is called once by the query evaluator before any tuples are passed to theprocess(edu.caltech.nanodb.relations.Tuple)
method, so that the tuple-processor knows what the expected tuple-schema will be.
-
-
-
Method Detail
-
setSchema
void setSchema(Schema schema)
This method is called once by the query evaluator before any tuples are passed to theprocess(edu.caltech.nanodb.relations.Tuple)
method, so that the tuple-processor knows what the expected tuple-schema will be.
-
process
void process(Tuple tuple)
Processes a single tuple generated from evaluating a query plan.- Parameters:
tuple
- The tuple to process.
-
finish
void finish()
This function is called when all tuples have been produced and passed to the tuple processor.
-
-