Concurrency Notes
The concurrency rules are derived from OpenBTree.
OpenBTree
| Modifier and Type | Field and Description |
|---|---|
| protected DataValueDescriptor[][] | fetchNext_one_slot_array
A 1 element array to turn fetchNext and fetch calls into fetchNextGroup calls. |
| protected FetchDescriptor | init_fetchDesc
The fetch descriptor which describes the row to be returned by the scan. |
| protected boolean | |
| protected boolean | |
| protected FetchDescriptor | init_lock_fetch_desc
A constant FetchDescriptor which describes the position of the RowLocation field within the btree, currently always the last column). |
| protected Qualifier[][] | |
| protected Transaction | init_rawtran
Hides org. |
| protected FormatableBitSet | |
| protected DataValueDescriptor[] | |
| protected int | |
| protected DataValueDescriptor[] | |
| protected int | |
| protected DataValueDescriptor[] | |
| protected boolean | init_useUpdateLocks
Whether the scan should requests UPDATE locks which then will be converted to X locks when the actual operation is performed. |
| protected int | lock_operation
What kind of row locks to get during the scan. |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| pack-priv BTreeRowPosition | |
| protected int | scan_state
Delay positioning the table at the start position until the first next() call. |
| protected int | |
| protected int | stat_numpages_visited
Performance counters ... |
| protected int | |
| protected int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides org. Implements org. Close the scan. |
| public boolean | closeForEndTransaction(boolean
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. closeHeldScan)Implements org. Close the scan, a commit or abort is about to happen. |
| public boolean | delete()
Implements org. Delete the row at the current position of the scan. |
| public void | didNotQualify()
Implements org. A call to allow client to indicate that current row does not qualify. |
| public boolean | doesCurrentPositionQualify()
Implements org. Returns true if the current position of the scan still qualifies under the set of qualifiers passed to the openScan(). |
| private void | fetch(DataValueDescriptor[]
The row into which the value of the current
position in the scan is to be stored. row, boolean indicates whether the qualifiers should be applied. qualify)Fetch the row at the current position of the Scan. |
| public void | fetch(DataValueDescriptor[]
The row into which the value of the current
position in the scan is to be stored. row)Implements org. Fetch the row at the current position of the Scan. |
| public void | fetchLocation(RowLocation templateLocation)
Implements org. Fetch the location of the current position in the scan. |
| public boolean | Returns: True if there is a next position in the scan, false if there isn't.The template row into which the value
of the next position in the scan is to be stored. row)Implements org. Fetch the row at the next position of the Scan. |
| public int | Returns: The number of qualifying rows found and copied into the provided array of rows. If 0 then the scan is complete, otherwise the return value will be: 1 <= row_count <= row_array.lengthThe array of rows to copy rows into.
row_array[].length must >= 1. This routine
assumes that all entries in the array
contain complete template rows. row_array, RowLocation[] If non-null, the array of row locations to
copy into. If null, no row locations are
retrieved. rowloc_array)Implements org. Fetch the next N rows from the table. |
| public int | fetchNextGroup(DataValueDescriptor[][] row_array, RowLocation[] old_rowloc_array, RowLocation[] new_rowloc_array)
Implements org.
|
| protected abstract int | fetchRows(BTreeRowPosition pos, DataValueDescriptor[][] row_array, RowLocation[] rowloc_array, BackingStoreHashtable hash_table, long max_rowcnt, int[] key_column_numbers)
Fetch the next N rows from the table. |
| public void | fetchSet(long
The maximum number of rows to insert into the
Hash table. Pass in -1 if there is no maximum. max_rowcnt, int[] The column numbers of the columns in the
scan result row to be the key to the Hashtable.
"0" is the first column in the scan result
row (which may be different than the first
column in the row in the table of the scan). key_column_numbers, BackingStoreHashtable The java HashTable to load into. hash_table)Implements org. Insert all rows that qualify for the current scan into the input Hash table. |
| public void | fetchWithoutQualify(DataValueDescriptor[]
The row into which the value of the current
position in the scan is to be stored. row)Implements org. Fetch the row at the current position of the Scan without applying the qualifiers. |
| public RecordHandle | |
| public ScanInfo | Returns: The ScanInfo object which contains info about current scan.Implements org. Return ScanInfo object which describes performance of scan. |
| public void | init(TransactionManager xact_manager, Transaction rawtran, boolean hold, int open_mode, int lock_level, BTreeLockingPolicy btree_locking_policy, FormatableBitSet scanColumnList, DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier[][] qualifier, DataValueDescriptor[] stopKeyValue, int stopSearchOperator, BTree conglomerate, LogicalUndo undo, StaticCompiledOpenConglomInfo static_info, DynamicCompiledOpenConglomInfo dynamic_info)
Initialize the scan for use. |
| private void | initScanParams(DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier[][] qualifier, DataValueDescriptor[] stopKeyValue, int stopSearchOperator)
Shared initialization code between init() and reopenScan(). |
| public boolean | isCurrentPositionDeleted()
Implements org. Returns true if the current position of the scan is at a deleted row. |
| pack-priv static boolean | |
| public boolean | isHeldAfterCommit()
Implements org. Return true is the scan has been closed after a commit, but was opened with holdability and can be reopened using positionAtRowLocation. |
| public boolean | Returns: whether this is a keyed conglomerate.Implements org. Return whether this is a keyed conglomerate. |
| public RowLocation | newRowLocationTemplate()
Implements org. Return a row location object of the correct type to be used in calls to fetchLocation. |
| public boolean | next()
Implements org. Move to the next position in the scan. |
| protected void | |
| protected void | positionAtDoneScanFromClose(BTreeRowPosition
current row position of the scan. pos)Do any necessary work to complete the scan. |
| protected void | positionAtNextPage(BTreeRowPosition
current row position of the scan. pos)Position scan to 0 slot on next page. |
| protected void | |
| public boolean | positionAtRowLocation(RowLocation
RowLocation for the new position for the scan. The
RowLocation submitted should be a RowLocation which has
previously been returned by this ScanController. rLoc)Implements org. Positions the scan at row location and locks the row. |
| protected void | positionAtStartForForwardScan(BTreeRowPosition pos)
Position scan at "start" position for a forward scan. |
| pack-priv abstract void | |
| protected boolean | process_qualifier(DataValueDescriptor[]
The row with the same partial column list as the
row returned by the current scan. row)process_qualifier - Determine if a row meets all qualifier conditions. |
| public final void | reopenScan(DataValueDescriptor[]
An indexable row which holds a
(partial) key value which, in combination with the
startSearchOperator, defines the starting position of
the scan. If null, the starting position of the scan
is the first row of the conglomerate. startKeyValue, int an operator which defines
how the startKeyValue is to be searched for. If
startSearchOperation is ScanController.GE, the scan starts on
the first row which is greater than or equal to the
startKeyValue. If startSearchOperation is ScanController.GT,
the scan starts on the first row whose key is greater than
startKeyValue. The startSearchOperation parameter is
ignored if the startKeyValue parameter is null. startSearchOperator, Qualifier[][] An array of qualifiers which, applied
to each key, restrict the rows returned by the scan. Rows
for which any one of the qualifiers returns false are not
returned by the scan. If null, all rows are returned. qualifier, DataValueDescriptor[] An indexable row which holds a
(partial) key value which, in combination with the
stopSearchOperator, defines the ending position of
the scan. If null, the ending position of the scan
is the last row of the conglomerate. stopKeyValue, int an operator which defines
how the stopKeyValue is used to determine the scan stopping
position. If stopSearchOperation is ScanController.GE, the scan
stops just before the first row which is greater than or
equal to the stopKeyValue. If stopSearchOperation is
ScanController.GT, the scan stops just before the first row whose
key is greater than startKeyValue. The stopSearchOperation
parameter is ignored if the stopKeyValue parameter is null. stopSearchOperator)Implements org. Reposition the current scan. |
| public void | reopenScanByRowLocation(RowLocation
An existing RowLocation within the conglomerate,
at which to position the start of the scan. The scan will begin at this
location and continue forward until the end of the conglomerate.
Positioning at a non-existent RowLocation (ie. an invalid one or one that
had been deleted), will result in an exception being thrown when the
first next operation is attempted. startRowLocation, Qualifier[][] An array of qualifiers which, applied
to each key, restrict the rows returned by the scan. Rows
for which any one of the qualifiers returns false are not
returned by the scan. If null, all rows are returned. qualifier)Implements org. Reposition the current scan. |
| public boolean | replace(DataValueDescriptor[] row, FormatableBitSet validColumns)
Implements org. Replace the entire row at the current position of the scan. |
| protected boolean | Returns: returns true if scan has been repositioned successfully, else returns false if the position key could not be found and missing_row_for_key_ok was false indicating that scan could only be positioned on the exact key match.position to set the scan to. pos, boolean if true and exact key is not found then
scan is just set to key just left of
the key (thus a next will move to the
key just after "pos") missing_row_for_key_ok)Reposition the scan leaving and reentering the access layer. |
| pack-priv void | savePositionAndReleasePage(DataValueDescriptor[]
known parts of the key that should be saved, or
partialKey, int[] null if the entire key is unknown and will have to be fetched
from the pagean array which tells which columns of the partial key are
valid (key columns that have 0 in this array are not valid, and their
values must be fetched from the page), or vcols)null if all the
columns are validSave the current scan position by key and release the latch on the leaf that's being scanned. |
| pack-priv void | |
| public String |