gridgain / gridgain-old

267 stars 85 forks source link

Have a Separate Affinity Compute Class | Better Modularisation and GG dependencies #34

Closed sirinath closed 10 years ago

sirinath commented 10 years ago

Please provide a way to use affinity without implementing the AffinityEvent interface.

Having to extend GG interfaces makes the other libs dependent on GG where such libraries can have more generic uses which are not dependent on GG. Also wrapping objects create other inheritance related headaches.

If there are other places where you have to unnecessarily have to extend GG classes or interfaces please provide alternatives so libraries can be modularized with minimum inter dependencies.

Having this for backward compatibility better way is to be able to register affinity checker for a stream. The you can do something like on the affinity register:

getAffinity(clazz).affinityKeyFor(obj)
dsetrakyan commented 10 years ago

Please use Stack Overflow for questions like this going forward.

I believe you are referring to AffinityEvent in GridStreamerAffinityEventRouter. This event exists to integrate cache affinity with streaming edition.

When using GridCacheAffinity class directly, you are not required to implement any interfaces to detect cache affinity for any key.

sirinath commented 10 years ago

Okay. I am looking at the streaming docs. The info given doesn't seem to show how this is done without implementing the interface.