org.apache.ignite.client

## Interface ClientPartitionAwarenessMapperFactory

-     public interface ClientPartitionAwarenessMapperFactory

  This factory is used on the client side and only when the partition awareness thin client feature is enabled. By default, on a new cache the RendezvousAffinityFunction will be used for calculating mappings 'key-to-partition' and 'partition-to-node'. The thin client will update all 'partitions-to-node' mappings on every cluster topology change and the 'key-to-partition' mapping will be calculated on the client side.

  The case described above will not be possible (and in turn partition awareness won't work) when a custom `AffinityFunction` or a `AffinityKeyMapper` was previously used for a cache creation. The partition awareness mapper factory is used to solve this issue. All 'partition-to-node' mappings will still be requested and received from a server node, however, if a custom AffinityFunction or a custom AffinityKeyMapper was used a ClientPartitionAwarenessMapper produced by this factory will calculate mapping a key to a partition.

  These key to partition mapping functions produced by the factory are used only for local calculations, they will not be passed to a server node.

  Since:
    2.14
  See Also:
    `AffinityFunction`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClientPartitionAwarenessMapper` | `create(String cacheName, int partitions)`

- - ### Method Detail

    - #### create

          ClientPartitionAwarenessMapper create(String cacheName,
                                                int partitions)

      Parameters:
        `cacheName` - Cache name to create a mapper for.
        `partitions` - Number of cache partitions received from a server node.
      Returns:
        Key to a partition mapper function.

${current.year} Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023