org.apache.storm.redis.common.container

## Class RedisClusterContainer

- java.lang.Object
- - org.apache.storm.redis.common.container.RedisClusterContainer

- All Implemented Interfaces:
    Closeable, AutoCloseable, RedisCommandsInstanceContainer

      public class RedisClusterContainer
      extends Object
      implements RedisCommandsInstanceContainer

  Container for managing JedisCluster.

  Note that JedisCluster doesn’t need to be pooled since it’s thread-safe and it stores pools internally.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RedisClusterContainer(redis.clients.jedis.JedisCluster jedisCluster)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `RedisCommands` | `getInstance()` Borrows instance from container.
    `void` | `returnInstance(RedisCommands redisCommands)` Returns instance to container.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RedisClusterContainer

          public RedisClusterContainer(redis.clients.jedis.JedisCluster jedisCluster)

      Constructor.

      Parameters:
        `jedisCluster` - JedisCluster instance

  - ### Method Detail

    - #### getInstance

          public RedisCommands getInstance()

      Borrows instance from container.

      Specified by:
        `getInstance` in interface `RedisCommandsInstanceContainer`
      Returns:
        instance which implements RedisCommands

    - #### returnInstance

          public void returnInstance(RedisCommands redisCommands)

      Returns instance to container.

      Specified by:
        `returnInstance` in interface `RedisCommandsInstanceContainer`
      Parameters:
        `redisCommands` - borrowed instance

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2021 The Apache Software Foundation. All rights reserved.