|
GemFire 5.8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ResultCollector
Defines the interface for a container that gathers results from function
execution.
GemFire provides a default implementation for ResultCollector.
Applications can choose to implement their own custom ResultCollector.
A custom ResultCollector facilitates result sorting or aggregation. Aggregation
functions like sum, minimum, maximum and average can also be applied to the result using
a custom ResultCollector.
Region region ;
Set keySet = Collections.singleton("myKey");
Function multiGetFunction ;
Serializable args ;
ResultCollector rc = FunctionService.onRegion(region)
.withArgs(args)
.withFilter(keySet)
.withCollector(new MyCustomResultCollector())
.execute(multiGetFunction.getId());
//Application can do something else here before retrieving the result
Serializable functionResult = rc.getResult();
| Method Summary | |
|---|---|
void |
addResult(Serializable resultOfSingleExecution)
Adds a single function execution result to the ResultCollector |
void |
endResults()
GemFire will invoke this method when function execution has completed and all results for the execution have been obtained and added to the ResultCollector |
Serializable |
getResult()
Returns the result of function execution, potentially blocking until all the results are available has been called. |
Serializable |
getResult(long timeout,
com.gemstone.bp.edu.emory.mathcs.backport.java.util.concurrent.TimeUnit unit)
Returns the result of function execution, blocking for the timeout period until all the results are available. |
| Method Detail |
|---|
Serializable getResult()
throws FunctionException
all the results are available has been called.
FunctionException - if result retrieval fails
Serializable getResult(long timeout,
com.gemstone.bp.edu.emory.mathcs.backport.java.util.concurrent.TimeUnit unit)
throws FunctionException,
InterruptedException
all the results are available.
timeout - the maximum time to waitunit - the time unit of the timeout argument
FunctionException - if result retrieval fails
InterruptedException - if the current thread was interrupted while waitingvoid addResult(Serializable resultOfSingleExecution)
resultOfSingleExecution - void endResults()
added to the ResultCollector
|
GemFire 5.8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||