Interface RowSource
-
- All Known Subinterfaces:
NoPutResultSet
,RowLocationRetRowSource
,ScanControllerRowSource
- All Known Implementing Classes:
AlterTableConstantAction
,AnyResultSet
,BasicNoPutResultSetImpl
,BulkTableScanResultSet
,CardinalityCounter
,CurrentOfResultSet
,DependentResultSet
,DistinctGroupedAggregateResultSet
,DistinctScalarAggregateResultSet
,DistinctScanResultSet
,GenericAggregateResultSet
,GroupedAggregateResultSet
,HashJoinResultSet
,HashLeftOuterJoinResultSet
,HashScanResultSet
,HashTableResultSet
,IndexRowToBaseRowResultSet
,JoinResultSet
,LastIndexKeyResultSet
,MaterializedResultSet
,MergeJoinResultSet
,MergeScanRowSource
,MultiProbeTableScanResultSet
,NestedLoopJoinResultSet
,NestedLoopLeftOuterJoinResultSet
,NoPutResultSetImpl
,NormalizeResultSet
,OnceResultSet
,ProjectRestrictResultSet
,RowCountResultSet
,RowResultSet
,ScalarAggregateResultSet
,ScanResultSet
,ScrollInsensitiveResultSet
,SetOpResultSet
,SortBufferRowSource
,SortResultSet
,TableScanResultSet
,TemporaryRowHolderResultSet
,UnionResultSet
,ValidateCheckConstraintResultSet
,VTIResultSet
,WindowResultSet
public interface RowSource
A RowSource is the mechanism for iterating over a set of rows. The RowSource is the interface through which access recieved a set of rows from the client for the purpose of inserting into a single conglomerate.A RowSource can come from many sources - from rows that are from fast path import, to rows coming out of a sort for index creation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
closeRowSource()
closeRowSource tells the RowSource that it will no longer need to return any rows and it can release any resource it may have.DataValueDescriptor[]
getNextRowFromRowSource()
Get the next row as an array of column objects.FormatableBitSet
getValidColumns()
getValidColumns describes the DataValueDescriptor[] returned by all calls to the getNextRowFromRowSource() call.boolean
needsToClone()
Does the caller of getNextRowFromRowSource() need to clone the row in order to keep a reference to the row past the getNextRowFromRowSource() call which returned the row.
-
-
-
Method Detail
-
getNextRowFromRowSource
DataValueDescriptor[] getNextRowFromRowSource() throws StandardException
Get the next row as an array of column objects. The column objects can be a JBMS Storable or any Serializable/Externalizable/Formattable/Streaming type.
A return of null indicates that the complete set of rows has been read.A null column can be specified by leaving the object null, or indicated by returning a non-null getValidColumns. On streaming columns, it can be indicated by returning a non-null get FieldStates.
If RowSource.needToClone() is true then the returned row (the DataValueDescriptor[]) is guaranteed not to be modified by drainer of the RowSource (except that the input stream will be read, of course) and drainer will keep no reference to it before making the subsequent nextRow call. So it is safe to return the same DataValueDescriptor[] in subsequent nextRow calls if that is desirable for performance reasons.
If RowSource.needToClone() is false then the returned row (the DataValueDescriptor[]) may be be modified by drainer of the RowSource, and the drainer may keep a reference to it after making the subsequent nextRow call. In this case the client should severe all references to the row after returning it from getNextRowFromRowSource().
- Throws:
StandardException
- Standard Derby Error Policy
-
needsToClone
boolean needsToClone()
Does the caller of getNextRowFromRowSource() need to clone the row in order to keep a reference to the row past the getNextRowFromRowSource() call which returned the row. This call must always return the same for all rows in a RowSource (ie. the caller will call this once per scan from a RowSource and assume the behavior is true for all rows in the RowSource).
-
getValidColumns
FormatableBitSet getValidColumns()
getValidColumns describes the DataValueDescriptor[] returned by all calls to the getNextRowFromRowSource() call. If getValidColumns returns null, the number of columns is given by the DataValueDescriptor.length where DataValueDescriptor[] is returned by the preceeding getNextRowFromRowSource() call. Column N maps to DataValueDescriptor[N], where column numbers start at zero. If getValidColumns return a non null validColumns FormatableBitSet the number of columns is given by the number of bits set in validColumns. Column N is not in the partial row if validColumns.get(N) returns false. Column N is in the partial row if validColumns.get(N) returns true. If column N is in the partial row then it maps to DataValueDescriptor[M] where M is the count of calls to validColumns.get(i) that return true where i < N. If DataValueDescriptor.length is greater than the number of columns indicated by validColumns the extra entries are ignored.
-
closeRowSource
void closeRowSource()
closeRowSource tells the RowSource that it will no longer need to return any rows and it can release any resource it may have. Subsequent call to any method on the RowSource will result in undefined behavior. A closed rowSource can be closed again.
-
-