Package edu.caltech.nanodb.commands
Class InsertCommand.TupleInserter
- java.lang.Object
-
- edu.caltech.nanodb.commands.InsertCommand.TupleInserter
-
- All Implemented Interfaces:
TupleProcessor
- Enclosing class:
- InsertCommand
private static class InsertCommand.TupleInserter extends java.lang.Object implements TupleProcessor
An implementation of the tuple processor interface used by theInsertCommand
to insert tuples into a table, when the command is of the form INSERT ... SELECT.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) EventDispatcher
eventDispatcher
The event-dispatcher for reporting insert events to other components.private TableInfo
tableInfo
The table into which the new tuples will be inserted.private TupleFile
tupleFile
-
Constructor Summary
Constructors Constructor Description TupleInserter(EventDispatcher eventDispatcher, TableInfo tableInfo)
Initialize the tuple-inserter object with the details it needs to insert tuples into the specified table.
-
Method Summary
All Methods Instance Methods Concrete 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)
This implementation simply inserts each tuple it is handed.void
setSchema(Schema schema)
This implementation ignores the schema of the results, since we just don't care.
-
-
-
Field Detail
-
tableInfo
private TableInfo tableInfo
The table into which the new tuples will be inserted.
-
tupleFile
private TupleFile tupleFile
-
eventDispatcher
EventDispatcher eventDispatcher
The event-dispatcher for reporting insert events to other components.
-
-
Constructor Detail
-
TupleInserter
TupleInserter(EventDispatcher eventDispatcher, TableInfo tableInfo)
Initialize the tuple-inserter object with the details it needs to insert tuples into the specified table.- Parameters:
tableInfo
- details of the table that will be modified
-
-
Method Detail
-
setSchema
public void setSchema(Schema schema)
This implementation ignores the schema of the results, since we just don't care.- Specified by:
setSchema
in interfaceTupleProcessor
-
process
public void process(Tuple tuple)
This implementation simply inserts each tuple it is handed.- Specified by:
process
in interfaceTupleProcessor
- Parameters:
tuple
- The tuple to process.
-
finish
public void finish()
Description copied from interface:TupleProcessor
This function is called when all tuples have been produced and passed to the tuple processor.- Specified by:
finish
in interfaceTupleProcessor
-
-