public interface IIndexProcedure<T> extends IReadOnly, Serializable
There is a fairly direct correspondence between map / reduce processing and
the use of index procedures. The "map" phase corresponds to the
IIndexProcedure
while the "reduce" phase corresponds to the
IResultHandler
. The main difference is that index procedures operate
on ordered data. IIndexProcedure
s MAY use
IParallelizableIndexProcedure
to declare that they can be executed in
parallel when mapped across multiple index partitions - parallelization is
handled automatically by ClientIndexView
. Otherwise it is assumed
that the procedure requires sequential execution as it is applied to the
relevant index partition(s) - again this is handled automatically.
There are basically three kinds of index procedures, each of which determines where an index procedure will be mapped in a different manner:
byte[] key
SparseRowStore
or
performing a datum ISimpleBTree#lookup(Object)
. These procedures are
always directed to a single index partition. Since they are never mapped
across index partitions, there is no "aggregation" phase. Likewise, there is
no AbstractKeyArrayIndexProcedureConstructor
since the procedure instance is
always created directly by the application.byte[] toKey, byte[] fromKey
IRangeQuery.rangeCount(byte[], byte[])
and
IRangeQuery#rangeIterator(byte[], byte[]). Since the same data is sent
to each index partition there is no requirement for an object to construct
instances of these procedures. However, the procedures do need a means to
combine or aggregate the results from each index partition. See
{@link IKeyRangeIndexProcedure}.byte[][] keys
java.rmi.server.codebase
).Modifier and Type | Method and Description |
---|---|
T |
apply(IIndex ndx)
Run the procedure.
|
isReadOnly
T apply(IIndex ndx)
Note: Unisolated procedures have "auto-commit" ACID properties for a local index only. In order for a distributed procedure to be ACID, the procedure MUST be executed within a fully isolated transaction.
ndx
- The index.null
. In general,
this MUST be Serializable
since it may have to pass
across a network interface.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.