Class DefaultStringRedisConnection
- All Implemented Interfaces:
AutoCloseable
,DecoratedRedisConnection
,DefaultedRedisConnection
,RedisCommands
,RedisCommandsProvider
,RedisConnection
,RedisConnectionCommands
,RedisGeoCommands
,RedisHashCommands
,RedisHyperLogLogCommands
,RedisKeyCommands
,RedisListCommands
,RedisPubSubCommands
,RedisScriptingCommands
,RedisServerCommands
,RedisSetCommands
,RedisStreamCommands
,RedisStringCommands
,RedisTxCommands
,RedisZSetCommands
,StringRedisConnection
StringRedisConnection
.- Author:
- Costin Leau, Jennifer Hickey, Christoph Strobl, Thomas Darimont, Mark Paluch, Ninad Divadkar, Tugdual Grall, Andrey Shlykov, dengliming, ihaohong, Dennis Neufeld, Shyngys Sapraliyev
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoCommandArgs, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs, RedisGeoCommands.GeoSearchCommandArgs, RedisGeoCommands.GeoSearchStoreCommandArgs
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisListCommands
RedisListCommands.Direction, RedisListCommands.Position
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisServerCommands
RedisServerCommands.FlushOption, RedisServerCommands.MigrateOption, RedisServerCommands.ShutdownOption
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
RedisStreamCommands.XAddOptions, RedisStreamCommands.XClaimOptions, RedisStreamCommands.XPendingOptions
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStringCommands
RedisStringCommands.BitOperation, RedisStringCommands.SetOption
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.ZAddArgs
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.StringRedisConnection
StringRedisConnection.StringTuple
-
Constructor Summary
ConstructorDescriptionDefaultStringRedisConnection
(RedisConnection connection) Constructs a newDefaultStringRedisConnection
instance.DefaultStringRedisConnection
(RedisConnection connection, RedisSerializer<String> serializer) Constructs a newDefaultStringRedisConnection
instance. -
Method Summary
Modifier and TypeMethodDescriptionappend
(byte[] key, byte[] value) Append avalue
tokey
.Append avalue
tokey
.void
Start an Append Only File rewrite process on server.void
bgSave()
Start background saving of db on server.bitCount
(byte[] key) Count the number of set bits (population counting) in value stored atkey
.bitCount
(byte[] key, long start, long end) Count the number of set bits (population counting) of value stored atkey
betweenstart
andend
.Count the number of set bits (population counting) in value stored atkey
.Count the number of set bits (population counting) of value stored atkey
betweenstart
andend
.bitfield
(String key, BitFieldSubCommands operation) Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey
.bitField
(byte[] key, BitFieldSubCommands subCommands) Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey
.bitOp
(RedisStringCommands.BitOperation op, byte[] destination, byte[]... keys) Perform bitwise operations between strings.bitOp
(RedisStringCommands.BitOperation op, String destination, String... keys) Perform bitwise operations between strings.Return the position of the first bit set to givenbit
in a string.Return the position of the first bit set to givenbit
in a string.byte[]
bLMove
(byte[] sourceKey, byte[] destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to, double timeout) Atomically returns and removes the first/last element (head/tail depending on thefrom
argument) of the list stored atsourceKey
, and pushes the element at the first/last element (head/tail depending on theto
argument) of the list stored atdestinationKey
.bLMove
(String sourceKey, String destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to, double timeout) Atomically returns and removes the first/last element (head/tail depending on thefrom
argument) of the list stored atsourceKey
, and pushes the element at the first/last element (head/tail depending on theto
argument) of the list stored atdestinationKey
.List<byte[]>
bLPop
(int timeout, byte[]... keys) Removes and returns first element from lists stored atkeys
.Removes and returns first element from lists stored atkeys
(see:DefaultedRedisConnection.lPop(byte[])
).List<byte[]>
bRPop
(int timeout, byte[]... keys) Removes and returns last element from lists stored atkeys
.Removes and returns last element from lists stored atkeys
(see:DefaultedRedisConnection.rPop(byte[])
).byte[]
bRPopLPush
(int timeout, byte[] srcKey, byte[] dstKey) Remove the last element from list atsrcKey
, append it todstKey
and return its value.bRPopLPush
(int timeout, String srcKey, String dstKey) Remove the last element from list atsrcKey
, append it todstKey
and return its value (seeDefaultedRedisConnection.rPopLPush(byte[], byte[])
).Remove and return the value with its score having the highest score from sorted set atkey
.Remove and return the value with its score having the highest score from sorted set atkey
.Remove and return the value with its score having the lowest score from sorted set atkey
.Remove and return the value with its score having the lowest score from sorted set atkey
.void
close()
Closes (or quits) the connection.Executes the commands in the pipeline and returns their result.commands()
GetRedisCommands
.copy
(byte[] sourceKey, byte[] targetKey, boolean replace) Copy givensourceKey
totargetKey
.Copy givensourceKey
totargetKey
.dbSize()
Get the total number of available keys in currently selected database.decr
(byte[] key) Decrement an integer value stored as string value ofkey
by 1.Decrement an integer value stored as string value ofkey
by 1.decrBy
(byte[] key, long value) Decrement an integer value stored as string value ofkey
byvalue
.Decrement an integer value stored as string value ofkey
byvalue
.del
(byte[]... keys) Delete givenkeys
.Delete givenkeys
.void
discard()
Discard all commands issued afterRedisTxCommands.multi()
.byte[]
dump
(byte[] key) Retrieve serialized version of the value stored atkey
.byte[]
echo
(byte[] message) Returnsmessage
via server roundtrip.Returnsmessage
via server roundtrip.encodingOf
(byte[] key) Get the type of internal representation used for storing the value at the givenkey
.encodingOf
(String key) Get the type of internal representation used for storing the value at the givenkey
.<T> T
eval
(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs) Evaluate givenscript
.<T> T
eval
(String script, ReturnType returnType, int numKeys, String... keysAndArgs) NOTE: This method will not deserialize Strings returned by Lua scripts, as they may not be encoded with the same serializer used here.<T> T
evalSha
(byte[] scriptSha1, ReturnType returnType, int numKeys, byte[]... keysAndArgs) Evaluate givenscriptSha
.<T> T
evalSha
(String scriptSha1, ReturnType returnType, int numKeys, byte[]... keysAndArgs) Evaluate givenscriptSha
.<T> T
evalSha
(String scriptSha1, ReturnType returnType, int numKeys, String... keysAndArgs) NOTE: This method will not deserialize Strings returned by Lua scripts, as they may not be encoded with the same serializer used here.exec()
Executes all queued commands in a transaction started withRedisTxCommands.multi()
.'Native' or 'raw' execution of the given command along-side the given arguments.Native or raw execution of the given Redis command along with the given arguments.'Native' or 'raw' execution of the given command along-side the given arguments.exists
(byte[] key) Determine if givenkey
exists.exists
(byte[]... keys) Count how many of the givenkeys
exist.Determine if givenkey
exists.Count how many of the givenkeys
exist.expire
(byte[] key, long seconds) Set time to live for givenkey
in seconds.Set time to live for givenkey
in seconds.expireAt
(byte[] key, long unixTime) Set the expiration for givenkey
as a UNIX timestamp.Set the expiration for givenkey
as a UNIX timestamp.void
flushAll()
Delete all all keys from all databases.void
Delete all all keys from all databases using the specifiedRedisServerCommands.FlushOption
.void
flushDb()
Delete all keys of the currently selected database.void
Delete all keys of the currently selected database using the specifiedRedisServerCommands.FlushOption
.geoAdd
(byte[] key, Iterable<RedisGeoCommands.GeoLocation<byte[]>> locations) AddRedisGeoCommands.GeoLocation
s to keyAddMap
of member /Point
pairs to key.geoAdd
(byte[] key, org.springframework.data.geo.Point point, byte[] member) AddPoint
with given member name to key.geoAdd
(byte[] key, RedisGeoCommands.GeoLocation<byte[]> location) AddRedisGeoCommands.GeoLocation
to key.geoAdd
(String key, Iterable<RedisGeoCommands.GeoLocation<String>> locations) AddRedisGeoCommands.GeoLocation
s to keyAddMap
of member /Point
pairs to key.AddPoint
with given member name to key.geoAdd
(String key, RedisGeoCommands.GeoLocation<String> location) AddRedisGeoCommands.GeoLocation
to key.GetRedisGeoCommands
.org.springframework.data.geo.Distance
geoDist
(byte[] key, byte[] member1, byte[] member2) Get theDistance
between member1 and member2.org.springframework.data.geo.Distance
geoDist
(byte[] key, byte[] member1, byte[] member2, org.springframework.data.geo.Metric metric) Get theDistance
between member1 and member2 in the givenMetric
.org.springframework.data.geo.Distance
Get theDistance
between member1 and member2.org.springframework.data.geo.Distance
Get theDistance
between member1 and member2 in the givenMetric
.geoHash
(byte[] key, byte[]... members) Get Geohash representation of the position for one or more members.Get geohash representation of the position for one or more members.List<org.springframework.data.geo.Point>
geoPos
(byte[] key, byte[]... members) Get thePoint
representation of positions for one or more members.List<org.springframework.data.geo.Point>
Get thePoint
representation of positions for one or more members.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadius
(byte[] key, org.springframework.data.geo.Circle within) Get the members within the boundaries of a givenCircle
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadius
(byte[] key, org.springframework.data.geo.Circle within, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircle
applyingRedisGeoCommands.GeoRadiusCommandArgs
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>>
Get the members within the boundaries of a givenCircle
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>>
geoRadius
(String key, org.springframework.data.geo.Circle within, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircle
applyingRedisGeoCommands.GeoRadiusCommandArgs
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadiusByMember
(byte[] key, byte[] member, double radius) Get the members within the circle defined by the members coordinates and given radius.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadiusByMember
(byte[] key, byte[] member, org.springframework.data.geo.Distance radius) Get the members within the circle defined by the members coordinates and givenDistance
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadiusByMember
(byte[] key, byte[] member, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates, givenDistance
andRedisGeoCommands.GeoRadiusCommandArgs
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>>
geoRadiusByMember
(String key, String member, double radius) Get the members within the circle defined by the members coordinates and given radius.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>>
geoRadiusByMember
(String key, String member, org.springframework.data.geo.Distance radius) Get the members within the circle defined by the members coordinates and givenDistance
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>>
geoRadiusByMember
(String key, String member, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates and givenDistance
andRedisGeoCommands.GeoRadiusCommandArgs
.geoRemove
(byte[] key, byte[]... members) Remove the members.Remove the members.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoSearch
(byte[] key, GeoReference<byte[]> reference, GeoShape predicate, RedisGeoCommands.GeoSearchCommandArgs args) Return the members of a geo set which are within the borders of the area specified by a givenshape
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>>
geoSearch
(String key, GeoReference<String> reference, GeoShape predicate, RedisGeoCommands.GeoSearchCommandArgs args) Return the members of a geo set which are within the borders of the area specified by a givenshape
.geoSearchStore
(byte[] destKey, byte[] key, GeoReference<byte[]> reference, GeoShape predicate, RedisGeoCommands.GeoSearchStoreCommandArgs args) Query the members of a geo set which are within the borders of the area specified by a givenshape
and store the result atdestKey
.geoSearchStore
(String destKey, String key, GeoReference<String> reference, GeoShape predicate, RedisGeoCommands.GeoSearchStoreCommandArgs args) Query the members of a geo set which are within the borders of the area specified by a givenshape
and store the result atdestKey
.byte[]
get
(byte[] key) Get the value ofkey
.Get the value ofkey
.getBit
(byte[] key, long offset) Get the bit value atoffset
of value atkey
.Get the bit value atoffset
of value atkey
.Request information and statistics about connected clients.Returns the name of the current connection.Load configuration parameters for givenpattern
from server.byte[]
getDel
(byte[] key) Return the value atkey
and delete the key.Return the value atkey
and delete the key.Gets the underlyingRedisConnection
.byte[]
getEx
(byte[] key, Expiration expiration) Return the value atkey
and expire the key by applyingExpiration
.getEx
(String key, Expiration expiration) Return the value atkey
and expire the key by applyingExpiration
.Returns the native connection (the underlying library/driver object).byte[]
getRange
(byte[] key, long start, long end) Get a substring of value ofkey
betweenstart
andend
.Get a substring of value ofkey
betweenstart
andend
.byte[]
getSet
(byte[] key, byte[] value) Setvalue
ofkey
and return its old value.Setvalue
ofkey
and return its old value.Returns the current subscription for this connection or null if the connection is not subscribed.GetRedisHashCommands
.hDel
(byte[] key, byte[]... fields) Delete given hashfields
.Delete given hashfields
.hExists
(byte[] key, byte[] field) Determine if given hashfield
exists.Determine if given hashfield
exists.byte[]
hGet
(byte[] key, byte[] field) Get value for givenfield
from hash atkey
.Get value for givenfield
from hash atkey
.Map<byte[],
byte[]> hGetAll
(byte[] key) Get entire hash stored atkey
.Get entire hash stored atkey
.hIncrBy
(byte[] key, byte[] field, double delta) Incrementvalue
of a hashfield
by the givendelta
.hIncrBy
(byte[] key, byte[] field, long delta) Incrementvalue
of a hashfield
by the givendelta
.Incrementvalue
of a hashfield
by the givendelta
.Incrementvalue
of a hashfield
by the givendelta
.Set<byte[]>
hKeys
(byte[] key) Get key set (fields) of hash atkey
.Get key set (fields) of hash atkey
.hLen
(byte[] key) Get size of hash atkey
.Get size of hash atkey
.List<byte[]>
hMGet
(byte[] key, byte[]... fields) Get values for givenfields
from hash atkey
.Get values for givenfields
from hash atkey
.void
Set multiple hash fields to multiple values using data provided inhashes
void
Set multiple hash fields to multiple values using data provided inhashes
byte[]
hRandField
(byte[] key) Return a random field from the hash stored atkey
.List<byte[]>
hRandField
(byte[] key, long count) Return a random field from the hash stored atkey
.hRandField
(String key) Return a random field from the hash stored atkey
.hRandField
(String key, long count) Return a random field from the hash stored atkey
.Map.Entry<byte[],
byte[]> hRandFieldWithValues
(byte[] key) Return a random field from the hash along with its value stored atkey
.hRandFieldWithValues
(byte[] key, long count) Return a random field from the hash along with its value stored atkey
.Return a random field from the hash along with its value stored atkey
.hRandFieldWithValues
(String key, long count) Return a random field from the hash along with its value stored atkey
.hScan
(byte[] key, ScanOptions options) Use aCursor
to iterate over entries in hash atkey
.hScan
(String key, ScanOptions options) Use aCursor
to iterate over entries in hash atkey
.hSet
(byte[] key, byte[] field, byte[] value) Set thevalue
of a hashfield
.Set thevalue
of a hashfield
.hSetNX
(byte[] key, byte[] field, byte[] value) Set thevalue
of a hashfield
only iffield
does not exist.Set thevalue
of a hashfield
only iffield
does not exist.hStrLen
(byte[] key, byte[] field) Returns the length of the value associated withfield
in the hash stored atkey
.Returns the length of the value associated withfield
in the hash stored atkey
.List<byte[]>
hVals
(byte[] key) Get entry set (values) of hash atfield
.Get entry set (values) of hash atfield
.idletime
(byte[] key) Get theDuration
since the object stored at the givenkey
is idle.Get theDuration
since the object stored at the givenkey
is idle.incr
(byte[] key) Increment an integer value stored as string value ofkey
by 1.Increment an integer value stored as string value ofkey
by 1.incrBy
(byte[] key, double value) Increment a floating point number value ofkey
bydelta
.incrBy
(byte[] key, long value) Increment an integer value stored ofkey
bydelta
.Increment a floating point number value ofkey
bydelta
.Increment an integer value stored ofkey
bydelta
.info()
Load default server information like memory cpu utilization replicationLoad server information for givenselection
.boolean
isClosed()
Indicates whether the underlying connection is closed or not.boolean
Indicates whether the connection is currently pipelined or not.boolean
Indicates whether the connection is in "queue"(or "MULTI") mode or not.boolean
Indicates whether the current connection is subscribed (to at least one channel) or not.GetRedisKeyCommands
.Set<byte[]>
keys
(byte[] pattern) Find all keys matching the givenpattern
.Find all keys matching the givenpattern
.void
killClient
(String host, int port) Closes a given client connection identified by host:port.lastSave()
Get time of lastRedisServerCommands.bgSave()
operation in seconds.byte[]
lIndex
(byte[] key, long index) Get element atindex
form list atkey
.Get element atindex
form list atkey
.lInsert
(byte[] key, RedisListCommands.Position where, byte[] pivot, byte[] value) Insertvalue
RedisListCommands.Position.BEFORE
orRedisListCommands.Position.AFTER
existingpivot
forkey
.lInsert
(String key, RedisListCommands.Position where, String pivot, String value) Insertvalue
RedisListCommands.Position.BEFORE
orRedisListCommands.Position.AFTER
existingpivot
forkey
.GetRedisListCommands
.lLen
(byte[] key) Get the size of list stored atkey
.Get the size of list stored atkey
.byte[]
lMove
(byte[] sourceKey, byte[] destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to) Atomically returns and removes the first/last element (head/tail depending on thefrom
argument) of the list stored atsourceKey
, and pushes the element at the first/last element (head/tail depending on theto
argument) of the list stored atdestinationKey
.lMove
(String sourceKey, String destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to) Atomically returns and removes the first/last element (head/tail depending on thefrom
argument) of the list stored atsourceKey
, and pushes the element at the first/last element (head/tail depending on theto
argument) of the list stored atdestinationKey
.byte[]
lPop
(byte[] key) Removes and returns first element in list stored atkey
.List<byte[]>
lPop
(byte[] key, long count) Removes and returns first elements in list stored atkey
.Removes and returns first element in list stored atkey
.Removes and returns first elements in list stored atkey
.Returns the index of matching elements inside the list stored at given key.Returns the index of matching elements inside the list stored at given key.lPush
(byte[] key, byte[]... values) Prependvalues
tokey
.Prependvalues
tokey
.lPushX
(byte[] key, byte[] value) Prependvalues
tokey
only if the list exists.Prependvalues
tokey
only if the list exists.List<byte[]>
lRange
(byte[] key, long start, long end) Get elements betweenstart
andend
from list atkey
.Get elements betweenstart
andend
from list atkey
.lRem
(byte[] key, long count, byte[] value) Removes the firstcount
occurrences ofvalue
from the list stored atkey
.Removes the firstcount
occurrences ofvalue
from the list stored atkey
.void
lSet
(byte[] key, long index, byte[] value) Set thevalue
list element atindex
.void
Set thevalue
list element atindex
.void
lTrim
(byte[] key, long start, long end) Trim list atkey
to elements betweenstart
andend
.void
Trim list atkey
to elements betweenstart
andend
.List<byte[]>
mGet
(byte[]... keys) Get multiplekeys
.Get multiplekeys
.void
migrate
(byte[] key, RedisNode target, int dbIndex, RedisServerCommands.MigrateOption option) Atomically transfer a key from a source Redis instance to a destination Redis instance.void
migrate
(byte[] key, RedisNode target, int dbIndex, RedisServerCommands.MigrateOption option, long timeout) Atomically transfer a key from a source Redis instance to a destination Redis instance.move
(byte[] key, int dbIndex) Move givenkey
to database withindex
.Move givenkey
to database withindex
.Set multiple keys to multiple values using key-value pairs provided intuple
.Set multiple keys to multiple values using key-value pairs provided intuple
only if the provided key does not exist.mSetNXString
(Map<String, String> tuple) Set multiple keys to multiple values using key-value pairs provided intuple
only if the provided key does not exist.mSetString
(Map<String, String> tuple) Set multiple keys to multiple values using key-value pairs provided intuple
.void
multi()
Mark the start of a transaction block.void
Activates the pipeline mode for this connection.persist
(byte[] key) Remove the expiration from givenkey
.Remove the expiration from givenkey
.pExpire
(byte[] key, long millis) Set time to live for givenkey
in milliseconds.Set time to live for givenkey
in milliseconds.pExpireAt
(byte[] key, long unixTimeInMillis) Set the expiration for givenkey
as a UNIX timestamp in milliseconds.Set the expiration for givenkey
as a UNIX timestamp in milliseconds.pfAdd
(byte[] key, byte[]... values) Adds given values to the HyperLogLog stored at given key.Adds given values to the HyperLogLog stored at given key.pfCount
(byte[]... keys) Return the approximated cardinality of the structures observed by the HyperLogLog at key(s).Return the approximated cardinality of the structures observed by the HyperLogLog at key(s).void
pfMerge
(byte[] destinationKey, byte[]... sourceKeys) Merge N different HyperLogLogs at sourceKeys into a single destinationKey.void
Merge N different HyperLogLogs at sourceKeys into a single destinationKey.ping()
Test connection.pSetEx
(byte[] key, long milliseconds, byte[] value) Set thevalue
and expiration inmilliseconds
forkey
.Set thevalue
and expiration inmilliseconds
forkey
.void
pSubscribe
(MessageListener listener, byte[]... patterns) Subscribes the connection to all channels matching the given patterns.void
pSubscribe
(MessageListener listener, String... patterns) Subscribes the connection to all channels matching the given patterns.pTtl
(byte[] key) Get the precise time to live forkey
in milliseconds.Get the precise time to live forkey
in and convert it to the givenTimeUnit
.Get the precise time to live forkey
in milliseconds.Get the precise time to live forkey
in and convert it to the givenTimeUnit
.publish
(byte[] channel, byte[] message) Publishes the given message to the given channel.Publishes the given message to the given channel.byte[]
Return a random key from the keyspace.refcount
(byte[] key) Get the number of references of the value associated with the specifiedkey
.Get the number of references of the value associated with the specifiedkey
.void
rename
(byte[] oldKey, byte[] newKey) Rename keyoldKey
tonewKey
.void
Rename keyoldKey
tonewKey
.renameNX
(byte[] oldKey, byte[] newKey) Rename keyoldKey
tonewKey
only ifnewKey
does not exist.Rename keyoldKey
tonewKey
only ifnewKey
does not exist.void
Change redis replication setting to new master.void
Change server into master.void
Reset statistic counters on server.void
restore
(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) void
Rewrites theredis.conf
file.byte[]
rPop
(byte[] key) Removes and returns last element in list stored atkey
.List<byte[]>
rPop
(byte[] key, long count) Removes and returns last elements in list stored atkey
.Removes and returns last element in list stored atkey
.Removes and returns last elements in list stored atkey
.byte[]
rPopLPush
(byte[] srcKey, byte[] dstKey) Remove the last element from list atsrcKey
, append it todstKey
and return its value.Remove the last element from list atsrcKey
, append it todstKey
and return its value.rPush
(byte[] key, byte[]... values) Appendvalues
tokey
.Appendvalues
tokey
.rPushX
(byte[] key, byte[] value) Appendvalues
tokey
only if the list exists.Appendvalues
tokey
only if the list exists.sAdd
(byte[] key, byte[]... values) Add givenvalues
to set atkey
.Add givenvalues
to set atkey
.void
save()
Synchronous save current db snapshot on server.Cursor<byte[]>
scan
(ScanOptions options) Use aCursor
to iterate over keys.sCard
(byte[] key) Get size of set atkey
.Get size of set atkey
.scriptExists
(String... scriptSha1) Check if givenscriptShas
exist in script cache.void
Flush lua script cache.void
Kill current lua script execution.scriptLoad
(byte[] script) Load lua script into scripts cache, without executing it.
Execute the script by callingRedisScriptingCommands.evalSha(byte[], ReturnType, int, byte[]...)
.scriptLoad
(String script) Load lua script into scripts cache, without executing it.
Execute the script by callingDefaultedRedisConnection.evalSha(byte[], ReturnType, int, byte[]...)
.Set<byte[]>
sDiff
(byte[]... keys) Diff all sets for givenkeys
.Diff all sets for givenkeys
.sDiffStore
(byte[] destKey, byte[]... keys) Diff all sets for givenkeys
and store result indestKey
.sDiffStore
(String destKey, String... keys) Diff all sets for givenkeys
and store result indestKey
.void
select
(int dbIndex) Select the DB with given positivedbIndex
.GetRedisServerCommands
.set
(byte[] key, byte[] value) Setvalue
forkey
.set
(byte[] key, byte[] value, Expiration expiration, RedisStringCommands.SetOption option) Setvalue
forkey
applying timeouts fromexpiration
if set and inserting/updating values depending onoption
.Setvalue
forkey
.set
(String key, String value, Expiration expiration, RedisStringCommands.SetOption option) Setvalue
forkey
applying timeouts fromexpiration
if set and inserting/updating values depending onoption
.setBit
(byte[] key, long offset, boolean value) Sets the bit atoffset
in value stored atkey
.Sets the bit atoffset
in value stored atkey
.void
setClientName
(byte[] name) Assign given name to current connection.void
setClientName
(String name) Assign given name to current connection.GetRedisSetCommands
.void
Set server configuration forparam
tovalue
.void
setDeserializePipelineAndTxResults
(boolean deserializePipelineAndTxResults) Specifies if pipelined and tx results should be deserialized to Strings.setEx
(byte[] key, long seconds, byte[] value) Set thevalue
and expiration inseconds
forkey
.Set thevalue
and expiration inseconds
forkey
.setNX
(byte[] key, byte[] value) Setvalue
forkey
, only ifkey
does not exist.Setvalue
forkey
, only ifkey
does not exist.void
setRange
(byte[] key, byte[] value, long start) Overwrite parts ofkey
starting at the specifiedoffset
with givenvalue
.void
Overwrite parts ofkey
starting at the specifiedoffset
with givenvalue
.void
shutdown()
Shutdown server.void
Shutdown server.Set<byte[]>
sInter
(byte[]... keys) Returns the members intersecting all given sets atkeys
.Returns the members intersecting all given sets atkeys
.sInterStore
(byte[] destKey, byte[]... keys) Intersect all given sets atkeys
and store result indestKey
.sInterStore
(String destKey, String... keys) Intersect all given sets atkeys
and store result indestKey
.sIsMember
(byte[] key, byte[] value) Check if set atkey
containsvalue
.Check if set atkey
containsvalue
.Set<byte[]>
sMembers
(byte[] key) Get all elements of set atkey
.Get all elements of set atkey
.sMIsMember
(byte[] key, byte[]... values) Check if set atkey
contains one or morevalues
.sMIsMember
(String key, String... values) Check if set atkey
contains one or morevalues
.sMove
(byte[] srcKey, byte[] destKey, byte[] value) Movevalue
fromsrcKey
todestKey
Movevalue
fromsrcKey
todestKey
List<byte[]>
sort
(byte[] key, SortParameters params) Sort the elements forkey
.sort
(byte[] key, SortParameters params, byte[] storeKey) Sort the elements forkey
and store result instoreKey
.sort
(String key, SortParameters params) Sort the elements forkey
.sort
(String key, SortParameters params, String storeKey) Sort the elements forkey
and store result instoreKey
.byte[]
sPop
(byte[] key) Remove and return a random member from set atkey
.List<byte[]>
sPop
(byte[] key, long count) Remove and returncount
random members from set atkey
.Remove and return a random member from set atkey
.Remove and returncount
random members from set atkey
.byte[]
sRandMember
(byte[] key) Get random element from set atkey
.List<byte[]>
sRandMember
(byte[] key, long count) Getcount
random elements from set atkey
.sRandMember
(String key) Get random element from set atkey
.sRandMember
(String key, long count) Getcount
random elements from set atkey
.sRem
(byte[] key, byte[]... values) Remove givenvalues
from set atkey
and return the number of removed elements.Remove givenvalues
from set atkey
and return the number of removed elements.Cursor<byte[]>
sScan
(byte[] key, ScanOptions options) Use aCursor
to iterate over elements in set atkey
.sScan
(String key, ScanOptions options) Use aCursor
to iterate over elements in set atkey
.GetRedisStreamCommands
.GetRedisStringCommands
.strLen
(byte[] key) Get the length of the value stored atkey
.Get the length of the value stored atkey
.void
subscribe
(MessageListener listener, byte[]... channels) Subscribes the connection to the given channels.void
subscribe
(MessageListener listener, String... channels) Subscribes the connection to the given channels.Set<byte[]>
sUnion
(byte[]... keys) Union all sets at givenkeys
.Union all sets at givenkeys
.sUnionStore
(byte[] destKey, byte[]... keys) Union all sets at givenkeys
and store result indestKey
.sUnionStore
(String destKey, String... keys) Union all sets at givenkeys
and store result indestKey
.time()
Request server timestamp usingTIME
command inTimeUnit.MILLISECONDS
.Request server timestamp usingTIME
command.touch
(byte[]... keys) Alter the last access time of givenkey(s)
.Alter the last access time of givenkey(s)
.ttl
(byte[] key) Get the time to live forkey
in seconds.Get the time to live forkey
in and convert it to the givenTimeUnit
.Get the time to live forkey
in seconds.Get the time to live forkey
in and convert it to the givenTimeUnit
.type
(byte[] key) Determine the type stored atkey
.Determine the type stored atkey
.unlink
(byte[]... keys) Unlink thekeys
from the keyspace.Unlink thekeys
from the keyspace.void
unwatch()
Flushes all the previouslyRedisTxCommands.watch(byte[]...)
keys.void
watch
(byte[]... keys) Watch givenkeys
for modifications during transaction started withRedisTxCommands.multi()
.Acknowledge one or more records, identified via their id, as processed.xAdd
(MapRecord<byte[], byte[], byte[]> record, RedisStreamCommands.XAddOptions options) Append the givenrecord
to the stream stored atRecord#getStream
.xAdd
(StringRecord record, RedisStreamCommands.XAddOptions options) Append the givenStringRecord
to the stream stored atRecord.getStream()
.xClaim
(byte[] key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer.xClaim
(String key, String group, String consumer, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer.xClaimJustId
(byte[] key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer without increasing the delivered count.xClaimJustId
(String key, String group, String consumer, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer without increasing the delivered count.Removes the records with the given id's from the stream.xGroupCreate
(byte[] key, String groupName, ReadOffset readOffset) Create a consumer group.xGroupCreate
(byte[] key, String groupName, ReadOffset readOffset, boolean mkStream) Create a consumer group.xGroupCreate
(String key, ReadOffset readOffset, String group) Create a consumer group.xGroupCreate
(String key, ReadOffset readOffset, String group, boolean mkStream) Create a consumer group.xGroupDelConsumer
(byte[] key, Consumer consumer) Delete a consumer from a consumer group.xGroupDelConsumer
(String key, Consumer consumer) Delete a consumer from a consumer group.xGroupDestroy
(byte[] key, String groupName) Destroy a consumer group.xGroupDestroy
(String key, String group) Destroy a consumer group.xInfo
(byte[] key) Obtain general information about the stream stored at the specified key.Obtain general information about the stream stored at the specified key.xInfoConsumers
(byte[] key, String groupName) Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.xInfoConsumers
(String key, String groupName) Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.xInfoGroups
(byte[] key) Obtain information about consumer groups associated with the stream stored at the specified key.xInfoGroups
(String key) Obtain information about consumer groups associated with the stream stored at the specified key.xLen
(byte[] key) Get the length of a stream.Get the length of a stream.Obtain thePendingMessagesSummary
for a given consumer group.xPending
(byte[] key, String groupName, RedisStreamCommands.XPendingOptions options) Obtain thePendingMessagesSummary
for a given consumer group.xPending
(String key, String groupName, String consumer, org.springframework.data.domain.Range<String> range, Long count) Obtain detailed information about pendingmessages
for a givenRange
within a consumer group.xPending
(String key, String groupName, org.springframework.data.domain.Range<String> range, Long count) Obtain detailed information about pendingmessages
for a givenRange
within a consumer group.xPending
(String key, String groupName, RedisStreamCommands.XPendingOptions options) Read records from a stream within a specificRedisZSetCommands.Range
applying aLimit
.xRead
(StreamReadOptions readOptions, StreamOffset<byte[]>... streams) Read records from one or moreStreamOffset
s.xReadAsString
(StreamReadOptions readOptions, StreamOffset<String>... streams) Read records from one or moreStreamOffset
s.xReadGroup
(Consumer consumer, StreamReadOptions readOptions, StreamOffset<byte[]>... streams) Read records from one or moreStreamOffset
s using a consumer group.xReadGroupAsString
(Consumer consumer, StreamReadOptions readOptions, StreamOffset<String>... streams) Read records from one or moreStreamOffset
s using a consumer group.Read records from a stream within a specificRange
applying aLimit
in reverse order.Read records from a stream within a specificRedisZSetCommands.Range
applying aLimit
in reverse order.xTrim
(byte[] key, long count) Trims the stream tocount
elements.xTrim
(byte[] key, long count, boolean approximateTrimming) Trims the stream tocount
elements.Trims the stream tocount
elements.Trims the stream tocount
elements.zAdd
(byte[] key, double score, byte[] value, RedisZSetCommands.ZAddArgs args) zAdd
(byte[] key, Set<Tuple> tuples, RedisZSetCommands.ZAddArgs args) Addvalue
to a sorted set atkey
, or update itsscore
if it already exists.zAdd
(String key, double score, String value, RedisZSetCommands.ZAddArgs args) zAdd
(String key, Set<StringRedisConnection.StringTuple> tuples) Addtuples
to a sorted set atkey
, or update itsscore
if it already exists.zAdd
(String key, Set<StringRedisConnection.StringTuple> tuples, RedisZSetCommands.ZAddArgs args) zCard
(byte[] key) Get the size of sorted set withkey
.Get the size of sorted set withkey
.zCount
(byte[] key, double min, double max) Count number of elements within sorted set with scores betweenmin
andmax
.Count number of elements within sorted set with scores betweenRange#min
andRange#max
.Count number of elements within sorted set with scores betweenmin
andmax
.Set<byte[]>
zDiff
(byte[]... sets) Diff sortedsets
.Diff sortedsets
.zDiffStore
(byte[] destKey, byte[]... sets) Diff sortedsets
and store result in destinationdestKey
.zDiffStore
(String destKey, String... sets) Diff sortedsets
and store result in destinationdestKey
.zDiffWithScores
(byte[]... sets) Diff sortedsets
.zDiffWithScores
(String... sets) Diff sortedsets
.zIncrBy
(byte[] key, double increment, byte[] value) Increment the score of element withvalue
in sorted set byincrement
.Increment the score of element withvalue
in sorted set byincrement
.Set<byte[]>
zInter
(byte[]... sets) Intersect sortedsets
.Intersect sortedsets
.zInterStore
(byte[] destKey, byte[]... sets) Intersect sortedsets
and store result in destinationdestKey
.zInterStore
(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) Intersect sortedsets
and store result in destinationdestKey
.zInterStore
(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) Intersect sortedsets
and store result in destinationdestKey
.zInterStore
(String destKey, String... sets) Intersect sortedsets
and store result in destinationkey
.zInterStore
(String destKey, Aggregate aggregate, int[] weights, String... sets) Intersect sortedsets
and store result in destinationkey
.zInterWithScores
(byte[]... sets) Intersect sortedsets
.zInterWithScores
(String... sets) Intersect sortedsets
.zInterWithScores
(Aggregate aggregate, Weights weights, byte[]... sets) Intersect sortedsets
.zInterWithScores
(Aggregate aggregate, Weights weights, String... sets) Intersect sortedsets
.zLexCount
(byte[] key, org.springframework.data.domain.Range<byte[]> range) Count number of elements within sorted set with value betweenRange#min
andRange#max
applying lexicographical ordering.Count number of elements within sorted set with value betweenRange#min
andRange#max
applying lexicographical ordering.zMScore
(byte[] key, byte[]... values) Get the scores of elements withvalues
from sorted set with keykey
.Get the scores of elements withvalues
from sorted set with keykey
.zPopMax
(byte[] key) Remove and return the value with its score having the highest score from sorted set atkey
.zPopMax
(byte[] key, long count) Remove and returncount
values with their score having the highest score from sorted set atkey
.Remove and return the value with its score having the highest score from sorted set atkey
.Remove and returncount
values with their score having the highest score from sorted set atkey
.zPopMin
(byte[] key) Remove and return the value with its score having the lowest score from sorted set atkey
.zPopMin
(byte[] key, long count) Remove and returncount
values with their score having the lowest score from sorted set atkey
.Remove and return the value with its score having the lowest score from sorted set atkey
.Remove and returncount
values with their score having the lowest score from sorted set atkey
.byte[]
zRandMember
(byte[] key) Get random element from sorted set atkey
.List<byte[]>
zRandMember
(byte[] key, long count) Getcount
random elements from sorted set atkey
.zRandMember
(String key) Get random element from sorted set atkey
.zRandMember
(String key, long count) Getcount
random elements from sorted set atkey
.zRandMemberWithScore
(byte[] key) Get random element from sorted set atkey
.zRandMemberWithScore
(byte[] key, long count) Getcount
random elements from sorted set atkey
.Get random element from sorted set atkey
.zRandMemberWithScores
(String key, long count) Getcount
random elements from sorted set atkey
.Set<byte[]>
zRange
(byte[] key, long start, long end) Get elements betweenstart
andend
from sorted set.Get elements betweenstart
andend
from sorted set.Set<byte[]>
zRangeByLex
(byte[] key) Get all the elements in the sorted set at key in lexicographical ordering.Set<byte[]>
zRangeByLex
(byte[] key, org.springframework.data.domain.Range<byte[]> range) Get all the elements inRange
from the sorted set at key in lexicographical ordering.Set<byte[]>
zRangeByLex
(byte[] key, org.springframework.data.domain.Range<byte[]> range, Limit limit) Get all the elements inRange
from the sorted set at key in lexicographical ordering.zRangeByLex
(String key) Get all the elements in the sorted set at key in lexicographical ordering.zRangeByLex
(String key, org.springframework.data.domain.Range<String> range) Get all the elements inRedisZSetCommands.Range
from the sorted set at key in lexicographical ordering.zRangeByLex
(String key, org.springframework.data.domain.Range<String> range, Limit limit) Get all the elements inRedisZSetCommands.Range
from the sorted set at key in lexicographical ordering.Set<byte[]>
zRangeByScore
(byte[] key, double min, double max) Get elements where score is betweenmin
andmax
from sorted set.Set<byte[]>
zRangeByScore
(byte[] key, double min, double max, long offset, long count) Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.Set<byte[]>
zRangeByScore
(byte[] key, String min, String max) Get elements where score is betweenmin
andmax
from sorted set.Set<byte[]>
zRangeByScore
(byte[] key, String min, String max, long offset, long count) Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.Set<byte[]>
zRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Get elements where score is betweenRange#min
andRange#max
from sorted set.Set<byte[]>
zRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Get elements in range fromLimit#count
toLimit#offset
where score is betweenRange#min
andRange#max
from sorted set.zRangeByScore
(String key, double min, double max) Get elements where score is betweenmin
andmax
from sorted set.zRangeByScore
(String key, double min, double max, long offset, long count) Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.zRangeByScore
(String key, String min, String max) Get elements where score is betweenmin
andmax
from sorted set.zRangeByScore
(String key, String min, String max, long offset, long count) Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.zRangeByScoreWithScores
(byte[] key, double min, double max) zRangeByScoreWithScores
(byte[] key, double min, double max, long offset, long count) zRangeByScoreWithScores
(byte[] key, org.springframework.data.domain.Range<? extends Number> range) zRangeByScoreWithScores
(byte[] key, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Get set ofTuple
s in range fromLimit#offset
toLimit#offset + Limit#count
where score is betweenRange#min
andRange#max
from sorted set.zRangeByScoreWithScores
(String key, double min, double max) zRangeByScoreWithScores
(String key, double min, double max, long offset, long count) zRangeStoreByLex
(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.Range<byte[]> range, Limit limit) This command is like ZRANGE , but stores the result in the dstKey destination key.zRangeStoreByLex
(String dstKey, String srcKey, org.springframework.data.domain.Range<String> range, Limit limit) This command is like ZRANGE , but stores the result in the dstKey destination key.zRangeStoreByScore
(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit) This command is like ZRANGE, but stores the result in the dstKey destination key.zRangeStoreByScore
(String dstKey, String srcKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit) This command is like ZRANGE, but stores the result in the dstKey destination key.zRangeStoreRevByLex
(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.Range<byte[]> range, Limit limit) This command is like ZRANGE … REV , but stores the result in the dstKey destination key.zRangeStoreRevByLex
(String dstKey, String srcKey, org.springframework.data.domain.Range<String> range, Limit limit) This command is like ZRANGE … REV , but stores the result in the dstKey destination key.zRangeStoreRevByScore
(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.zRangeStoreRevByScore
(String dstKey, String srcKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.zRangeWithScores
(byte[] key, long start, long end) zRangeWithScores
(String key, long start, long end) zRank
(byte[] key, byte[] value) Determine the index of element withvalue
in a sorted set.Determine the index of element withvalue
in a sorted set.zRem
(byte[] key, byte[]... values) Removevalues
from sorted set.Removevalues
from sorted set.zRemRange
(byte[] key, long start, long end) Remove elements in range betweenstart
andend
from sorted set withkey
.Remove elements in range betweenstart
andend
from sorted set withkey
.zRemRangeByLex
(byte[] key, org.springframework.data.domain.Range<byte[]> range) Remove all elements between the lexicographicalRange
.zRemRangeByLex
(String key, org.springframework.data.domain.Range<String> range) Remove all elements between the lexicographicalRedisZSetCommands.Range
.zRemRangeByScore
(byte[] key, double min, double max) Remove elements with scores betweenmin
andmax
from sorted set withkey
.zRemRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Remove elements with scores betweenRange#min
andRange#max
from sorted set withkey
.zRemRangeByScore
(String key, double min, double max) Remove elements with scores betweenmin
andmax
from sorted set withkey
.Set<byte[]>
zRevRange
(byte[] key, long start, long end) Get elements in range fromstart
toend
from sorted set ordered from high to low.Get elements in range fromstart
toend
from sorted set ordered from high to low.Set<byte[]>
zRevRangeByLex
(byte[] key, org.springframework.data.domain.Range<byte[]> range, Limit limit) Get all the elements inRange
from the sorted set at key in reversed lexicographical ordering.zRevRangeByLex
(String key, org.springframework.data.domain.Range<String> range, Limit limit) Get all the elements inRedisZSetCommands.Range
from the sorted set at key in reversed lexicographical ordering.Set<byte[]>
zRevRangeByScore
(byte[] key, double min, double max) Get elements where score is betweenmin
andmax
from sorted set ordered from high to low.Set<byte[]>
zRevRangeByScore
(byte[] key, double min, double max, long offset, long count) Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.Set<byte[]>
zRevRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Get elements where score is betweenRange#min
andRange#max
from sorted set ordered from high to low.Set<byte[]>
zRevRangeByScore
(byte[] key, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Get elements in range fromLimit#offset
toLimit#offset + Limit#count
where score is betweenRange#min
andRange#max
from sorted set ordered high -> low.zRevRangeByScore
(String key, double min, double max) Get elements where score is betweenmin
andmax
from sorted set ordered from high to low.zRevRangeByScore
(String key, double min, double max, long offset, long count) Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.zRevRangeByScoreWithScores
(byte[] key, double min, double max) zRevRangeByScoreWithScores
(byte[] key, double min, double max, long offset, long count) Get set ofTuple
in range fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.zRevRangeByScoreWithScores
(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Get set ofTuple
where score is betweenRange#min
andRange#max
from sorted set ordered from high to low.zRevRangeByScoreWithScores
(byte[] key, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Get set ofTuple
in range fromLimit#offset
toLimit#count
where score is betweenRange#min
andRange#max
from sorted set ordered high -> low.zRevRangeByScoreWithScores
(String key, double min, double max) zRevRangeByScoreWithScores
(String key, double min, double max, long offset, long count) Get set ofTuple
in range fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.zRevRangeWithScores
(byte[] key, long start, long end) zRevRangeWithScores
(String key, long start, long end) zRevRank
(byte[] key, byte[] value) Determine the index of element withvalue
in a sorted set when scored high to low.Determine the index of element withvalue
in a sorted set when scored high to low.zScan
(byte[] key, ScanOptions options) Use aCursor
to iterate over elements in sorted set atkey
.zScan
(String key, ScanOptions options) Use aCursor
to iterate over elements in sorted set atkey
.zScore
(byte[] key, byte[] value) Get the score of element withvalue
from sorted set with keykey
.Get the score of element withvalue
from sorted set with keykey
.GetRedisZSetCommands
.Set<byte[]>
zUnion
(byte[]... sets) Union sortedsets
.Union sortedsets
.zUnionStore
(byte[] destKey, byte[]... sets) Union sortedsets
.zUnionStore
(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) Union sortedsets
and store result in destinationdestKey
.zUnionStore
(byte[] destKey, Aggregate aggregate, Weights weights, byte[]... sets) Union sortedsets
and store result in destinationdestKey
.zUnionStore
(String destKey, String... sets) Union sortedsets
and store result in destinationkey
.zUnionStore
(String destKey, Aggregate aggregate, int[] weights, String... sets) Union sortedsets
and store result in destinationkey
.zUnionWithScores
(byte[]... sets) Union sortedsets
.zUnionWithScores
(String... sets) Union sortedsets
.zUnionWithScores
(Aggregate aggregate, Weights weights, byte[]... sets) Union sortedsets
.zUnionWithScores
(Aggregate aggregate, Weights weights, String... sets) Union sortedsets
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.redis.connection.DefaultedRedisConnection
xRange, xRead, xReadGroup, xRevRange, zInterWithScores, zUnionWithScores
Methods inherited from interface org.springframework.data.redis.connection.RedisKeyCommands
restore, scan
Methods inherited from interface org.springframework.data.redis.connection.RedisListCommands
lPos
Methods inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
xAck, xAdd, xAdd, xClaim, xDel, xGroupDelConsumer, xPending, xPending, xPending, xPending, xPending
Methods inherited from interface org.springframework.data.redis.connection.RedisStringCommands
bitPos
Methods inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
zAdd, zAdd, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRevRangeByLex, zRevRangeByLex
Methods inherited from interface org.springframework.data.redis.connection.StringRedisConnection
bitPos, lPos, xAck, xAdd, xAdd, xClaim, xDel, xRange, xReadAsString, xReadAsString, xReadAsString, xReadGroupAsString, xReadGroupAsString, xReadGroupAsString, xRevRange, zInterWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRevRangeByLex, zRevRangeByLex, zUnionWithScores
-
Constructor Details
-
DefaultStringRedisConnection
Constructs a newDefaultStringRedisConnection
instance. UsesStringRedisSerializer
as underlying serializer.- Parameters:
connection
- Redis connection
-
DefaultStringRedisConnection
Constructs a newDefaultStringRedisConnection
instance.- Parameters:
connection
- Redis connectionserializer
- String serializer
-
-
Method Details
-
commands
Description copied from interface:RedisCommandsProvider
GetRedisCommands
.- Specified by:
commands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
geoCommands
Description copied from interface:RedisCommandsProvider
GetRedisGeoCommands
.- Specified by:
geoCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
hashCommands
Description copied from interface:RedisCommandsProvider
GetRedisHashCommands
.- Specified by:
hashCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
hyperLogLogCommands
Description copied from interface:RedisCommandsProvider
- Specified by:
hyperLogLogCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
keyCommands
Description copied from interface:RedisCommandsProvider
GetRedisKeyCommands
.- Specified by:
keyCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
listCommands
Description copied from interface:RedisCommandsProvider
GetRedisListCommands
.- Specified by:
listCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
setCommands
Description copied from interface:RedisCommandsProvider
GetRedisSetCommands
.- Specified by:
setCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
scriptingCommands
Description copied from interface:RedisCommandsProvider
- Specified by:
scriptingCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
serverCommands
Description copied from interface:RedisCommandsProvider
GetRedisServerCommands
.- Specified by:
serverCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
streamCommands
Description copied from interface:RedisCommandsProvider
GetRedisStreamCommands
.- Specified by:
streamCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
stringCommands
Description copied from interface:RedisCommandsProvider
GetRedisStringCommands
.- Specified by:
stringCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
zSetCommands
Description copied from interface:RedisCommandsProvider
GetRedisZSetCommands
.- Specified by:
zSetCommands
in interfaceRedisCommandsProvider
- Returns:
- never null.
-
append
Description copied from interface:RedisStringCommands
Append avalue
tokey
.- Specified by:
append
in interfaceDefaultedRedisConnection
- Specified by:
append
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
bgSave
public void bgSave()Description copied from interface:RedisServerCommands
Start background saving of db on server.- Specified by:
bgSave
in interfaceDefaultedRedisConnection
- Specified by:
bgSave
in interfaceRedisServerCommands
- See Also:
-
bgReWriteAof
public void bgReWriteAof()Description copied from interface:RedisServerCommands
Start an Append Only File rewrite process on server.- Specified by:
bgReWriteAof
in interfaceDefaultedRedisConnection
- Specified by:
bgReWriteAof
in interfaceRedisServerCommands
- See Also:
-
bLPop
Description copied from interface:RedisListCommands
Removes and returns first element from lists stored atkeys
.
Blocks connection until element available ortimeout
reached.- Specified by:
bLPop
in interfaceDefaultedRedisConnection
- Specified by:
bLPop
in interfaceRedisListCommands
- Parameters:
timeout
- seconds to block.keys
- must not be null.- Returns:
- empty
List
when no element could be popped and the timeout was reached. null when used in pipeline / transaction. - See Also:
-
bRPop
Description copied from interface:RedisListCommands
Removes and returns last element from lists stored atkeys
.
Blocks connection until element available ortimeout
reached.- Specified by:
bRPop
in interfaceDefaultedRedisConnection
- Specified by:
bRPop
in interfaceRedisListCommands
- Parameters:
timeout
- seconds to block.keys
- must not be null.- Returns:
- empty
List
when no element could be popped and the timeout was reached. null when used in pipeline / transaction. - See Also:
-
bRPopLPush
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) Description copied from interface:RedisListCommands
Remove the last element from list atsrcKey
, append it todstKey
and return its value.
Blocks connection until element available ortimeout
reached.- Specified by:
bRPopLPush
in interfaceDefaultedRedisConnection
- Specified by:
bRPopLPush
in interfaceRedisListCommands
- Parameters:
timeout
- seconds to block.srcKey
- must not be null.dstKey
- must not be null.- Returns:
- can be null.
- See Also:
-
close
Description copied from interface:RedisConnection
Closes (or quits) the connection.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceRedisConnection
- Throws:
RedisSystemException
-
copy
Description copied from interface:RedisKeyCommands
Copy givensourceKey
totargetKey
.- Specified by:
copy
in interfaceDefaultedRedisConnection
- Specified by:
copy
in interfaceRedisKeyCommands
- Parameters:
sourceKey
- must not be null.targetKey
- must not be null.replace
- whether to replace existing keys.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
dbSize
Description copied from interface:RedisServerCommands
Get the total number of available keys in currently selected database.- Specified by:
dbSize
in interfaceDefaultedRedisConnection
- Specified by:
dbSize
in interfaceRedisServerCommands
- Returns:
- null when used in pipeline / transaction.
- See Also:
-
decr
Description copied from interface:RedisStringCommands
Decrement an integer value stored as string value ofkey
by 1.- Specified by:
decr
in interfaceDefaultedRedisConnection
- Specified by:
decr
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
decrBy
Description copied from interface:RedisStringCommands
Decrement an integer value stored as string value ofkey
byvalue
.- Specified by:
decrBy
in interfaceDefaultedRedisConnection
- Specified by:
decrBy
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
del
Description copied from interface:RedisKeyCommands
Delete givenkeys
.- Specified by:
del
in interfaceDefaultedRedisConnection
- Specified by:
del
in interfaceRedisKeyCommands
- Parameters:
keys
- must not be null.- Returns:
- The number of keys that were removed. null when used in pipeline / transaction.
- See Also:
-
unlink
Description copied from interface:RedisKeyCommands
Unlink thekeys
from the keyspace. Unlike withRedisKeyCommands.del(byte[]...)
the actual memory reclaiming here happens asynchronously.- Specified by:
unlink
in interfaceDefaultedRedisConnection
- Specified by:
unlink
in interfaceRedisKeyCommands
- Parameters:
keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
discard
public void discard()Description copied from interface:RedisTxCommands
Discard all commands issued afterRedisTxCommands.multi()
.- Specified by:
discard
in interfaceRedisTxCommands
- See Also:
-
echo
public byte[] echo(byte[] message) Description copied from interface:RedisConnectionCommands
Returnsmessage
via server roundtrip.- Specified by:
echo
in interfaceRedisConnectionCommands
- Parameters:
message
- the message to echo.- Returns:
- the message or null when used in pipeline / transaction.
- See Also:
-
exec
Description copied from interface:RedisTxCommands
Executes all queued commands in a transaction started withRedisTxCommands.multi()
.
If used along withRedisTxCommands.watch(byte[]...)
the operation will fail if any of watched keys has been modified.- Specified by:
exec
in interfaceRedisTxCommands
- Returns:
- List of replies for each executed command.
- See Also:
-
exists
Description copied from interface:RedisKeyCommands
Determine if givenkey
exists.- Specified by:
exists
in interfaceDefaultedRedisConnection
- Specified by:
exists
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- true if key exists. null when used in pipeline / transaction.
- See Also:
-
exists
Description copied from interface:StringRedisConnection
Count how many of the givenkeys
exist.- Specified by:
exists
in interfaceStringRedisConnection
- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
exists
Description copied from interface:RedisKeyCommands
Count how many of the givenkeys
exist. Providing the very samekey
more than once also counts multiple times.- Specified by:
exists
in interfaceDefaultedRedisConnection
- Specified by:
exists
in interfaceRedisKeyCommands
- Parameters:
keys
- must not be null.- Returns:
- the number of keys existing among the ones specified as arguments. null when used in pipeline / transaction.
-
expire
Description copied from interface:RedisKeyCommands
Set time to live for givenkey
in seconds.- Specified by:
expire
in interfaceDefaultedRedisConnection
- Specified by:
expire
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
expireAt
Description copied from interface:RedisKeyCommands
Set the expiration for givenkey
as a UNIX timestamp.- Specified by:
expireAt
in interfaceDefaultedRedisConnection
- Specified by:
expireAt
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
flushAll
public void flushAll()Description copied from interface:RedisServerCommands
Delete all all keys from all databases.- Specified by:
flushAll
in interfaceDefaultedRedisConnection
- Specified by:
flushAll
in interfaceRedisServerCommands
- See Also:
-
flushAll
Description copied from interface:RedisServerCommands
Delete all all keys from all databases using the specifiedRedisServerCommands.FlushOption
.- Specified by:
flushAll
in interfaceDefaultedRedisConnection
- Specified by:
flushAll
in interfaceRedisServerCommands
- See Also:
-
flushDb
public void flushDb()Description copied from interface:RedisServerCommands
Delete all keys of the currently selected database.- Specified by:
flushDb
in interfaceDefaultedRedisConnection
- Specified by:
flushDb
in interfaceRedisServerCommands
- See Also:
-
flushDb
Description copied from interface:RedisServerCommands
Delete all keys of the currently selected database using the specifiedRedisServerCommands.FlushOption
.- Specified by:
flushDb
in interfaceDefaultedRedisConnection
- Specified by:
flushDb
in interfaceRedisServerCommands
- See Also:
-
get
public byte[] get(byte[] key) Description copied from interface:RedisStringCommands
Get the value ofkey
.- Specified by:
get
in interfaceDefaultedRedisConnection
- Specified by:
get
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
getDel
Description copied from interface:RedisStringCommands
Return the value atkey
and delete the key.- Specified by:
getDel
in interfaceDefaultedRedisConnection
- Specified by:
getDel
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
getDel
Description copied from interface:StringRedisConnection
Return the value atkey
and delete the key.- Specified by:
getDel
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
getEx
Description copied from interface:RedisStringCommands
Return the value atkey
and expire the key by applyingExpiration
.Use
Expiration.seconds(long)
forEX
.
UseExpiration.milliseconds(long)
forPX
.
UseExpiration.unixTimestamp(long, TimeUnit)
forEXAT | PXAT
.- Specified by:
getEx
in interfaceDefaultedRedisConnection
- Specified by:
getEx
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.expiration
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
getEx
Description copied from interface:StringRedisConnection
Return the value atkey
and expire the key by applyingExpiration
.- Specified by:
getEx
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.expiration
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
getBit
Description copied from interface:RedisStringCommands
Get the bit value atoffset
of value atkey
.- Specified by:
getBit
in interfaceDefaultedRedisConnection
- Specified by:
getBit
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
getConfig
Description copied from interface:RedisServerCommands
Load configuration parameters for givenpattern
from server.- Specified by:
getConfig
in interfaceDefaultedRedisConnection
- Specified by:
getConfig
in interfaceRedisServerCommands
- Parameters:
pattern
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
getNativeConnection
Description copied from interface:RedisConnection
Returns the native connection (the underlying library/driver object).- Specified by:
getNativeConnection
in interfaceRedisConnection
- Returns:
- underlying, native object
-
getRange
public byte[] getRange(byte[] key, long start, long end) Description copied from interface:RedisStringCommands
Get a substring of value ofkey
betweenstart
andend
.- Specified by:
getRange
in interfaceDefaultedRedisConnection
- Specified by:
getRange
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
getSet
public byte[] getSet(byte[] key, byte[] value) Description copied from interface:RedisStringCommands
Setvalue
ofkey
and return its old value.- Specified by:
getSet
in interfaceDefaultedRedisConnection
- Specified by:
getSet
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- null if key did not exist before or when used in pipeline / transaction.
- See Also:
-
getSubscription
Description copied from interface:RedisPubSubCommands
Returns the current subscription for this connection or null if the connection is not subscribed.- Specified by:
getSubscription
in interfaceRedisPubSubCommands
- Returns:
- the current subscription, null if none is available.
-
hDel
Description copied from interface:RedisHashCommands
Delete given hashfields
.- Specified by:
hDel
in interfaceDefaultedRedisConnection
- Specified by:
hDel
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.fields
- must not be empty.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
hExists
Description copied from interface:RedisHashCommands
Determine if given hashfield
exists.- Specified by:
hExists
in interfaceDefaultedRedisConnection
- Specified by:
hExists
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
hGet
public byte[] hGet(byte[] key, byte[] field) Description copied from interface:RedisHashCommands
Get value for givenfield
from hash atkey
.- Specified by:
hGet
in interfaceDefaultedRedisConnection
- Specified by:
hGet
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- null when key or field do not exists or when used in pipeline / transaction.
- See Also:
-
hGetAll
Description copied from interface:RedisHashCommands
Get entire hash stored atkey
.- Specified by:
hGetAll
in interfaceDefaultedRedisConnection
- Specified by:
hGetAll
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Map
if key does not exist or null when used in pipeline / transaction. - See Also:
-
hIncrBy
Description copied from interface:RedisHashCommands
Incrementvalue
of a hashfield
by the givendelta
.- Specified by:
hIncrBy
in interfaceDefaultedRedisConnection
- Specified by:
hIncrBy
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
hIncrBy
Description copied from interface:RedisHashCommands
Incrementvalue
of a hashfield
by the givendelta
.- Specified by:
hIncrBy
in interfaceDefaultedRedisConnection
- Specified by:
hIncrBy
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
hKeys
Description copied from interface:RedisHashCommands
Get key set (fields) of hash atkey
.- Specified by:
hKeys
in interfaceDefaultedRedisConnection
- Specified by:
hKeys
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
hLen
Description copied from interface:RedisHashCommands
Get size of hash atkey
.- Specified by:
hLen
in interfaceDefaultedRedisConnection
- Specified by:
hLen
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
hMGet
Description copied from interface:RedisHashCommands
Get values for givenfields
from hash atkey
. Values are in the order of the requested keys Absent field values are represented usingnull
in the resultingList
.- Specified by:
hMGet
in interfaceDefaultedRedisConnection
- Specified by:
hMGet
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.fields
- must not be empty.- Returns:
- empty
List
if key does not exist. null when used in pipeline / transaction. - See Also:
-
hMSet
Description copied from interface:RedisHashCommands
Set multiple hash fields to multiple values using data provided inhashes
- Specified by:
hMSet
in interfaceDefaultedRedisConnection
- Specified by:
hMSet
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.hashes
- must not be null.- See Also:
-
hSet
Description copied from interface:RedisHashCommands
Set thevalue
of a hashfield
.- Specified by:
hSet
in interfaceDefaultedRedisConnection
- Specified by:
hSet
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.field
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
hSetNX
Description copied from interface:RedisHashCommands
Set thevalue
of a hashfield
only iffield
does not exist.- Specified by:
hSetNX
in interfaceDefaultedRedisConnection
- Specified by:
hSetNX
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.field
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
hVals
Description copied from interface:RedisHashCommands
Get entry set (values) of hash atfield
.- Specified by:
hVals
in interfaceDefaultedRedisConnection
- Specified by:
hVals
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.- Returns:
- empty
List
if key does not exist. null when used in pipeline / transaction. - See Also:
-
incr
Description copied from interface:RedisStringCommands
Increment an integer value stored as string value ofkey
by 1.- Specified by:
incr
in interfaceDefaultedRedisConnection
- Specified by:
incr
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
incrBy
Description copied from interface:RedisStringCommands
Increment an integer value stored ofkey
bydelta
.- Specified by:
incrBy
in interfaceDefaultedRedisConnection
- Specified by:
incrBy
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
incrBy
Description copied from interface:RedisStringCommands
Increment a floating point number value ofkey
bydelta
.- Specified by:
incrBy
in interfaceDefaultedRedisConnection
- Specified by:
incrBy
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
info
Description copied from interface:RedisServerCommands
Load default server information like- memory
- cpu utilization
- replication
- Specified by:
info
in interfaceDefaultedRedisConnection
- Specified by:
info
in interfaceRedisServerCommands
- Returns:
- null when used in pipeline / transaction.
- See Also:
-
info
Description copied from interface:RedisServerCommands
Load server information for givenselection
.- Specified by:
info
in interfaceDefaultedRedisConnection
- Specified by:
info
in interfaceRedisServerCommands
- Returns:
- null when used in pipeline / transaction.
- See Also:
-
isClosed
public boolean isClosed()Description copied from interface:RedisConnection
Indicates whether the underlying connection is closed or not.- Specified by:
isClosed
in interfaceRedisConnection
- Returns:
- true if the connection is closed, false otherwise.
-
isQueueing
public boolean isQueueing()Description copied from interface:RedisConnection
Indicates whether the connection is in "queue"(or "MULTI") mode or not. When queueing, all commands are postponed until EXEC or DISCARD commands are issued. Since in queueing no results are returned, the connection will return NULL on all operations that interact with the data.- Specified by:
isQueueing
in interfaceRedisConnection
- Returns:
- true if the connection is in queue/MULTI mode, false otherwise
-
isSubscribed
public boolean isSubscribed()Description copied from interface:RedisPubSubCommands
Indicates whether the current connection is subscribed (to at least one channel) or not.- Specified by:
isSubscribed
in interfaceRedisPubSubCommands
- Returns:
- true if the connection is subscribed, false otherwise
-
keys
Description copied from interface:RedisKeyCommands
Find all keys matching the givenpattern
.- Specified by:
keys
in interfaceDefaultedRedisConnection
- Specified by:
keys
in interfaceRedisKeyCommands
- Parameters:
pattern
- must not be null.- Returns:
- empty
Set
if no match found. null when used in pipeline / transaction. - See Also:
-
lastSave
Description copied from interface:RedisServerCommands
Get time of lastRedisServerCommands.bgSave()
operation in seconds.- Specified by:
lastSave
in interfaceDefaultedRedisConnection
- Specified by:
lastSave
in interfaceRedisServerCommands
- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lIndex
public byte[] lIndex(byte[] key, long index) Description copied from interface:RedisListCommands
Get element atindex
form list atkey
.- Specified by:
lIndex
in interfaceDefaultedRedisConnection
- Specified by:
lIndex
in interfaceRedisListCommands
- Parameters:
key
- must not be null.index
- zero based index value. Use negative number to designate elements starting at the tail.- Returns:
- null when index is out of range or when used in pipeline / transaction.
- See Also:
-
lInsert
Description copied from interface:RedisListCommands
Insertvalue
RedisListCommands.Position.BEFORE
orRedisListCommands.Position.AFTER
existingpivot
forkey
.- Specified by:
lInsert
in interfaceDefaultedRedisConnection
- Specified by:
lInsert
in interfaceRedisListCommands
- Parameters:
key
- must not be null.where
- must not be null.pivot
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lMove
public byte[] lMove(byte[] sourceKey, byte[] destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to) Description copied from interface:RedisListCommands
Atomically returns and removes the first/last element (head/tail depending on thefrom
argument) of the list stored atsourceKey
, and pushes the element at the first/last element (head/tail depending on theto
argument) of the list stored atdestinationKey
.- Specified by:
lMove
in interfaceDefaultedRedisConnection
- Specified by:
lMove
in interfaceRedisListCommands
- Parameters:
sourceKey
- must not be null.destinationKey
- must not be null.from
- must not be null.to
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
bLMove
public byte[] bLMove(byte[] sourceKey, byte[] destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to, double timeout) Description copied from interface:RedisListCommands
Atomically returns and removes the first/last element (head/tail depending on thefrom
argument) of the list stored atsourceKey
, and pushes the element at the first/last element (head/tail depending on theto
argument) of the list stored atdestinationKey
.Blocks connection until element available or
timeout
reached.- Specified by:
bLMove
in interfaceDefaultedRedisConnection
- Specified by:
bLMove
in interfaceRedisListCommands
- Parameters:
sourceKey
- must not be null.destinationKey
- must not be null.from
- must not be null.to
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lMove
public String lMove(String sourceKey, String destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to) Description copied from interface:StringRedisConnection
Atomically returns and removes the first/last element (head/tail depending on thefrom
argument) of the list stored atsourceKey
, and pushes the element at the first/last element (head/tail depending on theto
argument) of the list stored atdestinationKey
.- Specified by:
lMove
in interfaceStringRedisConnection
- Parameters:
sourceKey
- must not be null.destinationKey
- must not be null.from
- must not be null.to
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
bLMove
public String bLMove(String sourceKey, String destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to, double timeout) Description copied from interface:StringRedisConnection
Atomically returns and removes the first/last element (head/tail depending on thefrom
argument) of the list stored atsourceKey
, and pushes the element at the first/last element (head/tail depending on theto
argument) of the list stored atdestinationKey
.- Specified by:
bLMove
in interfaceStringRedisConnection
- Parameters:
sourceKey
- must not be null.destinationKey
- must not be null.from
- must not be null.to
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lLen
Description copied from interface:RedisListCommands
Get the size of list stored atkey
.- Specified by:
lLen
in interfaceDefaultedRedisConnection
- Specified by:
lLen
in interfaceRedisListCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lPop
public byte[] lPop(byte[] key) Description copied from interface:RedisListCommands
Removes and returns first element in list stored atkey
.- Specified by:
lPop
in interfaceDefaultedRedisConnection
- Specified by:
lPop
in interfaceRedisListCommands
- Parameters:
key
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
lPop
Description copied from interface:RedisListCommands
Removes and returns first elements in list stored atkey
.- Specified by:
lPop
in interfaceDefaultedRedisConnection
- Specified by:
lPop
in interfaceRedisListCommands
- Parameters:
key
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
lPos
Description copied from interface:RedisListCommands
Returns the index of matching elements inside the list stored at given key.
Requires Redis 6.0.6 or newer.- Specified by:
lPos
in interfaceDefaultedRedisConnection
- Specified by:
lPos
in interfaceRedisListCommands
- Parameters:
key
- must not be null.element
- must not be null.rank
- specifies the "rank" of the first element to return, in case there are multiple matches. A rank of 1 means to return the first match, 2 to return the second match, and so forth.count
- number of matches to return.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lPush
Description copied from interface:RedisListCommands
Prependvalues
tokey
.- Specified by:
lPush
in interfaceDefaultedRedisConnection
- Specified by:
lPush
in interfaceRedisListCommands
- Parameters:
key
- must not be null.values
- must not be empty.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lPushX
Description copied from interface:RedisListCommands
Prependvalues
tokey
only if the list exists.- Specified by:
lPushX
in interfaceDefaultedRedisConnection
- Specified by:
lPushX
in interfaceRedisListCommands
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lRange
Description copied from interface:RedisListCommands
Get elements betweenstart
andend
from list atkey
.- Specified by:
lRange
in interfaceDefaultedRedisConnection
- Specified by:
lRange
in interfaceRedisListCommands
- Parameters:
key
- must not be null.- Returns:
- empty
List
if key does not exists or range does not contain values. null when used in pipeline / transaction. - See Also:
-
lRem
Description copied from interface:RedisListCommands
Removes the firstcount
occurrences ofvalue
from the list stored atkey
.- Specified by:
lRem
in interfaceDefaultedRedisConnection
- Specified by:
lRem
in interfaceRedisListCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lSet
public void lSet(byte[] key, long index, byte[] value) Description copied from interface:RedisListCommands
Set thevalue
list element atindex
.- Specified by:
lSet
in interfaceDefaultedRedisConnection
- Specified by:
lSet
in interfaceRedisListCommands
- Parameters:
key
- must not be null.- See Also:
-
lTrim
public void lTrim(byte[] key, long start, long end) Description copied from interface:RedisListCommands
Trim list atkey
to elements betweenstart
andend
.- Specified by:
lTrim
in interfaceDefaultedRedisConnection
- Specified by:
lTrim
in interfaceRedisListCommands
- Parameters:
key
- must not be null.- See Also:
-
mGet
Description copied from interface:RedisStringCommands
Get multiplekeys
. Values are in the order of the requested keys Absent field values are represented usingnull
in the resultingList
.- Specified by:
mGet
in interfaceDefaultedRedisConnection
- Specified by:
mGet
in interfaceRedisStringCommands
- Parameters:
keys
- must not be null.- Returns:
null
when used in pipeline / transaction.- See Also:
-
mSet
Description copied from interface:RedisStringCommands
Set multiple keys to multiple values using key-value pairs provided intuple
.- Specified by:
mSet
in interfaceDefaultedRedisConnection
- Specified by:
mSet
in interfaceRedisStringCommands
- Parameters:
tuple
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
mSetNX
Description copied from interface:RedisStringCommands
Set multiple keys to multiple values using key-value pairs provided intuple
only if the provided key does not exist.- Specified by:
mSetNX
in interfaceDefaultedRedisConnection
- Specified by:
mSetNX
in interfaceRedisStringCommands
- Parameters:
tuple
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
multi
public void multi()Description copied from interface:RedisTxCommands
Mark the start of a transaction block.
Commands will be queued and can then be executed by callingRedisTxCommands.exec()
or rolled back usingRedisTxCommands.discard()
- Specified by:
multi
in interfaceRedisTxCommands
- See Also:
-
persist
Description copied from interface:RedisKeyCommands
Remove the expiration from givenkey
.- Specified by:
persist
in interfaceDefaultedRedisConnection
- Specified by:
persist
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
move
Description copied from interface:RedisKeyCommands
Move givenkey
to database withindex
.- Specified by:
move
in interfaceDefaultedRedisConnection
- Specified by:
move
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
ping
Description copied from interface:RedisConnectionCommands
Test connection.- Specified by:
ping
in interfaceRedisConnectionCommands
- Returns:
- Server response message - usually PONG. null when used in pipeline / transaction.
- See Also:
-
pSubscribe
Description copied from interface:RedisPubSubCommands
Subscribes the connection to all channels matching the given patterns. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.Note that this operation is blocking and the current thread starts waiting for new messages immediately.
- Specified by:
pSubscribe
in interfaceRedisPubSubCommands
- Parameters:
listener
- message listener, must not be null.patterns
- channel name patterns, must not be null.- See Also:
-
publish
Description copied from interface:RedisPubSubCommands
Publishes the given message to the given channel.- Specified by:
publish
in interfaceRedisPubSubCommands
- Parameters:
channel
- the channel to publish to. Must not be null.message
- message to publish. Must not be null.- Returns:
- the number of clients that received the message or null when used in pipeline / transaction.
- See Also:
-
randomKey
public byte[] randomKey()Description copied from interface:RedisKeyCommands
Return a random key from the keyspace.- Specified by:
randomKey
in interfaceDefaultedRedisConnection
- Specified by:
randomKey
in interfaceRedisKeyCommands
- Returns:
- null if no keys available or when used in pipeline or transaction.
- See Also:
-
rename
public void rename(byte[] oldKey, byte[] newKey) Description copied from interface:RedisKeyCommands
Rename keyoldKey
tonewKey
.- Specified by:
rename
in interfaceDefaultedRedisConnection
- Specified by:
rename
in interfaceRedisKeyCommands
- Parameters:
oldKey
- must not be null.newKey
- must not be null.- See Also:
-
renameNX
Description copied from interface:RedisKeyCommands
Rename keyoldKey
tonewKey
only ifnewKey
does not exist.- Specified by:
renameNX
in interfaceDefaultedRedisConnection
- Specified by:
renameNX
in interfaceRedisKeyCommands
- Parameters:
oldKey
- must not be null.newKey
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
resetConfigStats
public void resetConfigStats()Description copied from interface:RedisServerCommands
Reset statistic counters on server.
Counters can be retrieved usingRedisServerCommands.info()
.- Specified by:
resetConfigStats
in interfaceDefaultedRedisConnection
- Specified by:
resetConfigStats
in interfaceRedisServerCommands
- See Also:
-
rewriteConfig
public void rewriteConfig()Description copied from interface:RedisServerCommands
Rewrites theredis.conf
file.- Specified by:
rewriteConfig
in interfaceDefaultedRedisConnection
- Specified by:
rewriteConfig
in interfaceRedisServerCommands
- See Also:
-
rPop
public byte[] rPop(byte[] key) Description copied from interface:RedisListCommands
Removes and returns last element in list stored atkey
.- Specified by:
rPop
in interfaceDefaultedRedisConnection
- Specified by:
rPop
in interfaceRedisListCommands
- Parameters:
key
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
rPop
Description copied from interface:RedisListCommands
Removes and returns last elements in list stored atkey
.- Specified by:
rPop
in interfaceDefaultedRedisConnection
- Specified by:
rPop
in interfaceRedisListCommands
- Parameters:
key
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
rPopLPush
public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) Description copied from interface:RedisListCommands
Remove the last element from list atsrcKey
, append it todstKey
and return its value.- Specified by:
rPopLPush
in interfaceDefaultedRedisConnection
- Specified by:
rPopLPush
in interfaceRedisListCommands
- Parameters:
srcKey
- must not be null.dstKey
- must not be null.- Returns:
- can be null.
- See Also:
-
rPush
Description copied from interface:RedisListCommands
Appendvalues
tokey
.- Specified by:
rPush
in interfaceDefaultedRedisConnection
- Specified by:
rPush
in interfaceRedisListCommands
- Parameters:
key
- must not be null.values
- must not be empty.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
rPushX
Description copied from interface:RedisListCommands
Appendvalues
tokey
only if the list exists.- Specified by:
rPushX
in interfaceDefaultedRedisConnection
- Specified by:
rPushX
in interfaceRedisListCommands
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sAdd
Description copied from interface:RedisSetCommands
Add givenvalues
to set atkey
.- Specified by:
sAdd
in interfaceDefaultedRedisConnection
- Specified by:
sAdd
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.values
- must not be empty.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
save
public void save()Description copied from interface:RedisServerCommands
Synchronous save current db snapshot on server.- Specified by:
save
in interfaceDefaultedRedisConnection
- Specified by:
save
in interfaceRedisServerCommands
- See Also:
-
sCard
Description copied from interface:RedisSetCommands
Get size of set atkey
.- Specified by:
sCard
in interfaceDefaultedRedisConnection
- Specified by:
sCard
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sDiff
Description copied from interface:RedisSetCommands
Diff all sets for givenkeys
.- Specified by:
sDiff
in interfaceDefaultedRedisConnection
- Specified by:
sDiff
in interfaceRedisSetCommands
- Parameters:
keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sDiffStore
Description copied from interface:RedisSetCommands
Diff all sets for givenkeys
and store result indestKey
.- Specified by:
sDiffStore
in interfaceDefaultedRedisConnection
- Specified by:
sDiffStore
in interfaceRedisSetCommands
- Parameters:
destKey
- must not be null.keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
select
public void select(int dbIndex) Description copied from interface:RedisConnectionCommands
Select the DB with given positivedbIndex
.- Specified by:
select
in interfaceRedisConnectionCommands
- Parameters:
dbIndex
- the database index.- See Also:
-
set
Description copied from interface:RedisStringCommands
Setvalue
forkey
.- Specified by:
set
in interfaceDefaultedRedisConnection
- Specified by:
set
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
set
public Boolean set(byte[] key, byte[] value, Expiration expiration, RedisStringCommands.SetOption option) Description copied from interface:RedisStringCommands
Setvalue
forkey
applying timeouts fromexpiration
if set and inserting/updating values depending onoption
.- Specified by:
set
in interfaceDefaultedRedisConnection
- Specified by:
set
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.value
- must not be null.expiration
- must not be null. UseExpiration.persistent()
to not set any ttl orExpiration.keepTtl()
to keep the existing expiration.option
- must not be null. UseRedisStringCommands.SetOption.upsert()
to add non existing.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
setBit
Description copied from interface:RedisStringCommands
Sets the bit atoffset
in value stored atkey
.- Specified by:
setBit
in interfaceDefaultedRedisConnection
- Specified by:
setBit
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- the original bit value stored at
offset
or null when used in pipeline / transaction. - See Also:
-
setConfig
Description copied from interface:RedisServerCommands
Set server configuration forparam
tovalue
.- Specified by:
setConfig
in interfaceDefaultedRedisConnection
- Specified by:
setConfig
in interfaceRedisServerCommands
- Parameters:
param
- must not be null.value
- must not be null.- See Also:
-
setEx
Description copied from interface:RedisStringCommands
Set thevalue
and expiration inseconds
forkey
.- Specified by:
setEx
in interfaceDefaultedRedisConnection
- Specified by:
setEx
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
pSetEx
Description copied from interface:RedisStringCommands
Set thevalue
and expiration inmilliseconds
forkey
.- Specified by:
pSetEx
in interfaceDefaultedRedisConnection
- Specified by:
pSetEx
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
setNX
Description copied from interface:RedisStringCommands
Setvalue
forkey
, only ifkey
does not exist.- Specified by:
setNX
in interfaceDefaultedRedisConnection
- Specified by:
setNX
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
setRange
public void setRange(byte[] key, byte[] value, long start) Description copied from interface:RedisStringCommands
Overwrite parts ofkey
starting at the specifiedoffset
with givenvalue
.- Specified by:
setRange
in interfaceDefaultedRedisConnection
- Specified by:
setRange
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- See Also:
-
shutdown
public void shutdown()Description copied from interface:RedisServerCommands
Shutdown server.- Specified by:
shutdown
in interfaceDefaultedRedisConnection
- Specified by:
shutdown
in interfaceRedisServerCommands
- See Also:
-
shutdown
Description copied from interface:RedisServerCommands
Shutdown server.- Specified by:
shutdown
in interfaceDefaultedRedisConnection
- Specified by:
shutdown
in interfaceRedisServerCommands
- See Also:
-
sInter
Description copied from interface:RedisSetCommands
Returns the members intersecting all given sets atkeys
.- Specified by:
sInter
in interfaceDefaultedRedisConnection
- Specified by:
sInter
in interfaceRedisSetCommands
- Parameters:
keys
- must not be null.- Returns:
- empty
Set
if no intersection found. null when used in pipeline / transaction. - See Also:
-
sInterStore
Description copied from interface:RedisSetCommands
Intersect all given sets atkeys
and store result indestKey
.- Specified by:
sInterStore
in interfaceDefaultedRedisConnection
- Specified by:
sInterStore
in interfaceRedisSetCommands
- Parameters:
destKey
- must not be null.keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sIsMember
Description copied from interface:RedisSetCommands
Check if set atkey
containsvalue
.- Specified by:
sIsMember
in interfaceDefaultedRedisConnection
- Specified by:
sIsMember
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sMIsMember
Description copied from interface:RedisSetCommands
Check if set atkey
contains one or morevalues
.- Specified by:
sMIsMember
in interfaceDefaultedRedisConnection
- Specified by:
sMIsMember
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.values
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sMembers
Description copied from interface:RedisSetCommands
Get all elements of set atkey
.- Specified by:
sMembers
in interfaceDefaultedRedisConnection
- Specified by:
sMembers
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exist. null when used in pipeline / transaction. - See Also:
-
sMove
Description copied from interface:RedisSetCommands
Movevalue
fromsrcKey
todestKey
- Specified by:
sMove
in interfaceDefaultedRedisConnection
- Specified by:
sMove
in interfaceRedisSetCommands
- Parameters:
srcKey
- must not be null.destKey
- must not be null.value
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sort
Description copied from interface:RedisKeyCommands
Sort the elements forkey
and store result instoreKey
.- Specified by:
sort
in interfaceDefaultedRedisConnection
- Specified by:
sort
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.params
- must not be null.storeKey
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sort
Description copied from interface:RedisKeyCommands
Sort the elements forkey
.- Specified by:
sort
in interfaceDefaultedRedisConnection
- Specified by:
sort
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.params
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
encodingOf
Description copied from interface:RedisKeyCommands
Get the type of internal representation used for storing the value at the givenkey
.- Specified by:
encodingOf
in interfaceDefaultedRedisConnection
- Specified by:
encodingOf
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
ValueEncoding.RedisValueEncoding.VACANT
if key does not exist or null when used in pipeline / transaction.- See Also:
-
idletime
Description copied from interface:RedisKeyCommands
Get theDuration
since the object stored at the givenkey
is idle.- Specified by:
idletime
in interfaceDefaultedRedisConnection
- Specified by:
idletime
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
refcount
Description copied from interface:RedisKeyCommands
Get the number of references of the value associated with the specifiedkey
.- Specified by:
refcount
in interfaceDefaultedRedisConnection
- Specified by:
refcount
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
sPop
public byte[] sPop(byte[] key) Description copied from interface:RedisSetCommands
Remove and return a random member from set atkey
.- Specified by:
sPop
in interfaceDefaultedRedisConnection
- Specified by:
sPop
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- See Also:
-
sPop
Description copied from interface:RedisSetCommands
Remove and returncount
random members from set atkey
.- Specified by:
sPop
in interfaceDefaultedRedisConnection
- Specified by:
sPop
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.count
- number of random members to pop from the set.- Returns:
- empty
List
if set does not exist. null when used in pipeline / transaction. - See Also:
-
sRandMember
public byte[] sRandMember(byte[] key) Description copied from interface:RedisSetCommands
Get random element from set atkey
.- Specified by:
sRandMember
in interfaceDefaultedRedisConnection
- Specified by:
sRandMember
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.- Returns:
- can be null.
- See Also:
-
sRandMember
Description copied from interface:RedisSetCommands
Getcount
random elements from set atkey
.- Specified by:
sRandMember
in interfaceDefaultedRedisConnection
- Specified by:
sRandMember
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sRem
Description copied from interface:RedisSetCommands
Remove givenvalues
from set atkey
and return the number of removed elements.- Specified by:
sRem
in interfaceDefaultedRedisConnection
- Specified by:
sRem
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.values
- must not be empty.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
strLen
Description copied from interface:RedisStringCommands
Get the length of the value stored atkey
.- Specified by:
strLen
in interfaceDefaultedRedisConnection
- Specified by:
strLen
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
bitCount
Description copied from interface:RedisStringCommands
Count the number of set bits (population counting) in value stored atkey
.- Specified by:
bitCount
in interfaceDefaultedRedisConnection
- Specified by:
bitCount
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
bitCount
Description copied from interface:RedisStringCommands
Count the number of set bits (population counting) of value stored atkey
betweenstart
andend
.- Specified by:
bitCount
in interfaceDefaultedRedisConnection
- Specified by:
bitCount
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
bitOp
Description copied from interface:RedisStringCommands
Perform bitwise operations between strings.- Specified by:
bitOp
in interfaceDefaultedRedisConnection
- Specified by:
bitOp
in interfaceRedisStringCommands
- Parameters:
op
- must not be null.destination
- must not be null.keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
bitPos
@Nullable public Long bitPos(byte[] key, boolean bit, org.springframework.data.domain.Range<Long> range) Description copied from interface:RedisStringCommands
Return the position of the first bit set to givenbit
in a string.Range
start and end can contain negative values in order to index bytes starting from the end of the string, where -1 is the last byte, -2 is the penultimate.- Specified by:
bitPos
in interfaceDefaultedRedisConnection
- Specified by:
bitPos
in interfaceRedisStringCommands
- Parameters:
key
- the key holding the actual String.bit
- the bit value to look for.range
- must not be null. UseRange.unbounded()
to not limit search.- Returns:
- null when used in pipeline / transaction. The position of the first bit set to 1 or 0 according to the request.
- See Also:
-
subscribe
Description copied from interface:RedisPubSubCommands
Subscribes the connection to the given channels. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.Note that this operation is blocking and the current thread starts waiting for new messages immediately.
- Specified by:
subscribe
in interfaceRedisPubSubCommands
- Parameters:
listener
- message listener, must not be null.channels
- channel names, must not be null.- See Also:
-
sUnion
Description copied from interface:RedisSetCommands
Union all sets at givenkeys
.- Specified by:
sUnion
in interfaceDefaultedRedisConnection
- Specified by:
sUnion
in interfaceRedisSetCommands
- Parameters:
keys
- must not be null.- Returns:
- empty
Set
if keys do not exist. null when used in pipeline / transaction. - See Also:
-
sUnionStore
Description copied from interface:RedisSetCommands
Union all sets at givenkeys
and store result indestKey
.- Specified by:
sUnionStore
in interfaceDefaultedRedisConnection
- Specified by:
sUnionStore
in interfaceRedisSetCommands
- Parameters:
destKey
- must not be null.keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
ttl
Description copied from interface:RedisKeyCommands
Get the time to live forkey
in seconds.- Specified by:
ttl
in interfaceDefaultedRedisConnection
- Specified by:
ttl
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
ttl
Description copied from interface:RedisKeyCommands
Get the time to live forkey
in and convert it to the givenTimeUnit
.- Specified by:
ttl
in interfaceDefaultedRedisConnection
- Specified by:
ttl
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.timeUnit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
type
Description copied from interface:RedisKeyCommands
Determine the type stored atkey
.- Specified by:
type
in interfaceDefaultedRedisConnection
- Specified by:
type
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
touch
Description copied from interface:RedisKeyCommands
Alter the last access time of givenkey(s)
.- Specified by:
touch
in interfaceDefaultedRedisConnection
- Specified by:
touch
in interfaceRedisKeyCommands
- Parameters:
keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
unwatch
public void unwatch()Description copied from interface:RedisTxCommands
Flushes all the previouslyRedisTxCommands.watch(byte[]...)
keys.- Specified by:
unwatch
in interfaceRedisTxCommands
- See Also:
-
watch
public void watch(byte[]... keys) Description copied from interface:RedisTxCommands
Watch givenkeys
for modifications during transaction started withRedisTxCommands.multi()
.- Specified by:
watch
in interfaceRedisTxCommands
- Parameters:
keys
- must not be null.- See Also:
-
zAdd
Description copied from interface:RedisZSetCommands
- Specified by:
zAdd
in interfaceDefaultedRedisConnection
- Specified by:
zAdd
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.score
- the score.value
- the value.args
- must not be null useRedisZSetCommands.ZAddArgs.empty()
instead.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zAdd
Description copied from interface:RedisZSetCommands
- Specified by:
zAdd
in interfaceDefaultedRedisConnection
- Specified by:
zAdd
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.tuples
- must not be null.args
- must not be null useRedisZSetCommands.ZAddArgs.empty()
instead.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zCard
Description copied from interface:RedisZSetCommands
Get the size of sorted set withkey
.- Specified by:
zCard
in interfaceDefaultedRedisConnection
- Specified by:
zCard
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zCount
Description copied from interface:RedisZSetCommands
Count number of elements within sorted set with scores betweenmin
andmax
.- Specified by:
zCount
in interfaceDefaultedRedisConnection
- Specified by:
zCount
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zCount
Description copied from interface:RedisZSetCommands
Count number of elements within sorted set with scores betweenRange#min
andRange#max
.- Specified by:
zCount
in interfaceDefaultedRedisConnection
- Specified by:
zCount
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zIncrBy
Description copied from interface:RedisZSetCommands
Increment the score of element withvalue
in sorted set byincrement
.- Specified by:
zIncrBy
in interfaceDefaultedRedisConnection
- Specified by:
zIncrBy
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.value
- the value.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zDiff
Description copied from interface:RedisZSetCommands
Diff sortedsets
.- Specified by:
zDiff
in interfaceDefaultedRedisConnection
- Specified by:
zDiff
in interfaceRedisZSetCommands
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zDiffWithScores
Description copied from interface:RedisZSetCommands
Diff sortedsets
.- Specified by:
zDiffWithScores
in interfaceDefaultedRedisConnection
- Specified by:
zDiffWithScores
in interfaceRedisZSetCommands
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zDiffStore
Description copied from interface:RedisZSetCommands
Diff sortedsets
and store result in destinationdestKey
.- Specified by:
zDiffStore
in interfaceDefaultedRedisConnection
- Specified by:
zDiffStore
in interfaceRedisZSetCommands
- Parameters:
destKey
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zDiff
Description copied from interface:StringRedisConnection
Diff sortedsets
.- Specified by:
zDiff
in interfaceStringRedisConnection
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zDiffWithScores
Description copied from interface:StringRedisConnection
Diff sortedsets
.- Specified by:
zDiffWithScores
in interfaceStringRedisConnection
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zDiffStore
Description copied from interface:StringRedisConnection
Diff sortedsets
and store result in destinationdestKey
.- Specified by:
zDiffStore
in interfaceStringRedisConnection
- Parameters:
destKey
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zInter
Description copied from interface:RedisZSetCommands
Intersect sortedsets
.- Specified by:
zInter
in interfaceDefaultedRedisConnection
- Specified by:
zInter
in interfaceRedisZSetCommands
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zInterWithScores
Description copied from interface:RedisZSetCommands
Intersect sortedsets
.- Specified by:
zInterWithScores
in interfaceDefaultedRedisConnection
- Specified by:
zInterWithScores
in interfaceRedisZSetCommands
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zInterWithScores
Description copied from interface:RedisZSetCommands
Intersect sortedsets
.- Specified by:
zInterWithScores
in interfaceDefaultedRedisConnection
- Specified by:
zInterWithScores
in interfaceRedisZSetCommands
- Parameters:
aggregate
- must not be null.weights
- must not be null.sets
- must not be null.- Returns:
- See Also:
-
zInter
Description copied from interface:StringRedisConnection
Intersect sortedsets
.- Specified by:
zInter
in interfaceStringRedisConnection
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zInterWithScores
Description copied from interface:StringRedisConnection
Intersect sortedsets
.- Specified by:
zInterWithScores
in interfaceStringRedisConnection
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zInterWithScores
@Nullable public Set<StringRedisConnection.StringTuple> zInterWithScores(Aggregate aggregate, Weights weights, String... sets) Description copied from interface:StringRedisConnection
Intersect sortedsets
.- Specified by:
zInterWithScores
in interfaceStringRedisConnection
- Parameters:
aggregate
- must not be null.weights
- must not be null.sets
- must not be null.- Returns:
- See Also:
-
zInterStore
@Nullable public Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) Description copied from interface:RedisZSetCommands
Intersect sortedsets
and store result in destinationdestKey
.- Specified by:
zInterStore
in interfaceDefaultedRedisConnection
- Specified by:
zInterStore
in interfaceRedisZSetCommands
- Parameters:
destKey
- must not be null.aggregate
- must not be null.weights
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zInterStore
Description copied from interface:RedisZSetCommands
Intersect sortedsets
and store result in destinationdestKey
.- Specified by:
zInterStore
in interfaceDefaultedRedisConnection
- Specified by:
zInterStore
in interfaceRedisZSetCommands
- Parameters:
destKey
- must not be null.aggregate
- must not be null.weights
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zInterStore
Description copied from interface:RedisZSetCommands
Intersect sortedsets
and store result in destinationdestKey
.- Specified by:
zInterStore
in interfaceDefaultedRedisConnection
- Specified by:
zInterStore
in interfaceRedisZSetCommands
- Parameters:
destKey
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRange
Description copied from interface:RedisZSetCommands
Get elements betweenstart
andend
from sorted set.- Specified by:
zRange
in interfaceDefaultedRedisConnection
- Specified by:
zRange
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRangeByScore
Description copied from interface:RedisZSetCommands
Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.- Specified by:
zRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRangeByScore
public Set<byte[]> zRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Description copied from interface:RedisZSetCommands
Get elements where score is betweenRange#min
andRange#max
from sorted set.- Specified by:
zRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeByScore
public Set<byte[]> zRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Description copied from interface:RedisZSetCommands
Get elements in range fromLimit#count
toLimit#offset
where score is betweenRange#min
andRange#max
from sorted set.- Specified by:
zRangeByScore
in interfaceDefaultedRedisConnection
- Specified by:
zRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeByScoreWithScores
public Set<Tuple> zRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Description copied from interface:RedisZSetCommands
- Specified by:
zRangeByScoreWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRangeByScore
Description copied from interface:RedisZSetCommands
Get elements where score is betweenmin
andmax
from sorted set.- Specified by:
zRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRangeByScoreWithScores
public Set<Tuple> zRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count) Description copied from interface:RedisZSetCommands
- Specified by:
zRangeByScoreWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRangeByScoreWithScores
public Set<Tuple> zRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Description copied from interface:RedisZSetCommands
Get set ofTuple
s in range fromLimit#offset
toLimit#offset + Limit#count
where score is betweenRange#min
andRange#max
from sorted set.- Specified by:
zRangeByScoreWithScores
in interfaceDefaultedRedisConnection
- Specified by:
zRangeByScoreWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRangeByScoreWithScores
Description copied from interface:RedisZSetCommands
- Specified by:
zRangeByScoreWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRangeWithScores
Description copied from interface:RedisZSetCommands
- Specified by:
zRangeWithScores
in interfaceDefaultedRedisConnection
- Specified by:
zRangeWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRevRangeByScore
Description copied from interface:RedisZSetCommands
Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.- Specified by:
zRevRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRevRangeByScore
public Set<byte[]> zRevRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Description copied from interface:RedisZSetCommands
Get elements where score is betweenRange#min
andRange#max
from sorted set ordered from high to low.- Specified by:
zRevRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRevRangeByScore
Description copied from interface:RedisZSetCommands
Get elements where score is betweenmin
andmax
from sorted set ordered from high to low.- Specified by:
zRevRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRevRangeByScore
public Set<byte[]> zRevRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Description copied from interface:RedisZSetCommands
Get elements in range fromLimit#offset
toLimit#offset + Limit#count
where score is betweenRange#min
andRange#max
from sorted set ordered high -> low.- Specified by:
zRevRangeByScore
in interfaceDefaultedRedisConnection
- Specified by:
zRevRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRevRangeByScoreWithScores
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count) Description copied from interface:RedisZSetCommands
Get set ofTuple
in range fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.- Specified by:
zRevRangeByScoreWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRevRangeByScoreWithScores
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Description copied from interface:RedisZSetCommands
Get set ofTuple
where score is betweenRange#min
andRange#max
from sorted set ordered from high to low.- Specified by:
zRevRangeByScoreWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRevRangeByScoreWithScores
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Description copied from interface:RedisZSetCommands
Get set ofTuple
in range fromLimit#offset
toLimit#count
where score is betweenRange#min
andRange#max
from sorted set ordered high -> low.- Specified by:
zRevRangeByScoreWithScores
in interfaceDefaultedRedisConnection
- Specified by:
zRevRangeByScoreWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRevRangeByScoreWithScores
Description copied from interface:RedisZSetCommands
- Specified by:
zRevRangeByScoreWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRank
Description copied from interface:RedisZSetCommands
Determine the index of element withvalue
in a sorted set.- Specified by:
zRank
in interfaceDefaultedRedisConnection
- Specified by:
zRank
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.value
- the value. Must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRem
Description copied from interface:RedisZSetCommands
Removevalues
from sorted set. Return number of removed elements.- Specified by:
zRem
in interfaceDefaultedRedisConnection
- Specified by:
zRem
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.values
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRemRange
Description copied from interface:RedisZSetCommands
Remove elements in range betweenstart
andend
from sorted set withkey
.- Specified by:
zRemRange
in interfaceDefaultedRedisConnection
- Specified by:
zRemRange
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRemRangeByLex
Description copied from interface:RedisZSetCommands
Remove all elements between the lexicographicalRange
.- Specified by:
zRemRangeByLex
in interfaceDefaultedRedisConnection
- Specified by:
zRemRangeByLex
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- the number of elements removed, or null when used in pipeline / transaction.
- See Also:
-
zRemRangeByScore
Description copied from interface:RedisZSetCommands
Remove elements with scores betweenmin
andmax
from sorted set withkey
.- Specified by:
zRemRangeByScore
in interfaceDefaultedRedisConnection
- Specified by:
zRemRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRemRangeByScore
public Long zRemRangeByScore(byte[] key, org.springframework.data.domain.Range<? extends Number> range) Description copied from interface:RedisZSetCommands
Remove elements with scores betweenRange#min
andRange#max
from sorted set withkey
.- Specified by:
zRemRangeByScore
in interfaceDefaultedRedisConnection
- Specified by:
zRemRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRevRange
Description copied from interface:RedisZSetCommands
Get elements in range fromstart
toend
from sorted set ordered from high to low.- Specified by:
zRevRange
in interfaceDefaultedRedisConnection
- Specified by:
zRevRange
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRevRangeWithScores
Description copied from interface:RedisZSetCommands
- Specified by:
zRevRangeWithScores
in interfaceDefaultedRedisConnection
- Specified by:
zRevRangeWithScores
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- empty
Set
when key does not exists or no members in range. null when used in pipeline / transaction. - See Also:
-
zRevRank
Description copied from interface:RedisZSetCommands
Determine the index of element withvalue
in a sorted set when scored high to low.- Specified by:
zRevRank
in interfaceDefaultedRedisConnection
- Specified by:
zRevRank
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.value
- the value.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zScore
Description copied from interface:RedisZSetCommands
Get the score of element withvalue
from sorted set with keykey
.- Specified by:
zScore
in interfaceDefaultedRedisConnection
- Specified by:
zScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.value
- the value.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zMScore
Description copied from interface:RedisZSetCommands
Get the scores of elements withvalues
from sorted set with keykey
.- Specified by:
zMScore
in interfaceDefaultedRedisConnection
- Specified by:
zMScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.values
- the values.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnion
Description copied from interface:RedisZSetCommands
Union sortedsets
.- Specified by:
zUnion
in interfaceDefaultedRedisConnection
- Specified by:
zUnion
in interfaceRedisZSetCommands
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnionWithScores
Description copied from interface:RedisZSetCommands
Union sortedsets
.- Specified by:
zUnionWithScores
in interfaceDefaultedRedisConnection
- Specified by:
zUnionWithScores
in interfaceRedisZSetCommands
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnionWithScores
Description copied from interface:RedisZSetCommands
Union sortedsets
.- Specified by:
zUnionWithScores
in interfaceDefaultedRedisConnection
- Specified by:
zUnionWithScores
in interfaceRedisZSetCommands
- Parameters:
aggregate
- must not be null.weights
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnion
Description copied from interface:StringRedisConnection
Union sortedsets
.- Specified by:
zUnion
in interfaceStringRedisConnection
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnionWithScores
Description copied from interface:StringRedisConnection
Union sortedsets
.- Specified by:
zUnionWithScores
in interfaceStringRedisConnection
- Parameters:
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnionWithScores
@Nullable public Set<StringRedisConnection.StringTuple> zUnionWithScores(Aggregate aggregate, Weights weights, String... sets) Description copied from interface:StringRedisConnection
Union sortedsets
.- Specified by:
zUnionWithScores
in interfaceStringRedisConnection
- Parameters:
aggregate
- must not be null.weights
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnionStore
Description copied from interface:RedisZSetCommands
Union sortedsets
and store result in destinationdestKey
.- Specified by:
zUnionStore
in interfaceDefaultedRedisConnection
- Specified by:
zUnionStore
in interfaceRedisZSetCommands
- Parameters:
destKey
- must not be null.aggregate
- must not be null.weights
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnionStore
@Nullable public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) Description copied from interface:RedisZSetCommands
Union sortedsets
and store result in destinationdestKey
.- Specified by:
zUnionStore
in interfaceDefaultedRedisConnection
- Specified by:
zUnionStore
in interfaceRedisZSetCommands
- Parameters:
destKey
- must not be null.aggregate
- must not be null.weights
- must not be null.sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnionStore
Description copied from interface:RedisZSetCommands
Union sortedsets
.- Specified by:
zUnionStore
in interfaceDefaultedRedisConnection
- Specified by:
zUnionStore
in interfaceRedisZSetCommands
sets
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zLexCount
Description copied from interface:StringRedisConnection
Count number of elements within sorted set with value betweenRange#min
andRange#max
applying lexicographical ordering.- Specified by:
zLexCount
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
pExpire
Description copied from interface:RedisKeyCommands
Set time to live for givenkey
in milliseconds.- Specified by:
pExpire
in interfaceDefaultedRedisConnection
- Specified by:
pExpire
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
pExpireAt
Description copied from interface:RedisKeyCommands
Set the expiration for givenkey
as a UNIX timestamp in milliseconds.- Specified by:
pExpireAt
in interfaceDefaultedRedisConnection
- Specified by:
pExpireAt
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
pTtl
Description copied from interface:RedisKeyCommands
Get the precise time to live forkey
in milliseconds.- Specified by:
pTtl
in interfaceDefaultedRedisConnection
- Specified by:
pTtl
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
pTtl
Description copied from interface:RedisKeyCommands
Get the precise time to live forkey
in and convert it to the givenTimeUnit
.- Specified by:
pTtl
in interfaceDefaultedRedisConnection
- Specified by:
pTtl
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.timeUnit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
dump
public byte[] dump(byte[] key) Description copied from interface:RedisKeyCommands
Retrieve serialized version of the value stored atkey
.- Specified by:
dump
in interfaceDefaultedRedisConnection
- Specified by:
dump
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
restore
public void restore(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) Description copied from interface:RedisKeyCommands
- Specified by:
restore
in interfaceDefaultedRedisConnection
- Specified by:
restore
in interfaceRedisKeyCommands
- Parameters:
key
- must not be null.serializedValue
- must not be null.replace
- use true to replace a potentially existing value instead of erroring.- See Also:
-
scriptFlush
public void scriptFlush()Description copied from interface:RedisScriptingCommands
Flush lua script cache.- Specified by:
scriptFlush
in interfaceDefaultedRedisConnection
- Specified by:
scriptFlush
in interfaceRedisScriptingCommands
- See Also:
-
scriptKill
public void scriptKill()Description copied from interface:RedisScriptingCommands
Kill current lua script execution.- Specified by:
scriptKill
in interfaceDefaultedRedisConnection
- Specified by:
scriptKill
in interfaceRedisScriptingCommands
- See Also:
-
scriptLoad
Description copied from interface:RedisScriptingCommands
Load lua script into scripts cache, without executing it.
Execute the script by callingRedisScriptingCommands.evalSha(byte[], ReturnType, int, byte[]...)
.- Specified by:
scriptLoad
in interfaceDefaultedRedisConnection
- Specified by:
scriptLoad
in interfaceRedisScriptingCommands
- Parameters:
script
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
scriptExists
Description copied from interface:RedisScriptingCommands
Check if givenscriptShas
exist in script cache.- Specified by:
scriptExists
in interfaceDefaultedRedisConnection
- Specified by:
scriptExists
in interfaceRedisScriptingCommands
- Returns:
- one entry per given scriptSha in returned
List
or null when used in pipeline / transaction. - See Also:
-
eval
Description copied from interface:RedisScriptingCommands
Evaluate givenscript
.- Specified by:
eval
in interfaceDefaultedRedisConnection
- Specified by:
eval
in interfaceRedisScriptingCommands
- Parameters:
script
- must not be null.returnType
- must not be null.keysAndArgs
- must not be null.- Returns:
- script result. null when used in pipeline / transaction.
- See Also:
-
evalSha
Description copied from interface:RedisScriptingCommands
Evaluate givenscriptSha
.- Specified by:
evalSha
in interfaceDefaultedRedisConnection
- Specified by:
evalSha
in interfaceRedisScriptingCommands
- Parameters:
scriptSha1
- must not be null.returnType
- must not be null.keysAndArgs
- must not be null.- Returns:
- script result. null when used in pipeline / transaction.
- See Also:
-
evalSha
Description copied from interface:RedisScriptingCommands
Evaluate givenscriptSha
.- Specified by:
evalSha
in interfaceDefaultedRedisConnection
- Specified by:
evalSha
in interfaceRedisScriptingCommands
- Parameters:
scriptSha1
- must not be null.returnType
- must not be null.keysAndArgs
- must not be null.- Returns:
- script result. null when used in pipeline / transaction.
- See Also:
-
append
Description copied from interface:StringRedisConnection
Append avalue
tokey
.- Specified by:
append
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
bLPop
Description copied from interface:StringRedisConnection
Removes and returns first element from lists stored atkeys
(see:DefaultedRedisConnection.lPop(byte[])
).
Blocks connection until element available ortimeout
reached.- Specified by:
bLPop
in interfaceStringRedisConnection
keys
- must not be null.- Returns:
- See Also:
-
bRPop
Description copied from interface:StringRedisConnection
Removes and returns last element from lists stored atkeys
(see:DefaultedRedisConnection.rPop(byte[])
).
Blocks connection until element available ortimeout
reached.- Specified by:
bRPop
in interfaceStringRedisConnection
keys
- must not be null.- Returns:
- See Also:
-
bRPopLPush
Description copied from interface:StringRedisConnection
Remove the last element from list atsrcKey
, append it todstKey
and return its value (seeDefaultedRedisConnection.rPopLPush(byte[], byte[])
).
Blocks connection until element available ortimeout
reached.- Specified by:
bRPopLPush
in interfaceStringRedisConnection
srcKey
- must not be null.dstKey
- must not be null.- Returns:
- See Also:
-
copy
Description copied from interface:StringRedisConnection
Copy givensourceKey
totargetKey
.- Specified by:
copy
in interfaceStringRedisConnection
- Parameters:
sourceKey
- must not be null.targetKey
- must not be null.replace
- whether to replace existing keys.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
decr
Description copied from interface:StringRedisConnection
Decrement an integer value stored as string value ofkey
by 1.- Specified by:
decr
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
decrBy
Description copied from interface:StringRedisConnection
Decrement an integer value stored as string value ofkey
byvalue
.- Specified by:
decrBy
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
del
Description copied from interface:StringRedisConnection
Delete givenkeys
.- Specified by:
del
in interfaceStringRedisConnection
- Parameters:
keys
- must not be null.- Returns:
- The number of keys that were removed.
- See Also:
-
unlink
Description copied from interface:StringRedisConnection
Unlink thekeys
from the keyspace. Unlike withStringRedisConnection.del(String...)
the actual memory reclaiming here happens asynchronously.- Specified by:
unlink
in interfaceStringRedisConnection
- Parameters:
keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
echo
Description copied from interface:StringRedisConnection
Returnsmessage
via server roundtrip.- Specified by:
echo
in interfaceStringRedisConnection
- Parameters:
message
- the message to echo.- Returns:
- See Also:
-
exists
Description copied from interface:StringRedisConnection
Determine if givenkey
exists.- Specified by:
exists
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
expire
Description copied from interface:StringRedisConnection
Set time to live for givenkey
in seconds.- Specified by:
expire
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
expireAt
Description copied from interface:StringRedisConnection
Set the expiration for givenkey
as a UNIX timestamp.- Specified by:
expireAt
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
get
Description copied from interface:StringRedisConnection
Get the value ofkey
.- Specified by:
get
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
getBit
Description copied from interface:StringRedisConnection
Get the bit value atoffset
of value atkey
.- Specified by:
getBit
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
getRange
Description copied from interface:StringRedisConnection
Get a substring of value ofkey
betweenstart
andend
.- Specified by:
getRange
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
getSet
Description copied from interface:StringRedisConnection
Setvalue
ofkey
and return its old value.- Specified by:
getSet
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
hDel
Description copied from interface:StringRedisConnection
Delete given hashfields
.- Specified by:
hDel
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.fields
- must not be null.- Returns:
- See Also:
-
hExists
Description copied from interface:StringRedisConnection
Determine if given hashfield
exists.- Specified by:
hExists
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- See Also:
-
hGet
Description copied from interface:StringRedisConnection
Get value for givenfield
from hash atkey
.- Specified by:
hGet
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- See Also:
-
hGetAll
Description copied from interface:StringRedisConnection
Get entire hash stored atkey
.- Specified by:
hGetAll
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
hIncrBy
Description copied from interface:StringRedisConnection
Incrementvalue
of a hashfield
by the givendelta
.- Specified by:
hIncrBy
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- See Also:
-
hIncrBy
Description copied from interface:StringRedisConnection
Incrementvalue
of a hashfield
by the givendelta
.- Specified by:
hIncrBy
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
hRandField
Description copied from interface:RedisHashCommands
Return a random field from the hash stored atkey
.- Specified by:
hRandField
in interfaceDefaultedRedisConnection
- Specified by:
hRandField
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
hRandFieldWithValues
Description copied from interface:RedisHashCommands
Return a random field from the hash along with its value stored atkey
.- Specified by:
hRandFieldWithValues
in interfaceDefaultedRedisConnection
- Specified by:
hRandFieldWithValues
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
hRandField
Description copied from interface:RedisHashCommands
Return a random field from the hash stored atkey
. If the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the hash size. Ifcount
is negative, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count.- Specified by:
hRandField
in interfaceDefaultedRedisConnection
- Specified by:
hRandField
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.count
- number of fields to return.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
hRandFieldWithValues
Description copied from interface:RedisHashCommands
Return a random field from the hash along with its value stored atkey
. If the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the hash size. Ifcount
is negative, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count.- Specified by:
hRandFieldWithValues
in interfaceDefaultedRedisConnection
- Specified by:
hRandFieldWithValues
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.count
- number of fields to return.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
hRandField
Description copied from interface:StringRedisConnection
Return a random field from the hash stored atkey
.- Specified by:
hRandField
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
hRandFieldWithValues
Description copied from interface:StringRedisConnection
Return a random field from the hash along with its value stored atkey
.- Specified by:
hRandFieldWithValues
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
hRandField
Description copied from interface:StringRedisConnection
Return a random field from the hash stored atkey
. If the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the hash size. Ifcount
is negative, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count.- Specified by:
hRandField
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.count
- number of fields to return.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
hRandFieldWithValues
Description copied from interface:StringRedisConnection
Return a random field from the hash along with its value stored atkey
. If the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the hash size. Ifcount
is negative, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count.- Specified by:
hRandFieldWithValues
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.count
- number of fields to return.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- See Also:
-
hKeys
Description copied from interface:StringRedisConnection
Get key set (fields) of hash atkey
.- Specified by:
hKeys
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
hLen
Description copied from interface:StringRedisConnection
Get size of hash atkey
.- Specified by:
hLen
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
hMGet
Description copied from interface:StringRedisConnection
Get values for givenfields
from hash atkey
.- Specified by:
hMGet
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.fields
- must not be null.- Returns:
- See Also:
-
hMSet
Description copied from interface:StringRedisConnection
Set multiple hash fields to multiple values using data provided inhashes
- Specified by:
hMSet
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.hashes
- must not be null.- See Also:
-
hSet
Description copied from interface:StringRedisConnection
Set thevalue
of a hashfield
.- Specified by:
hSet
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- See Also:
-
hSetNX
Description copied from interface:StringRedisConnection
Set thevalue
of a hashfield
only iffield
does not exist.- Specified by:
hSetNX
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- See Also:
-
hVals
Description copied from interface:StringRedisConnection
Get entry set (values) of hash atfield
.- Specified by:
hVals
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
incr
Description copied from interface:StringRedisConnection
Increment an integer value stored as string value ofkey
by 1.- Specified by:
incr
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
incrBy
Description copied from interface:StringRedisConnection
Increment an integer value stored ofkey
bydelta
.- Specified by:
incrBy
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
incrBy
Description copied from interface:StringRedisConnection
Increment a floating point number value ofkey
bydelta
.- Specified by:
incrBy
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
keys
Description copied from interface:StringRedisConnection
Find all keys matching the givenpattern
.- Specified by:
keys
in interfaceStringRedisConnection
- Parameters:
pattern
- must not be null.- Returns:
- See Also:
-
lIndex
Description copied from interface:StringRedisConnection
Get element atindex
form list atkey
.- Specified by:
lIndex
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
lInsert
Description copied from interface:StringRedisConnection
Insertvalue
RedisListCommands.Position.BEFORE
orRedisListCommands.Position.AFTER
existingpivot
forkey
.- Specified by:
lInsert
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.where
- must not be null.- Returns:
- See Also:
-
lLen
Description copied from interface:StringRedisConnection
Get the size of list stored atkey
.- Specified by:
lLen
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
lPop
Description copied from interface:StringRedisConnection
Removes and returns first element in list stored atkey
.- Specified by:
lPop
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
lPop
Description copied from interface:StringRedisConnection
Removes and returns first elements in list stored atkey
.- Specified by:
lPop
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
lPos
Description copied from interface:StringRedisConnection
Returns the index of matching elements inside the list stored at given key.
Requires Redis 6.0.6 or newer.- Specified by:
lPos
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.element
- must not be null.rank
- specifies the "rank" of the first element to return, in case there are multiple matches. A rank of 1 means to return the first match, 2 to return the second match, and so forth.count
- number of matches to return.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
lPush
Description copied from interface:StringRedisConnection
Prependvalues
tokey
.- Specified by:
lPush
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
lPushX
Description copied from interface:StringRedisConnection
Prependvalues
tokey
only if the list exists.- Specified by:
lPushX
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
lRange
Description copied from interface:StringRedisConnection
Get elements betweenstart
andend
from list atkey
.- Specified by:
lRange
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
lRem
Description copied from interface:StringRedisConnection
Removes the firstcount
occurrences ofvalue
from the list stored atkey
.- Specified by:
lRem
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
lSet
Description copied from interface:StringRedisConnection
Set thevalue
list element atindex
.- Specified by:
lSet
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- See Also:
-
lTrim
Description copied from interface:StringRedisConnection
Trim list atkey
to elements betweenstart
andend
.- Specified by:
lTrim
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- See Also:
-
mGet
Description copied from interface:StringRedisConnection
Get multiplekeys
. Values are in the order of the requested keys.- Specified by:
mGet
in interfaceStringRedisConnection
- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
mSetNXString
Description copied from interface:StringRedisConnection
Set multiple keys to multiple values using key-value pairs provided intuple
only if the provided key does not exist.- Specified by:
mSetNXString
in interfaceStringRedisConnection
- Parameters:
tuple
- must not be null.- See Also:
-
mSetString
Description copied from interface:StringRedisConnection
Set multiple keys to multiple values using key-value pairs provided intuple
.- Specified by:
mSetString
in interfaceStringRedisConnection
- Parameters:
tuple
- must not be null.- See Also:
-
persist
Description copied from interface:StringRedisConnection
Remove the expiration from givenkey
.- Specified by:
persist
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
move
Description copied from interface:StringRedisConnection
Move givenkey
to database withindex
.- Specified by:
move
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
pSubscribe
Description copied from interface:StringRedisConnection
Subscribes the connection to all channels matching the given patterns. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.Note that this operation is blocking and the current thread starts waiting for new messages immediately.
- Specified by:
pSubscribe
in interfaceStringRedisConnection
- Parameters:
listener
- message listener, must not be null.patterns
- channel name patterns, must not be null.- See Also:
-
publish
Description copied from interface:StringRedisConnection
Publishes the given message to the given channel.- Specified by:
publish
in interfaceStringRedisConnection
- Parameters:
channel
- the channel to publish to, must not be null.message
- message to publish- Returns:
- the number of clients that received the message
- See Also:
-
rename
Description copied from interface:StringRedisConnection
Rename keyoldKey
tonewKey
.- Specified by:
rename
in interfaceStringRedisConnection
- Parameters:
oldKey
- must not be null.newKey
- must not be null.- See Also:
-
renameNX
Description copied from interface:StringRedisConnection
Rename keyoldKey
tonewKey
only ifnewKey
does not exist.- Specified by:
renameNX
in interfaceStringRedisConnection
- Parameters:
oldKey
- must not be null.newKey
- must not be null.- Returns:
- See Also:
-
rPop
Description copied from interface:StringRedisConnection
Removes and returns last element in list stored atkey
.- Specified by:
rPop
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
rPop
Description copied from interface:StringRedisConnection
Removes and returns last elements in list stored atkey
.- Specified by:
rPop
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
rPopLPush
Description copied from interface:StringRedisConnection
Remove the last element from list atsrcKey
, append it todstKey
and return its value.- Specified by:
rPopLPush
in interfaceStringRedisConnection
- Parameters:
srcKey
- must not be null.dstKey
- must not be null.- Returns:
- See Also:
-
rPush
Description copied from interface:StringRedisConnection
Appendvalues
tokey
.- Specified by:
rPush
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
rPushX
Description copied from interface:StringRedisConnection
Appendvalues
tokey
only if the list exists.- Specified by:
rPushX
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sAdd
Description copied from interface:StringRedisConnection
Add givenvalues
to set atkey
.- Specified by:
sAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sCard
Description copied from interface:StringRedisConnection
Get size of set atkey
.- Specified by:
sCard
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sDiff
Description copied from interface:StringRedisConnection
Diff all sets for givenkeys
.- Specified by:
sDiff
in interfaceStringRedisConnection
- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
sDiffStore
Description copied from interface:StringRedisConnection
Diff all sets for givenkeys
and store result indestKey
.- Specified by:
sDiffStore
in interfaceStringRedisConnection
- Parameters:
destKey
- must not be null.keys
- must not be null.- Returns:
- See Also:
-
set
Description copied from interface:StringRedisConnection
Setvalue
forkey
.- Specified by:
set
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.value
- must not be null.- See Also:
-
set
public Boolean set(String key, String value, Expiration expiration, RedisStringCommands.SetOption option) Description copied from interface:StringRedisConnection
Setvalue
forkey
applying timeouts fromexpiration
if set and inserting/updating values depending onoption
.- Specified by:
set
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.value
- must not be null.expiration
- can be null. Defaulted toExpiration.persistent()
. UseExpiration.keepTtl()
to keep the existing expiration.option
- can be null. Defaulted toRedisStringCommands.SetOption.UPSERT
.- See Also:
-
setBit
Description copied from interface:StringRedisConnection
Sets the bit atoffset
in value stored atkey
.- Specified by:
setBit
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- the original bit value stored at
offset
. - See Also:
-
setEx
Description copied from interface:StringRedisConnection
Set thevalue
and expiration inseconds
forkey
.- Specified by:
setEx
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.value
- must not be null.- See Also:
-
pSetEx
Description copied from interface:StringRedisConnection
Set thevalue
and expiration inmilliseconds
forkey
.- Specified by:
pSetEx
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.value
- must not be null.- See Also:
-
setNX
Description copied from interface:StringRedisConnection
Setvalue
forkey
, only ifkey
does not exist.- Specified by:
setNX
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- See Also:
-
setRange
Description copied from interface:StringRedisConnection
Overwrite parts ofkey
starting at the specifiedoffset
with givenvalue
.- Specified by:
setRange
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- See Also:
-
sInter
Description copied from interface:StringRedisConnection
Returns the members intersecting all given sets atkeys
.- Specified by:
sInter
in interfaceStringRedisConnection
- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
sInterStore
Description copied from interface:StringRedisConnection
Intersect all given sets atkeys
and store result indestKey
.- Specified by:
sInterStore
in interfaceStringRedisConnection
- Parameters:
destKey
- must not be null.keys
- must not be null.- Returns:
- See Also:
-
sIsMember
Description copied from interface:StringRedisConnection
Check if set atkey
containsvalue
.- Specified by:
sIsMember
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sMIsMember
Description copied from interface:StringRedisConnection
Check if set atkey
contains one or morevalues
.- Specified by:
sMIsMember
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.values
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
sMembers
Description copied from interface:StringRedisConnection
Get all elements of set atkey
.- Specified by:
sMembers
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sMove
Description copied from interface:StringRedisConnection
Movevalue
fromsrcKey
todestKey
- Specified by:
sMove
in interfaceStringRedisConnection
- Parameters:
srcKey
- must not be null.destKey
- must not be null.- Returns:
- See Also:
-
sort
Description copied from interface:StringRedisConnection
Sort the elements forkey
and store result instoreKey
.- Specified by:
sort
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.params
- must not be null.storeKey
- must not be null.- Returns:
- See Also:
-
sort
Description copied from interface:StringRedisConnection
Sort the elements forkey
.- Specified by:
sort
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.params
- must not be null.- Returns:
- See Also:
-
encodingOf
Description copied from interface:StringRedisConnection
Get the type of internal representation used for storing the value at the givenkey
.- Specified by:
encodingOf
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
-
idletime
Description copied from interface:StringRedisConnection
Get theDuration
since the object stored at the givenkey
is idle.- Specified by:
idletime
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
-
refcount
Description copied from interface:StringRedisConnection
Get the number of references of the value associated with the specifiedkey
.- Specified by:
refcount
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
-
sPop
Description copied from interface:StringRedisConnection
Remove and return a random member from set atkey
.- Specified by:
sPop
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sPop
Description copied from interface:StringRedisConnection
Remove and returncount
random members from set atkey
.- Specified by:
sPop
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.count
- the number of random members to return.- Returns:
- empty
List
if key does not exist. - See Also:
-
sRandMember
Description copied from interface:StringRedisConnection
Get random element from set atkey
.- Specified by:
sRandMember
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sRandMember
Description copied from interface:StringRedisConnection
Getcount
random elements from set atkey
.- Specified by:
sRandMember
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
sRem
Description copied from interface:StringRedisConnection
Remove givenvalues
from set atkey
and return the number of removed elements.- Specified by:
sRem
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
strLen
Description copied from interface:StringRedisConnection
Get the length of the value stored atkey
.- Specified by:
strLen
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
bitCount
Description copied from interface:StringRedisConnection
Count the number of set bits (population counting) in value stored atkey
.- Specified by:
bitCount
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
bitCount
Description copied from interface:StringRedisConnection
Count the number of set bits (population counting) of value stored atkey
betweenstart
andend
.- Specified by:
bitCount
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
bitOp
Description copied from interface:StringRedisConnection
Perform bitwise operations between strings.- Specified by:
bitOp
in interfaceStringRedisConnection
- Parameters:
op
- must not be null.destination
- must not be null.keys
- must not be null.- Returns:
- See Also:
-
bitPos
@Nullable public Long bitPos(String key, boolean bit, org.springframework.data.domain.Range<Long> range) Description copied from interface:StringRedisConnection
Return the position of the first bit set to givenbit
in a string.Range
start and end can contain negative values in order to index bytes starting from the end of the string, where -1 is the last byte, -2 is the penultimate.- Specified by:
bitPos
in interfaceStringRedisConnection
- Parameters:
key
- the key holding the actual String.bit
- the bit value to look for.range
- must not be null. UseRedisZSetCommands.Range.unbounded()
to not limit search.- Returns:
- null when used in pipeline / transaction. The position of the first bit set to 1 or 0 according to the request.
- See Also:
-
subscribe
Description copied from interface:StringRedisConnection
Subscribes the connection to the given channels. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.Note that this operation is blocking and the current thread starts waiting for new messages immediately.
- Specified by:
subscribe
in interfaceStringRedisConnection
- Parameters:
listener
- message listener, must not be null.channels
- channel names, must not be null.- See Also:
-
sUnion
Description copied from interface:StringRedisConnection
Union all sets at givenkeys
.- Specified by:
sUnion
in interfaceStringRedisConnection
- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
sUnionStore
Description copied from interface:StringRedisConnection
Union all sets at givenkeys
and store result indestKey
.- Specified by:
sUnionStore
in interfaceStringRedisConnection
- Parameters:
destKey
- must not be null.keys
- must not be null.- Returns:
- See Also:
-
ttl
Description copied from interface:StringRedisConnection
Get the time to live forkey
in seconds.- Specified by:
ttl
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
ttl
Description copied from interface:StringRedisConnection
Get the time to live forkey
in and convert it to the givenTimeUnit
.- Specified by:
ttl
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.timeUnit
- must not be null.- Returns:
- See Also:
-
type
Description copied from interface:StringRedisConnection
Determine the type stored atkey
.- Specified by:
type
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
touch
Description copied from interface:StringRedisConnection
Alter the last access time of givenkey(s)
.- Specified by:
touch
in interfaceStringRedisConnection
- Parameters:
keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zAdd
Description copied from interface:StringRedisConnection
Addvalue
to a sorted set atkey
, or update itsscore
if it already exists.- Specified by:
zAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.score
- the score.value
- the value.- Returns:
- See Also:
-
zAdd
Description copied from interface:StringRedisConnection
- Specified by:
zAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.score
- must not be null.value
- must not be null.args
- must not be null useRedisZSetCommands.ZAddArgs.empty()
instead.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zAdd
Description copied from interface:StringRedisConnection
Addtuples
to a sorted set atkey
, or update itsscore
if it already exists.- Specified by:
zAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.tuples
- the tuples.- Returns:
- See Also:
-
zAdd
public Long zAdd(String key, Set<StringRedisConnection.StringTuple> tuples, RedisZSetCommands.ZAddArgs args) Description copied from interface:StringRedisConnection
- Specified by:
zAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.tuples
- must not be null.args
- must not be null useRedisZSetCommands.ZAddArgs.empty()
instead.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zCard
Description copied from interface:StringRedisConnection
Get the size of sorted set withkey
.- Specified by:
zCard
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zCount
Description copied from interface:StringRedisConnection
Count number of elements within sorted set with scores betweenmin
andmax
.- Specified by:
zCount
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zLexCount
Description copied from interface:RedisZSetCommands
Count number of elements within sorted set with value betweenRange#min
andRange#max
applying lexicographical ordering.- Specified by:
zLexCount
in interfaceDefaultedRedisConnection
- Specified by:
zLexCount
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zPopMin
Description copied from interface:RedisZSetCommands
Remove and return the value with its score having the lowest score from sorted set atkey
.- Specified by:
zPopMin
in interfaceDefaultedRedisConnection
- Specified by:
zPopMin
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- See Also:
-
zPopMin
Description copied from interface:StringRedisConnection
Remove and return the value with its score having the lowest score from sorted set atkey
.- Specified by:
zPopMin
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- See Also:
-
zPopMin
Description copied from interface:RedisZSetCommands
Remove and returncount
values with their score having the lowest score from sorted set atkey
.- Specified by:
zPopMin
in interfaceDefaultedRedisConnection
- Specified by:
zPopMin
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.count
- number of elements to pop.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- See Also:
-
zPopMin
Description copied from interface:StringRedisConnection
Remove and returncount
values with their score having the lowest score from sorted set atkey
.- Specified by:
zPopMin
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.count
- number of elements to pop.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- See Also:
-
bZPopMin
Description copied from interface:RedisZSetCommands
Remove and return the value with its score having the lowest score from sorted set atkey
.
Blocks connection until element available ortimeout
reached.- Specified by:
bZPopMin
in interfaceDefaultedRedisConnection
- Specified by:
bZPopMin
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.unit
- must not be null.- Returns:
- can be null.
- See Also:
-
bZPopMin
@Nullable public StringRedisConnection.StringTuple bZPopMin(String key, long timeout, TimeUnit unit) Description copied from interface:StringRedisConnection
Remove and return the value with its score having the lowest score from sorted set atkey
. Blocks connection until element available ortimeout
reached.- Specified by:
bZPopMin
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.unit
- must not be null.- Returns:
- can be null.
- See Also:
-
zPopMax
Description copied from interface:RedisZSetCommands
Remove and return the value with its score having the highest score from sorted set atkey
.- Specified by:
zPopMax
in interfaceDefaultedRedisConnection
- Specified by:
zPopMax
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- See Also:
-
zPopMax
Description copied from interface:StringRedisConnection
Remove and return the value with its score having the highest score from sorted set atkey
.- Specified by:
zPopMax
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- See Also:
-
zPopMax
Description copied from interface:RedisZSetCommands
Remove and returncount
values with their score having the highest score from sorted set atkey
.- Specified by:
zPopMax
in interfaceDefaultedRedisConnection
- Specified by:
zPopMax
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.count
- number of elements to pop.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- See Also:
-
zPopMax
Description copied from interface:StringRedisConnection
Remove and returncount
values with their score having the highest score from sorted set atkey
.- Specified by:
zPopMax
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.count
- number of elements to pop.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- See Also:
-
bZPopMax
Description copied from interface:RedisZSetCommands
Remove and return the value with its score having the highest score from sorted set atkey
.
Blocks connection until element available ortimeout
reached.- Specified by:
bZPopMax
in interfaceDefaultedRedisConnection
- Specified by:
bZPopMax
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.unit
- must not be null.- Returns:
- can be null.
- See Also:
-
bZPopMax
@Nullable public StringRedisConnection.StringTuple bZPopMax(String key, long timeout, TimeUnit unit) Description copied from interface:StringRedisConnection
Remove and return the value with its score having the highest score from sorted set atkey
. Blocks connection until element available ortimeout
reached.- Specified by:
bZPopMax
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.unit
- must not be null.- Returns:
- can be null.
- See Also:
-
zIncrBy
Description copied from interface:StringRedisConnection
Increment the score of element withvalue
in sorted set byincrement
.- Specified by:
zIncrBy
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.value
- the value.- Returns:
- See Also:
-
zInterStore
Description copied from interface:StringRedisConnection
Intersect sortedsets
and store result in destinationkey
.- Specified by:
zInterStore
in interfaceStringRedisConnection
- Parameters:
destKey
- must not be null.aggregate
- must not be null.sets
- must not be null.- Returns:
- See Also:
-
zInterStore
Description copied from interface:StringRedisConnection
Intersect sortedsets
and store result in destinationkey
.- Specified by:
zInterStore
in interfaceStringRedisConnection
- Parameters:
destKey
- must not be null.sets
- must not be null.- Returns:
- See Also:
-
zRandMember
public byte[] zRandMember(byte[] key) Description copied from interface:RedisZSetCommands
Get random element from sorted set atkey
.- Specified by:
zRandMember
in interfaceDefaultedRedisConnection
- Specified by:
zRandMember
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- can be null.
- See Also:
-
zRandMember
Description copied from interface:RedisZSetCommands
Getcount
random elements from sorted set atkey
.- Specified by:
zRandMember
in interfaceDefaultedRedisConnection
- Specified by:
zRandMember
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.count
- if the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the set size. Ifcount
is negative, the behavior changes and the command is allowed to return the same value multiple times. In this case, the number of returned values is the absolute value of the specified count.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRandMemberWithScore
Description copied from interface:RedisZSetCommands
Get random element from sorted set atkey
.- Specified by:
zRandMemberWithScore
in interfaceDefaultedRedisConnection
- Specified by:
zRandMemberWithScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- can be null.
- See Also:
-
zRandMemberWithScore
Description copied from interface:RedisZSetCommands
Getcount
random elements from sorted set atkey
.- Specified by:
zRandMemberWithScore
in interfaceDefaultedRedisConnection
- Specified by:
zRandMemberWithScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.count
- if the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the set size. Ifcount
is negative, the behavior changes and the command is allowed to return the same value multiple times. In this case, the number of returned values is the absolute value of the specified count.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRandMember
Description copied from interface:StringRedisConnection
Get random element from sorted set atkey
.- Specified by:
zRandMember
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- can be null.
- See Also:
-
zRandMember
Description copied from interface:StringRedisConnection
Getcount
random elements from sorted set atkey
.- Specified by:
zRandMember
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.count
- if the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the set size. Ifcount
is negative, the behavior changes and the command is allowed to return the same value multiple times. In this case, the number of returned values is the absolute value of the specified count.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRandMemberWithScore
Description copied from interface:StringRedisConnection
Get random element from sorted set atkey
.- Specified by:
zRandMemberWithScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- can be null.
- See Also:
-
zRandMemberWithScores
Description copied from interface:StringRedisConnection
Getcount
random elements from sorted set atkey
.- Specified by:
zRandMemberWithScores
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.count
- if the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the set size. Ifcount
is negative, the behavior changes and the command is allowed to return the same value multiple times. In this case, the number of returned values is the absolute value of the specified count.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRange
Description copied from interface:StringRedisConnection
Get elements betweenstart
andend
from sorted set.- Specified by:
zRange
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRangeByScore
Description copied from interface:StringRedisConnection
Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.- Specified by:
zRangeByScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRangeByScore
Description copied from interface:StringRedisConnection
Get elements where score is betweenmin
andmax
from sorted set.- Specified by:
zRangeByScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRangeByScoreWithScores
public Set<StringRedisConnection.StringTuple> zRangeByScoreWithScores(String key, double min, double max, long offset, long count) Description copied from interface:StringRedisConnection
- Specified by:
zRangeByScoreWithScores
in interfaceStringRedisConnection
- Returns:
- See Also:
-
zRangeByScoreWithScores
public Set<StringRedisConnection.StringTuple> zRangeByScoreWithScores(String key, double min, double max) Description copied from interface:StringRedisConnection
- Specified by:
zRangeByScoreWithScores
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRangeWithScores
Description copied from interface:StringRedisConnection
- Specified by:
zRangeWithScores
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRank
Description copied from interface:StringRedisConnection
Determine the index of element withvalue
in a sorted set.- Specified by:
zRank
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.value
- the value.- Returns:
- See Also:
-
zRem
Description copied from interface:StringRedisConnection
Removevalues
from sorted set. Return number of removed elements.- Specified by:
zRem
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.values
- must not be null.- Returns:
- See Also:
-
zRemRange
Description copied from interface:StringRedisConnection
Remove elements in range betweenstart
andend
from sorted set withkey
.- Specified by:
zRemRange
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRemRangeByLex
Description copied from interface:StringRedisConnection
Remove all elements between the lexicographicalRedisZSetCommands.Range
.- Specified by:
zRemRangeByLex
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- the number of elements removed, or null when used in pipeline / transaction.
- See Also:
-
zRemRangeByScore
Description copied from interface:StringRedisConnection
Remove elements with scores betweenmin
andmax
from sorted set withkey
.- Specified by:
zRemRangeByScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRevRange
Description copied from interface:StringRedisConnection
Get elements in range fromstart
toend
from sorted set ordered from high to low.- Specified by:
zRevRange
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRevRangeWithScores
Description copied from interface:StringRedisConnection
- Specified by:
zRevRangeWithScores
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRevRangeByScore
Description copied from interface:StringRedisConnection
Get elements where score is betweenmin
andmax
from sorted set ordered from high to low.- Specified by:
zRevRangeByScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRevRangeByScoreWithScores
public Set<StringRedisConnection.StringTuple> zRevRangeByScoreWithScores(String key, double min, double max) Description copied from interface:StringRedisConnection
- Specified by:
zRevRangeByScoreWithScores
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRevRangeByScore
Description copied from interface:StringRedisConnection
Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.- Specified by:
zRevRangeByScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRevRangeByScoreWithScores
public Set<StringRedisConnection.StringTuple> zRevRangeByScoreWithScores(String key, double min, double max, long offset, long count) Description copied from interface:StringRedisConnection
Get set ofTuple
in range fromstart
toend
where score is betweenmin
andmax
from sorted set ordered high -> low.- Specified by:
zRevRangeByScoreWithScores
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRevRank
Description copied from interface:StringRedisConnection
Determine the index of element withvalue
in a sorted set when scored high to low.- Specified by:
zRevRank
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.value
- the value.- Returns:
- See Also:
-
zScore
Description copied from interface:StringRedisConnection
Get the score of element withvalue
from sorted set with keykey
.- Specified by:
zScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.value
- the value.- Returns:
- See Also:
-
zMScore
Description copied from interface:StringRedisConnection
Get the scores of elements withvalues
from sorted set with keykey
.- Specified by:
zMScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.values
- the values.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zUnionStore
Description copied from interface:StringRedisConnection
Union sortedsets
and store result in destinationkey
.- Specified by:
zUnionStore
in interfaceStringRedisConnection
- Parameters:
destKey
- must not be null.aggregate
- must not be null.sets
- must not be null.- Returns:
- See Also:
-
zUnionStore
Description copied from interface:StringRedisConnection
Union sortedsets
and store result in destinationkey
.- Specified by:
zUnionStore
in interfaceStringRedisConnection
- Parameters:
destKey
- must not be null.sets
- must not be null.- Returns:
- See Also:
-
geoAdd
Description copied from interface:RedisGeoCommands
AddPoint
with given member name to key.- Specified by:
geoAdd
in interfaceDefaultedRedisConnection
- Specified by:
geoAdd
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.point
- must not be null.member
- must not be null.- Returns:
- Number of elements added. null when used in pipeline / transaction.
- See Also:
-
geoAdd
Description copied from interface:RedisGeoCommands
AddRedisGeoCommands.GeoLocation
to key.- Specified by:
geoAdd
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.location
- must not be null.- Returns:
- Number of elements added. null when used in pipeline / transaction.
- See Also:
-
geoAdd
Description copied from interface:StringRedisConnection
AddPoint
with given member name to key.- Specified by:
geoAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.point
- must not be null.member
- must not be null.- Returns:
- Number of elements added.
- See Also:
-
geoAdd
Description copied from interface:StringRedisConnection
AddRedisGeoCommands.GeoLocation
to key.- Specified by:
geoAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.location
- must not be null.- Returns:
- Number of elements added.
- See Also:
-
geoAdd
Description copied from interface:RedisGeoCommands
AddMap
of member /Point
pairs to key.- Specified by:
geoAdd
in interfaceDefaultedRedisConnection
- Specified by:
geoAdd
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.memberCoordinateMap
- must not be null.- Returns:
- Number of elements added. null when used in pipeline / transaction.
- See Also:
-
geoAdd
Description copied from interface:RedisGeoCommands
AddRedisGeoCommands.GeoLocation
s to key- Specified by:
geoAdd
in interfaceDefaultedRedisConnection
- Specified by:
geoAdd
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.locations
- must not be null.- Returns:
- Number of elements added. null when used in pipeline / transaction.
- See Also:
-
geoAdd
Description copied from interface:StringRedisConnection
AddMap
of member /Point
pairs to key.- Specified by:
geoAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.memberCoordinateMap
- must not be null.- Returns:
- Number of elements added.
- See Also:
-
geoAdd
Description copied from interface:StringRedisConnection
AddRedisGeoCommands.GeoLocation
s to key- Specified by:
geoAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.locations
- must not be null.- Returns:
- Number of elements added.
- See Also:
-
geoDist
public org.springframework.data.geo.Distance geoDist(byte[] key, byte[] member1, byte[] member2) Description copied from interface:RedisGeoCommands
Get theDistance
between member1 and member2.- Specified by:
geoDist
in interfaceDefaultedRedisConnection
- Specified by:
geoDist
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.member1
- must not be null.member2
- must not be null.- Returns:
- can be null. null when used in pipeline / transaction.
- See Also:
-
geoDist
Description copied from interface:StringRedisConnection
Get theDistance
between member1 and member2.- Specified by:
geoDist
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.member1
- must not be null.member2
- must not be null.- Returns:
- can be null.
- See Also:
-
geoDist
public org.springframework.data.geo.Distance geoDist(byte[] key, byte[] member1, byte[] member2, org.springframework.data.geo.Metric metric) Description copied from interface:RedisGeoCommands
Get theDistance
between member1 and member2 in the givenMetric
.- Specified by:
geoDist
in interfaceDefaultedRedisConnection
- Specified by:
geoDist
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.member1
- must not be null.member2
- must not be null.metric
- must not be null.- Returns:
- can be null. null when used in pipeline / transaction.
- See Also:
-
geoDist
public org.springframework.data.geo.Distance geoDist(String key, String member1, String member2, org.springframework.data.geo.Metric metric) Description copied from interface:StringRedisConnection
Get theDistance
between member1 and member2 in the givenMetric
.- Specified by:
geoDist
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.member1
- must not be null.member2
- must not be null.metric
- must not be null.- Returns:
- can be null.
- See Also:
-
geoHash
Description copied from interface:RedisGeoCommands
Get Geohash representation of the position for one or more members.- Specified by:
geoHash
in interfaceDefaultedRedisConnection
- Specified by:
geoHash
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.members
- must not be null.- Returns:
- empty list when key or members do not exists. null when used in pipeline / transaction.
- See Also:
-
geoHash
Description copied from interface:StringRedisConnection
Get geohash representation of the position for one or more members.- Specified by:
geoHash
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.members
- must not be null.- Returns:
- never null.
- See Also:
-
geoPos
Description copied from interface:RedisGeoCommands
Get thePoint
representation of positions for one or more members.- Specified by:
geoPos
in interfaceDefaultedRedisConnection
- Specified by:
geoPos
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.members
- must not be null.- Returns:
- empty
List
when key of members do not exist. null when used in pipeline / transaction. - See Also:
-
geoPos
Description copied from interface:StringRedisConnection
Get thePoint
representation of positions for one or more members.- Specified by:
geoPos
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.members
- must not be null.- Returns:
- never null.
- See Also:
-
geoRadius
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadius(String key, org.springframework.data.geo.Circle within) Description copied from interface:StringRedisConnection
Get the members within the boundaries of a givenCircle
.- Specified by:
geoRadius
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.within
- must not be null.- Returns:
- never null.
- See Also:
-
geoRadius
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadius(String key, org.springframework.data.geo.Circle within, RedisGeoCommands.GeoRadiusCommandArgs args) Description copied from interface:StringRedisConnection
Get the members within the boundaries of a givenCircle
applyingRedisGeoCommands.GeoRadiusCommandArgs
.- Specified by:
geoRadius
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.within
- must not be null.args
- must not be null.- Returns:
- never null.
- See Also:
-
geoRadiusByMember
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(String key, String member, double radius) Description copied from interface:StringRedisConnection
Get the members within the circle defined by the members coordinates and given radius.- Specified by:
geoRadiusByMember
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.member
- must not be null.- Returns:
- never null.
- See Also:
-
geoRadiusByMember
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(String key, String member, org.springframework.data.geo.Distance radius) Description copied from interface:StringRedisConnection
Get the members within the circle defined by the members coordinates and givenDistance
.- Specified by:
geoRadiusByMember
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.member
- must not be null.radius
- must not be null.- Returns:
- never null.
- See Also:
-
geoRadiusByMember
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(String key, String member, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args) Description copied from interface:StringRedisConnection
Get the members within the circle defined by the members coordinates and givenDistance
andRedisGeoCommands.GeoRadiusCommandArgs
.- Specified by:
geoRadiusByMember
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.member
- must not be null.radius
- must not be null.args
- must not be null.- Returns:
- never null.
- See Also:
-
geoRadius
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadius(byte[] key, org.springframework.data.geo.Circle within) Description copied from interface:RedisGeoCommands
Get the members within the boundaries of a givenCircle
.- Specified by:
geoRadius
in interfaceDefaultedRedisConnection
- Specified by:
geoRadius
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.within
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoRadius
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadius(byte[] key, org.springframework.data.geo.Circle within, RedisGeoCommands.GeoRadiusCommandArgs args) Description copied from interface:RedisGeoCommands
Get the members within the boundaries of a givenCircle
applyingRedisGeoCommands.GeoRadiusCommandArgs
.- Specified by:
geoRadius
in interfaceDefaultedRedisConnection
- Specified by:
geoRadius
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.within
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoRadiusByMember
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, double radius) Description copied from interface:RedisGeoCommands
Get the members within the circle defined by the members coordinates and given radius.- Specified by:
geoRadiusByMember
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.member
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoRadiusByMember
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, org.springframework.data.geo.Distance radius) Description copied from interface:RedisGeoCommands
Get the members within the circle defined by the members coordinates and givenDistance
.- Specified by:
geoRadiusByMember
in interfaceDefaultedRedisConnection
- Specified by:
geoRadiusByMember
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.member
- must not be null.radius
- must not be null.- Returns:
- null when used in pipeline / transaction..
- See Also:
-
geoRadiusByMember
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args) Description copied from interface:RedisGeoCommands
Get the members within the circle defined by the members coordinates, givenDistance
andRedisGeoCommands.GeoRadiusCommandArgs
.- Specified by:
geoRadiusByMember
in interfaceDefaultedRedisConnection
- Specified by:
geoRadiusByMember
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.member
- must not be null.radius
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoRemove
Description copied from interface:RedisGeoCommands
Remove the members.- Specified by:
geoRemove
in interfaceDefaultedRedisConnection
- Specified by:
geoRemove
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.members
- must not be null.- Returns:
- Number of elements removed. null when used in pipeline / transaction.
- See Also:
-
geoRemove
Description copied from interface:StringRedisConnection
Remove the members.- Specified by:
geoRemove
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.members
- must not be null.- Returns:
- Number of members elements removed.
- See Also:
-
geoSearch
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoSearch(byte[] key, GeoReference<byte[]> reference, GeoShape predicate, RedisGeoCommands.GeoSearchCommandArgs args) Description copied from interface:RedisGeoCommands
Return the members of a geo set which are within the borders of the area specified by a givenshape
. The query's center point is provided byGeoReference
.- Specified by:
geoSearch
in interfaceDefaultedRedisConnection
- Specified by:
geoSearch
in interfaceRedisGeoCommands
- Parameters:
key
- must not be null.reference
- must not be null.predicate
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoSearchStore
public Long geoSearchStore(byte[] destKey, byte[] key, GeoReference<byte[]> reference, GeoShape predicate, RedisGeoCommands.GeoSearchStoreCommandArgs args) Description copied from interface:RedisGeoCommands
Query the members of a geo set which are within the borders of the area specified by a givenshape
and store the result atdestKey
. The query's center point is provided byGeoReference
.- Specified by:
geoSearchStore
in interfaceDefaultedRedisConnection
- Specified by:
geoSearchStore
in interfaceRedisGeoCommands
key
- must not be null.reference
- must not be null.predicate
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoSearch
public org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<String>> geoSearch(String key, GeoReference<String> reference, GeoShape predicate, RedisGeoCommands.GeoSearchCommandArgs args) Description copied from interface:StringRedisConnection
Return the members of a geo set which are within the borders of the area specified by a givenshape
. The query's center point is provided byGeoReference
.- Specified by:
geoSearch
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.reference
- must not be null.predicate
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoSearchStore
public Long geoSearchStore(String destKey, String key, GeoReference<String> reference, GeoShape predicate, RedisGeoCommands.GeoSearchStoreCommandArgs args) Description copied from interface:StringRedisConnection
Query the members of a geo set which are within the borders of the area specified by a givenshape
and store the result atdestKey
. The query's center point is provided byGeoReference
.- Specified by:
geoSearchStore
in interfaceStringRedisConnection
key
- must not be null.reference
- must not be null.predicate
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
closePipeline
Description copied from interface:RedisConnection
Executes the commands in the pipeline and returns their result. If the connection is not pipelined, an empty collection is returned.- Specified by:
closePipeline
in interfaceRedisConnection
- Returns:
- the result of the executed commands.
-
isPipelined
public boolean isPipelined()Description copied from interface:RedisConnection
Indicates whether the connection is currently pipelined or not.- Specified by:
isPipelined
in interfaceRedisConnection
- Returns:
- true if the connection is pipelined, false otherwise
- See Also:
-
openPipeline
public void openPipeline()Description copied from interface:RedisConnection
Activates the pipeline mode for this connection. When pipelined, all commands return null (the reply is read at the end throughRedisConnection.closePipeline()
. Calling this method when the connection is already pipelined has no effect. Pipelining is used for issuing commands without requesting the response right away but rather at the end of the batch. While somewhat similar to MULTI, pipelining does not guarantee atomicity - it only tries to improve performance when issuing a lot of commands (such as in batching scenarios).Note:
Consider doing some performance testing before using this feature since in many cases the performance benefits are minimal yet the impact on usage are not.- Specified by:
openPipeline
in interfaceRedisConnection
- See Also:
-
execute
Description copied from interface:StringRedisConnection
'Native' or 'raw' execution of the given command along-side the given arguments. The command is executed as is, with as little 'interpretation' as possible - it is up to the caller to take care of any processing of arguments or the result.- Specified by:
execute
in interfaceStringRedisConnection
- Parameters:
command
- Command to execute- Returns:
- execution result.
- See Also:
-
execute
Description copied from interface:RedisCommands
Native or raw execution of the given Redis command along with the given arguments.The command is executed as is, with as little interpretation as possible - it is up to the caller to take care of any processing of arguments or the result.
- Specified by:
execute
in interfaceRedisCommands
- Parameters:
command
- Rediscommand
to execute; must not be null.args
- optional array of command arguments; may be empty;- Returns:
- the execution result; may be null.
-
execute
Description copied from interface:StringRedisConnection
'Native' or 'raw' execution of the given command along-side the given arguments. The command is executed as is, with as little 'interpretation' as possible - it is up to the caller to take care of any processing of arguments or the result.- Specified by:
execute
in interfaceStringRedisConnection
- Parameters:
command
- Command to executeargs
- Possible command arguments (may be null)- Returns:
- execution result.
- See Also:
-
pExpire
Description copied from interface:StringRedisConnection
Set time to live for givenkey
in milliseconds.- Specified by:
pExpire
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
pExpireAt
Description copied from interface:StringRedisConnection
Set the expiration for givenkey
as a UNIX timestamp in milliseconds.- Specified by:
pExpireAt
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
pTtl
Description copied from interface:StringRedisConnection
Get the precise time to live forkey
in milliseconds.- Specified by:
pTtl
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
pTtl
Description copied from interface:StringRedisConnection
Get the precise time to live forkey
in and convert it to the givenTimeUnit
.- Specified by:
pTtl
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.timeUnit
- must not be null.- Returns:
- See Also:
-
scriptLoad
Description copied from interface:StringRedisConnection
Load lua script into scripts cache, without executing it.
Execute the script by callingDefaultedRedisConnection.evalSha(byte[], ReturnType, int, byte[]...)
.- Specified by:
scriptLoad
in interfaceStringRedisConnection
- Parameters:
script
- must not be null.- Returns:
- See Also:
-
eval
NOTE: This method will not deserialize Strings returned by Lua scripts, as they may not be encoded with the same serializer used here. They will be returned as byte[]s- Specified by:
eval
in interfaceStringRedisConnection
- Parameters:
script
- must not be null.returnType
- must not be null.keysAndArgs
- must not be null.- Returns:
- See Also:
-
evalSha
NOTE: This method will not deserialize Strings returned by Lua scripts, as they may not be encoded with the same serializer used here. They will be returned as byte[]s- Specified by:
evalSha
in interfaceStringRedisConnection
- Parameters:
scriptSha1
- must not be null.returnType
- must not be null.keysAndArgs
- must not be null.- Returns:
- See Also:
-
time
Description copied from interface:RedisServerCommands
Request server timestamp usingTIME
command inTimeUnit.MILLISECONDS
.- Specified by:
time
in interfaceDefaultedRedisConnection
- Specified by:
time
in interfaceRedisServerCommands
- Returns:
- current server time in milliseconds or null when used in pipeline / transaction.
- See Also:
-
time
Description copied from interface:RedisServerCommands
Request server timestamp usingTIME
command.- Specified by:
time
in interfaceDefaultedRedisConnection
- Specified by:
time
in interfaceRedisServerCommands
- Parameters:
timeUnit
- target unit.- Returns:
- current server time in
TimeUnit
or null when used in pipeline / transaction. - See Also:
-
getClientList
Description copied from interface:StringRedisConnection
Request information and statistics about connected clients.- Specified by:
getClientList
in interfaceDefaultedRedisConnection
- Specified by:
getClientList
in interfaceRedisServerCommands
- Specified by:
getClientList
in interfaceStringRedisConnection
- Returns:
List
ofRedisClientInfo
objects.- See Also:
-
replicaOf
Description copied from interface:RedisServerCommands
Change redis replication setting to new master.- Specified by:
replicaOf
in interfaceDefaultedRedisConnection
- Specified by:
replicaOf
in interfaceRedisServerCommands
- Parameters:
host
- must not be null.- See Also:
-
replicaOfNoOne
public void replicaOfNoOne()Description copied from interface:RedisServerCommands
Change server into master.- Specified by:
replicaOfNoOne
in interfaceDefaultedRedisConnection
- Specified by:
replicaOfNoOne
in interfaceRedisServerCommands
- See Also:
-
scan
Description copied from interface:RedisKeyCommands
Use aCursor
to iterate over keys.- Specified by:
scan
in interfaceDefaultedRedisConnection
- Specified by:
scan
in interfaceRedisKeyCommands
- Parameters:
options
- must not be null.- Returns:
- never null.
- See Also:
-
zScan
Description copied from interface:RedisZSetCommands
Use aCursor
to iterate over elements in sorted set atkey
.- Specified by:
zScan
in interfaceDefaultedRedisConnection
- Specified by:
zScan
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.options
- must not be null.- Returns:
- See Also:
-
sScan
Description copied from interface:RedisSetCommands
Use aCursor
to iterate over elements in set atkey
.- Specified by:
sScan
in interfaceDefaultedRedisConnection
- Specified by:
sScan
in interfaceRedisSetCommands
- Parameters:
key
- must not be null.options
- must not be null.- Returns:
- never null.
- See Also:
-
hScan
Description copied from interface:RedisHashCommands
Use aCursor
to iterate over entries in hash atkey
.- Specified by:
hScan
in interfaceDefaultedRedisConnection
- Specified by:
hScan
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.options
- must not be null.- Returns:
- See Also:
-
hStrLen
Description copied from interface:RedisHashCommands
Returns the length of the value associated withfield
in the hash stored atkey
. If thekey
or thefield
do not exist,0
is returned.- Specified by:
hStrLen
in interfaceDefaultedRedisConnection
- Specified by:
hStrLen
in interfaceRedisHashCommands
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
setClientName
public void setClientName(byte[] name) Description copied from interface:RedisServerCommands
Assign given name to current connection.- Specified by:
setClientName
in interfaceDefaultedRedisConnection
- Specified by:
setClientName
in interfaceRedisServerCommands
- See Also:
-
setClientName
Description copied from interface:StringRedisConnection
Assign given name to current connection.- Specified by:
setClientName
in interfaceStringRedisConnection
- See Also:
-
killClient
Description copied from interface:RedisServerCommands
Closes a given client connection identified by host:port.- Specified by:
killClient
in interfaceDefaultedRedisConnection
- Specified by:
killClient
in interfaceRedisServerCommands
- Parameters:
host
- of connection to close.port
- of connection to close- See Also:
-
getClientName
Description copied from interface:RedisServerCommands
Returns the name of the current connection.- Specified by:
getClientName
in interfaceDefaultedRedisConnection
- Specified by:
getClientName
in interfaceRedisServerCommands
- Returns:
- null when used in pipeline / transaction.
- See Also:
-
hScan
Description copied from interface:StringRedisConnection
Use aCursor
to iterate over entries in hash atkey
.- Specified by:
hScan
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.options
- must not be null.- Returns:
- See Also:
-
hStrLen
Description copied from interface:StringRedisConnection
Returns the length of the value associated withfield
in the hash stored atkey
. If the key or the field do not exist,0
is returned.- Specified by:
hStrLen
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- null when used in pipeline / transaction.
-
sScan
Description copied from interface:StringRedisConnection
Use aCursor
to iterate over elements in set atkey
.- Specified by:
sScan
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.options
- must not be null.- Returns:
- See Also:
-
zScan
Description copied from interface:StringRedisConnection
Use aCursor
to iterate over elements in sorted set atkey
.- Specified by:
zScan
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.options
- must not be null.- Returns:
- See Also:
-
getSentinelConnection
- Specified by:
getSentinelConnection
in interfaceRedisConnection
- Returns:
-
zRangeByScore
Description copied from interface:StringRedisConnection
Get elements where score is betweenmin
andmax
from sorted set.- Specified by:
zRangeByScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.min
- must not be null.max
- must not be null.- Returns:
- See Also:
-
zRangeByScore
Description copied from interface:StringRedisConnection
Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.- Specified by:
zRangeByScore
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.min
- must not be null.max
- must not be null.- Returns:
- See Also:
-
zRangeByScore
Description copied from interface:RedisZSetCommands
Get elements where score is betweenmin
andmax
from sorted set.- Specified by:
zRangeByScore
in interfaceDefaultedRedisConnection
- Specified by:
zRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeByScore
Description copied from interface:RedisZSetCommands
Get elements in range fromstart
toend
where score is betweenmin
andmax
from sorted set.- Specified by:
zRangeByScore
in interfaceDefaultedRedisConnection
- Specified by:
zRangeByScore
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.min
- must not be null.max
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
pfAdd
Description copied from interface:RedisHyperLogLogCommands
Adds given values to the HyperLogLog stored at given key.- Specified by:
pfAdd
in interfaceDefaultedRedisConnection
- Specified by:
pfAdd
in interfaceRedisHyperLogLogCommands
- Parameters:
key
- must not be null.values
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
pfAdd
Description copied from interface:StringRedisConnection
Adds given values to the HyperLogLog stored at given key.- Specified by:
pfAdd
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.values
- must not be null.- Returns:
- See Also:
-
pfCount
Description copied from interface:RedisHyperLogLogCommands
Return the approximated cardinality of the structures observed by the HyperLogLog at key(s).- Specified by:
pfCount
in interfaceDefaultedRedisConnection
- Specified by:
pfCount
in interfaceRedisHyperLogLogCommands
- Parameters:
keys
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
pfCount
Description copied from interface:StringRedisConnection
Return the approximated cardinality of the structures observed by the HyperLogLog at key(s).- Specified by:
pfCount
in interfaceStringRedisConnection
- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
pfMerge
public void pfMerge(byte[] destinationKey, byte[]... sourceKeys) Description copied from interface:RedisHyperLogLogCommands
Merge N different HyperLogLogs at sourceKeys into a single destinationKey.- Specified by:
pfMerge
in interfaceDefaultedRedisConnection
- Specified by:
pfMerge
in interfaceRedisHyperLogLogCommands
- Parameters:
destinationKey
- must not be null.sourceKeys
- must not be null.- See Also:
-
pfMerge
Description copied from interface:StringRedisConnection
Merge N different HyperLogLogs at sourceKeys into a single destinationKey.- Specified by:
pfMerge
in interfaceStringRedisConnection
- Parameters:
destinationKey
- must not be null.sourceKeys
- must not be null.- See Also:
-
zRangeByLex
Description copied from interface:RedisZSetCommands
Get all the elements in the sorted set at key in lexicographical ordering.- Specified by:
zRangeByLex
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeByLex
Description copied from interface:RedisZSetCommands
Get all the elements inRange
from the sorted set at key in lexicographical ordering.- Specified by:
zRangeByLex
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeByLex
public Set<byte[]> zRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> range, Limit limit) Description copied from interface:RedisZSetCommands
Get all the elements inRange
from the sorted set at key in lexicographical ordering. Result is limited viaRedisZSetCommands.Limit
.- Specified by:
zRangeByLex
in interfaceDefaultedRedisConnection
- Specified by:
zRangeByLex
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeByLex
Description copied from interface:StringRedisConnection
Get all the elements in the sorted set at key in lexicographical ordering.- Specified by:
zRangeByLex
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.- Returns:
- See Also:
-
zRangeByLex
Description copied from interface:StringRedisConnection
Get all the elements inRedisZSetCommands.Range
from the sorted set at key in lexicographical ordering.- Specified by:
zRangeByLex
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.range
- must not be null.- Returns:
- See Also:
-
zRangeByLex
public Set<String> zRangeByLex(String key, org.springframework.data.domain.Range<String> range, Limit limit) Description copied from interface:StringRedisConnection
Get all the elements inRedisZSetCommands.Range
from the sorted set at key in lexicographical ordering. Result is limited viaLimit
.- Specified by:
zRangeByLex
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.range
- must not be null.limit
- can be null.- Returns:
- See Also:
-
zRevRangeByLex
public Set<byte[]> zRevRangeByLex(byte[] key, org.springframework.data.domain.Range<byte[]> range, Limit limit) Description copied from interface:RedisZSetCommands
Get all the elements inRange
from the sorted set at key in reversed lexicographical ordering. Result is limited viaRedisZSetCommands.Limit
.- Specified by:
zRevRangeByLex
in interfaceDefaultedRedisConnection
- Specified by:
zRevRangeByLex
in interfaceRedisZSetCommands
- Parameters:
key
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRevRangeByLex
public Set<String> zRevRangeByLex(String key, org.springframework.data.domain.Range<String> range, Limit limit) Description copied from interface:StringRedisConnection
Get all the elements inRedisZSetCommands.Range
from the sorted set at key in reversed lexicographical ordering. Result is limited viaLimit
.- Specified by:
zRevRangeByLex
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- See Also:
-
zRangeStoreByLex
public Long zRangeStoreByLex(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.Range<byte[]> range, Limit limit) Description copied from interface:RedisZSetCommands
This command is like ZRANGE , but stores the result in the dstKey destination key.- Specified by:
zRangeStoreByLex
in interfaceDefaultedRedisConnection
- Specified by:
zRangeStoreByLex
in interfaceRedisZSetCommands
- Parameters:
dstKey
- must not be null.srcKey
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeStoreByLex
public Long zRangeStoreByLex(String dstKey, String srcKey, org.springframework.data.domain.Range<String> range, Limit limit) Description copied from interface:StringRedisConnection
This command is like ZRANGE , but stores the result in the dstKey destination key.- Specified by:
zRangeStoreByLex
in interfaceStringRedisConnection
- Parameters:
dstKey
- must not be null.srcKey
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeStoreRevByLex
public Long zRangeStoreRevByLex(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.Range<byte[]> range, Limit limit) Description copied from interface:RedisZSetCommands
This command is like ZRANGE … REV , but stores the result in the dstKey destination key.- Specified by:
zRangeStoreRevByLex
in interfaceDefaultedRedisConnection
- Specified by:
zRangeStoreRevByLex
in interfaceRedisZSetCommands
- Parameters:
dstKey
- must not be null.srcKey
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeStoreRevByLex
public Long zRangeStoreRevByLex(String dstKey, String srcKey, org.springframework.data.domain.Range<String> range, Limit limit) Description copied from interface:StringRedisConnection
This command is like ZRANGE … REV , but stores the result in the dstKey destination key.- Specified by:
zRangeStoreRevByLex
in interfaceStringRedisConnection
- Parameters:
dstKey
- must not be null.srcKey
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeStoreByScore
public Long zRangeStoreByScore(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Description copied from interface:RedisZSetCommands
This command is like ZRANGE, but stores the result in the dstKey destination key.- Specified by:
zRangeStoreByScore
in interfaceDefaultedRedisConnection
- Specified by:
zRangeStoreByScore
in interfaceRedisZSetCommands
- Parameters:
dstKey
- must not be null.srcKey
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeStoreByScore
public Long zRangeStoreByScore(String dstKey, String srcKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Description copied from interface:StringRedisConnection
This command is like ZRANGE, but stores the result in the dstKey destination key.- Specified by:
zRangeStoreByScore
in interfaceStringRedisConnection
- Parameters:
dstKey
- must not be null.srcKey
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeStoreRevByScore
public Long zRangeStoreRevByScore(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Description copied from interface:RedisZSetCommands
This command is like ZRANGE … REV, but stores the result in the dstKey destination key.- Specified by:
zRangeStoreRevByScore
in interfaceDefaultedRedisConnection
- Specified by:
zRangeStoreRevByScore
in interfaceRedisZSetCommands
- Parameters:
dstKey
- must not be null.srcKey
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
zRangeStoreRevByScore
public Long zRangeStoreRevByScore(String dstKey, String srcKey, org.springframework.data.domain.Range<? extends Number> range, Limit limit) Description copied from interface:StringRedisConnection
This command is like ZRANGE … REV, but stores the result in the dstKey destination key.- Specified by:
zRangeStoreRevByScore
in interfaceStringRedisConnection
- Parameters:
dstKey
- must not be null.srcKey
- must not be null.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
migrate
public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable RedisServerCommands.MigrateOption option) Description copied from interface:RedisServerCommands
Atomically transfer a key from a source Redis instance to a destination Redis instance. On success the key is deleted from the original instance and is guaranteed to exist in the target instance.- Specified by:
migrate
in interfaceDefaultedRedisConnection
- Specified by:
migrate
in interfaceRedisServerCommands
- Parameters:
key
- must not be null.target
- must not be null.option
- can be null. Defaulted toRedisServerCommands.MigrateOption.COPY
.- See Also:
-
migrate
public void migrate(byte[] key, RedisNode target, int dbIndex, @Nullable RedisServerCommands.MigrateOption option, long timeout) Description copied from interface:RedisServerCommands
Atomically transfer a key from a source Redis instance to a destination Redis instance. On success the key is deleted from the original instance and is guaranteed to exist in the target instance.- Specified by:
migrate
in interfaceDefaultedRedisConnection
- Specified by:
migrate
in interfaceRedisServerCommands
- Parameters:
key
- must not be null.target
- must not be null.option
- can be null. Defaulted toRedisServerCommands.MigrateOption.COPY
.- See Also:
-
xAck
- Specified by:
xAck
in interfaceStringRedisConnection
-
xAdd
Description copied from interface:StringRedisConnection
Append the givenStringRecord
to the stream stored atRecord.getStream()
.- Specified by:
xAdd
in interfaceStringRedisConnection
- Parameters:
record
- must not be null.options
- must not be null, useRedisStreamCommands.XAddOptions.none()
instead.- Returns:
- the record Id. null when used in pipeline / transaction.
-
xClaimJustId
public List<RecordId> xClaimJustId(String key, String group, String consumer, RedisStreamCommands.XClaimOptions options) Description copied from interface:StringRedisConnection
Change the ownership of a pending message to the given new consumer without increasing the delivered count.- Specified by:
xClaimJustId
in interfaceStringRedisConnection
- Parameters:
key
- the key the stream is stored at.group
- the name of the consumer group.consumer
- the name of the new consumer.options
- must not be null.- Returns:
- list of
ids
that changed user. - See Also:
-
xClaim
public List<StringRecord> xClaim(String key, String group, String consumer, RedisStreamCommands.XClaimOptions options) Description copied from interface:StringRedisConnection
Change the ownership of a pending message to the given new consumer.- Specified by:
xClaim
in interfaceStringRedisConnection
- Parameters:
key
- the key the stream is stored at.group
- the name of the consumer group.consumer
- the name of the new consumer.options
- must not be null.- Returns:
- list of
StringRecord
that changed user. - See Also:
-
xDel
- Specified by:
xDel
in interfaceStringRedisConnection
-
xGroupCreate
Description copied from interface:StringRedisConnection
Create a consumer group.- Specified by:
xGroupCreate
in interfaceStringRedisConnection
- Parameters:
key
- the stream key.group
- name of the consumer group.- Returns:
- true if successful. null when used in pipeline / transaction.
-
xGroupCreate
Description copied from interface:StringRedisConnection
Create a consumer group.- Specified by:
xGroupCreate
in interfaceStringRedisConnection
- Parameters:
key
- the stream key.group
- name of the consumer group.mkStream
- if true the group will create the stream if needed (MKSTREAM)- Returns:
- true if successful. null when used in pipeline / transaction.
-
xGroupDelConsumer
Description copied from interface:StringRedisConnection
Delete a consumer from a consumer group.- Specified by:
xGroupDelConsumer
in interfaceStringRedisConnection
- Parameters:
key
- the stream key.consumer
- consumer identified by group name and consumer key.- Returns:
- true if successful. null when used in pipeline / transaction.
-
xGroupDestroy
Description copied from interface:StringRedisConnection
Destroy a consumer group.- Specified by:
xGroupDestroy
in interfaceStringRedisConnection
- Parameters:
key
- the stream key.group
- name of the consumer group.- Returns:
- true if successful. null when used in pipeline / transaction.
-
xInfo
Description copied from interface:StringRedisConnection
Obtain general information about the stream stored at the specified key.- Specified by:
xInfo
in interfaceStringRedisConnection
- Parameters:
key
- the key the stream is stored at.- Returns:
- null when used in pipeline / transaction.
-
xInfoGroups
Description copied from interface:StringRedisConnection
Obtain information about consumer groups associated with the stream stored at the specified key.- Specified by:
xInfoGroups
in interfaceStringRedisConnection
- Parameters:
key
- the key the stream is stored at.- Returns:
- null when used in pipeline / transaction.
-
xInfoConsumers
Description copied from interface:StringRedisConnection
Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.- Specified by:
xInfoConsumers
in interfaceStringRedisConnection
- Parameters:
key
- the key the stream is stored at.groupName
- name of the consumer group.- Returns:
- null when used in pipeline / transaction.
-
xLen
Description copied from interface:StringRedisConnection
Get the length of a stream.- Specified by:
xLen
in interfaceStringRedisConnection
- Parameters:
key
- the stream key.- Returns:
- length of the stream. null when used in pipeline / transaction.
- See Also:
-
xPending
Description copied from interface:StringRedisConnection
Obtain thePendingMessagesSummary
for a given consumer group.- Specified by:
xPending
in interfaceStringRedisConnection
- Parameters:
key
- the key the stream is stored at. Must not be null.groupName
- the name of the consumer group. Must not be null.- Returns:
- a summary of pending messages within the given consumer group or null when used in pipeline / transaction.
- See Also:
-
xPending
public PendingMessages xPending(String key, String groupName, String consumer, org.springframework.data.domain.Range<String> range, Long count) Description copied from interface:StringRedisConnection
Obtain detailed information about pendingmessages
for a givenRange
within a consumer group.- Specified by:
xPending
in interfaceStringRedisConnection
- Parameters:
key
- the key the stream is stored at. Must not be null.groupName
- the name of the consumer group. Must not be null.consumer
- the name of the consumer. Must not be null.range
- the range of messages ids to search within. Must not be null.count
- limit the number of results. Must not be null.- Returns:
- pending messages for the given consumer group or null when used in pipeline / transaction.
- See Also:
-
xPending
public PendingMessages xPending(String key, String groupName, org.springframework.data.domain.Range<String> range, Long count) Description copied from interface:StringRedisConnection
Obtain detailed information about pendingmessages
for a givenRange
within a consumer group.- Specified by:
xPending
in interfaceStringRedisConnection
- Parameters:
key
- the key the stream is stored at. Must not be null.groupName
- the name of the consumer group. Must not be null.range
- the range of messages ids to search within. Must not be null.count
- limit the number of results. Must not be null.- Returns:
- pending messages for the given consumer group or null when used in pipeline / transaction.
- See Also:
-
xPending
public PendingMessages xPending(String key, String groupName, RedisStreamCommands.XPendingOptions options) Description copied from interface:StringRedisConnection
- Specified by:
xPending
in interfaceStringRedisConnection
- Parameters:
key
- the key the stream is stored at. Must not be null.groupName
- the name of the consumer group. Must not be null.options
- the options containing range, consumer and count. Must not be null.- Returns:
- pending messages matching given criteria or null when used in pipeline / transaction.
- See Also:
-
xRange
public List<StringRecord> xRange(String key, org.springframework.data.domain.Range<String> range, Limit limit) Description copied from interface:StringRedisConnection
Read records from a stream within a specificRedisZSetCommands.Range
applying aLimit
.- Specified by:
xRange
in interfaceStringRedisConnection
- Parameters:
key
- the stream key.range
- must not be null.limit
- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
xReadAsString
public List<StringRecord> xReadAsString(StreamReadOptions readOptions, StreamOffset<String>... streams) Description copied from interface:StringRedisConnection
Read records from one or moreStreamOffset
s.- Specified by:
xReadAsString
in interfaceStringRedisConnection
- Parameters:
readOptions
- read arguments.streams
- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
xReadGroupAsString
public List<StringRecord> xReadGroupAsString(Consumer consumer, StreamReadOptions readOptions, StreamOffset<String>... streams) Description copied from interface:StringRedisConnection
Read records from one or moreStreamOffset
s using a consumer group.- Specified by:
xReadGroupAsString
in interfaceStringRedisConnection
- Parameters:
consumer
- consumer/group.readOptions
- read arguments.streams
- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
xRevRange
public List<StringRecord> xRevRange(String key, org.springframework.data.domain.Range<String> range, Limit limit) Description copied from interface:StringRedisConnection
Read records from a stream within a specificRedisZSetCommands.Range
applying aLimit
in reverse order.- Specified by:
xRevRange
in interfaceStringRedisConnection
- Parameters:
key
- the stream key.range
- must not be null.limit
- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
xTrim
Description copied from interface:StringRedisConnection
Trims the stream tocount
elements.- Specified by:
xTrim
in interfaceStringRedisConnection
- Parameters:
key
- the stream key.count
- length of the stream.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- See Also:
-
xTrim
Description copied from interface:StringRedisConnection
Trims the stream tocount
elements.- Specified by:
xTrim
in interfaceStringRedisConnection
- Parameters:
key
- the stream key.count
- length of the stream.approximateTrimming
- the trimming must be performed in a approximated way in order to maximize performances.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- See Also:
-
xAck
Description copied from interface:RedisStreamCommands
Acknowledge one or more records, identified via their id, as processed.- Specified by:
xAck
in interfaceDefaultedRedisConnection
- Specified by:
xAck
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.group
- name of the consumer group.recordIds
- the id's of the records to acknowledge.- Returns:
- length of acknowledged messages. null when used in pipeline / transaction.
- See Also:
-
xAdd
public RecordId xAdd(MapRecord<byte[], byte[], byte[]> record, RedisStreamCommands.XAddOptions options) Description copied from interface:RedisStreamCommands
Append the givenrecord
to the stream stored atRecord#getStream
. If you prefer manual id assignment over server generated ones make sure to provide an id viaRecord#withId
.- Specified by:
xAdd
in interfaceDefaultedRedisConnection
- Specified by:
xAdd
in interfaceRedisStreamCommands
- Parameters:
record
- therecord
to append.options
- additional options (eg. MAXLEN). Must not be null, useRedisStreamCommands.XAddOptions.none()
instead.- Returns:
- the
id
after save. null when used in pipeline / transaction.
-
xClaimJustId
public List<RecordId> xClaimJustId(byte[] key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Description copied from interface:RedisStreamCommands
Change the ownership of a pending message to the given new consumer without increasing the delivered count.- Specified by:
xClaimJustId
in interfaceDefaultedRedisConnection
- Specified by:
xClaimJustId
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.group
- the name of the consumer group.newOwner
- the name of the new consumer.options
- must not be null.- Returns:
- list of
ids
that changed user. - See Also:
-
xClaim
public List<ByteRecord> xClaim(byte[] key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Description copied from interface:RedisStreamCommands
Change the ownership of a pending message to the given new consumer.- Specified by:
xClaim
in interfaceDefaultedRedisConnection
- Specified by:
xClaim
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.group
- the name of the consumer group.newOwner
- the name of the new consumer.options
- must not be null.- Returns:
- list of
ByteRecord
that changed user. - See Also:
-
xDel
Description copied from interface:RedisStreamCommands
Removes the records with the given id's from the stream. Returns the number of items deleted, that may be different from the number of id's passed in case certain id's do not exist.- Specified by:
xDel
in interfaceDefaultedRedisConnection
- Specified by:
xDel
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.recordIds
- the id's of the records to remove.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- See Also:
-
xGroupCreate
Description copied from interface:RedisStreamCommands
Create a consumer group.- Specified by:
xGroupCreate
in interfaceDefaultedRedisConnection
- Specified by:
xGroupCreate
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.groupName
- name of the consumer group to create.readOffset
- the offset to start at.- Returns:
- ok if successful. null when used in pipeline / transaction.
-
xGroupCreate
Description copied from interface:RedisStreamCommands
Create a consumer group.- Specified by:
xGroupCreate
in interfaceDefaultedRedisConnection
- Specified by:
xGroupCreate
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.groupName
- name of the consumer group to create.readOffset
- the offset to start at.mkStream
- if true the group will create the stream if not already present (MKSTREAM)- Returns:
- ok if successful. null when used in pipeline / transaction.
-
xGroupDelConsumer
Description copied from interface:RedisStreamCommands
Delete a consumer from a consumer group.- Specified by:
xGroupDelConsumer
in interfaceDefaultedRedisConnection
- Specified by:
xGroupDelConsumer
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.consumer
- consumer identified by group name and consumer name.- Returns:
- true if successful. null when used in pipeline / transaction.
-
xGroupDestroy
Description copied from interface:RedisStreamCommands
Destroy a consumer group.- Specified by:
xGroupDestroy
in interfaceDefaultedRedisConnection
- Specified by:
xGroupDestroy
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.groupName
- name of the consumer group.- Returns:
- true if successful. null when used in pipeline / transaction.
-
xInfo
Description copied from interface:RedisStreamCommands
Obtain general information about the stream stored at the specified key.- Specified by:
xInfo
in interfaceDefaultedRedisConnection
- Specified by:
xInfo
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.- Returns:
- null when used in pipeline / transaction.
-
xInfoGroups
Description copied from interface:RedisStreamCommands
Obtain information about consumer groups associated with the stream stored at the specified key.- Specified by:
xInfoGroups
in interfaceDefaultedRedisConnection
- Specified by:
xInfoGroups
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.- Returns:
- null when used in pipeline / transaction.
-
xInfoConsumers
Description copied from interface:RedisStreamCommands
Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.- Specified by:
xInfoConsumers
in interfaceDefaultedRedisConnection
- Specified by:
xInfoConsumers
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.groupName
- name of the consumer group.- Returns:
- null when used in pipeline / transaction.
-
xLen
Description copied from interface:RedisStreamCommands
Get the length of a stream.- Specified by:
xLen
in interfaceDefaultedRedisConnection
- Specified by:
xLen
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.- Returns:
- length of the stream. null when used in pipeline / transaction.
- See Also:
-
xPending
Description copied from interface:RedisStreamCommands
Obtain thePendingMessagesSummary
for a given consumer group.- Specified by:
xPending
in interfaceDefaultedRedisConnection
- Specified by:
xPending
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at. Must not be null.groupName
- the name of the consumer group. Must not be null.- Returns:
- a summary of pending messages within the given consumer group or null when used in pipeline / transaction.
- See Also:
-
xPending
public PendingMessages xPending(byte[] key, String groupName, RedisStreamCommands.XPendingOptions options) Description copied from interface:RedisStreamCommands
- Specified by:
xPending
in interfaceDefaultedRedisConnection
- Specified by:
xPending
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at. Must not be null.groupName
- the name of the consumer group. Must not be null.options
- the options containing range, consumer and count. Must not be null.- Returns:
- pending messages matching given criteria or null when used in pipeline / transaction.
- See Also:
-
xRange
public List<ByteRecord> xRange(byte[] key, org.springframework.data.domain.Range<String> range, Limit limit) Description copied from interface:RedisStreamCommands
Retrieve alimited number
ofrecords
within a specificRange
from the stream stored at key.
UseRange.unbounded()
to read from the minimum and the maximum ID possible.
UseLimit.unlimited()
to read all records.- Specified by:
xRange
in interfaceDefaultedRedisConnection
- Specified by:
xRange
in interfaceRedisStreamCommands
- Parameters:
key
- the key the stream is stored at.range
- must not be null.limit
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
xRead
Description copied from interface:RedisStreamCommands
Read records from one or moreStreamOffset
s.- Specified by:
xRead
in interfaceDefaultedRedisConnection
- Specified by:
xRead
in interfaceRedisStreamCommands
- Parameters:
readOptions
- read arguments.streams
- the streams to read from.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
xReadGroup
public List<ByteRecord> xReadGroup(Consumer consumer, StreamReadOptions readOptions, StreamOffset<byte[]>... streams) Description copied from interface:RedisStreamCommands
Read records from one or moreStreamOffset
s using a consumer group.- Specified by:
xReadGroup
in interfaceDefaultedRedisConnection
- Specified by:
xReadGroup
in interfaceRedisStreamCommands
- Parameters:
consumer
- consumer/group.readOptions
- read arguments.streams
- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
xRevRange
public List<ByteRecord> xRevRange(byte[] key, org.springframework.data.domain.Range<String> range, Limit limit) Description copied from interface:RedisStreamCommands
Read records from a stream within a specificRange
applying aLimit
in reverse order.- Specified by:
xRevRange
in interfaceDefaultedRedisConnection
- Specified by:
xRevRange
in interfaceRedisStreamCommands
- Parameters:
key
- the stream key.range
- must not be null.limit
- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- See Also:
-
xTrim
Description copied from interface:RedisStreamCommands
Trims the stream tocount
elements.- Specified by:
xTrim
in interfaceDefaultedRedisConnection
- Specified by:
xTrim
in interfaceRedisStreamCommands
- Parameters:
key
- the stream key.count
- length of the stream.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- See Also:
-
xTrim
Description copied from interface:RedisStreamCommands
Trims the stream tocount
elements.- Specified by:
xTrim
in interfaceDefaultedRedisConnection
- Specified by:
xTrim
in interfaceRedisStreamCommands
- Parameters:
key
- the stream key.count
- length of the stream.approximateTrimming
- the trimming must be performed in a approximated way in order to maximize performances.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- See Also:
-
setDeserializePipelineAndTxResults
public void setDeserializePipelineAndTxResults(boolean deserializePipelineAndTxResults) Specifies if pipelined and tx results should be deserialized to Strings. If false, results ofclosePipeline()
andexec()
will be of the type returned by the underlying connection- Parameters:
deserializePipelineAndTxResults
- Whether or not to deserialize pipeline and tx results
-
bitField
Description copied from interface:RedisStringCommands
Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey
.- Specified by:
bitField
in interfaceDefaultedRedisConnection
- Specified by:
bitField
in interfaceRedisStringCommands
- Parameters:
key
- must not be null.subCommands
- must not be null.- Returns:
- null when used in pipeline / transaction.
-
bitfield
Description copied from interface:StringRedisConnection
Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey
.- Specified by:
bitfield
in interfaceStringRedisConnection
- Parameters:
key
- must not be null.operation
- must not be null.- Returns:
-
getDelegate
Description copied from interface:DecoratedRedisConnection
Gets the underlyingRedisConnection
.- Specified by:
getDelegate
in interfaceDecoratedRedisConnection
- Returns:
- never null.
-