ScanControllerRowSource, ScanManager, GenericScanController, GroupFetchScanController, RowCountable, RowLocationRetRowSource, RowSource, ScanController, ScanInfopublic class SortBufferRowSource extends Scan implements ScanControllerRowSource
| Modifier and Type | Field | Description |
|---|---|---|
private int |
maxFreeListSize |
|
(package private) SortBuffer |
sortBuffer |
The Sort buffer where rows come from
|
private SortObserver |
sortObserver |
|
protected TransactionManager |
tran |
The TransactionManager that opened this scan.
|
private boolean |
writingToDisk |
GE, GT, NA| Constructor | Description |
|---|---|
SortBufferRowSource(SortBuffer sortBuffer,
TransactionManager tran,
SortObserver sortObserver,
boolean writingToDisk,
int maxFreeListSize) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Close the scan
|
boolean |
closeForEndTransaction(boolean closeHeldScan) |
Close the scan
|
void |
closeRowSource() |
Close the rowSource
|
void |
fetch(DataValueDescriptor[] result) |
Fetch the row at the current position of the Scan.
|
boolean |
fetchNext(DataValueDescriptor[] row) |
Fetch the (partial) row at the next position of the Scan.
|
void |
fetchWithoutQualify(DataValueDescriptor[] result) |
Fetch the row at the current position of the Scan and does not apply the
qualifiers.
|
DataValueDescriptor[] |
getNextRowFromRowSource() |
Get the next row as an array of column objects.
|
FormatableBitSet |
getValidColumns() |
All columns are always set from a sorter
|
boolean |
needsRowLocation() |
needsRowLocation returns true iff this the row source expects the
drainer of the row source to call rowLocation after getting a row from
getNextRowFromRowSource.
|
boolean |
needsRowLocationForDeferredCheckConstraints() |
|
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.
|
boolean |
next() |
Move to the next position in the scan.
|
void |
offendingRowLocation(RowLocation rl,
long containdId) |
|
void |
rowLocation(RowLocation rl) |
rowLocation is a callback for the drainer of the row source to return
the rowLocation of the current row, i.e, the row that is being returned
by getNextRowFromRowSource.
|
getScanInfo, isKeyed, isTableLocked, newRowLocationTemplate, reopenScan, reopenScanByRowLocationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEstimatedRowCount, setEstimatedRowCountdelete, didNotQualify, doesCurrentPositionQualify, fetchLocation, fetchNextGroup, fetchNextGroup, fetchSet, getAllScanInfo, getEstimatedRowCount, getScanInfo, isCurrentPositionDeleted, isHeldAfterCommit, isKeyed, isTableLocked, newRowLocationTemplate, positionAtRowLocation, reopenScan, reopenScanByRowLocation, replace, setEstimatedRowCountdelete, didNotQualify, doesCurrentPositionQualify, fetchLocation, isCurrentPositionDeleted, isHeldAfterCommit, positionAtRowLocation, replaceSortBuffer sortBuffer
protected TransactionManager tran
private int maxFreeListSize
private boolean writingToDisk
private SortObserver sortObserver
SortBufferRowSource(SortBuffer sortBuffer, TransactionManager tran, SortObserver sortObserver, boolean writingToDisk, int maxFreeListSize)
public DataValueDescriptor[] getNextRowFromRowSource()
RowSourceA 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().
getNextRowFromRowSource in interface RowSourcepublic boolean needsRowLocation()
RowLocationRetRowSourceneedsRowLocation in interface RowLocationRetRowSourceRowLocationRetRowSource.rowLocation(org.apache.derby.iapi.types.RowLocation)public boolean needsRowLocationForDeferredCheckConstraints()
needsRowLocationForDeferredCheckConstraints in interface RowLocationRetRowSourcepublic boolean needsToClone()
RowSourceneedsToClone in interface RowSourceRowSource.needsToClone()public void rowLocation(RowLocation rl)
RowLocationRetRowSource
boolean needsRL = rowSource.needsRowLocation();
DataValueDescriptor[] row;
while((row = rowSource.getNextRowFromRowSource()) != null)
{
RowLocation rl = heapConglomerate.insertRow(row);
if (needsRL)
rowSource.rowLocation(rl);
}
rowLocation in interface RowLocationRetRowSourcepublic void offendingRowLocation(RowLocation rl, long containdId) throws StandardException
offendingRowLocation in interface RowLocationRetRowSourceStandardExceptionpublic FormatableBitSet getValidColumns()
getValidColumns in interface RowSourcepublic void close()
close in interface GenericScanControllerpublic boolean closeForEndTransaction(boolean closeHeldScan)
closeForEndTransaction in interface ScanManagercloseHeldScan - If true, means to close scan even if it has been
opened to be kept opened across commit. This is
used to close these scans on abort.public void closeRowSource()
closeRowSource in interface RowSourcepublic boolean next()
throws StandardException
ScanControllernext in interface GroupFetchScanControllernext in interface ScanControllerStandardException - Standard exception policy.public void fetchWithoutQualify(DataValueDescriptor[] result) throws StandardException
fetchWithoutQualify in interface ScanControllerresult - The row into which the value of the current
position in the scan is to be stored.StandardException - Standard exception policy.ScanController.fetchWithoutQualify(org.apache.derby.iapi.types.DataValueDescriptor[])public void fetch(DataValueDescriptor[] result) throws StandardException
fetch in interface ScanControllerresult - The row into which the value of the current
position in the scan is to be stored.StandardException - Standard exception policy.ScanController.fetch(org.apache.derby.iapi.types.DataValueDescriptor[])public final boolean fetchNext(DataValueDescriptor[] row) throws StandardException
ScanControllerfetchNext in interface ScanControllerrow - The destRow row into which the value
of the next position in the scan is to be stored.StandardException - Standard exception policy.ScanController.fetch(org.apache.derby.iapi.types.DataValueDescriptor[]),
RowUtilApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.