public class ReadOnlyIndex extends DelegateIndex
Note: use this class sparingly. An index loaded from a historical commit point will always be read-only.
|Modifier and Type||Method and Description|
Counter is read-only.
Overridden to ensure that procedure is applied against read-only view and not the
contains, contains, getCounters, insert, lookup, lookup, putIfAbsent, rangeCount, rangeCount, rangeCountExact, rangeCountExactWithDeleted, rangeIterator, rangeIterator, remove, submit, submit, toString
public ReadOnlyIndex(IIndex src)
public final IndexMetadata getIndexMetadata()
IndexMetadatais cloned to disallow modification.
public final IResourceMetadata getResourceMetadata()
IResourceMetadata is cloned to disallow modification (the
IResourceMetadatainstances in the array are all dynamically created so changes to them do not propagate back to the index).
public final ICounter getCounter()
public final byte insert(byte key, byte value)
public final byte remove(byte key)
public final ITupleIterator rangeIterator(byte fromKey, byte toKey, int capacity, int flags, IFilter filter)
fromKey- The first key that will be visited (inclusive lower bound). When
nullthere is no lower bound.
toKey- The first key that will NOT be visited (exclusive upper bound). When
nullthere 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
flags- A bitwise OR of
filter- An optional object used to construct a stacked iterator. When
IRangeQuery.CURSORis specified in flags, the base iterator will implement
ITupleCursorand 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
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 void submit(int fromIndex, int toIndex, byte keys, byte vals, AbstractKeyArrayIndexProcedureConstructor ctor, IResultHandler aggregator)
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.
aggregator- When defined, results from each procedure application will be reported to this object. TODO In order to allow parallelization within a shard, we need to modify this method signature to pass in an
IResultHandlerconstructor object. That might be something which could be pushed down onto the ctor argument. It would be used in scale-out to create a DS local result handler so we can locally aggregate when parallelizing against each shard and then return that aggregated result to the client which would extract the aggregate result across the shards from the client's result handler. See BLZG-1537.
(Schedule more IOs when loading data)
Copyright © 2006–2016 SYSTAP, LLC DBA Blazegraph. All rights reserved.