public class MyArrayListResultCollector extends Object implements com.gemstone.gemfire.cache.execute.ResultCollector<Object,Object>
Using a custom ResultCollector a user can sort/aggregate the result. This implementation stores the result in a List. The size of the list will be same as the no of nodes on which a function got executed
| Constructor and Description |
|---|
MyArrayListResultCollector() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResult(com.gemstone.gemfire.distributed.DistributedMember memberID,
Object resultOfSingleExecution)
Adds a single function execution result from a remote node to the
ResultCollector
|
void |
clearResults()
GemFire will invoke this method before re-executing function (in case of
Function Execution HA) This is to clear the previous execution results from
the result collector
|
void |
endResults()
Call back provided to caller, which is called after function execution is
complete and caller can retrieve results using
ResultCollector.getResult() |
Object |
getResult()
Waits if necessary for the computation to complete, and then retrieves its
result.
|
Object |
getResult(long timeout,
TimeUnit unit)
Waits if necessary for at most the given time for the computation to
complete, and then retrieves its result, if available.
|
public void addResult(com.gemstone.gemfire.distributed.DistributedMember memberID,
Object resultOfSingleExecution)
public Object getResult() throws com.gemstone.gemfire.cache.execute.FunctionException
If Function.hasResult() is false, upon calling
ResultCollector.getResult() throws FunctionException.
public Object getResult(long timeout, TimeUnit unit) throws com.gemstone.gemfire.cache.execute.FunctionException, InterruptedException
If Function.hasResult() is false, upon calling
ResultCollector.getResult() throws FunctionException.
getResult in interface com.gemstone.gemfire.cache.execute.ResultCollector<Object,Object>timeout - the maximum time to waitunit - the time unit of the timeout argumentcom.gemstone.gemfire.cache.execute.FunctionException - if something goes wrong while retrieving the resultInterruptedExceptionpublic void clearResults()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.