Interface RedisNode

All Known Subinterfaces:
RedisClusterMaster, RedisClusterNode, RedisClusterSlave, RedisMaster, RedisSentinel, RedisSlave
All Known Implementing Classes:
RedisNode, SentinelRedisNode

public interface RedisNode
Base Redis node API interface
Author:
Nikita Koksharov
  • Method Details

    • getMemoryStatistics

      Map<String,String> getMemoryStatistics()
      Returns Redis memory statistics
      Returns:
      statistics info map
    • time

      Time time()
      Returns current Redis server time in seconds
      Returns:
      time in seconds
    • getAddr

      Get Redis node address
      Returns:
      node address
    • ping

      boolean ping()
      Ping Redis node. Default timeout is 1000 milliseconds
      Returns:
      true if "PONG" reply received, false otherwise
    • ping

      boolean ping(long timeout, TimeUnit timeUnit)
      Ping Redis node with specified timeout.
      Parameters:
      timeout - - ping timeout
      timeUnit - - timeout unit
      Returns:
      true if "PONG" reply received, false otherwise
    • info

      Returns information about Redis node.
      Parameters:
      section - - section of information
      Returns:
      information
    • getConfig

      Map<String,String> getConfig(String parameter)
      Get value of Redis configuration parameter.
      Parameters:
      parameter - - name of parameter
      Returns:
      value of parameter
    • setConfig

      void setConfig(String parameter, String value)
      Set value of Redis configuration parameter.
      Parameters:
      parameter - - name of parameter
      value - - value of parameter
    • bgSave

      void bgSave()
      Runs the Redis database saving process in background.
    • scheduleBgSave

      void scheduleBgSave()
      Save the Redis database in background. If AOF rewrite process is in progress then the background save is scheduled to run upon its completion.
    • save

      void save()
      Save the Redis database.
    • getLastSaveTime

      Instant getLastSaveTime()
      Returns time of the last successful Redis database save operation.
      Returns:
      time
    • bgRewriteAOF

      void bgRewriteAOF()
      Runs an Append Only File rewrite process. Starts only if there is no a background process doing persistence.

      If fails no data gets lost

    • size

      long size()
      Returns keys amount stored in this Redis node.
      Returns:
      keys amount