THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
This makes it impossible to write pure unit tests for the function code that mock the cache.
See
Jira | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Functions invoked with onRegion always have to cast the FunctionContext to RegionFunctionContext
...
Code Block |
---|
public void execute(FunctionContext context) { RegionFunctionContext ctx = (RegionFunctionContext) context; |
See
Jira | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Getting the local data set of a function is not intuitive, uses static functions that expect concrete objects
...
We can also get rid of FunctionAdapter in favor of using default methods on Function.
See
Jira | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Suggested API changes
Instead of a single Function interface, there should be multiple interfaces for different types of functions. TODO - Do we really need VoidFunction (equivalent to hasResult() == false)The function interface should return a value. For functions that don't return a value, they can return null.
Code Block |
---|
interface RegionFunction<T> { public T execute(RegionFunctionContext context) } interface Function<T> { public T execute(FunctionContext context) } |
...