Package io.vertx.reactivex.redis.client

## Class RedisCluster

- java.lang.Object
- - io.vertx.reactivex.redis.client.RedisCluster

-     public class RedisCluster
      extends Object

  Utilities for Redis cluster. Calling `create()` with an instance of `Redis` or `RedisConnection` that are not Redis cluster client/connection leads to an exception.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static io.vertx.lang.rx.TypeArg<RedisCluster>` | `__TYPE_ARG` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `RedisCluster​(RedisCluster delegate)` |
    `RedisCluster​(Object delegate)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static RedisCluster` | `create​(Redis client)` |
    `static RedisCluster` | `create​(RedisConnection connection)` |
    `boolean` | `equals​(Object o)` |
    `RedisCluster` | `getDelegate()` |
    `Future<RequestGrouping>` | `groupByNodes​(List<Request> requests)` | Groups the `requests` into a `RequestGrouping`, which contains: keyed requests: requests that include a key and it is therefore possible to determine to which master node they should be sent; all requests in each inner list in the `keyed` collection are guaranteed to be sent to the same master node; unkeyed requests: requests that do not include a key and it is therefore not possible to determine to which master node they should be sent. If any of the `requests` includes multiple keys that belong to different master nodes, the resulting future will fail.
    `int` | `hashCode()` |
    `static RedisCluster` | `newInstance​(RedisCluster arg)` |
    `Future<List<Response>>` | `onAllMasterNodes​(Request request)` | Runs the `request` against all master nodes in the cluster.
    `Future<List<Response>>` | `onAllNodes​(Request request)` | Runs the `request` against all nodes in the cluster.
    `Single<RequestGrouping>` | `rxGroupByNodes​(List<Request> requests)` | Groups the `requests` into a `RequestGrouping`, which contains: keyed requests: requests that include a key and it is therefore possible to determine to which master node they should be sent; all requests in each inner list in the `keyed` collection are guaranteed to be sent to the same master node; unkeyed requests: requests that do not include a key and it is therefore not possible to determine to which master node they should be sent. If any of the `requests` includes multiple keys that belong to different master nodes, the resulting future will fail.
    `Single<List<Response>>` | `rxOnAllMasterNodes​(Request request)` | Runs the `request` against all master nodes in the cluster.
    `Single<List<Response>>` | `rxOnAllNodes​(Request request)` | Runs the `request` against all nodes in the cluster.
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<RedisCluster> __TYPE_ARG

  - ### Constructor Detail

    - #### RedisCluster

          public RedisCluster​(RedisCluster delegate)

    - #### RedisCluster

          public RedisCluster​(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public RedisCluster getDelegate()

    - #### create

          public static RedisCluster create​(Redis client)

    - #### create

          public static RedisCluster create​(RedisConnection connection)

    - #### onAllNodes

          public Future<List<Response>> onAllNodes​(Request request)

      Runs the `request` against all nodes in the cluster. Returns a future that completes with a list of responses, one from each node, or failure when one of the operations fails. Note that in case of a failure, there are no guarantees that the request was or wasn't executed successfully on other Redis cluster nodes. No result order is guaranteed either.
      Parameters:
        `request` - the request, must not be `null`
      Returns:
        the future result, never `null`

    - #### rxOnAllNodes

          public Single<List<Response>> rxOnAllNodes​(Request request)

      Runs the `request` against all nodes in the cluster. Returns a future that completes with a list of responses, one from each node, or failure when one of the operations fails. Note that in case of a failure, there are no guarantees that the request was or wasn't executed successfully on other Redis cluster nodes. No result order is guaranteed either.
      Parameters:
        `request` - the request, must not be `null`
      Returns:
        the future result, never `null`

    - #### onAllMasterNodes

          public Future<List<Response>> onAllMasterNodes​(Request request)

      Runs the `request` against all master nodes in the cluster. Returns a future that completes with a list of responses, one from each master node, or failure when one of the operations fails. Note that in case of a failure, there are no guarantees that the request was or wasn't executed successfully on other Redis cluster master nodes. No result order is guaranteed either.
      Parameters:
        `request` - the request, must not be `null`
      Returns:
        the future result, never `null`

    - #### rxOnAllMasterNodes

          public Single<List<Response>> rxOnAllMasterNodes​(Request request)

      Runs the `request` against all master nodes in the cluster. Returns a future that completes with a list of responses, one from each master node, or failure when one of the operations fails. Note that in case of a failure, there are no guarantees that the request was or wasn't executed successfully on other Redis cluster master nodes. No result order is guaranteed either.
      Parameters:
        `request` - the request, must not be `null`
      Returns:
        the future result, never `null`

    - #### groupByNodes

          public Future<RequestGrouping> groupByNodes​(List<Request> requests)

      Groups the `requests` into a `RequestGrouping`, which contains:
      - keyed requests: requests that include a key and it is therefore possible to determine to which master node they should be sent; all requests in each inner list in the `keyed` collection are guaranteed to be sent to the same master node;
      - unkeyed requests: requests that do not include a key and it is therefore not possible to determine to which master node they should be sent.
      If any of the `requests` includes multiple keys that belong to different master nodes, the resulting future will fail.

      If the cluster client was created with or and the commands are executed individually (using , not ), it is possible that the commands will be spread across different replicas of the same master node.

      Note that this method is only reliable in case the Redis cluster is in a stable state. In case of resharding, failover or in general any change of cluster topology, there are no guarantees on the validity of the result.

      Parameters:
        `requests` - the requests, must not be `null`
      Returns:
        the requests grouped by the cluster node assignment

    - #### rxGroupByNodes

          public Single<RequestGrouping> rxGroupByNodes​(List<Request> requests)

      Groups the `requests` into a `RequestGrouping`, which contains:
      - keyed requests: requests that include a key and it is therefore possible to determine to which master node they should be sent; all requests in each inner list in the `keyed` collection are guaranteed to be sent to the same master node;
      - unkeyed requests: requests that do not include a key and it is therefore not possible to determine to which master node they should be sent.
      If any of the `requests` includes multiple keys that belong to different master nodes, the resulting future will fail.

      If the cluster client was created with or and the commands are executed individually (using , not ), it is possible that the commands will be spread across different replicas of the same master node.

      Note that this method is only reliable in case the Redis cluster is in a stable state. In case of resharding, failover or in general any change of cluster topology, there are no guarantees on the validity of the result.

      Parameters:
        `requests` - the requests, must not be `null`
      Returns:
        the requests grouped by the cluster node assignment

    - #### newInstance

          public static RedisCluster newInstance​(RedisCluster arg)