com.bigdata.btree.proc
Interface IResultHandler<R,A>

Type Parameters:
R - The type of the result from applying the procedure to a single Split of data.
A - The type of the aggregated result.
All Known Subinterfaces:
IAsyncResultHandler<R,A,O,X>
All Known Implementing Classes:
AbstractKeyArrayIndexProcedure.ResultBitBufferCounter, AbstractKeyArrayIndexProcedure.ResultBitBufferHandler, AbstractKeyArrayIndexProcedure.ResultBufferHandler, BooleanORAggregator, IdentityHandler, IntegerAggregator, ListResultAggregator, LongAggregator

public interface IResultHandler<R,A>

An interface for handling results obtained when an IIndexProcedure is applied to either a unitary index or to partitions of a scale-out index.

Version:
$Id: IResultHandler.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
TODO:
drop getResult() from the signature? The handler implementation can expose a custom method when an aggregated return is desirable. However some handlers will apply iterative processing to the results as they are obtained without any sense of aggregation.

Method Summary
 void aggregate(R result, Split split)
          Method is invoked for each result and is responsible for combining the results in whatever manner is meaningful for the procedure.
 A getResult()
          Return the aggregated results as an implementation dependent object.
 

Method Detail

aggregate

void aggregate(R result,
               Split split)
Method is invoked for each result and is responsible for combining the results in whatever manner is meaningful for the procedure. Implementations of this method MUST be thread-safe since the procedure MAY be applied in parallel when it spans more than one index partition.

Parameters:
result - The result from applying the procedure to a single index partition.
split - The Split that generated that result.

getResult

A getResult()
Return the aggregated results as an implementation dependent object.



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