Class SentinelRedisNode

java.lang.Object
org.redisson.redisnode.SentinelRedisNode
All Implemented Interfaces:
RedisNode, RedisNodeAsync, RedisSentinel, RedisSentinelAsync

public class SentinelRedisNode extends Object implements RedisSentinel, RedisSentinelAsync
Author:
Nikita Koksharov
  • Constructor Details

  • Method Details

    • getClient

      public RedisClient getClient()
    • getAddr

      public InetSocketAddress getAddr()
      Description copied from interface: RedisNode
      Get Redis node address
      Specified by:
      getAddr in interface RedisNode
      Returns:
      node address
    • getMemoryStatistics

      public Map<String,String> getMemoryStatistics()
      Description copied from interface: RedisNode
      Returns Redis memory statistics
      Specified by:
      getMemoryStatistics in interface RedisNode
      Returns:
      statistics info map
    • getMemoryStatisticsAsync

      public RFuture<Map<String,String>> getMemoryStatisticsAsync()
      Description copied from interface: RedisNodeAsync
      Returns Redis memory statistics
      Specified by:
      getMemoryStatisticsAsync in interface RedisNodeAsync
      Returns:
      statistics info map
    • pingAsync

      public RFuture<Boolean> pingAsync()
      Description copied from interface: RedisNodeAsync
      Ping Redis node. Default timeout is 1000 milliseconds
      Specified by:
      pingAsync in interface RedisNodeAsync
      Returns:
      true if "PONG" reply received, false otherwise
    • pingAsync

      public RFuture<Boolean> pingAsync(long timeout, TimeUnit timeUnit)
      Description copied from interface: RedisNodeAsync
      Ping Redis node with specified timeout.
      Specified by:
      pingAsync in interface RedisNodeAsync
      Parameters:
      timeout - - ping timeout
      timeUnit - - timeout unit
      Returns:
      true if "PONG" reply received, false otherwise
    • ping

      public boolean ping()
      Description copied from interface: RedisNode
      Ping Redis node. Default timeout is 1000 milliseconds
      Specified by:
      ping in interface RedisNode
      Returns:
      true if "PONG" reply received, false otherwise
    • ping

      public boolean ping(long timeout, TimeUnit timeUnit)
      Description copied from interface: RedisNode
      Ping Redis node with specified timeout.
      Specified by:
      ping in interface RedisNode
      Parameters:
      timeout - - ping timeout
      timeUnit - - timeout unit
      Returns:
      true if "PONG" reply received, false otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • timeAsync

      public RFuture<Time> timeAsync()
      Description copied from interface: RedisNodeAsync
      Returns current Redis server time in seconds
      Specified by:
      timeAsync in interface RedisNodeAsync
      Returns:
      time in seconds
    • time

      public Time time()
      Description copied from interface: RedisNode
      Returns current Redis server time in seconds
      Specified by:
      time in interface RedisNode
      Returns:
      time in seconds
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • info

      public Map<String,String> info(RedisNode.InfoSection section)
      Description copied from interface: RedisNode
      Returns information about Redis node.
      Specified by:
      info in interface RedisNode
      Parameters:
      section - - section of information
      Returns:
      information
    • infoAsync

      public RFuture<Map<String,String>> infoAsync(RedisNode.InfoSection section)
      Description copied from interface: RedisNodeAsync
      Returns information about Redis node.
      Specified by:
      infoAsync in interface RedisNodeAsync
      Parameters:
      section - - section of information
      Returns:
      information map
    • getMasterAddr

      public RedisURI getMasterAddr(String masterName)
      Description copied from interface: RedisSentinel
      Returns network address of defined Redis master.
      Specified by:
      getMasterAddr in interface RedisSentinel
      Parameters:
      masterName - - name of master
      Returns:
      network address
    • getSentinels

      public List<Map<String,String>> getSentinels(String masterName)
      Description copied from interface: RedisSentinel
      Returns list of map containing info regarding Redis Sentinel server monitoring defined master.
      Specified by:
      getSentinels in interface RedisSentinel
      Parameters:
      masterName - - name of master
      Returns:
      list of Redis Sentinels
    • getMasters

      public List<Map<String,String>> getMasters()
      Description copied from interface: RedisSentinel
      Returns list of map containing info regarding Redis Master server monitored by current Redis Sentinel server.
      Specified by:
      getMasters in interface RedisSentinel
      Returns:
      list of Redis Masters
    • getSlaves

      public List<Map<String,String>> getSlaves(String masterName)
      Description copied from interface: RedisSentinel
      Returns list of map containing info regarding Redis Slave server of defined master.
      Specified by:
      getSlaves in interface RedisSentinel
      Parameters:
      masterName - - name of master
      Returns:
      list of Redis Slaves
    • getMaster

      public Map<String,String> getMaster(String masterName)
      Description copied from interface: RedisSentinel
      Returns map containing info regarding defined Redis master.
      Specified by:
      getMaster in interface RedisSentinel
      Parameters:
      masterName - - name of master
      Returns:
      map containing info
    • failover

      public void failover(String masterName)
      Description copied from interface: RedisSentinel
      Starts failover process for defined Redis master
      Specified by:
      failover in interface RedisSentinel
      Parameters:
      masterName - - name of master
    • getMasterAddrAsync

      public RFuture<RedisURI> getMasterAddrAsync(String masterName)
      Description copied from interface: RedisSentinelAsync
      Returns network address of defined Redis master.
      Specified by:
      getMasterAddrAsync in interface RedisSentinelAsync
      Parameters:
      masterName - - name of master
      Returns:
      network address
    • getSentinelsAsync

      public RFuture<List<Map<String,String>>> getSentinelsAsync(String masterName)
      Description copied from interface: RedisSentinelAsync
      Returns list of map containing info regarding Redis Sentinel server monitoring defined master.
      Specified by:
      getSentinelsAsync in interface RedisSentinelAsync
      Parameters:
      masterName - - name of master
      Returns:
      list of Redis Sentinels
    • getMastersAsync

      public RFuture<List<Map<String,String>>> getMastersAsync()
      Description copied from interface: RedisSentinelAsync
      Returns list of map containing info regarding Redis Master server monitored by current Redis Sentinel server.
      Specified by:
      getMastersAsync in interface RedisSentinelAsync
      Returns:
      list of Redis Masters
    • getSlavesAsync

      public RFuture<List<Map<String,String>>> getSlavesAsync(String masterName)
      Description copied from interface: RedisSentinelAsync
      Returns list of map containing info regarding Redis Slave server of defined master.
      Specified by:
      getSlavesAsync in interface RedisSentinelAsync
      Parameters:
      masterName - - name of master
      Returns:
      list of Redis Slaves
    • getMasterAsync

      public RFuture<Map<String,String>> getMasterAsync(String masterName)
      Description copied from interface: RedisSentinelAsync
      Returns map containing info regarding defined Redis master.
      Specified by:
      getMasterAsync in interface RedisSentinelAsync
      Parameters:
      masterName - - name of master
      Returns:
      map containing info
    • failoverAsync

      public RFuture<Void> failoverAsync(String masterName)
      Description copied from interface: RedisSentinelAsync
      Starts failover process for defined Redis master
      Specified by:
      failoverAsync in interface RedisSentinelAsync
      Parameters:
      masterName - - name of master
    • getConfig

      public Map<String,String> getConfig(String parameter)
      Description copied from interface: RedisNode
      Get value of Redis configuration parameter.
      Specified by:
      getConfig in interface RedisNode
      Parameters:
      parameter - - name of parameter
      Returns:
      value of parameter
    • setConfig

      public void setConfig(String parameter, String value)
      Description copied from interface: RedisNode
      Set value of Redis configuration parameter.
      Specified by:
      setConfig in interface RedisNode
      Parameters:
      parameter - - name of parameter
      value - - value of parameter
    • getConfigAsync

      public RFuture<Map<String,String>> getConfigAsync(String parameter)
      Description copied from interface: RedisNodeAsync
      Get value of Redis configuration parameter.
      Specified by:
      getConfigAsync in interface RedisNodeAsync
      Parameters:
      parameter - - name of parameter
      Returns:
      value of parameter
    • setConfigAsync

      public RFuture<Void> setConfigAsync(String parameter, String value)
      Description copied from interface: RedisNodeAsync
      Set value of Redis configuration parameter.
      Specified by:
      setConfigAsync in interface RedisNodeAsync
      Parameters:
      parameter - - name of parameter
      value - - value of parameter
      Returns:
      void
    • bgSave

      public void bgSave()
      Description copied from interface: RedisNode
      Runs the Redis database saving process in background.
      Specified by:
      bgSave in interface RedisNode
    • scheduleBgSave

      public void scheduleBgSave()
      Description copied from interface: RedisNode
      Save the Redis database in background. If AOF rewrite process is in progress then the background save is scheduled to run upon its completion.
      Specified by:
      scheduleBgSave in interface RedisNode
    • save

      public void save()
      Description copied from interface: RedisNode
      Save the Redis database.
      Specified by:
      save in interface RedisNode
    • getLastSaveTime

      public Instant getLastSaveTime()
      Description copied from interface: RedisNode
      Returns time of the last successful Redis database save operation.
      Specified by:
      getLastSaveTime in interface RedisNode
      Returns:
      time
    • bgSaveAsync

      public RFuture<Void> bgSaveAsync()
      Description copied from interface: RedisNodeAsync
      Runs the Redis database saving process in background.
      Specified by:
      bgSaveAsync in interface RedisNodeAsync
    • scheduleBgSaveAsync

      public RFuture<Void> scheduleBgSaveAsync()
      Description copied from interface: RedisNodeAsync
      Save the Redis database in background. If AOF rewrite process is in progress then the background save is scheduled to run upon its completion.
      Specified by:
      scheduleBgSaveAsync in interface RedisNodeAsync
    • saveAsync

      public RFuture<Void> saveAsync()
      Description copied from interface: RedisNodeAsync
      Save the Redis database.
      Specified by:
      saveAsync in interface RedisNodeAsync
    • getLastSaveTimeAsync

      public RFuture<Instant> getLastSaveTimeAsync()
      Description copied from interface: RedisNodeAsync
      Returns time of the last successful Redis database save operation.
      Specified by:
      getLastSaveTimeAsync in interface RedisNodeAsync
      Returns:
      time
    • bgRewriteAOF

      public void bgRewriteAOF()
      Description copied from interface: RedisNode
      Runs an Append Only File rewrite process. Starts only if there is no a background process doing persistence.

      If fails no data gets lost

      Specified by:
      bgRewriteAOF in interface RedisNode
    • bgRewriteAOFAsync

      public RFuture<Void> bgRewriteAOFAsync()
      Description copied from interface: RedisNodeAsync
      Runs an Append Only File rewrite process. Starts only if there is no a background process doing persistence.

      If fails no data gets lost

      Specified by:
      bgRewriteAOFAsync in interface RedisNodeAsync
    • size

      public long size()
      Description copied from interface: RedisNode
      Returns keys amount stored in this Redis node.
      Specified by:
      size in interface RedisNode
      Returns:
      keys amount
    • sizeAsync

      public RFuture<Long> sizeAsync()
      Description copied from interface: RedisNodeAsync
      Returns keys amount stored in this Redis node.
      Specified by:
      sizeAsync in interface RedisNodeAsync
      Returns:
      keys amount