|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> store >> access >> [ conglomerate overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.impl.store.access.conglomerate
Class GenericScanController

java.lang.Objectorg.apache.derby.impl.store.access.conglomerate.GenericController
org.apache.derby.impl.store.access.conglomerate.GenericScanController
- All Implemented Interfaces:
- org.apache.derby.iapi.store.access.GenericScanController, org.apache.derby.iapi.store.access.GroupFetchScanController, org.apache.derby.iapi.store.access.RowCountable, org.apache.derby.iapi.store.access.ScanController, org.apache.derby.iapi.store.access.conglomerate.ScanManager
- public abstract class GenericScanController
- extends GenericController
- implements org.apache.derby.iapi.store.access.conglomerate.ScanManager
- extends GenericController
Generic class implementing shared ScanController methods. Logically a scancontroller is used to scan a set of rows that meet some specified qualification. Rows that meet the qualification may be operated upon by the scan to fetch, delete, or replace. The ScanController also supports the notion or "repositioning" the scan, which simply resets the beginning of the scan to a new place, and allows the user to continue from there. This class attempts to abstract out some of the parts of the scan such that maybe multiple access methods can share code, even if they perform parts of the scan wildly differently. Here is how the scan has been broken apart: scan_position - this variable holds the current scan position, it may be extended to provide more information if necessary. scan_state - a scan has 3 possible states: SCAN_INIT, SCAN_INPROGRESS, SCAN_DONE positionAtInitScan() - This routine is called to move the scan to the SCAN_INIT state. It is used both for initialization of the ScanController and by reopenScan(). positionAtStartForForwardScan() - This routine is called to move the scan from SCAN_INIT to SCAN_INPROGRESS. Upon return from this routine it is expected that scan_position is set such that calling the generic scan loop will reach the first row of the scan. Note that this usually means setting the scan_postion to one before the 1st row to be returned. fetchRows() - This routine is the meat of the scan, it moves the scan to the next row, applies necessary qualifiers, and handles group or non-group operations. It moves through rows on a page in order and then moves to the "next" page. positionAtNextPage() - This routine handles moving the scan from the current scan_position to the next page. positionAtDoneScan() - Handle all cleanup associated with moving the scan state from SCAN_INPROGRESS to SCAN_DONE. This may include releasing locks, and setting the state of the scan. This does not close the scan, it allows for a reopenScan() to be called.
| Fields inherited from class org.apache.derby.impl.store.access.conglomerate.GenericController |
open_conglom |
| Fields inherited from interface org.apache.derby.iapi.store.access.ScanController |
GE, GT, NA |
| Constructor Summary | |
GenericScanController()
|
|
| Method Summary | |
protected RowPosition |
allocateScanPosition()
Create object which represents the scan position. |
void |
close()
Close the scan. |
boolean |
closeForEndTransaction(boolean closeHeldScan)
Close scan as part of terminating a transaction. |
private void |
closeScan()
Public Methods implementing ScanController: |
boolean |
delete()
Delete the row at the current position of the scan. |
void |
didNotQualify()
A call to allow client to indicate that current row does not qualify. |
boolean |
doesCurrentPositionQualify()
Returns true if the current position of the scan still qualifies under the set of qualifiers passed to the openScan(). |
void |
fetch(org.apache.derby.iapi.types.DataValueDescriptor[] row)
Fetch the (partial) row at the current position of the Scan. |
void |
fetchLocation(org.apache.derby.iapi.types.RowLocation templateLocation)
Fetch the location of the current position in the scan. |
protected int |
fetchRows(org.apache.derby.iapi.types.DataValueDescriptor[][] row_array,
org.apache.derby.iapi.types.RowLocation[] rowloc_array,
org.apache.derby.iapi.store.access.BackingStoreHashtable hash_table,
long max_rowcnt,
int[] key_column_numbers)
Fetch the next N rows from the table. |
void |
fetchSet(long max_rowcnt,
int[] key_column_numbers,
org.apache.derby.iapi.store.access.BackingStoreHashtable hash_table)
Insert all rows that qualify for the current scan into the input Hash table. |
int |
getNumPagesVisited()
|
int |
getNumRowsQualified()
|
int |
getNumRowsVisited()
|
org.apache.derby.iapi.store.access.Qualifier[][] |
getQualifier()
|
org.apache.derby.iapi.services.io.FormatableBitSet |
getScanColumnList()
|
org.apache.derby.iapi.store.access.ScanInfo |
getScanInfo()
Return ScanInfo object which describes performance of scan. |
RowPosition |
getScanPosition()
|
int |
getScanState()
|
org.apache.derby.iapi.types.DataValueDescriptor[] |
getStartKeyValue()
|
int |
getStartSearchOperator()
|
org.apache.derby.iapi.types.DataValueDescriptor[] |
getStopKeyValue()
|
int |
getStopSearchOperator()
|
void |
init(OpenConglomerate open_conglom,
org.apache.derby.iapi.services.io.FormatableBitSet scanColumnList,
org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue,
int startSearchOperator,
org.apache.derby.iapi.store.access.Qualifier[][] qualifier,
org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue,
int stopSearchOperator)
Public Methods of This class: |
boolean |
isCurrentPositionDeleted()
Returns true if the current position of the scan is at a deleted row. |
protected void |
positionAtDoneScan(RowPosition pos)
Do any necessary work to complete the scan. |
protected void |
positionAtInitScan(org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue,
int startSearchOperator,
org.apache.derby.iapi.store.access.Qualifier[][] qualifier,
org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue,
int stopSearchOperator,
RowPosition pos)
Move scan to the the SCAN_INIT state. |
protected void |
positionAtNextPage(RowPosition pos)
Position scan to slot before first slot on next page. |
protected void |
positionAtResumeScan(RowPosition pos)
Reposition the scan upon entering the fetchRows loop. |
protected void |
positionAtStartForForwardScan(RowPosition pos)
Move the scan from SCAN_INIT to SCAN_INPROGRESS. |
void |
reopenScan(org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue,
int startSearchOperator,
org.apache.derby.iapi.store.access.Qualifier[][] qualifier,
org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue,
int stopSearchOperator)
Reposition the current scan. |
protected void |
reopenScanByRecordHandle(org.apache.derby.iapi.store.raw.RecordHandle startRecordHandle,
org.apache.derby.iapi.store.access.Qualifier[][] qualifier)
Reposition the current scan. |
void |
reopenScanByRowLocation(org.apache.derby.iapi.types.RowLocation startRowLocation,
org.apache.derby.iapi.store.access.Qualifier[][] qualifier)
Reposition the current scan. |
boolean |
replace(org.apache.derby.iapi.types.DataValueDescriptor[] row,
org.apache.derby.iapi.services.io.FormatableBitSet validColumns)
Replace the (partial) row at the current position of the scan. |
private void |
repositionScanForUpateOper()
Private methods of This class: |
protected void |
setRowLocationArray(org.apache.derby.iapi.types.RowLocation[] rowloc_array,
int index,
RowPosition pos)
|
void |
setScanPosition(RowPosition pos)
|
void |
setScanState(int state)
|
| Methods inherited from class org.apache.derby.impl.store.access.conglomerate.GenericController |
checkConsistency, debugConglomerate, getEstimatedRowCount, getInternalTablePropertySet, getOpenConglom, getRowPositionFromRowLocation, getSpaceInfo, getTableProperties, init, isKeyed, isTableLocked, newRowLocationTemplate, queueDeletePostCommitWork, 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.conglomerate.ScanManager |
savePosition |
| Methods inherited from interface org.apache.derby.iapi.store.access.ScanController |
fetchNext, next |
| Methods inherited from interface org.apache.derby.iapi.store.access.GenericScanController |
isKeyed, isTableLocked, newRowLocationTemplate |
| Methods inherited from interface org.apache.derby.iapi.store.access.RowCountable |
getEstimatedRowCount, setEstimatedRowCount |
| Methods inherited from interface org.apache.derby.iapi.store.access.GroupFetchScanController |
fetchNextGroup, fetchNextGroup, next |
| Field Detail |
SCAN_INIT
public static final int SCAN_INIT
- Constants of the class
- See Also:
- Constant Field Values
SCAN_INPROGRESS
public static final int SCAN_INPROGRESS
- See Also:
- Constant Field Values
SCAN_DONE
public static final int SCAN_DONE
- See Also:
- Constant Field Values
SCAN_HOLD_INIT
public static final int SCAN_HOLD_INIT
- See Also:
- Constant Field Values
SCAN_HOLD_INPROGRESS
public static final int SCAN_HOLD_INPROGRESS
- See Also:
- Constant Field Values
init_scanColumnList
private org.apache.derby.iapi.services.io.FormatableBitSet init_scanColumnList
- The following group of fields are all basic input parameters which are
provided by the calling code when doing a scan.
These are just saved values from what was initially input.
init_startKeyValue
private org.apache.derby.iapi.types.DataValueDescriptor[] init_startKeyValue
init_startSearchOperator
private int init_startSearchOperator
init_qualifier
private org.apache.derby.iapi.store.access.Qualifier[][] init_qualifier
init_stopKeyValue
private org.apache.derby.iapi.types.DataValueDescriptor[] init_stopKeyValue
init_stopSearchOperator
private int init_stopSearchOperator
init_fetchDesc
private org.apache.derby.iapi.store.raw.FetchDescriptor init_fetchDesc
scan_state
private int scan_state
- Delay positioning the table at the start position until the first
next() call.
scan_position
protected RowPosition scan_position
- The position for the current scan. The can be maintained in any
of the following ways:
record handle - scan_position.current_rh:
The scan maintains it's position using the record handle while
it does not have a latch on the page, which is the case anytime
control leaves access. The access method must take appropriate
steps to make sure the record handle will still be valid when
the scan needs to reposition using the record handle.
slot number - scan_position.current_slot:
While the scan has a latch on the page the scan is positioned
using the slot number as the order of the rows cannot change
while the latch is held (unless the holder of the latch causes
them to move).
page number - (RESOLVE - TODO)
Sometimes it would be interesting to position a scan "between"
pages, such that the next time the scan starts is starts at
the next page. This would allow us to efficiently do group
scans returning page at atime results.
NOT IMPLEMENTED CURRENTLY.
stat_numpages_visited
protected int stat_numpages_visited
- Performance counters ...
stat_numrows_visited
protected int stat_numrows_visited
stat_numrows_qualified
protected int stat_numrows_qualified
| Constructor Detail |
GenericScanController
public GenericScanController()
| Method Detail |
repositionScanForUpateOper
private final void repositionScanForUpateOper()
throws org.apache.derby.iapi.error.StandardException
- Private methods of This class:
positionAtInitScan
protected void positionAtInitScan(org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue, int startSearchOperator, org.apache.derby.iapi.store.access.Qualifier[][] qualifier, org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue, int stopSearchOperator, RowPosition pos) throws org.apache.derby.iapi.error.StandardException
- Move scan to the the SCAN_INIT state.
This routine is called to move the scan to the SCAN_INIT state. It is used both for initialization of the ScanController and by reopenScan().
positionAtResumeScan
protected void positionAtResumeScan(RowPosition pos) throws org.apache.derby.iapi.error.StandardException
- Reposition the scan upon entering the fetchRows loop.
Called upon entering fetchRows() while in the SCAN_INPROGRESS state. Do work necessary to look at rows in the current page of the scan.
The default implementation uses a record handle to maintain a scan position. It will get the latch again on the current scan position and set the slot to the current record handle.
positionAtStartForForwardScan
protected void positionAtStartForForwardScan(RowPosition pos) throws org.apache.derby.iapi.error.StandardException
- Move the scan from SCAN_INIT to SCAN_INPROGRESS.
This routine is called to move the scan from SCAN_INIT to SCAN_INPROGRESS. Upon return from this routine it is expected that scan_position is set such that calling the generic scan loop will reach the first row of the scan. Note that this usually means setting the scan_postion to one before the 1st row to be returned.
positionAtNextPage
protected void positionAtNextPage(RowPosition pos) throws org.apache.derby.iapi.error.StandardException
- Position scan to slot before first slot on next page.
positionAtDoneScan
protected void positionAtDoneScan(RowPosition pos) throws org.apache.derby.iapi.error.StandardException
- Do any necessary work to complete the scan.
reopenScanByRowLocation
public void reopenScanByRowLocation(org.apache.derby.iapi.types.RowLocation startRowLocation, org.apache.derby.iapi.store.access.Qualifier[][] qualifier) throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.store.access.GenericScanController - Reposition the current scan. This call is semantically the same as if
the current scan had been closed and a openScan() had been called instead.
The scan is reopened against the same conglomerate, and the scan
is reopened with the same "scan column list", "hold" and "forUpdate"
parameters passed in the original openScan.
The statistics gathered by the scan are not reset to 0 by a reopenScan(), rather they continue to accumulate.
Note that this operation is currently only supported on Heap conglomerates. Also note that order of rows within are heap are not guaranteed, so for instance positioning at a RowLocation in the "middle" of a heap, then inserting more data, then continuing the scan is not guaranteed to see the new rows - they may be put in the "beginning" of the heap.
- Specified by:
reopenScanByRowLocationin interfaceorg.apache.derby.iapi.store.access.GenericScanController
allocateScanPosition
protected RowPosition allocateScanPosition() throws org.apache.derby.iapi.error.StandardException
- Create object which represents the scan position.
Designed so that extending classes can override and allocate implementation specific row position's.
fetchRows
protected int fetchRows(org.apache.derby.iapi.types.DataValueDescriptor[][] row_array, org.apache.derby.iapi.types.RowLocation[] rowloc_array, org.apache.derby.iapi.store.access.BackingStoreHashtable hash_table, long max_rowcnt, int[] key_column_numbers) throws org.apache.derby.iapi.error.StandardException
- Fetch the next N rows from the table.
Utility routine used by both fetchSet() and fetchNextGroup().
reopenScanByRecordHandle
protected void reopenScanByRecordHandle(org.apache.derby.iapi.store.raw.RecordHandle startRecordHandle, org.apache.derby.iapi.store.access.Qualifier[][] qualifier) throws org.apache.derby.iapi.error.StandardException
- Reposition the current scan. This call is semantically the same as if
the current scan had been closed and a openScan() had been called instead.
The scan is reopened against the same conglomerate, and the scan
is reopened with the same "scan column list", "hold" and "forUpdate"
parameters passed in the original openScan.
The statistics gathered by the scan are not reset to 0 by a reopenScan(), rather they continue to accumulate.
Note that this operation is currently only supported on Heap conglomerates. Also note that order of rows within are heap are not guaranteed, so for instance positioning at a RowLocation in the "middle" of a heap, then inserting more data, then continuing the scan is not guaranteed to see the new rows - they may be put in the "beginning" of the heap.
setRowLocationArray
protected void setRowLocationArray(org.apache.derby.iapi.types.RowLocation[] rowloc_array, int index, RowPosition pos) throws org.apache.derby.iapi.error.StandardException
init
public void init(OpenConglomerate open_conglom, org.apache.derby.iapi.services.io.FormatableBitSet scanColumnList, org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue, int startSearchOperator, org.apache.derby.iapi.store.access.Qualifier[][] qualifier, org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue, int stopSearchOperator) throws org.apache.derby.iapi.error.StandardException
- Public Methods of This class:
getNumPagesVisited
public final int getNumPagesVisited()
getNumRowsVisited
public final int getNumRowsVisited()
getNumRowsQualified
public final int getNumRowsQualified()
getScanColumnList
public final org.apache.derby.iapi.services.io.FormatableBitSet getScanColumnList()
getStartKeyValue
public final org.apache.derby.iapi.types.DataValueDescriptor[] getStartKeyValue()
getStartSearchOperator
public final int getStartSearchOperator()
getStopKeyValue
public final org.apache.derby.iapi.types.DataValueDescriptor[] getStopKeyValue()
getStopSearchOperator
public final int getStopSearchOperator()
getQualifier
public final org.apache.derby.iapi.store.access.Qualifier[][] getQualifier()
getScanState
public final int getScanState()
setScanState
public final void setScanState(int state)
getScanPosition
public final RowPosition getScanPosition()
setScanPosition
public final void setScanPosition(RowPosition pos)
closeScan
private void closeScan()
throws org.apache.derby.iapi.error.StandardException
- Public Methods implementing ScanController:
close
public void close()
throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.store.access.GenericScanController - Close the scan. This method always succeeds, and never throws
any exceptions. Callers must not use the scan controller after
closing it; they are strongly advised to clear out the scan
controller reference after closing.
- Specified by:
closein interfaceorg.apache.derby.iapi.store.access.GenericScanController- Overrides:
closein classGenericController
closeForEndTransaction
public boolean closeForEndTransaction(boolean closeHeldScan)
throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.store.access.conglomerate.ScanManager - Close scan as part of terminating a transaction.
Use this call to close the scan resources as part of committing or aborting a transaction. The normal close() routine may do some cleanup that is either unnecessary, or not correct due to the unknown condition of the scan following a transaction ending error. Use this call when closing all scans as part of an abort of a transaction.
- Specified by:
closeForEndTransactionin interfaceorg.apache.derby.iapi.store.access.conglomerate.ScanManager
delete
public boolean delete()
throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.store.access.ScanController - Delete the row at the current position of the scan.
- Specified by:
deletein interfaceorg.apache.derby.iapi.store.access.ScanController
didNotQualify
public void didNotQualify()
throws org.apache.derby.iapi.error.StandardException
- A call to allow client to indicate that current row does not qualify.
Indicates to the ScanController that the current row does not qualify for the scan. If the isolation level of the scan allows, this may result in the scan releasing the lock on this row.
Note that some scan implimentations may not support releasing locks on non-qualifying rows, or may delay releasing the lock until sometime later in the scan (ie. it may be necessary to keep the lock until either the scan is repositioned on the next row or page).
This call should only be made while the scan is positioned on a current valid row. RESOLVE (mikem-05/29/98) - Implement this when we support levels of concurrency less than serializable.
- Specified by:
didNotQualifyin interfaceorg.apache.derby.iapi.store.access.ScanController
fetchSet
public void fetchSet(long max_rowcnt,
int[] key_column_numbers,
org.apache.derby.iapi.store.access.BackingStoreHashtable hash_table)
throws org.apache.derby.iapi.error.StandardException
- Insert all rows that qualify for the current scan into the input
Hash table.
This routine scans executes the entire scan as described in the openScan call. For every qualifying unique row value an entry is placed into the HashTable. For unique row values the entry in the Hashtable has a key value of the object stored in row[key_column_number], and the value of the data is row. For row values with duplicates, the key value is also row[key_column_number], but the value of the data is a Vector of rows. The caller will have to call "instanceof" on the data value object if duplicates are expected, to determine if the data value of the Hashtable entry is a row or is a Vector of rows.
Note, that for this routine to work efficiently the caller must ensure that the object in row[key_column_number] implements the hashCode and equals method as appropriate for it's datatype.
It is expected that this call will be the first and only call made in an openscan. Qualifiers and stop position of the openscan are applied just as in a normal scan. This call is logically equivalent to the caller performing the following: import java.util.Hashtable; hash_table = new Hashtable(); while (next()) { row = create_new_row(); fetch(row); if ((duplicate_value = hash_table.put(row[key_column_number], row)) != null) { Vector row_vec; // inserted a duplicate if ((duplicate_value instanceof vector)) { row_vec = (Vector) duplicate_value; } else { // allocate vector to hold duplicates row_vec = new Vector(2); // insert original row into vector row_vec.addElement(duplicate_value); // put the vector as the data rather than the row hash_table.put(row[key_column_number], row_vec); } // insert new row into vector row_vec.addElement(row); } }
The columns of the row will be the standard columns returned as part of a scan, as described by the validColumns - see openScan for description. RESOLVE - is this ok? or should I hard code somehow the row to be the first column and the row location?
Currently it is only possible to hash on the first column in the conglomerate, in the future we may change the interface to allow hashing either on a different column or maybe on a combination of columns.
No overflow to external storage is provided, so calling this routine on a 1 gigabyte conglomerate will incur at least 1 gigabyte of memory (probably failing with a java out of memory condition). If this routine gets an out of memory condition, or if "max_rowcnt" is exceeded then then the routine will give up, empty the Hashtable, and return "false."
On exit from this routine, whether the fetchSet() succeeded or not the scan is complete, it is positioned just the same as if the scan had been drained by calling "next()" until it returns false (ie. fetchNext() and next() calls will return false). reopenScan() can be called to restart the scan.
RESOLVE - until we get row counts what should we do for sizing the the size, capasity, and load factor of the hash table. For now it is up to the caller to create the Hashtable, Access does not reset any parameters.
RESOLVE - I am not sure if access should be in charge of allocating the new row objects. I know that I can do this in the case of btree's, but I don't think I can do this in heaps. Maybe this is solved by work to be done on the sort interface.
- Specified by:
fetchSetin interfaceorg.apache.derby.iapi.store.access.conglomerate.ScanManager
reopenScan
public void reopenScan(org.apache.derby.iapi.types.DataValueDescriptor[] startKeyValue, int startSearchOperator, org.apache.derby.iapi.store.access.Qualifier[][] qualifier, org.apache.derby.iapi.types.DataValueDescriptor[] stopKeyValue, int stopSearchOperator) throws org.apache.derby.iapi.error.StandardException
- Reposition the current scan. This call is semantically the same as if
the current scan had been closed and a openScan() had been called instead.
The scan is reopened with against the same conglomerate, and the scan
is reopened with the same "hold" and "forUpdate" parameters passed in
the original openScan. The previous template row continues to be used.
- Specified by:
reopenScanin interfaceorg.apache.derby.iapi.store.access.GenericScanController
replace
public boolean replace(org.apache.derby.iapi.types.DataValueDescriptor[] row, org.apache.derby.iapi.services.io.FormatableBitSet validColumns) throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.store.access.ScanController - Replace the (partial) row at the current position of the scan.
- Specified by:
replacein interfaceorg.apache.derby.iapi.store.access.ScanController
doesCurrentPositionQualify
public boolean doesCurrentPositionQualify()
throws org.apache.derby.iapi.error.StandardException
- Returns true if the current position of the scan still qualifies
under the set of qualifiers passed to the openScan(). When called
this routine will reapply all qualifiers against the row currently
positioned and return true if the row still qualifies. If the row
has been deleted or no longer passes the qualifiers then this routine
will return false.
This case can come about if the current scan
or another scan on the same table in the same transaction
deleted the row or changed columns referenced by the qualifier after
the next() call which positioned the scan at this row.
Note that for comglomerates which don't support update, like btree's,
there is no need to recheck the qualifiers.
The results of a fetch() performed on a scan positioned on
a deleted row are undefined.
- Specified by:
doesCurrentPositionQualifyin interfaceorg.apache.derby.iapi.store.access.ScanController
fetch
public void fetch(org.apache.derby.iapi.types.DataValueDescriptor[] row) throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.store.access.ScanController - Fetch the (partial) row at the current position of the Scan.
The value in the destRow storable row is replaced
with the value of the row at the current scan
position. The columns of the destRow row must
be of the same type as the actual columns in the
underlying conglomerate. The number of elements in
fetch must be compatible with the number of scan columns
requested at the openScan call time.
A fetch can return a sub-set of the scan columns reqested at scan open time by supplying a destRow will less elements than the number of requested columns. In this case the N leftmost of the requested columns are fetched, where N = destRow.length. In the case where all columns are rested and N = 2 then columns 0 and 1 are returned. In the case where the openScan FormatableBitSet requested columns 1, 4 and 7, then columns 1 and 4 would be fetched when N = 2.
The results of a fetch() performed on a scan after next() has returned false are undefined. A fetch() performed on a scan positioned on a deleted row will throw a StandardException with state = SQLState.AM_RECORD_NOT_FOUND. Note that this can happen even if next() has returned true (for instance the client can delete the row, or if using read uncommitted another thread can delete the row after the next() call but before the fetch).- Specified by:
fetchin interfaceorg.apache.derby.iapi.store.access.ScanController
fetchLocation
public void fetchLocation(org.apache.derby.iapi.types.RowLocation templateLocation) throws org.apache.derby.iapi.error.StandardException
- Fetch the location of the current position in the scan.
- Specified by:
fetchLocationin interfaceorg.apache.derby.iapi.store.access.ScanController
getScanInfo
public org.apache.derby.iapi.store.access.ScanInfo getScanInfo() throws org.apache.derby.iapi.error.StandardException
- Return ScanInfo object which describes performance of scan.
Return ScanInfo object which contains information about the current scan.
- Specified by:
getScanInfoin interfaceorg.apache.derby.iapi.store.access.GenericScanController
isCurrentPositionDeleted
public boolean isCurrentPositionDeleted()
throws org.apache.derby.iapi.error.StandardException
- Returns true if the current position of the scan is at a
deleted row. This case can come about if the current scan
or another scan on the same table in the same transaction
deleted the row after the next() call which positioned the
scan at this row.
The results of a fetch() performed on a scan positioned on
a deleted row are undefined.
- Specified by:
isCurrentPositionDeletedin interfaceorg.apache.derby.iapi.store.access.ScanController
|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> store >> access >> [ conglomerate overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC