Class RedissonClusterConnection

  • All Implemented Interfaces:
    AutoCloseable, org.springframework.data.redis.connection.DefaultedRedisClusterConnection, org.springframework.data.redis.connection.DefaultedRedisConnection, org.springframework.data.redis.connection.RedisClusterCommands, org.springframework.data.redis.connection.RedisClusterConnection, org.springframework.data.redis.connection.RedisClusterServerCommands, org.springframework.data.redis.connection.RedisCommands, org.springframework.data.redis.connection.RedisConnection, org.springframework.data.redis.connection.RedisConnectionCommands, org.springframework.data.redis.connection.RedisGeoCommands, org.springframework.data.redis.connection.RedisHashCommands, org.springframework.data.redis.connection.RedisHyperLogLogCommands, org.springframework.data.redis.connection.RedisKeyCommands, org.springframework.data.redis.connection.RedisListCommands, org.springframework.data.redis.connection.RedisPubSubCommands, org.springframework.data.redis.connection.RedisScriptingCommands, org.springframework.data.redis.connection.RedisServerCommands, org.springframework.data.redis.connection.RedisSetCommands, org.springframework.data.redis.connection.RedisStreamCommands, org.springframework.data.redis.connection.RedisStringCommands, org.springframework.data.redis.connection.RedisTxCommands, org.springframework.data.redis.connection.RedisZSetCommands

    public class RedissonClusterConnection
    extends RedissonConnection
    implements org.springframework.data.redis.connection.DefaultedRedisClusterConnection
    Author:
    Nikita Koksharov
    • Constructor Detail

      • RedissonClusterConnection

        public RedissonClusterConnection​(RedissonClient redisson)
    • Method Detail

      • clusterGetNodes

        public Iterable<org.springframework.data.redis.connection.RedisClusterNode> clusterGetNodes()
        Specified by:
        clusterGetNodes in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterGetSlaves

        public Collection<org.springframework.data.redis.connection.RedisClusterNode> clusterGetSlaves​(org.springframework.data.redis.connection.RedisClusterNode master)
        Specified by:
        clusterGetSlaves in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterGetMasterSlaveMap

        public Map<org.springframework.data.redis.connection.RedisClusterNode,​Collection<org.springframework.data.redis.connection.RedisClusterNode>> clusterGetMasterSlaveMap()
        Specified by:
        clusterGetMasterSlaveMap in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterGetSlotForKey

        public Integer clusterGetSlotForKey​(byte[] key)
        Specified by:
        clusterGetSlotForKey in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterGetNodeForSlot

        public org.springframework.data.redis.connection.RedisClusterNode clusterGetNodeForSlot​(int slot)
        Specified by:
        clusterGetNodeForSlot in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterGetNodeForKey

        public org.springframework.data.redis.connection.RedisClusterNode clusterGetNodeForKey​(byte[] key)
        Specified by:
        clusterGetNodeForKey in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterGetClusterInfo

        public org.springframework.data.redis.connection.ClusterInfo clusterGetClusterInfo()
        Specified by:
        clusterGetClusterInfo in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterAddSlots

        public void clusterAddSlots​(org.springframework.data.redis.connection.RedisClusterNode node,
                                    int... slots)
        Specified by:
        clusterAddSlots in interface org.springframework.data.redis.connection.RedisClusterCommands
      • convert

        protected List<Integer> convert​(int... slots)
      • clusterAddSlots

        public void clusterAddSlots​(org.springframework.data.redis.connection.RedisClusterNode node,
                                    org.springframework.data.redis.connection.RedisClusterNode.SlotRange range)
        Specified by:
        clusterAddSlots in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterCountKeysInSlot

        public Long clusterCountKeysInSlot​(int slot)
        Specified by:
        clusterCountKeysInSlot in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterDeleteSlots

        public void clusterDeleteSlots​(org.springframework.data.redis.connection.RedisClusterNode node,
                                       int... slots)
        Specified by:
        clusterDeleteSlots in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterDeleteSlotsInRange

        public void clusterDeleteSlotsInRange​(org.springframework.data.redis.connection.RedisClusterNode node,
                                              org.springframework.data.redis.connection.RedisClusterNode.SlotRange range)
        Specified by:
        clusterDeleteSlotsInRange in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterForget

        public void clusterForget​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        clusterForget in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterMeet

        public void clusterMeet​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        clusterMeet in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterSetSlot

        public void clusterSetSlot​(org.springframework.data.redis.connection.RedisClusterNode node,
                                   int slot,
                                   org.springframework.data.redis.connection.RedisClusterCommands.AddSlots mode)
        Specified by:
        clusterSetSlot in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterGetKeysInSlot

        public List<byte[]> clusterGetKeysInSlot​(int slot,
                                                 Integer count)
        Specified by:
        clusterGetKeysInSlot in interface org.springframework.data.redis.connection.RedisClusterCommands
      • clusterReplicate

        public void clusterReplicate​(org.springframework.data.redis.connection.RedisClusterNode master,
                                     org.springframework.data.redis.connection.RedisClusterNode slave)
        Specified by:
        clusterReplicate in interface org.springframework.data.redis.connection.RedisClusterCommands
      • ping

        public String ping​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        ping in interface org.springframework.data.redis.connection.RedisClusterConnection
      • bgReWriteAof

        public void bgReWriteAof​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        bgReWriteAof in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        bgReWriteAof in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • bgSave

        public void bgSave​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        bgSave in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        bgSave in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • lastSave

        public Long lastSave​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        lastSave in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        lastSave in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • save

        public void save​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        save in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        save in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • dbSize

        public Long dbSize​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        dbSize in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        dbSize in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • getEntry

        protected MasterSlaveEntry getEntry​(org.springframework.data.redis.connection.RedisClusterNode node)
      • flushDb

        public void flushDb​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        flushDb in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        flushDb in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • flushAll

        public void flushAll​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        flushAll in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        flushAll in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • info

        public Properties info​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        info in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        info in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • info

        public Properties info​(org.springframework.data.redis.connection.RedisClusterNode node,
                               String section)
        Specified by:
        info in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        info in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • keys

        public Set<byte[]> keys​(org.springframework.data.redis.connection.RedisClusterNode node,
                                byte[] pattern)
        Specified by:
        keys in interface org.springframework.data.redis.connection.RedisClusterConnection
      • randomKey

        public byte[] randomKey​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        randomKey in interface org.springframework.data.redis.connection.RedisClusterConnection
      • shutdown

        public void shutdown​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        shutdown in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        shutdown in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • getConfig

        public Properties getConfig​(org.springframework.data.redis.connection.RedisClusterNode node,
                                    String pattern)
        Specified by:
        getConfig in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        getConfig in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • setConfig

        public void setConfig​(org.springframework.data.redis.connection.RedisClusterNode node,
                              String param,
                              String value)
        Specified by:
        setConfig in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        setConfig in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • resetConfigStats

        public void resetConfigStats​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        resetConfigStats in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        resetConfigStats in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • time

        public Long time​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        time in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        time in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • getClientList

        public List<org.springframework.data.redis.core.types.RedisClientInfo> getClientList​(org.springframework.data.redis.connection.RedisClusterNode node)
        Specified by:
        getClientList in interface org.springframework.data.redis.connection.DefaultedRedisClusterConnection
        Specified by:
        getClientList in interface org.springframework.data.redis.connection.RedisClusterServerCommands
      • scan

        public org.springframework.data.redis.core.Cursor<byte[]> scan​(org.springframework.data.redis.connection.RedisClusterNode node,
                                                                       org.springframework.data.redis.core.ScanOptions options)
        Specified by:
        scan in interface org.springframework.data.redis.connection.RedisClusterConnection
      • rename

        public void rename​(byte[] oldName,
                           byte[] newName)
        Specified by:
        rename in interface org.springframework.data.redis.connection.DefaultedRedisConnection
        Specified by:
        rename in interface org.springframework.data.redis.connection.RedisKeyCommands
        Overrides:
        rename in class RedissonConnection
      • renameNX

        public Boolean renameNX​(byte[] oldName,
                                byte[] newName)
        Specified by:
        renameNX in interface org.springframework.data.redis.connection.DefaultedRedisConnection
        Specified by:
        renameNX in interface org.springframework.data.redis.connection.RedisKeyCommands
        Overrides:
        renameNX in class RedissonConnection
      • del

        public Long del​(byte[]... keys)
        Specified by:
        del in interface org.springframework.data.redis.connection.DefaultedRedisConnection
        Specified by:
        del in interface org.springframework.data.redis.connection.RedisKeyCommands
        Overrides:
        del in class RedissonConnection
      • mGet

        public List<byte[]> mGet​(byte[]... keys)
        Specified by:
        mGet in interface org.springframework.data.redis.connection.DefaultedRedisConnection
        Specified by:
        mGet in interface org.springframework.data.redis.connection.RedisStringCommands
        Overrides:
        mGet in class RedissonConnection
      • mSet

        public Boolean mSet​(Map<byte[],​byte[]> tuple)
        Specified by:
        mSet in interface org.springframework.data.redis.connection.DefaultedRedisConnection
        Specified by:
        mSet in interface org.springframework.data.redis.connection.RedisStringCommands
        Overrides:
        mSet in class RedissonConnection