|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.AbstractBTree
com.bigdata.btree.BTree
com.bigdata.journal.CommitRecordIndex
public class CommitRecordIndex
BTree mapping commit times to 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.
| Nested Class Summary | |
|---|---|
static class |
CommitRecordIndex.CommitRecordIndexTupleSerializer
Encapsulates key and value formation for the CommitRecordIndex. |
static class |
CommitRecordIndex.Entry
An entry in the persistent index. |
| Nested classes/interfaces inherited from class com.bigdata.btree.BTree |
|---|
BTree.Counter, BTree.LeafCursor, BTree.NodeFactory, BTree.PartitionedCounter, BTree.Stack |
| Field Summary |
|---|
| Fields inherited from class com.bigdata.btree.BTree |
|---|
counter, height, nentries, nleaves, nnodes |
| Fields inherited from class com.bigdata.btree.AbstractBTree |
|---|
branchingFactor, debug, DEBUG, dumpLog, ERROR_CLOSED, ERROR_LESS_THAN_ZERO, ERROR_READ_ONLY, ERROR_TOO_LARGE, ERROR_TRANSIENT, INFO, log, metadata, ndistinctOnWriteRetentionQueue, nodeSer, root, store, storeCache, writeRetentionQueue |
| Fields inherited from interface com.bigdata.btree.IRangeQuery |
|---|
ALL, CURSOR, DEFAULT, DELETED, FIXED_LENGTH_SUCCESSOR, KEYS, NONE, PARALLEL, READONLY, REMOVEALL, REVERSE, VALS |
| Constructor Summary | |
|---|---|
CommitRecordIndex(IRawStore store,
Checkpoint checkpoint,
IndexMetadata metadata)
Load from the store. |
|
| Method Summary | |
|---|---|
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. |
int |
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. |
| Methods inherited from class com.bigdata.btree.BTree |
|---|
_reopen, create, createTransient, fireDirtyEvent, flush, getBloomFilter, getCheckpoint, getCounter, getDirtyListener, getEntryCount, getHeight, getLastCommitTime, getLeafCount, getMutableBTree, getNodeCount, getSourceCount, getSources, getStore, handleCommit, isReadOnly, load, load, needsCheckpoint, newLeafCursor, newLeafCursor, readBloomFilter, removeAll, setDirtyListener, setIndexMetadata, setLastCommitTime, setReadOnly, writeCheckpoint, writeCheckpoint2 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.bigdata.btree.IIndex |
|---|
getCounters, getIndexMetadata, getResourceMetadata, submit, submit, submit |
| Methods inherited from interface com.bigdata.btree.ISimpleBTree |
|---|
contains, insert, lookup, remove |
| Methods inherited from interface com.bigdata.btree.IAutoboxBTree |
|---|
contains, insert, lookup, remove |
| Methods inherited from interface com.bigdata.btree.IRangeQuery |
|---|
rangeCount, rangeCount, rangeCountExact, rangeCountExactWithDeleted, rangeIterator, rangeIterator, rangeIterator |
| Constructor Detail |
|---|
public CommitRecordIndex(IRawStore store,
Checkpoint checkpoint,
IndexMetadata metadata)
store - The backing store.checkpoint - The Checkpoint record.metadataId - The metadata record for the index.| Method Detail |
|---|
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 int 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||