public class CommitRecordIndex extends BTree
ICommitRecords. The keys are the long
integers corresponding to the timestamps assigned to commit points in the
store. The values are CommitRecordIndex.Entry objects recording the commit time of the
index and the address of the ICommitRecord for that commit time. A
canonicalizing cache is maintained such that the caller will never observe
distinct concurrent instances of the same ICommitRecord. This in
turn facilitates canonicalizing caches for objects loaded from that
ICommitRecord.| Modifier and Type | Class and Description |
|---|---|
static class |
CommitRecordIndex.CommitRecordIndexTupleSerializer
Encapsulates key and value formation for the
CommitRecordIndex. |
static class |
CommitRecordIndex.Entry
An entry in the persistent index.
|
BTree.Counter, BTree.LeafCursor, BTree.NodeFactory, BTree.PartitionedCounter, BTree.StackAbstractBTree.IBTreeCounterscounter, height, nentries, nleaves, nnodes, recordVersionbranchingFactor, debug, DEBUG, dumpLog, error, ERROR_CLOSED, ERROR_ERROR_STATE, ERROR_LESS_THAN_ZERO, ERROR_READ_ONLY, ERROR_TOO_LARGE, ERROR_TRANSIENT, INFO, log, metadata, ndistinctOnWriteRetentionQueue, nodeSer, readOnly, root, store, storeCache, writeRetentionQueue| Constructor and Description |
|---|
CommitRecordIndex(IRawStore store,
Checkpoint checkpoint,
IndexMetadata metadata,
boolean readOnly)
Load from the store.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(long commitRecordAddr,
ICommitRecord commitRecord)
Add an entry for a commit record.
|
static CommitRecordIndex |
create(IRawStore store)
Create a new instance.
|
static CommitRecordIndex |
createTransient() |
ICommitRecord |
fetchCommitRecord(CommitRecordIndex.Entry entry)
Materialize a commit record, from cache if possible.
|
ICommitRecord |
find(long timestamp)
Return the
ICommitRecord having the largest timestamp that is
less than or equal to the given timestamp. |
long |
findIndexOf(long timestamp)
Find the index of the
ICommitRecord having the largest timestamp
that is less than or equal to the given timestamp. |
ICommitRecord |
findNext(long timestamp)
Find the first commit record strictly greater than the timestamp.
|
ICommitRecord |
get(long commitTime)
Return the
ICommitRecord with the given timestamp (exact match). |
boolean |
hasTimestamp(long commitTime)
Existence test for a commit record with the specified commit timestamp
(exact match).
|
protected ICommitRecord |
loadCommitRecord(IRawStore store,
long addr)
Re-load a commit record from the store.
|
_reopen, asReadOnly, create, createTransient, createViewCheckpoint, fireDirtyEvent, getBloomFilter, getCheckpoint, getCounter, getDirtyListener, getEntryCount, getHeight, getLastCommitTime, getLeafCount, getMetadataAddr, getMutableBTree, getNodeCount, getRecordVersion, getRevisionTimestamp, getRootAddr, getSourceCount, getSources, getStore, handleCommit, invalidate, load, needsCheckpoint, newLeafCursor, newLeafCursor, readBloomFilter, removeAll, setDirtyListener, setIndexMetadata, setLastCommitTime, writeCheckpoint, writeCheckpoint2assertNotReadOnly, assertNotTransient, close, contains, contains, decodeRecordAddr, dump, dump, dumpPages, encodeRecordAddr, getBranchingFactor, getBtreeCounters, getContainsTuple, getCounters, getIndexMetadata, getLevel, getLevel, getLookupTuple, getNodeSerializer, getReadLockCount, getResourceMetadata, getRightMostNode, getRoot, getRootOrFinger, getStatistics, getUtilization, getWriteTuple, indexOf, insert, insert, insert, isBalanced, isOpen, isReadOnly, isTransient, keyAt, lookup, lookup, lookup, putIfAbsent, rangeCheck, rangeCopy, rangeCount, rangeCount, rangeCount, rangeCountExact, rangeCountExactWithDeleted, rangeIterator, rangeIterator, rangeIterator, rangeIterator, rangeIterator, readLock, readNodeOrLeaf, recycle, remove, remove, remove, reopen, scan, setBTreeCounters, submit, submit, submit, toString, touch, valueAt, valueAt, writeLock, writeNodeOrLeaf, writeNodeRecursive, writeNodeRecursiveCallersThread, writeNodeRecursiveConcurrentclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, dumpPages, getIndexMetadata, isOpen, reopengetCountersrangeCount, scangetReadLockCount, isReadOnly, readLock, writeLockpublic CommitRecordIndex(IRawStore store, Checkpoint checkpoint, IndexMetadata metadata, boolean readOnly)
store - The backing store.checkpoint - The Checkpoint record.metadataId - The metadata record for the index.public static CommitRecordIndex create(IRawStore store)
store - The backing store.public static CommitRecordIndex createTransient()
public boolean hasTimestamp(long commitTime)
commitTime - The commit timestamp.ICommitRecord exists in the index with
that commit timestamp (exact match(.public ICommitRecord get(long commitTime)
ICommitRecord with the given timestamp (exact match).commitTime - The commit time.ICommitRecord index or null iff there
is no ICommitTimestamp for that commit time.public ICommitRecord find(long timestamp)
ICommitRecord having the largest timestamp that is
less than or equal to the given timestamp. This is used primarily to
locate the commit record that will serve as the ground state for a
transaction having timestamp as its start time. In this context
the LTE search identifies the most recent commit state that not later
than the start time of the transaction.timestamp - The given timestamp (may be negative for historical reads or
positive for transaction identifiers, but MAY NOT be
ITx.UNISOLATED NOR ITx.READ_COMMITTED).null iff there are no
ICommitRecords in the index that satisify the probe.get(long)public ICommitRecord findNext(long timestamp)
timestamp - The timestamp.null if there is no commit
record whose timestamp is strictly greater than timestamp.public ICommitRecord fetchCommitRecord(CommitRecordIndex.Entry entry)
Note: This DOES NOT perform lookup of the commit time!
entry - An CommitRecordIndex.Entry.ICommitRecord.get(long)public long findIndexOf(long timestamp)
ICommitRecord having the largest timestamp
that is less than or equal to the given timestamp.ICommitRecord having the largest
timestamp that is less than or equal to the given timestamp -or-
-1 iff there are no ICommitRecords
defined.protected ICommitRecord loadCommitRecord(IRawStore store, long addr)
store - The store.addr - The address of the ICommitRecord.ICommitRecord loaded from the specified address.public void add(long commitRecordAddr,
ICommitRecord commitRecord)
commitRecordAddr - The address at which that commit record was written on the
store.commitRecord - The commit record.IllegalArgumentException - if commitRecord is null.IllegalArgumentException - if there is already a ICommitRecord registered
under for the ICommitRecord.getTimestamp().IllegalArgumentException - if addr is invalid.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.