|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.DelegateIndex
com.bigdata.btree.ReadOnlyIndex
public class ReadOnlyIndex
A fly-weight wrapper that does not permit write operations and reads through
onto an underlying IIndex.
Note: use this class sparingly. An index loaded from a historical commit point will always be read-only.
IResourceManager#getIndex(String, long)}| Field Summary |
|---|
| Fields inherited from interface com.bigdata.btree.IRangeQuery |
|---|
ALL, CURSOR, DEFAULT, DELETED, FIXED_LENGTH_SUCCESSOR, KEYS, NONE, PARALLEL, READONLY, REMOVEALL, REVERSE, VALS |
| Constructor Summary | |
|---|---|
ReadOnlyIndex(IIndex src)
|
|
| Method Summary | |
|---|---|
ICounter |
getCounter()
Counter is read-only. |
IndexMetadata |
getIndexMetadata()
IndexMetadata is cloned to disallow modification. |
IResourceMetadata[] |
getResourceMetadata()
IResourceMetadata[] is cloned to disallow modification (the
IResourceMetadata instances in the array are all dynamically
created so changes to them do not propagate back to the index). |
byte[] |
insert(byte[] key,
byte[] value)
Disabled. |
ITupleIterator |
rangeIterator(byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilter filter)
IRangeQuery.REMOVEALL and Iterator.remove() are disabled. |
byte[] |
remove(byte[] key)
Disabled. |
void |
submit(byte[] fromKey,
byte[] toKey,
IIndexProcedure proc,
IResultHandler handler)
Overriden to ensure that procedure is applied against read-only view and not the DelegateIndex. |
Object |
submit(byte[] key,
IIndexProcedure proc)
Overriden to ensure that procedure is applied against read-only view and not the DelegateIndex. |
void |
submit(int fromIndex,
int toIndex,
byte[][] keys,
byte[][] vals,
AbstractKeyArrayIndexProcedureConstructor ctor,
IResultHandler aggregator)
Overriden to ensure that procedure is applied against read-only view and not the DelegateIndex. |
| Methods inherited from class com.bigdata.btree.DelegateIndex |
|---|
contains, contains, getCounters, insert, lookup, lookup, rangeCount, rangeCount, rangeCountExact, rangeCountExactWithDeleted, rangeIterator, rangeIterator, remove, submit, submit, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ReadOnlyIndex(IIndex src)
| Method Detail |
|---|
public final IndexMetadata getIndexMetadata()
IndexMetadata is cloned to disallow modification.
getIndexMetadata in interface IIndexgetIndexMetadata in class DelegateIndexpublic final IResourceMetadata[] getResourceMetadata()
IResourceMetadata[] is cloned to disallow modification (the
IResourceMetadata instances in the array are all dynamically
created so changes to them do not propagate back to the index).
getResourceMetadata in interface IIndexgetResourceMetadata in class DelegateIndexpublic final ICounter getCounter()
getCounter in interface IIndexLocalCountergetCounter in class DelegateIndex
public final byte[] insert(byte[] key,
byte[] value)
insert in interface ISimpleBTreeinsert in class DelegateIndexkey - The key.value - The value (may be null).
null if the
key was not found or if the previous entry for that key was
marked as deleted.public final byte[] remove(byte[] key)
remove in interface ISimpleBTreeremove in class DelegateIndexkey - The key.
null if the key
was not found or if the previous entry under that key was marked
as deleted.
public final ITupleIterator rangeIterator(byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilter filter)
IRangeQuery.REMOVEALL and Iterator.remove() are disabled.
rangeIterator in interface IRangeQueryrangeIterator in class DelegateIndexfromKey - The first key that will be visited (inclusive lower bound).
When null there is no lower bound.toKey - The first key that will NOT be visited (exclusive upper
bound). When null there is no upper bound.capacity - The #of entries to buffer at a time. This is a hint and MAY be
zero (0) to use an implementation specific default
capacity. A non-zero value may be used if you know that you
want at most N results or if you want to override the default
#of results to be buffered before sending them across a
network interface. (Note that you can control the default
value using
IBigdataClient.Options#DEFAULT_CLIENT_RANGE_QUERY_CAPACITY).flags - A bitwise OR of IRangeQuery.KEYS, IRangeQuery.VALS, etc.filter - An optional object used to construct a stacked iterator. When
IRangeQuery.CURSOR is specified in flags, the base
iterator will implement ITupleCursor and the first
filter in the stack can safely cast the source iterator to an
ITupleCursor. If the outermost filter in the stack
does not implement ITupleIterator, then it will be
wrapped an ITupleIterator.SuccessorUtil, which may be used to compute the successor of a value
before encoding it as a component of a key.,
BytesUtil#successor(byte[]), which may be used to compute the
successor of an encoded key.,
IFilterConstructor, which may be used to construct an iterator stack
performing filtering or other operations.
public final Object submit(byte[] key,
IIndexProcedure proc)
DelegateIndex.
public final void submit(byte[] fromKey,
byte[] toKey,
IIndexProcedure proc,
IResultHandler handler)
DelegateIndex.
public final void submit(int fromIndex,
int toIndex,
byte[][] keys,
byte[][] vals,
AbstractKeyArrayIndexProcedureConstructor ctor,
IResultHandler aggregator)
DelegateIndex.
submit in interface IIndexsubmit in class DelegateIndexfromIndex - 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.aggregator - When defined, results from each procedure application will be
reported to this object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||