com.bigdata.btree
Interface IIndex

All Superinterfaces:
IAutoboxBTree, IRangeQuery, ISimpleBTree
All Known Subinterfaces:
IClientIndex, ILocalBTreeView, IScaleOutClientIndex
All Known Implementing Classes:
AbstractBTree, AbstractScaleOutClientIndexView, AbstractScaleOutClientIndexView2, BTree, ClientIndexView, ClientIndexViewRefactor, CommitRecordIndex, CommitTimeIndex, CounterSetBTree, DataServiceIndex, DelegateIndex, EventReceiver.EventBTree, FusedView, IndexSegment, IndexSegmentIndex, IsolatedFusedView, JournalIndex, MetadataIndex, MetadataIndexView, Name2Addr, ReadCommittedView, ReadOnlyIndex, ReadOnlyMetadataIndexView, UnisolatedReadWriteIndex

public interface IIndex
extends ISimpleBTree, IAutoboxBTree, IRangeQuery

Interface for mutable B+-Tree mapping arbitrary non-null keys to arbitrary values.

Version:
$Id: IIndex.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Field Summary
 
Fields inherited from interface com.bigdata.btree.IRangeQuery
ALL, CURSOR, DEFAULT, DELETED, FIXED_LENGTH_SUCCESSOR, KEYS, NONE, PARALLEL, READONLY, REMOVEALL, REVERSE, VALS
 
Method Summary
 ICounter getCounter()
          A restart-safe counter.
 ICounterSet getCounters()
          Interesting performance counters and other statistics about the index.
 IndexMetadata getIndexMetadata()
          The metadata for the index.
 IResourceMetadata[] getResourceMetadata()
          The description of the resources comprising the index view.
 void submit(byte[] fromKey, byte[] toKey, IKeyRangeIndexProcedure proc, IResultHandler handler)
          The procedure will be transparently applied against each index partition spanned by the given key range.
 Object submit(byte[] key, ISimpleIndexProcedure proc)
          Submits an index procedure that operations on a single key to the appropriate index partition returning the result of that procedure.
 void submit(int fromIndex, int toIndex, byte[][] keys, byte[][] vals, AbstractKeyArrayIndexProcedureConstructor ctor, IResultHandler resultHandler)
          Runs a procedure against an index.
 
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
 

Method Detail

getResourceMetadata

IResourceMetadata[] getResourceMetadata()
The description of the resources comprising the index view.


getIndexMetadata

IndexMetadata getIndexMetadata()
The metadata for the index. This is full of good stuff about the index.


getCounter

ICounter getCounter()
A restart-safe counter. For an unpartitioned index, this a single counter for the entire index with an initial value of zero (0) and it is stored in the index Checkpoint record. For a partitioned index, there is a distinct counter for each index partition, the partition identifier is used as the high int32 bits of the counter, and the low int32 of the counter has an initial value of zero (0) in each index partition.


getCounters

ICounterSet getCounters()
Interesting performance counters and other statistics about the index.


submit

Object submit(byte[] key,
              ISimpleIndexProcedure proc)
Submits an index procedure that operations on a single key to the appropriate index partition returning the result of that procedure.

Parameters:
key - The key.
proc - The procedure.
Returns:
The value returned by IIndexProcedure.apply(IIndex)

submit

void submit(byte[] fromKey,
            byte[] toKey,
            IKeyRangeIndexProcedure proc,
            IResultHandler handler)
The procedure will be transparently applied against each index partition spanned by the given key range.

Note: Since this variant of submit() does not split keys the fromIndex and toIndex in the Splits reported to the IResultHandler will be zero (0).

Parameters:
fromKey - The lower bound (inclusive) -or- null if there is no lower bound.
toKey - The upper bound (exclusive) -or- null if there is no upper bound.
proc - The procedure. If the procedure implements the IParallelizableIndexProcedure marker interface then it MAY be executed in parallel against the relevant index partition(s).
resultHandler - When defined, results from each procedure application will be reported to this object.

submit

void submit(int fromIndex,
            int toIndex,
            byte[][] keys,
            byte[][] vals,
            AbstractKeyArrayIndexProcedureConstructor ctor,
            IResultHandler resultHandler)
Runs a procedure against an index.

Note: This may be used to send custom logic together with the data to a remote index or index partition. When the index is remote both the procedure and the return value MUST be Serializable.

Note: The scale-out indices add support for auto-split of the procedure such that it runs locally against each relevant index partition.

Parameters:
fromIndex - The index of the first key to be used (inclusive).
toIndex - The index of the last key to be used (exclusive).
keys - The keys (required).
vals - The values (optional depending on the procedure).
ctor - An object that can create instances of the procedure.
resultHandler - When defined, results from each procedure application will be reported to this object.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.