public interface Execution
Function
. A Context describes the environment in which the Execution
will
take place.
This interface is implemented by GemFire. To obtain an instance of it use FunctionService
.
FunctionService
,
Function
Modifier and Type | Method and Description |
---|---|
ResultCollector<?,?> |
execute(Function function)
Executes the function instance provided.
|
ResultCollector<?,?> |
execute(String functionId)
Executes the function using its id
Function.execute(FunctionContext) is called on the instance
retrieved using FunctionService.getFunction(String) on the
executing member. |
ResultCollector<?,?> |
execute(String functionId,
boolean hasResult)
Deprecated.
as of 6.6, use
execute(String) instead |
ResultCollector<?,?> |
execute(String functionId,
boolean hasResult,
boolean isHA)
Deprecated.
as of 6.6, use
execute(String) instead |
ResultCollector<?,?> |
execute(String functionId,
boolean hasResult,
boolean isHA,
boolean optimizeForWrite)
Deprecated.
as of 6.6, use
execute(String) instead |
Execution |
withArgs(Object args)
Specifies the user data passed to the function when it is executed.
|
Execution |
withCollector(ResultCollector<?,?> rc)
Specifies the
ResultCollector that will receive the results after
the function has been executed. |
Execution |
withFilter(Set<?> filter)
Specifies a data filter of routing objects for selecting the GemFire
members to execute the function on.
|
Execution withFilter(Set<?> filter)
Applicable only for regions with DataPolicy.PARTITION
DataPolicy.
If the filter is null, it will execute on all data of the region.
filter
- Set defining the data filter to be used for executing the functionIllegalArgumentException
- if filter passed is null.UnsupportedOperationException
- if not called after
FunctionService.onRegion(com.gemstone.gemfire.cache.Region)
Execution withArgs(Object args)
FunctionContext.getArguments()
args
- user data passed to the function executionIllegalArgumentException
- if the input parameter is nullExecution withCollector(ResultCollector<?,?> rc)
ResultCollector
that will receive the results after
the function has been executed. Collector will receive results as they are sent
from the Function.execute(FunctionContext)
using ResultSender
.IllegalArgumentException
- if ResultCollector
is nullResultCollector
ResultCollector<?,?> execute(String functionId) throws FunctionException
Function.execute(FunctionContext)
is called on the instance
retrieved using FunctionService.getFunction(String)
on the
executing member.
functionId
- the Function.getId()
of the functionwithCollector(ResultCollector)
. User has to use
this reference to retrieve results.LowMemoryException
- if the Function.optimizeForWrite()
returns true and there
is a low memory conditionFunctionException
ResultCollector<?,?> execute(Function function) throws FunctionException
Function.execute(FunctionContext)
is called on the de-serialized
instance on the executing member.
function
- instance to executewithCollector(ResultCollector)
. User has to use
this reference to retrieve results.LowMemoryException
- if the Function.optimizeForWrite()
returns true and there
is a low memory conditionFunctionException
@Deprecated ResultCollector<?,?> execute(String functionId, boolean hasResult) throws FunctionException
execute(String)
instead
Function.execute(FunctionContext)
is called on the de-serialized
instance on the executing member. Function should be registered on the
executing member using FunctionService.registerFunction(Function)
method before calling this method.
As of 6.6, this is deprecated, since users can pass different value for
the hasResult parameter that than the boolean value returned from Function.hasResult()
.
functionId
- the Function.getId()
of the functionhasResult
- Whether the function returns any resultwithCollector(ResultCollector)
. User has to use
this reference to retrieve results.LowMemoryException
- if the Function.optimizeForWrite()
returns true and there
is a low memory conditionFunctionException
@Deprecated ResultCollector<?,?> execute(String functionId, boolean hasResult, boolean isHA) throws FunctionException
execute(String)
instead
Function.execute(FunctionContext)
is called on the de-serialized
instance on the executing member.Function should be registered on the
executing member using FunctionService.registerFunction(Function)
method before calling this method.
As of 6.6, this is deprecated, since users can pass different value for the
hasResult, isHA parameter that than the boolean values returned from
Function.hasResult()
, Function.isHA()
.
functionId
- the Function.getId()
of the functionhasResult
- Whether the function returns any resultisHA
- Whether the given function is HAwithCollector(ResultCollector)
. User has to use
this reference to retrieve results.LowMemoryException
- if the Function.optimizeForWrite()
returns true and there
is a low memory conditionFunctionException
@Deprecated ResultCollector<?,?> execute(String functionId, boolean hasResult, boolean isHA, boolean optimizeForWrite) throws FunctionException
execute(String)
instead
Function.execute(FunctionContext)
is called on the de-serialized
instance on the executing member.Function should be registered on the
executing member using FunctionService.registerFunction(Function)
method before calling this method.
As of 6.6, this is deprecated, since users can pass different value for the
hasResult, isHA, optimizeForWrite parameters that than the boolean values returned from
Function.hasResult()
, Function.isHA()
, Function.optimizeForWrite()
.
functionId
- the Function.getId()
of the functionhasResult
- Whether the function returns any resultisHA
- Whether the given function is HAoptimizeForWrite
- Whether the function should be optmized for write operationswithCollector(ResultCollector)
. User has to use
this reference to retrieve results.LowMemoryException
- if the Function.optimizeForWrite()
returns true and there
is a low memory conditionFunctionException
Copyright © 1997-2017 Pivotal Software, Inc. All rights reserved.