com.bigdata.resources
Class IndexSegmentIndex

java.lang.Object
  extended by com.bigdata.btree.AbstractBTree
      extended by com.bigdata.btree.BTree
          extended by com.bigdata.resources.IndexSegmentIndex
All Implemented Interfaces:
IAutoboxBTree, IBTreeStatistics, ICheckpointProtocol, IIndex, IIndexLocalCounter, ILinearList, ILocalBTreeView, IRangeQuery, ISimpleBTree, ICounterSetAccess, ICommitter

public class IndexSegmentIndex
extends BTree

BTree mapping IndexSegmentStore createTimes to IResourceMetadata records. The keys are the long integers (commitTimes) followed by the index segment UUID to break ties (this is not the scale-out index UUID, but the UUID of the specific index segment). The values are IResourceMetadata objects.

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.


Nested Class Summary
 
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
IndexSegmentIndex(IRawStore store, Checkpoint checkpoint, IndexMetadata metadata, boolean readOnly)
          Load from the store.
 
Method Summary
 void add(SegmentMetadata resourceMetadata)
          Add an entry under the commitTime and resource UUID associated with the IResourceMetadata record.
static IndexSegmentIndex createTransient()
          Create a transient instance.
protected  byte[] getKey(long commitTime, UUID uuid)
          Encodes the commit time into a key.
 
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 com.bigdata.btree.AbstractBTree
assertNotReadOnly, assertNotTransient, close, contains, contains, decodeRecordAddr, dump, dump, encodeRecordAddr, getBranchingFactor, getBtreeCounters, getContainsTuple, getCounters, getIndexMetadata, getLookupTuple, getNodeSerializer, getResourceMetadata, getRightMostNode, getRoot, getRootOrFinger, getStatistics, getUtilization, getWriteTuple, indexOf, insert, insert, insert, isOpen, isReadOnly, isTransient, keyAt, lookup, lookup, lookup, rangeCheck, rangeCopy, rangeCount, rangeCount, rangeCount, rangeCountExact, rangeCountExactWithDeleted, rangeIterator, rangeIterator, rangeIterator, rangeIterator, rangeIterator, readNodeOrLeaf, recycle, remove, remove, remove, reopen, setBTreeCounters, submit, submit, submit, toString, touch, valueAt, valueAt, writeNodeOrLeaf, writeNodeRecursive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexSegmentIndex

public IndexSegmentIndex(IRawStore store,
                         Checkpoint checkpoint,
                         IndexMetadata metadata,
                         boolean readOnly)
Load from the store.

Parameters:
store - The backing store.
checkpoint - The Checkpoint record.
metadata - The metadata record for the index.
Method Detail

createTransient

public static IndexSegmentIndex createTransient()
Create a transient instance.

Returns:
The new instance.

getKey

protected byte[] getKey(long commitTime,
                        UUID uuid)
Encodes the commit time into a key.

Parameters:
commitTime - The commit time.
The - UUID of the resource.
Returns:
The corresponding key.

add

public void add(SegmentMetadata resourceMetadata)
Add an entry under the commitTime and resource UUID associated with the IResourceMetadata record.

Parameters:
resourceMetadata - The IResourceMetadata record.
Throws:
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-2011 SYSTAP, LLC. All Rights Reserved.