2 Replies Latest reply on Dec 18, 2014 10:15 AM by Pedro Ruivo

    DistributedExecutorService

    infinispan user Newbie

      Hi all,

      Can any one provide help on,How to distribute task at specific time and ScheduleAtFixedRate(Just like TimerTasks) using DistributedExecutorService.

      Can any one provide some sample code regarding this.

      Regards,

      Ram

        • 1. Re: DistributedExecutorService
          infinispan user Newbie

          Hi  Forum Members,

           

          can any body help me

          1.How to handle timers/timertasks in distributed mode?

          DistributedExecutorService is not helpful,because of it is not having SchedulingAtFixedRate/Delay,,and we need to create seperate Thread for each timertask.Which is not acceptable...

           

          2.If we have cluster with 4nodes 2owners in distributed node..If one node is getting down/crashed...How can i know what are the keys owned by the failed node.

           

          3.If we have 2 owners for a cache entry..How to know who is Primary Owner(Original owner) and how to know who is secondary owner...

           

          Thank You!

          • 2. Re: DistributedExecutorService
            Pedro Ruivo Novice

            Hi,

            infinispan user wrote:

            1.How to handle timers/timertasks in distributed mode?

            DistributedExecutorService is not helpful,because of it is not having SchedulingAtFixedRate/Delay,,and we need to create seperate Thread for each timertask.Which is not acceptable...

            Timer task are not supported.

            infinispan user wrote:

             

            2.If we have cluster with 4nodes 2owners in distributed node..If one node is getting down/crashed...How can i know what are the keys owned by the failed node.

            The only way to find out the keys belonging to the node is to iterate over all keys and check in the DistributionManager if that particular node is an owner or not.

            infinispan user wrote:

            3.If we have 2 owners for a cache entry..How to know who is Primary Owner(Original owner) and how to know who is secondary owner...

            In AdvancedCache interface, you can get the DistributionManager. With the DistributionManager, you can query for the primary owner (getPrimaryOwner(Object key)) and the owners (locate(Object key)). Note that the locate returns all the owners (the primary owner and the backup owners).

             

            Cheers,

            Pedro