public abstract class FunctionAdapter extends Object implements Function
Function
interface.
This implementation provides the following defaults
Function.hasResult()
returns trueFunction.optimizeForWrite()
returns falseFunction.isHA()
returns trueFunction
,
Serialized FormConstructor and Description |
---|
FunctionAdapter() |
Modifier and Type | Method and Description |
---|---|
abstract void |
execute(FunctionContext context)
The method which contains the logic to be executed.
|
abstract String |
getId()
Return a unique function identifier, used to register the function with
FunctionService |
boolean |
hasResult()
Specifies whether the function sends results while executing.
|
boolean |
isHA()
Specifies whether the function is eligible for re-execution (in case of
failure).
|
boolean |
optimizeForWrite()
Return true to indicate to GemFire the method requires optimization for
writing the targeted
FunctionService.onRegion(com.gemstone.gemfire.cache.Region) and any
associated routing objects
. |
public abstract void execute(FunctionContext context)
Execution
. The context provided to this function is the one
which was built using Execution. The contexts can be data
dependent or data-independent so user should check to see if the context
provided in parameter is instance of RegionFunctionContext
.public abstract String getId()
FunctionService
getId
in interface Function
getId
in interface Identifiable
public boolean hasResult()
If Function.hasResult()
returns false,
ResultCollector.getResult()
throws FunctionException
.
If Function.hasResult()
returns true,
ResultCollector.getResult()
blocks and waits for the result of
function execution
public boolean optimizeForWrite()
Return true to indicate to GemFire the method requires optimization for
writing the targeted
FunctionService.onRegion(com.gemstone.gemfire.cache.Region)
and any
associated routing objects
.
Returning false will optimize for read behavior on the targeted
FunctionService.onRegion(com.gemstone.gemfire.cache.Region)
and any
associated routing objects
.
This method is only consulted when invoked as a data dependent function
optimizeForWrite
in interface Function
FunctionService
public boolean isHA()
isHA
in interface Function
FunctionContext.isPossibleDuplicate()
Copyright © 1997-2017 Pivotal Software, Inc. All rights reserved.