Class GridCacheDefaultAffinityKeyMapper

    • Constructor Detail

      • GridCacheDefaultAffinityKeyMapper

        public GridCacheDefaultAffinityKeyMapper()
    • Method Detail

      • affinityKey

        public Object affinityKey​(Object key)
        If key class has annotation AffinityKeyMapped, then the value of annotated method or field will be used to get affinity value instead of the key itself. If there is no annotation, then the key is returned as is.
        Specified by:
        affinityKey in interface AffinityKeyMapper
        Parameters:
        key - Key to get affinity key for.
        Returns:
        Affinity key for given key.
      • affinityKeyPropertyName

        @Nullable
        public @Nullable String affinityKeyPropertyName​(Class<?> cls)
        Parameters:
        cls - Key class.
        Returns:
        Name of
      • reset

        public void reset()
        Resets cache affinity mapper to its initial state. This method will be called by the system any time the affinity mapper has been sent to remote node where it has to be reinitialized. If your implementation of affinity mapper has no initialization logic, leave this method empty.
        Specified by:
        reset in interface AffinityKeyMapper