Class Sharded<R,​S extends ShardInfo<R>>

    • Field Detail

      • DEFAULT_KEY_TAG_PATTERN

        public static final Pattern DEFAULT_KEY_TAG_PATTERN
    • Constructor Detail

      • Sharded

        public Sharded​(List<S> shards)
      • Sharded

        public Sharded​(List<S> shards,
                       Hashing algo)
      • Sharded

        public Sharded​(List<S> shards,
                       Pattern tagPattern)
    • Method Detail

      • getShard

        public R getShard​(byte[] key)
      • getShard

        public R getShard​(String key)
      • getShardInfo

        public S getShardInfo​(byte[] key)
      • getShardInfo

        public S getShardInfo​(String key)
      • getKeyTag

        public String getKeyTag​(String key)
        A key tag is a special pattern inside a key that, if preset, is the only part of the key hashed in order to select the server for this key.
        Parameters:
        key -
        Returns:
        The tag if it exists, or the original key
        See Also:
        partitioning
      • getAllShardInfo

        public Collection<S> getAllShardInfo()