Add another dependency?
by Pedro Ruivo
Hi all,
In Extended Statistic Pull Request [1] I'm using a library called Stream
Lib [2] for probabilistic + space-efficient top-key (i.e. for each key,
it keeps the number of accesses). It allows us to set a bound for the
number of key to keep track (memory constrains) with the cost of some
errors in counters. The key more frequently accessed have a more
accurate counter than the less frequently accessed.
It is not too difficult to implement it, so the question here is: Can I
add this dependency or it is better to implement it myself?
Regards,
Pedro
[1] https://github.com/infinispan/infinispan/pull/1938
[2] https://github.com/clearspring/stream-lib
10 years, 10 months
RELAY2 using shorts as site-ids
by Bela Ban
This is re [1].
I want to replace shorts as site-ids with strings. This would make EAP
and JDG configuration simpler, as both configure the mapping from site
string (e.g. "sfo") to ID (e.g. 1) on the fly. If we have sites sfo, lon
and nyc in 1 config, we might end up with sfo=0, lon=1 and nyc=2. If we
only configure lon and nyc in a differemt config, we have lon=0, nyc=1.
This means that the second site interprets 0 as lon, although it was
effectively sent by sfo.
However, this will make RELAY2 incompatible with previous releases as
SiteUUID is now different. The change would be in 3.4 (not 3.3.x), and
as it will be used by Infinispan 6.0, I don't think this should be an
issue...
Thoughts ?
[1] https://issues.jboss.org/browse/JGRP-1640
--
Bela Ban, JGroups lead (http://www.jgroups.org)
10 years, 10 months
Fw: Infinispan DEF - Custom parameters upon a failover
by Strahinja Lazetic
Hi,
Sorry for a bit late response, I was very busy with some other stuff. I have some doubts and comments on your suggestions:
>Well, but you wanted to have a setEnvironment that takes extra params,
so I guess you'll be calling at >some point, so can't you just cast the
callable to your own and call whatever setters you want? I'm >very weary
of adding random parameter to setEnvironment for "random" stuff :)
I am not sure where should I cast my Callable and call the setter from, upon a failover. I mean, can use some of the existing DEF interfaces for it or do it deeper in the code?
>Maybe your distributed callable could have a reference to your own failover policy and query it?
In a case that my Callable is running on a remote node, to achieve this I guess I would have to make the failover policy Serializable and hold a remote reference to it, right? And from the design point of view I am not sure whether it is good that the Callable is aware of its failover policy.
I would appreciate any comment on this.
Best regards,
Strahinja Lazetic
________________________________
From: Galder Zamarreño <galder(a)redhat.com>
To: Strahinja Lazetic <lazetics(a)yahoo.com>
Cc: infinispan -Dev List <infinispan-dev(a)lists.jboss.org>
Sent: Wednesday, May 29, 2013 9:59 AM
Subject: Re: [infinispan-dev] Infinispan DEF - Custom parameters upon a failover
On May 28, 2013, at 11:56 AM, Strahinja Lazetic <lazetics(a)yahoo.com> wrote:
> 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.
Well, but you wanted to have a setEnvironment that takes extra params, so I guess you'll be
calling at some point, so can't you just cast the callable to your own and call whatever setters you want? I'm very weary of adding random parameter to setEnvironment for "random" stuff :)
> 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...).
^ Maybe your distributed callable could have a reference to your own failover policy and query it?
>
> Thanks,
> Strahinja Lazetic
>
>
> From: Galder Zamarreño <galder(a)redhat.com>
> To: Strahinja Lazetic <lazetics(a)yahoo.com>; infinispan -Dev List <infinispan-dev(a)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(a)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(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
>
> --
> Galder Zamarreño
> galder(a)redhat.com
> twitter.com/galderz
>
> Project Lead, Escalante
> http://escalante.io
>
> Engineer, Infinispan
> http://infinispan.org
>
>
--
Galder Zamarreño
galder(a)redhat.com
twitter.com/galderz
Project Lead, Escalante
http://escalante.io
Engineer, Infinispan
http://infinispan.org
10 years, 10 months