3 Replies Latest reply on Feb 26, 2014 10:21 AM by vblagojevic

    Getting address of a Future (5.3)

    veselov

      Hi.

       

      Using InfiniSpan 5.3.

       

      I'm interested in being able to get an address of a future that has been submitted into an executor service.

      Wouldn't any task that's ever submitted into any execution service, have a target address where it's to be executed, even it's local?

      In this case, may be execution service methods can return TargetedFuture that extends Future, but also can return an address of where it's to be executed.

      This way the caller can now which of the nodes failed execution, when executing remotely.

       

      Otherwise, this is a bit tedios, as instead of, for example, submitEverwhere(), I have to iterate over all known nodes, and call submit(where,task)...

       

      Thank you.

        • 1. Re: Getting address of a Future (5.3)
          mircea.markus

          In this case, may be execution service methods can return TargetedFuture that extends Future, but also can return an address of where it's to be executed.

          This way the caller can now which of the nodes failed execution, when executing remotely.

          If controlling the failures is what you're after, you might want to take a look at the DistributedTaskFailoverPolicy (Infinispan Distribution 5.2.8.CR1 API)

          • 2. Re: Getting address of a Future (5.3)
            veselov

            Not really after controlling the failures.

            More like I need to ask all the nodes a question, and know which node's answering what (or not answering, which I called a "failure").

            I can submit to nodes individually, associating addresses with futures, and/or can ask the nodes to return their address in the response.

            I think it's reasonable all together to associate futures to the addresses where they have been executed.

            • 3. Re: Getting address of a Future (5.3)
              vblagojevic

              Hi Pawel,

               

              You make a good point. As a workaround you can add Address of the execution node to the result object you return from Callable. But you are right, I can see this is something other users might need as well. Let us consult about this, we'll keep you updated.

               

              Regards,

              Vladimir