Module lettuce.core

Interface NodeSelectionSupport<API,​CMD>

Type Parameters:
API - API type.
CMD - Command command interface type to invoke multi-node operations.
All Known Subinterfaces:
AsyncNodeSelection<K,​V>, NodeSelection<K,​V>, PubSubAsyncNodeSelection<K,​V>, PubSubNodeSelection<K,​V>, PubSubReactiveNodeSelection<K,​V>

public interface NodeSelectionSupport<API,​CMD>
A node selection represents a set of Redis Cluster nodes. Provides access to particular node connection APIs and allows the execution of commands on the selected cluster nodes.
Since:
4.0
Author:
Mark Paluch
  • Method Details

    • size

      int size()
      Returns:
      number of nodes.
    • commands

      CMD commands()
      Returns:
      commands API to run on this node selection.
    • commands

      API commands​(int index)
      Obtain the connection/commands to a particular node.
      Parameters:
      index - index of the node
      Returns:
      the connection/commands object
    • node

      RedisClusterNode node​(int index)
      Parameters:
      index - index of the cluster node
      Returns:
      the cluster node
    • asMap

      Map<RedisClusterNode,​API> asMap()
      Returns:
      map of RedisClusterNode and the connection/commands objects