|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IIndexProcedure
An arbitrary procedure run against a single index.
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. IIndexProcedures 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[] keySparseRowStore 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[] fromKeyIRangeQuery.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[][] keysjava.rmi.server.codebase).
apply(IIndex) 's return value (much like
Callable).| Method Summary | |
|---|---|
Object |
apply(IIndex ndx)
Run the procedure. |
boolean |
isReadOnly()
Return true iff the procedure asserts that it will not
write on the index. |
| Method Detail |
|---|
boolean isReadOnly()
true iff the procedure asserts that it will not
write on the index. When true, the procedure may be run
against a view of the index that is read-only or which allows concurrent
processes to read on the same index object. When false the
procedure will be run against a mutable view of the index (assuming that
the procedure is executed in a context that has access to a mutable index
view).
Object 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||