[infinispan-dev] Infinispan DEF - Custom parameters upon a failover

Strahinja Lazetic lazetics at yahoo.com
Tue May 28 05:56:39 EDT 2013


Hi Galder,

thank you for your response. I can serialize the parameters that I passed in the constructor upon first start, but they remain the same upon a failover and recreation of the Callable, so I can not get any new info based on the failover. As I mentioned in my example (though maybe not very smart), how can I say to my Callable that it does not start for the first time but rather it was restarted. Or any other data that depends on the specific conditions of the failover (e.g. Callable needs to know a new ip or port that was determined in the FailoverPolicy based on the available targets...).

Thanks,
Strahinja Lazetic



________________________________
 From: Galder Zamarreño <galder at redhat.com>
To: Strahinja Lazetic <lazetics at yahoo.com>; infinispan -Dev List <infinispan-dev at lists.jboss.org> 
Sent: Tuesday, May 28, 2013 10:58 AM
Subject: Re: [infinispan-dev] Infinispan DEF - Custom parameters upon a failover
 

Hi Strahinja,

Glad to hear that you're using Infinispan in your master thesis :)

I have some reservations about adding these methods.

You can create a custom distributed callable, so why not pass in this info on construction of the callable, and make sure it's serialized so these parameters are available when these classes are sent to other nodes?

Cheers,

On May 27, 2013, at 6:51 PM, Strahinja Lazetic <lazetics at yahoo.com> wrote:

> Hi, 
> 
> I am currently using Infinispan Distributed Execution Framework for my Master thesis project and I am wondering if it is possible that a DistributedCallable receives some custom parameters from the framework upon a failover, besides Cache instance and Set of keys passed in the setEnvironment method. As a simplified example, a DistributedCallable wants to know whether it was restarted or freshly started. If this is not possible, does it make sense to add a new method to the DistributedTaskFailoverPolicy which will return a user supplied parameters Map and then read it from the setEnvironment method in the DistributedCallable? Here are the signatures of the methods I was thinking off:
> 
> In the DistributedTaskFailoverPolicy class:
> 
> Map<Object, Object> getEnvironmentParameters()
> 
> In the DistributedCallable class:
> 
> setEnvironment(Cache<K, V> cache, Set<K> inputKeys, Map<Object, Object> params)
> 
> I was free to try to implement this and did not take to much time, so now I am wondering if there was already a way to do something like this in the Infinispan DEF.
> 
> Thank you in advance for your comments and suggestions.
> Strahinja Lazetic
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


--
Galder Zamarreño
galder at redhat.com
twitter.com/galderz

Project Lead, Escalante
http://escalante.io

Engineer, Infinispan
http://infinispan.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20130528/5a899eb8/attachment-0001.html 


More information about the infinispan-dev mailing list