Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1974

Add <T> Future<T> submit(Address target, Callable<T> task) at least to DefaultExecutorService

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 5.2.0.Final
    • 5.1.3.FINAL
    • Clustered Executor
    • None

      To easy execute tasks on specific nodes I'd like to have an additional method at DefaultExecutorService:

             public <T> Future<T> submit(Address target, Callable<T> task){
                  if (task == null) throw new NullPointerException();
                  if (target == null) throw new NullPointerException();
                  List<Address> members = rpc.getTransport().getMembers();
                  if(!members.contains(target)){
                      throw new IllegalArgumentException("Unknown node "+target.toString());
                  }
                  Address me = rpc.getAddress();
                  DistributedExecuteCommand<T> c = null;
                  if(target.equals(me)){
                      c = factory.buildDistributedExecuteCommand(clone(task), me, null);
                  } else {
                      c = factory.buildDistributedExecuteCommand(task, me, null);
                  }
                  DistributedRunnableFuture<T> f = new DistributedRunnableFuture<T>(c);
                  executeFuture(target, f);
                  return f;
              }
      

              vblagoje Vladimir Blagojevic (Inactive)
              tfromm_jira Thomas Fromm (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: