Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyGEODE-728

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyGEODE-2217
 

 

RegionFunctionContext should provide the local data set

...

Code Block
interface RegionFunction<T> {
  public T execute(RegionFunctionContext context)
}

interface MemberFunction<T> {
  public T execute(FunctionContext context)
}

Combining these changes with

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyGEODE-2217
 would result in interfaces with two generic types, one for the function argument type and another for the function return type.

Code Block
interface RegionFunction<S, T> {
  public T execute(RegionFunctionContext<S> context)
}

interface MemberFunction<S, T> {
  public T execute(FunctionContext<S> context)
}

interface FunctionContext<S> {
  public S getArguments();
}



See

Jira
showSummaryfalse
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyGEODE-729

Add Cache.getFunctionService and deprecate the static methods on FunctionService

...

New interfaces

Code Block
interface RegionFunction<S, RegionFunction<T>T> {
  public T execute(RegionFunctionContextRegionFunctionContext<S> context)
}

interface MemberFunction<S, MemberFunction<T>T> {
  public T execute(FunctionContextFunctionContext<S> context)
}

interface RegionExecution<S, RegionExecution<TT,S> U> extends Execution {
  public ResultCollector<T, S>U> execute(RegionFunction<T>RegionFunction<S,T> function);
}

interface MemberExecution<S, MemberExecution<TT,S> U> extends Execution {
  public ResultCollector<T, S>U> execute(MemberFunction<T>MemberFunction<S,T> function);
}

 

New Methods

Code Block
FunctionService Cache.getFunctionService()

Region RegionFunctionContext.getLocalDataSet();

Execution.isHA(boolean value)
Execution.optimizeForWrite(boolean value)
Execution.hasResult(boolean value)

//New instance methods, rather than static
FunctionService {
  public RegionExecution onRegion(Region region);
  public MemberExecution onServer(RegionService regionService);
  public MemberExecution onServers(RegionService regionService);
  public MemberExecution onMember(DistributedMember distributedMember);
  public MemberExecution onMembers(Set<DistributedMember> distributedMembers);
  public MemberExecution onMember(String... groups);
  public void registerFunction(Function function);
  public void unregisterFunction(String functionId);
  public boolean isRegistered(String functionId);
}

...