|
||||||||||
| 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.service.CommitTimeIndex
public class CommitTimeIndex
BTree whose keys are commit times. No values are stored in the
BTree.
BTree for long keys and arbitrary values and move the
find() and findNext() methods onto that class and make the value type
generic. That same logic is replicated right now in several places and
there is no reason for that. Allow 0L for find(long), but
check all callers first to see who might use that for error checking
and then modify callers using 1L to use 0L. In fact,
find(long) should probably accept the value to be returned in
case there is no LTE entry (that is, in case the index is empty).| Nested Class Summary | |
|---|---|
protected static class |
CommitTimeIndex.TupleSerializer
Encapsulates key and value formation. |
| Nested classes/interfaces inherited from class com.bigdata.btree.BTree |
|---|
BTree.Counter, BTree.LeafCursor, BTree.NodeFactory, BTree.PartitionedCounter, BTree.Stack |
| Nested classes/interfaces inherited from class com.bigdata.btree.AbstractBTree |
|---|
AbstractBTree.IBTreeCounters |
| Field Summary |
|---|
| Fields inherited from class com.bigdata.btree.BTree |
|---|
counter, height, nentries, nleaves, nnodes, recordVersion |
| 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, readOnly, 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 | |
|---|---|
CommitTimeIndex(IRawStore store,
Checkpoint checkpoint,
IndexMetadata metadata,
boolean readOnly)
Load from the store. |
|
| Method Summary | |
|---|---|
void |
add(long commitTime)
Add an entry for the commitTime. |
static CommitTimeIndex |
createTransient()
Create a transient instance. |
protected long |
decodeKey(byte[] key)
|
protected byte[] |
encodeKey(long commitTime)
Encodes the commit time into a key. |
long |
find(long timestamp)
Return the largest commitTime that is less than or equal to the given timestamp. |
long |
findIndexOf(long timestamp)
Find the index having the largest timestamp that is less than or equal to the given timestamp. |
long |
findNext(long timestamp)
Find the first commit time strictly greater than the timestamp. |
| Methods inherited from class com.bigdata.btree.BTree |
|---|
_reopen, asReadOnly, create, createTransient, createViewCheckpoint, fireDirtyEvent, getBloomFilter, getCheckpoint, getCounter, getDirtyListener, getEntryCount, getHeight, getLastCommitTime, getLeafCount, getMetadataAddr, getMutableBTree, getNodeCount, getRecordVersion, getRevisionTimestamp, getRootAddr, getSourceCount, getSources, getStore, handleCommit, load, load, needsCheckpoint, newLeafCursor, newLeafCursor, readBloomFilter, removeAll, setDirtyListener, setIndexMetadata, setLastCommitTime, writeCheckpoint, writeCheckpoint2 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CommitTimeIndex(IRawStore store,
Checkpoint checkpoint,
IndexMetadata metadata,
boolean readOnly)
store - The backing store.checkpoint - The Checkpoint record.metadata - The metadata record for the index.| Method Detail |
|---|
public static CommitTimeIndex createTransient()
protected byte[] encodeKey(long commitTime)
commitTime - The commit time.
protected long decodeKey(byte[] key)
public long find(long timestamp)
timestamp - The given timestamp.
-1L iff there is no entry
in the index which satisifies the probe.
IllegalArgumentException - if timestamp is less than or equals to ZERO (0L).public long findNext(long timestamp)
timestamp - The timestamp. A value of ZERO (0) may be used to find the
first commit time.
-1L if there is no commit
record whose timestamp is strictly greater than timestamp.public long findIndexOf(long timestamp)
-1 iff there
are no index entries.public void add(long commitTime)
commitTime - A timestamp representing a commit time.
IllegalArgumentException - if commitTime is 0L.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||