ScanControllerRowSource
, ScanManager
, GenericScanController
, GroupFetchScanController
, RowCountable
, RowLocationRetRowSource
, RowSource
, ScanController
, ScanInfo
public 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, reopenScanByRowLocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEstimatedRowCount, setEstimatedRowCount
delete, didNotQualify, doesCurrentPositionQualify, fetchLocation, fetchNextGroup, fetchNextGroup, fetchSet, getAllScanInfo, getEstimatedRowCount, getScanInfo, isCurrentPositionDeleted, isHeldAfterCommit, isKeyed, isTableLocked, newRowLocationTemplate, positionAtRowLocation, reopenScan, reopenScanByRowLocation, replace, setEstimatedRowCount
delete, didNotQualify, doesCurrentPositionQualify, fetchLocation, isCurrentPositionDeleted, isHeldAfterCommit, positionAtRowLocation, replace
SortBuffer 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()
RowSource
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().
getNextRowFromRowSource
in interface RowSource
public boolean needsRowLocation()
RowLocationRetRowSource
needsRowLocation
in interface RowLocationRetRowSource
RowLocationRetRowSource.rowLocation(org.apache.derby.iapi.types.RowLocation)
public boolean needsRowLocationForDeferredCheckConstraints()
needsRowLocationForDeferredCheckConstraints
in interface RowLocationRetRowSource
public boolean needsToClone()
RowSource
needsToClone
in interface RowSource
RowSource.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 RowLocationRetRowSource
public void offendingRowLocation(RowLocation rl, long containdId) throws StandardException
offendingRowLocation
in interface RowLocationRetRowSource
StandardException
public FormatableBitSet getValidColumns()
getValidColumns
in interface RowSource
public void close()
close
in interface GenericScanController
public boolean closeForEndTransaction(boolean closeHeldScan)
closeForEndTransaction
in interface ScanManager
closeHeldScan
- 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 RowSource
public boolean next() throws StandardException
ScanController
next
in interface GroupFetchScanController
next
in interface ScanController
StandardException
- Standard exception policy.public void fetchWithoutQualify(DataValueDescriptor[] result) throws StandardException
fetchWithoutQualify
in interface ScanController
result
- 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 ScanController
result
- 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
ScanController
fetchNext
in interface ScanController
row
- 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[])
,
RowUtil
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.