Class JdkKeyStore<K extends Comparable<K>>

  • Type Parameters:
    K - the type of the keys tracked
    All Implemented Interfaces:
    KeyStore<K>

    public class JdkKeyStore<K extends Comparable<K>>
    extends Object
    implements KeyStore<K>
    A repository for the entity keys tracked by each shard.
    • Constructor Detail

      • JdkKeyStore

        public JdkKeyStore()
    • Method Detail

      • add

        public void add​(int shardId,
                        K key)
        Description copied from interface: KeyStore
        Add the given key under a shard index.
        Specified by:
        add in interface KeyStore<K extends Comparable<K>>
        Parameters:
        shardId - the shard index a key will be associated under
        key - the actual key to store
      • remove

        public void remove​(int shardId,
                           K key)
        Description copied from interface: KeyStore
        Remove the given key from a shard index.
        Specified by:
        remove in interface KeyStore<K extends Comparable<K>>
        Parameters:
        shardId - the shard index a key will be removed from
        key - the actual key to remove
      • clear

        public void clear​(int shardId)
        Description copied from interface: KeyStore
        Removes all keys stored under a given shard index.
        Specified by:
        clear in interface KeyStore<K extends Comparable<K>>
        Parameters:
        shardId - the shard index to remove all keys from
      • keys

        public Set<K> keys​(int shardId)
        Description copied from interface: KeyStore
        Return an unmodifiable Set of keys for the given shard index.
        Specified by:
        keys in interface KeyStore<K extends Comparable<K>>
        Parameters:
        shardId - the shard index to obtain its keys from
        Returns:
        a Set with keys