Class ShardStrategy<T extends Endpoint>


public class ShardStrategy<T extends Endpoint> extends XorShiftRandomStrategy<T>
Sharding invocation strategy. Using consistent-hashing.
More info: https://www.toptal.com/big-data/consistent-hashing
See Also:
  • Field Details

    • shardKey

      protected final String shardKey
      Shard key's path (eg. "userID", "user.email", etc.)
    • vnodes

      protected final int vnodes
      Number of virtual nodes
    • ringSize

      protected final Integer ringSize
      Ring size (optional)
    • useMeta

      protected final boolean useMeta
      Size of the memory cache (0 = disabled)
    • cacheSize

      protected final int cacheSize
      Size of the memory cache (0 = disabled)
    • ringRef

      protected final AtomicReference<ShardStrategy.Ring> ringRef
      The "hash ring" (https://www.toptal.com/big-data/consistent-hashing)
    • hash

      protected final Function<String,Long> hash
      Hasher function (generated hash is 32 bits long, default method is MD5)
  • Constructor Details

  • Method Details