|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.store.access.sort.Scan
org.apache.derby.impl.store.access.sort.SortBufferRowSource
public class SortBufferRowSource
Wrapping the output of a SortBuffer in a RowSource for the benefit of the createAndLoadConglomerate and loadConglomerate interface. Scan implements ScanController, this class just implements the RowSource interface.
Field Summary | |
---|---|
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
|
Fields inherited from interface org.apache.derby.iapi.store.access.ScanController |
---|
GE, GT, NA |
Constructor Summary | |
---|---|
SortBufferRowSource(SortBuffer sortBuffer,
TransactionManager tran,
SortObserver sortObserver,
boolean writingToDisk,
int maxFreeListSize)
|
Method Summary | |
---|---|
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 |
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 |
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. |
Methods inherited from class org.apache.derby.impl.store.access.sort.Scan |
---|
delete, didNotQualify, doesCurrentPositionQualify, fetchLocation, fetchNextGroup, fetchNextGroup, fetchSet, getAllScanInfo, getEstimatedRowCount, getScanInfo, isCurrentPositionDeleted, isHeldAfterCommit, isKeyed, isTableLocked, newRowLocationTemplate, positionAtRowLocation, reopenScan, reopenScanByRowLocation, replace, setEstimatedRowCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.store.access.ScanController |
---|
delete, didNotQualify, doesCurrentPositionQualify, fetchLocation, isCurrentPositionDeleted, isHeldAfterCommit, positionAtRowLocation, replace |
Methods inherited from interface org.apache.derby.iapi.store.access.GenericScanController |
---|
getScanInfo, isKeyed, isTableLocked, newRowLocationTemplate, reopenScan, reopenScanByRowLocation |
Methods inherited from interface org.apache.derby.iapi.store.access.RowCountable |
---|
getEstimatedRowCount, setEstimatedRowCount |
Field Detail |
---|
SortBuffer sortBuffer
protected TransactionManager tran
private int maxFreeListSize
private boolean writingToDisk
private SortObserver sortObserver
Constructor Detail |
---|
SortBufferRowSource(SortBuffer sortBuffer, TransactionManager tran, SortObserver sortObserver, boolean writingToDisk, int maxFreeListSize)
Method Detail |
---|
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 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 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
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |