-
Task
-
Resolution: Done
-
Major
-
4.0.0.Final
-
None
-
Medium
InvalidateL1Command currently is broadcast cluster-wide (multicast) for the sake of efficiency. This means that even other owners will receive this command. The command's perform() method will prevent such owners from evicting the keys though, so this does not affect correctness.
However it does affect performance since the command is still passed up the interceptor stack and, crucially, locks are acquired for the keys in question.
A better solution would be for ReplicableCommand to expose a boolean shouldInvoke() method. By default this always returns true, but in the case of the InvalidateL1Command, the ownership of keys is checked here. The InboundInvocationHandler can then choose whether to invoke the command or not.