public class JournalIndex extends BTree
BTree
mapping IJournal
createTimes (long integers)
to JournalMetadata
records describing the IJournal
.
Note: Access to this object MUST be synchronized.
Note: This is used as a transient data structure that is populated from the
file system by the ResourceManager
.
Modifier and Type | Class and Description |
---|---|
protected static class |
JournalIndex.TupleSerializer
Encapsulates key and value formation.
|
BTree.Counter, BTree.LeafCursor, BTree.NodeFactory, BTree.PartitionedCounter, BTree.Stack
AbstractBTree.IBTreeCounters
counter, height, nentries, nleaves, nnodes, recordVersion
branchingFactor, 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 |
---|
JournalIndex(IRawStore store,
Checkpoint checkpoint,
IndexMetadata metadata,
boolean readOnly)
Load from the store.
|
Modifier and Type | Method and Description |
---|---|
void |
add(JournalMetadata resourceMetadata)
Add an entry under the commitTime associated with the
JournalMetadata record. |
static JournalIndex |
createTransient()
Create a transient instance.
|
JournalMetadata |
find(long timestamp)
Return the
JournalMetadata identifying the journal having the
largest createTime 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. |
JournalMetadata |
findNext(long timestamp)
Find the first journal whose createTime is strictly greater
than the timestamp.
|
_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, writeCheckpoint2
assertNotReadOnly, 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, writeNodeRecursiveConcurrent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, dumpPages, getIndexMetadata, isOpen, reopen
getCounters
rangeCount, scan
getReadLockCount, isReadOnly, readLock, writeLock
public JournalIndex(IRawStore store, Checkpoint checkpoint, IndexMetadata metadata, boolean readOnly)
store
- The backing store.checkpoint
- The Checkpoint
record.metadata
- The metadata record for the index.public static JournalIndex createTransient()
public JournalMetadata find(long timestamp)
JournalMetadata
identifying the journal having the
largest createTime 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.null
iff there are no journals in the index that
satisify the probe.IllegalArgumentException
- if timestamp is less than or equals to ZERO (0L).public JournalMetadata findNext(long timestamp)
timestamp
- The timestamp. A value of ZERO (0) may be used to find the
first journal.null
if there is no commit
record whose timestamp is strictly greater than timestamp.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 ICommitRecord
s
defined.public void add(JournalMetadata resourceMetadata)
JournalMetadata
record.resourceMetadata
- The JournalMetadata
record.IllegalArgumentException
- if commitTime is 0L
.IllegalArgumentException
- if resourceMetadata is null
.IllegalArgumentException
- if there is already an entry registered under for the
given timestamp.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.