Unfortunately the requirement that was desired was specifically for methods such as
entrySet which wouldn't work with statistics, but I understand your point. I for one
didn't realize the operations were local only until I looked at them recently.
Although one thing this makes me wonder about is shared cache loaders. In this case each
node would pull every passivated entry from the cache store where as a non shared would
only pull the nodes that are local to the given node - I wonder if that is a concern or
not.
Also looking closer at separating out the interfaces I didn't realize how much
FlagAffectedCommand was referenced and the scope of the change is a lot larger than I
would have hoped changing many other interfaces. This worries me as I am not familiar
with which interfaces are called by external code and could cause compile time errors for
some references or extending classes. I will have to see what I can work up though if it
is acceptable or not.
- Will
----- Original Message -----
From: "Sanne Grinovero" <sanne(a)infinispan.org>
To: "infinispan -Dev List" <infinispan-dev(a)lists.jboss.org>
Sent: Friday, May 31, 2013 10:11:57 AM
Subject: Re: [infinispan-dev] FlagAffectedCommand interface hierarchy (ISPN-761)
On 31 May 2013 14:37, William Burns <wburns(a)redhat.com> wrote:
While adding changes for cache methods (entrySet, keySet, values,
size) to include passivated entries it had been pointed out to conditionally do these
operations if flags such as SKIP_CACHE_STORE and SKIP_CACHE_LOAD were provided. Also does
anyone have any feedback on if both flags should apply or just say SKIP_CACHE_STORE?
Right, that could definitely be improved. I would expect both to be
needed as one mentions "store", the other "load", but in practice it
seems that SKIP_CACHE_STORE skips both operations. I think this should
at least be clarified in the javadocs.
Currently SizeCommand, EntrySetCommand, ValuesCommand and
KeySetCommand do not inherit from FlagAffectedCommand which are used for commands that
behavior is dependent upon flags.
You just listed the most evil operations you can use in Infinispan.
All of these are inherently broken as we need to constantly clarify to
users that they only apply to the local datastore, which makes it even
trickier to test something on a single node and then expect it to work
on multiple nodes as well..
I know, we have warnings on javadoc but since it implements
ConcurrentMap and Map, these warnings are easily overseen.
So my doubt actually is, since these operations are fundamentally
unreliable, why should they include CacheStore s as well? IMHO they
should all throw a runtime exception to flag they are not supported.
I guess we don't throw such exceptions as they could be useful for
some metrics, but still I think it would be more appropriate to move
this responsibility to a statistics/monitoring API.
Sanne
The problem is that FlagAffectedCommand currently extends
VisitableCommand, TopologyAffectedCommand, MetadataAwareCommand interfaces. These
interfaces do not really apply to the commands I am working on as they are local only. I
was planning on removing the extended interfaces from the FlagAffectedCommand interface
and update all the commands that implement this interface currently to make sure they
still properly implement the additional interfaces. Searching for instanceof
FlagAffectedCommand it also appears that all current references should be alright after
refactoring. Once these interfaces are decoupled I can add the FlagAffectedCommand
interface to the SizeCommand, EntrySetCommand, ValuesCommand and KeySetCommand and
subsequently to the CommandFactory and my changes should be good.
Any opinions or concerns?
Thanks,
- Will
_______________________________________________
infinispan-dev mailing list
infinispan-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
_______________________________________________
infinispan-dev mailing list
infinispan-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev