Interface StringRedisConnection
- All Superinterfaces:
AutoCloseable,DefaultedRedisConnection,RedisCommands,RedisCommandsProvider,RedisConnection,RedisConnectionCommands,RedisGeoCommands,RedisHashCommands,RedisHyperLogLogCommands,RedisKeyCommands,RedisListCommands,RedisPubSubCommands,RedisScriptingCommands,RedisServerCommands,RedisSetCommands,RedisStreamCommands,RedisStringCommands,RedisTxCommands,RedisZSetCommands
- All Known Implementing Classes:
DefaultStringRedisConnection
Convenience extension of
RedisConnection that accepts and returns Strings instead of byte arrays.
Uses a RedisSerializer underneath to perform the conversion.- Author:
- Costin Leau, Christoph Strobl, Thomas Darimont, David Liu, Mark Paluch, Ninad Divadkar, Tugdual Grall, Dengliming, Andrey Shlykov, ihaohong, Shyngys Sapraliyev
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceString-friendly ZSet tuple.Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoCommandArgs, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs, RedisGeoCommands.GeoSearchCommandArgs, RedisGeoCommands.GeoSearchStoreCommandArgsNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisListCommands
RedisListCommands.Direction, RedisListCommands.PositionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisServerCommands
RedisServerCommands.FlushOption, RedisServerCommands.MigrateOption, RedisServerCommands.ShutdownOptionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
RedisStreamCommands.XAddOptions, RedisStreamCommands.XClaimOptions, RedisStreamCommands.XPendingOptionsNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStringCommands
RedisStringCommands.BitOperation, RedisStringCommands.SetOptionNested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.ZAddArgs -
Method Summary
Modifier and TypeMethodDescriptionAppend avaluetokey.Count the number of set bits (population counting) in value stored atkey.Count the number of set bits (population counting) of value stored atkeybetweenstartandend.bitfield(String key, BitFieldSubCommands command) Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey.bitOp(RedisStringCommands.BitOperation op, String destination, String... keys) Perform bitwise operations between strings.default LongReturn the position of the first bit set to givenbitin a string.Return the position of the first bit set to givenbitin a string.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 thefromargument) of the list stored atsourceKey, and pushes the element at the first/last element (head/tail depending on thetoargument) of the list stored atdestinationKey.Removes and returns first element from lists stored atkeys(see:DefaultedRedisConnection.lPop(byte[])).Removes and returns last element from lists stored atkeys(see:DefaultedRedisConnection.rPop(byte[])).bRPopLPush(int timeout, String srcKey, String dstKey) Remove the last element from list atsrcKey, append it todstKeyand 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 lowest score from sorted set atkey.Copy givensourceKeytotargetKey.Decrement an integer value stored as string value ofkeyby 1.Decrement an integer value stored as string value ofkeybyvalue.Delete givenkeys.Returnsmessagevia server roundtrip.encodingOf(String key) Get the type of internal representation used for storing the value at the givenkey.static RecordId[]<T> Teval(String script, ReturnType returnType, int numKeys, String... keysAndArgs) Evaluate givenscript.<T> TevalSha(String scriptSha, ReturnType returnType, int numKeys, String... keysAndArgs) Evaluate givenscriptSha.'Native' or 'raw' execution of the given command along-side the given arguments.'Native' or 'raw' execution of the given command along-side the given arguments.Determine if givenkeyexists.Count how many of the givenkeysexist.Set time to live for givenkeyin seconds.Set the expiration for givenkeyas a UNIX timestamp.geoAdd(String key, Iterable<RedisGeoCommands.GeoLocation<String>> locations) AddRedisGeoCommands.GeoLocations to keyAddPointwith given member name to key.geoAdd(String key, RedisGeoCommands.GeoLocation<String> location) AddRedisGeoCommands.GeoLocationto key.Get theDistancebetween member1 and member2.Get geohash representation of the position for one or more members.Get thePointrepresentation of positions for one or more members.Get the members within the boundaries of a givenCircle.geoRadius(String key, Circle within, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircleapplyingRedisGeoCommands.GeoRadiusCommandArgs.geoRadiusByMember(String key, String member, double radius) Get the members within the circle defined by the members coordinates and given radius.geoRadiusByMember(String key, String member, Distance radius) Get the members within the circle defined by the members coordinates and givenDistance.geoRadiusByMember(String key, String member, Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates and givenDistanceandRedisGeoCommands.GeoRadiusCommandArgs.Remove the members.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(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 givenshapeand store the result atdestKey.Get the value ofkey.Get the bit value atoffsetof value atkey.Request information and statistics about connected clients.Return the value atkeyand delete the key.getEx(String key, Expiration expiration) Return the value atkeyand expire the key by applyingExpiration.Get a substring of value ofkeybetweenstartandend.Setvalueofkeyand return its old value.Delete given hashfields.Determine if given hashfieldexists.Get value for givenfieldfrom hash atkey.Get entire hash stored atkey.Incrementvalueof a hashfieldby the givendelta.Incrementvalueof a hashfieldby the givendelta.Get key set (fields) of hash atkey.Get size of hash atkey.Get values for givenfieldsfrom hash atkey.voidSet multiple hash fields to multiple values using data provided inhasheshRandField(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.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(String key, ScanOptions options) Use aCursorto iterate over entries in hash atkey.Set thevalueof a hashfield.Set thevalueof a hashfieldonly iffielddoes not exist.Returns the length of the value associated withfieldin the hash stored atkey.Get entry set (values) of hash atfield.Get theDurationsince the object stored at the givenkeyis idle.Increment an integer value stored as string value ofkeyby 1.Increment a floating point number value ofkeybydelta.Increment an integer value stored ofkeybydelta.Retrieve all keys matching the given pattern viaKEYScommand.Get element atindexform list atkey.lInsert(String key, RedisListCommands.Position where, String pivot, String value) InsertvalueRedisListCommands.Position.BEFOREorRedisListCommands.Position.AFTERexistingpivotforkey.Get the size of list stored atkey.lMove(String sourceKey, String destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to) Atomically returns and removes the first/last element (head/tail depending on thefromargument) of the list stored atsourceKey, and pushes the element at the first/last element (head/tail depending on thetoargument) of the list stored atdestinationKey.Removes and returns first element in list stored atkey.Removes and returns first elements in list stored atkey.default LongReturns 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.Prependvaluestokey.Prependvaluestokeyonly if the list exists.Get elements betweenstartandendfrom list atkey.Removes the firstcountoccurrences ofvaluefrom the list stored atkey.voidSet thevaluelist element atindex.voidTrim list atkeyto elements betweenstartandend.Get multiplekeys.Move givenkeyto database withindex.mSetNXString(Map<String, String> tuple) Set multiple keys to multiple values using key-value pairs provided intupleonly if the provided key does not exist.mSetString(Map<String, String> tuple) Set multiple keys to multiple values using key-value pairs provided intuple.Remove the expiration from givenkey.Set time to live for givenkeyin milliseconds.Set the expiration for givenkeyas a UNIX timestamp in milliseconds.Adds given values to the HyperLogLog stored at given key.Return the approximated cardinality of the structures observed by the HyperLogLog at key(s).voidMerge N different HyperLogLogs at sourceKeys into a single destinationKey.Set thevalueand expiration inmillisecondsforkey.voidpSubscribe(MessageListener listener, String... patterns) Subscribes the connection to all channels matching the given patterns.Get the precise time to live forkeyin milliseconds.Get the precise time to live forkeyin and convert it to the givenTimeUnit.Publishes the given message to the given channel.Get the number of references of the value associated with the specifiedkey.voidRename keyoldKeytonewKey.Rename keyoldKeytonewKeyonly ifnewKeydoes not exist.Removes and returns last element in list stored atkey.Removes and returns last elements in list stored atkey.Remove the last element from list atsrcKey, append it todstKeyand return its value.Appendvaluestokey.Appendvaluestokeyonly if the list exists.Add givenvaluesto set atkey.Get size of set atkey.scriptLoad(String script) Load lua script into scripts cache, without executing it.
Execute the script by callingDefaultedRedisConnection.evalSha(byte[], ReturnType, int, byte[]...).Diff all sets for givenkeys.sDiffStore(String destKey, String... keys) Diff all sets for givenkeysand store result indestKey.Setvalueforkey.set(String key, String value, Expiration expiration, RedisStringCommands.SetOption option) Setvalueforkeyapplying timeouts fromexpirationif set and inserting/updating values depending onoption.Sets the bit atoffsetin value stored atkey.voidsetClientName(String name) Assign given name to current connection.Set thevalueand expiration insecondsforkey.Setvalueforkey, only ifkeydoes not exist.voidOverwrite parts ofkeystarting at the specifiedoffsetwith givenvalue.Returns the members intersecting all given sets atkeys.sInterStore(String destKey, String... keys) Intersect all given sets atkeysand store result indestKey.Check if set atkeycontainsvalue.Get all elements of set atkey.sMIsMember(String key, String... values) Check if set atkeycontains one or morevalues.MovevaluefromsrcKeytodestKeysort(String key, SortParameters params) Sort the elements forkey.sort(String key, SortParameters params, String storeKey) Sort the elements forkeyand store result instoreKey.Remove and return a random member from set atkey.Remove and returncountrandom members from set atkey.sRandMember(String key) Get random element from set atkey.sRandMember(String key, long count) Getcountrandom elements from set atkey.Remove givenvaluesfrom set atkeyand return the number of removed elements.sScan(String key, ScanOptions options) Use aCursorto iterate over elements in set atkey.Get the length of the value stored atkey.voidsubscribe(MessageListener listener, String... channels) Subscribes the connection to the given channels.Union all sets at givenkeys.sUnionStore(String destKey, String... keys) Union all sets at givenkeysand store result indestKey.Alter the last access time of givenkey(s).Get the time to live forkeyin seconds.Get the time to live forkeyin and convert it to the givenTimeUnit.Determine the type stored atkey.Unlink thekeysfrom the keyspace.default LongAcknowledge one or more record as processed.default RecordIdAppend a record to the streamkey.default RecordIdxAdd(StringRecord record) Append the givenStringRecordto the stream stored atRecord.getStream().xAdd(StringRecord record, RedisStreamCommands.XAddOptions options) Append the givenStringRecordto the stream stored atRecord.getStream().default List<StringRecord>Change the ownership of a pending message to the given new consumer.xClaim(String key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer.xClaimJustId(String 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.default LongRemoves the specified entries from the stream.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(String key, Consumer consumer) Delete a consumer from a consumer group.xGroupDestroy(String key, String group) Destroy a consumer group.Obtain general information about 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(String key) Obtain information about consumer groups associated with the stream stored at the specified key.Get the length of a stream.Obtain thePendingMessagesSummaryfor a given consumer group.xPending(String key, String groupName, RedisStreamCommands.XPendingOptions options) default List<StringRecord>Read records from a stream within a specificRedisZSetCommands.Range.Read records from a stream within a specificRedisZSetCommands.Rangeapplying aLimit.default List<StringRecord>xReadAsString(StreamOffset<String> stream) Read records from one or moreStreamOffsets.default List<StringRecord>xReadAsString(StreamOffset<String>... streams) Read records from one or moreStreamOffsets.default List<StringRecord>xReadAsString(StreamReadOptions readOptions, StreamOffset<String> stream) Read records from one or moreStreamOffsets.xReadAsString(StreamReadOptions readOptions, StreamOffset<String>... streams) Read records from one or moreStreamOffsets.default List<StringRecord>xReadGroupAsString(Consumer consumer, StreamOffset<String> stream) Read records from one or moreStreamOffsets using a consumer group.default List<StringRecord>xReadGroupAsString(Consumer consumer, StreamOffset<String>... streams) Read records from one or moreStreamOffsets using a consumer group.default List<StringRecord>xReadGroupAsString(Consumer consumer, StreamReadOptions readOptions, StreamOffset<String> stream) Read records from one or moreStreamOffsets using a consumer group.xReadGroupAsString(Consumer consumer, StreamReadOptions readOptions, StreamOffset<String>... streams) Read records from one or moreStreamOffsets using a consumer group.default List<StringRecord>Read records from a stream within a specificRedisZSetCommands.Rangein reverse order.Read records from a stream within a specificRedisZSetCommands.Rangeapplying aLimitin reverse order.Trims the stream tocountelements.Trims the stream tocountelements.Addvalueto a sorted set atkey, or update itsscoreif it already exists.zAdd(String key, double score, String value, RedisZSetCommands.ZAddArgs args) zAdd(String key, Set<StringRedisConnection.StringTuple> tuples) Addtuplesto a sorted set atkey, or update itsscoreif it already exists.zAdd(String key, Set<StringRedisConnection.StringTuple> tuples, RedisZSetCommands.ZAddArgs args) Get the size of sorted set withkey.Count number of elements within sorted set with scores betweenminandmax.Diff sortedsets.zDiffStore(String destKey, String... sets) Diff sortedsetsand store result in destinationdestKey.zDiffWithScores(String... sets) Diff sortedsets.Increment the score of element withvaluein sorted set byincrement.Intersect sortedsets.zInterStore(String destKey, String... sets) Intersect sortedsetsand store result in destinationkey.zInterStore(String destKey, Aggregate aggregate, int[] weights, String... sets) Intersect sortedsetsand store result in destinationkey.zInterWithScores(String... sets) Intersect sortedsets.default Set<StringRedisConnection.StringTuple>zInterWithScores(Aggregate aggregate, int[] weights, String... sets) Intersect sortedsets.zInterWithScores(Aggregate aggregate, Weights weights, String... sets) Intersect sortedsets.Count number of elements within sorted set with value betweenRange#minandRange#maxapplying lexicographical ordering.Get the scores of elements withvaluesfrom sorted set with keykey.Remove and return the value with its score having the highest score from sorted set atkey.Remove and returncountvalues with their 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 returncountvalues with their score having the lowest score from sorted set atkey.zRandMember(String key) Get random element from sorted set atkey.zRandMember(String key, long count) Getcountrandom elements from sorted set atkey.Get random element from sorted set atkey.zRandMemberWithScores(String key, long count) Getcountrandom elements from sorted set atkey.Get elements betweenstartandendfrom sorted set.zRangeByLex(String key) Get all the elements in the sorted set at key in lexicographical ordering.zRangeByLex(String key, Range<String> range) Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in lexicographical ordering.zRangeByLex(String key, Range<String> range, Limit limit) Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in lexicographical ordering.zRangeByScore(String key, double min, double max) Get elements where score is betweenminandmaxfrom sorted set.zRangeByScore(String key, double min, double max, long offset, long count) Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.zRangeByScore(String key, String min, String max) Get elements where score is betweenminandmaxfrom sorted set.zRangeByScore(String key, String min, String max, long offset, long count) Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.zRangeByScoreWithScores(String key, double min, double max) zRangeByScoreWithScores(String key, double min, double max, long offset, long count) default LongzRangeStoreByLex(String dstKey, String srcKey, Range<String> range) This command is like ZRANGE , but stores the result in the dstKey destination key.This command is like ZRANGE , but stores the result in the dstKey destination key.default LongzRangeStoreByScore(String dstKey, String srcKey, Range<? extends Number> range) This command is like ZRANGE, but stores the result in the dstKey destination key.This command is like ZRANGE, but stores the result in the dstKey destination key.default LongzRangeStoreRevByLex(String dstKey, String srcKey, Range<String> range) This command is like ZRANGE … REV , but stores the result in the dstKey destination key.This command is like ZRANGE … REV , but stores the result in the dstKey destination key.default LongzRangeStoreRevByScore(String dstKey, String srcKey, Range<? extends Number> range) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.This command is like ZRANGE … REV, but stores the result in the dstKey destination key.zRangeWithScores(String key, long start, long end) Determine the index of element withvaluein a sorted set.Removevaluesfrom sorted set.Remove elements in range betweenstartandendfrom sorted set withkey.zRemRangeByLex(String key, Range<String> range) Remove all elements between the lexicographicalRedisZSetCommands.Range.zRemRangeByScore(String key, double min, double max) Remove elements with scores betweenminandmaxfrom sorted set withkey.Get elements in range fromstarttoendfrom sorted set ordered from high to low.zRevRangeByLex(String key) Get all the elements in the sorted set at key in reversed lexicographical ordering.zRevRangeByLex(String key, Range<String> range) Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in reversed lexicographical ordering.zRevRangeByLex(String key, Range<String> range, Limit limit) Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in reversed lexicographical ordering.zRevRangeByScore(String key, double min, double max) Get elements where score is betweenminandmaxfrom sorted set ordered from high to low.zRevRangeByScore(String key, double min, double max, long offset, long count) Get elements in range fromstarttoendwhere score is betweenminandmaxfrom 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 ofTuplein range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.zRevRangeWithScores(String key, long start, long end) Determine the index of element withvaluein a sorted set when scored high to low.zScan(String key, ScanOptions options) Use aCursorto iterate over elements in sorted set atkey.Get the score of element withvaluefrom sorted set with keykey.Union sortedsets.zUnionStore(String destKey, String... sets) Union sortedsetsand store result in destinationkey.zUnionStore(String destKey, Aggregate aggregate, int[] weights, String... sets) Union sortedsetsand store result in destinationkey.zUnionWithScores(String... sets) Union sortedsets.default Set<StringRedisConnection.StringTuple>zUnionWithScores(Aggregate aggregate, int[] weights, String... sets) Union sortedsets.zUnionWithScores(Aggregate aggregate, Weights weights, String... sets) Union sortedsets.Methods inherited from interface org.springframework.data.redis.connection.DefaultedRedisConnection
append, bgReWriteAof, bgSave, bitCount, bitCount, bitField, bitOp, bitPos, bLMove, bLPop, bRPop, bRPopLPush, bZPopMax, bZPopMin, copy, dbSize, decr, decrBy, del, dump, encodingOf, eval, evalSha, evalSha, exists, exists, expire, expireAt, flushAll, flushAll, flushDb, flushDb, geoAdd, geoAdd, geoAdd, geoDist, geoDist, geoHash, geoPos, geoRadius, geoRadius, geoRadiusByMember, geoRadiusByMember, geoRemove, geoSearch, geoSearchStore, get, getBit, getClientName, getConfig, getDel, getEx, getRange, getSet, hDel, hExists, hGet, hGetAll, hIncrBy, hIncrBy, hKeys, hLen, hMGet, hMSet, hRandField, hRandField, hRandFieldWithValues, hRandFieldWithValues, hScan, hSet, hSetNX, hStrLen, hVals, idletime, incr, incrBy, incrBy, info, info, keys, killClient, lastSave, lIndex, lInsert, lLen, lMove, lPop, lPop, lPos, lPush, lPushX, lRange, lRem, lSet, lTrim, mGet, migrate, migrate, move, mSet, mSetNX, persist, pExpire, pExpireAt, pfAdd, pfCount, pfMerge, pSetEx, pTtl, pTtl, randomKey, refcount, rename, renameNX, replicaOf, replicaOfNoOne, resetConfigStats, restore, rewriteConfig, rPop, rPop, rPopLPush, rPush, rPushX, sAdd, save, scan, sCard, scriptExists, scriptFlush, scriptKill, scriptLoad, sDiff, sDiffStore, set, set, setBit, setClientName, setConfig, setEx, setNX, setRange, shutdown, shutdown, sInter, sInterStore, sIsMember, sMembers, sMIsMember, sMove, sort, sort, sPop, sPop, sRandMember, sRandMember, sRem, sScan, strLen, sUnion, sUnionStore, time, time, touch, ttl, ttl, type, unlink, xAck, xAdd, xClaim, xClaimJustId, xDel, xGroupCreate, xGroupCreate, xGroupDelConsumer, xGroupDestroy, xInfo, xInfoConsumers, xInfoGroups, xLen, xPending, xPending, xRange, xRange, xRead, xRead, xReadGroup, xReadGroup, xRevRange, xRevRange, xTrim, xTrim, zAdd, zAdd, zCard, zCount, zCount, zDiff, zDiffStore, zDiffWithScores, zIncrBy, zInter, zInterStore, zInterStore, zInterStore, zInterWithScores, zInterWithScores, zInterWithScores, zLexCount, zMScore, zPopMax, zPopMax, zPopMin, zPopMin, zRandMember, zRandMember, zRandMemberWithScore, zRandMemberWithScore, zRange, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRangeWithScores, zRank, zRem, zRemRange, zRemRangeByLex, zRemRangeByScore, zRemRangeByScore, zRevRange, zRevRangeByLex, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeWithScores, zRevRank, zScan, zScore, zUnion, zUnionStore, zUnionStore, zUnionStore, zUnionWithScores, zUnionWithScores, zUnionWithScoresMethods inherited from interface org.springframework.data.redis.connection.RedisCommands
executeMethods inherited from interface org.springframework.data.redis.connection.RedisCommandsProvider
commands, geoCommands, hashCommands, hyperLogLogCommands, keyCommands, listCommands, scriptingCommands, serverCommands, setCommands, streamCommands, stringCommands, zSetCommandsMethods inherited from interface org.springframework.data.redis.connection.RedisConnection
close, closePipeline, getNativeConnection, getSentinelConnection, isClosed, isPipelined, isQueueing, openPipelineMethods inherited from interface org.springframework.data.redis.connection.RedisConnectionCommands
echo, ping, selectMethods inherited from interface org.springframework.data.redis.connection.RedisGeoCommands
geoAdd, geoRadiusByMemberMethods inherited from interface org.springframework.data.redis.connection.RedisKeyCommands
restore, scanMethods inherited from interface org.springframework.data.redis.connection.RedisListCommands
lPosMethods inherited from interface org.springframework.data.redis.connection.RedisPubSubCommands
getSubscription, isSubscribed, pSubscribe, publish, subscribeMethods inherited from interface org.springframework.data.redis.connection.RedisStreamCommands
xAck, xAdd, xAdd, xClaim, xDel, xGroupDelConsumer, xPending, xPending, xPending, xPending, xPendingMethods inherited from interface org.springframework.data.redis.connection.RedisStringCommands
bitPosMethods inherited from interface org.springframework.data.redis.connection.RedisTxCommands
discard, exec, multi, unwatch, watchMethods inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
zAdd, zAdd, zRangeByLex, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeStoreByLex, zRangeStoreByScore, zRangeStoreRevByLex, zRangeStoreRevByScore, zRevRangeByLex, zRevRangeByLex, zRevRangeByScore, zRevRangeByScore, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores
-
Method Details
-
execute
'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.- Parameters:
command- Command to executeargs- Possible command arguments (may be null)- Returns:
- execution result.
- See Also:
-
execute
'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.- Parameters:
command- Command to execute- Returns:
- execution result.
- See Also:
-
exists
Determine if givenkeyexists.- Parameters:
key- must not be null.- Returns:
- See Also:
-
exists
Count how many of the givenkeysexist.- Parameters:
keys- must not be null.- Returns:
- Since:
- 2.1
- See Also:
-
del
Delete givenkeys.- Parameters:
keys- must not be null.- Returns:
- The number of keys that were removed.
- See Also:
-
copy
Copy givensourceKeytotargetKey.- 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:
-
unlink
Unlink thekeysfrom the keyspace. Unlike withdel(String...)the actual memory reclaiming here happens asynchronously.- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
type
Determine the type stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
touch
Alter the last access time of givenkey(s).- Parameters:
keys- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
- See Also:
-
keys
Retrieve all keys matching the given pattern viaKEYScommand.IMPORTANT: This command is non-interruptible and scans the entire keyspace which may cause performance issues. Consider
DefaultedRedisConnection.scan(ScanOptions)for large datasets.- Parameters:
pattern- must not be null.- Returns:
- See Also:
-
rename
Rename keyoldKeytonewKey.- Parameters:
oldKey- must not be null.newKey- must not be null.- See Also:
-
renameNX
Rename keyoldKeytonewKeyonly ifnewKeydoes not exist.- Parameters:
oldKey- must not be null.newKey- must not be null.- Returns:
- See Also:
-
expire
Set time to live for givenkeyin seconds.- Parameters:
key- must not be null.seconds-- Returns:
- See Also:
-
pExpire
Set time to live for givenkeyin milliseconds.- Parameters:
key- must not be null.millis-- Returns:
- See Also:
-
expireAt
Set the expiration for givenkeyas a UNIX timestamp.- Parameters:
key- must not be null.unixTime-- Returns:
- See Also:
-
pExpireAt
Set the expiration for givenkeyas a UNIX timestamp in milliseconds.- Parameters:
key- must not be null.unixTimeInMillis-- Returns:
- See Also:
-
persist
Remove the expiration from givenkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
move
Move givenkeyto database withindex.- Parameters:
key- must not be null.dbIndex-- Returns:
- See Also:
-
ttl
Get the time to live forkeyin seconds.- Parameters:
key- must not be null.- Returns:
- See Also:
-
ttl
Get the time to live forkeyin and convert it to the givenTimeUnit.- Parameters:
key- must not be null.timeUnit- must not be null.- Returns:
- Since:
- 1.8
- See Also:
-
pTtl
Get the precise time to live forkeyin milliseconds.- Parameters:
key- must not be null.- Returns:
- See Also:
-
pTtl
Get the precise time to live forkeyin and convert it to the givenTimeUnit.- Parameters:
key- must not be null.timeUnit- must not be null.- Returns:
- Since:
- 1.8
- See Also:
-
echo
Returnsmessagevia server roundtrip.- Parameters:
message- the message to echo.- Returns:
- See Also:
-
sort
Sort the elements forkey.- Parameters:
key- must not be null.params- must not be null.- Returns:
- See Also:
-
sort
Sort the elements forkeyand store result instoreKey.- Parameters:
key- must not be null.params- must not be null.storeKey- must not be null.- Returns:
- See Also:
-
encodingOf
Get the type of internal representation used for storing the value at the givenkey.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Throws:
IllegalArgumentException- ifkeyis null.- Since:
- 2.1
-
idletime
Get theDurationsince the object stored at the givenkeyis idle.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Throws:
IllegalArgumentException- ifkeyis null.- Since:
- 2.1
-
refcount
Get the number of references of the value associated with the specifiedkey.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Throws:
IllegalArgumentException- ifkeyis null.- Since:
- 2.1
-
get
Get the value ofkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
getDel
Return the value atkeyand delete the key.- Parameters:
key- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
getEx
Return the value atkeyand expire the key by applyingExpiration.- Parameters:
key- must not be null.expiration- must not be null.- Returns:
- null when key does not exist or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
getSet
Setvalueofkeyand return its old value.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
mGet
Get multiplekeys. Values are in the order of the requested keys.- Parameters:
keys- must not be null.- Returns:
- See Also:
-
set
Setvalueforkey.- Parameters:
key- must not be null.value- must not be null.- See Also:
-
set
@Nullable Boolean set(String key, String value, Expiration expiration, RedisStringCommands.SetOption option) Setvalueforkeyapplying timeouts fromexpirationif set and inserting/updating values depending onoption.- 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.- Since:
- 1.7
- See Also:
-
setNX
Setvalueforkey, only ifkeydoes not exist.- Parameters:
key- must not be null.value- must not be null.- Returns:
- See Also:
-
setEx
Set thevalueand expiration insecondsforkey.- Parameters:
key- must not be null.seconds-value- must not be null.- See Also:
-
pSetEx
Set thevalueand expiration inmillisecondsforkey.- Parameters:
key- must not be null.milliseconds-value- must not be null.- Since:
- 1.3
- See Also:
-
mSetString
Set multiple keys to multiple values using key-value pairs provided intuple.- Parameters:
tuple- must not be null.- See Also:
-
mSetNXString
Set multiple keys to multiple values using key-value pairs provided intupleonly if the provided key does not exist.- Parameters:
tuple- must not be null.- See Also:
-
incr
Increment an integer value stored as string value ofkeyby 1.- Parameters:
key- must not be null.- Returns:
- See Also:
-
incrBy
Increment an integer value stored ofkeybydelta.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
incrBy
Increment a floating point number value ofkeybydelta.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
decr
Decrement an integer value stored as string value ofkeyby 1.- Parameters:
key- must not be null.- Returns:
- See Also:
-
decrBy
Decrement an integer value stored as string value ofkeybyvalue.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
append
Append avaluetokey.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
getRange
Get a substring of value ofkeybetweenstartandend.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
setRange
Overwrite parts ofkeystarting at the specifiedoffsetwith givenvalue.- Parameters:
key- must not be null.value-offset-- See Also:
-
getBit
Get the bit value atoffsetof value atkey.- Parameters:
key- must not be null.offset-- Returns:
- See Also:
-
setBit
Sets the bit atoffsetin value stored atkey.- Parameters:
key- must not be null.offset-value-- Returns:
- the original bit value stored at
offset. - See Also:
-
bitCount
Count the number of set bits (population counting) in value stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
bitCount
Count the number of set bits (population counting) of value stored atkeybetweenstartandend.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
bitOp
Perform bitwise operations between strings.- Parameters:
op- must not be null.destination- must not be null.keys- must not be null.- Returns:
- See Also:
-
bitPos
Return the position of the first bit set to givenbitin a string.- Parameters:
key- the key holding the actual String.bit- the bit value to look for.- Returns:
- null when used in pipeline / transaction. The position of the first bit set to 1 or 0 according to the request.
- Since:
- 2.1
- See Also:
-
bitPos
Return the position of the first bit set to givenbitin a string.Rangestart 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.- 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.
- Since:
- 2.1
- See Also:
-
strLen
Get the length of the value stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
rPush
Appendvaluestokey.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
lPos
Returns the index of matching elements inside the list stored at given key.
Requires Redis 6.0.6 or newer.- Parameters:
key- must not be null.element- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.4
- See Also:
-
lPos
Returns the index of matching elements inside the list stored at given key.
Requires Redis 6.0.6 or newer.- 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.
- Since:
- 2.4
- See Also:
-
lPush
Prependvaluestokey.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
rPushX
Appendvaluestokeyonly if the list exists.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
lPushX
Prependvaluestokeyonly if the list exists.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
lLen
Get the size of list stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
lRange
Get elements betweenstartandendfrom list atkey.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
lTrim
Trim list atkeyto elements betweenstartandend.- Parameters:
key- must not be null.start-end-- See Also:
-
lIndex
Get element atindexform list atkey.- Parameters:
key- must not be null.index-- Returns:
- See Also:
-
lInsert
InsertvalueRedisListCommands.Position.BEFOREorRedisListCommands.Position.AFTERexistingpivotforkey.- Parameters:
key- must not be null.where- must not be null.pivot-value-- Returns:
- See Also:
-
lMove
@Nullable String lMove(String sourceKey, String destinationKey, RedisListCommands.Direction from, RedisListCommands.Direction to) Atomically returns and removes the first/last element (head/tail depending on thefromargument) of the list stored atsourceKey, and pushes the element at the first/last element (head/tail depending on thetoargument) of the list stored atdestinationKey.- 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.
- Since:
- 2.6
- See Also:
-
bLMove
@Nullable String 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 thefromargument) of the list stored atsourceKey, and pushes the element at the first/last element (head/tail depending on thetoargument) of the list stored atdestinationKey.- Parameters:
sourceKey- must not be null.destinationKey- must not be null.from- must not be null.to- must not be null.timeout-- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
lSet
Set thevaluelist element atindex.- Parameters:
key- must not be null.index-value-- See Also:
-
lRem
Removes the firstcountoccurrences ofvaluefrom the list stored atkey.- Parameters:
key- must not be null.count-value-- Returns:
- See Also:
-
lPop
Removes and returns first element in list stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
lPop
Removes and returns first elements in list stored atkey.- Parameters:
key- must not be null.count-- Returns:
- Since:
- 2.6
- See Also:
-
rPop
Removes and returns last element in list stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
rPop
Removes and returns last elements in list stored atkey.- Parameters:
key- must not be null.count-- Returns:
- Since:
- 2.6
- See Also:
-
bLPop
Removes and returns first element from lists stored atkeys(see:DefaultedRedisConnection.lPop(byte[])).
Blocks connection until element available ortimeoutreached.- Parameters:
timeout-keys- must not be null.- Returns:
- See Also:
-
bRPop
Removes and returns last element from lists stored atkeys(see:DefaultedRedisConnection.rPop(byte[])).
Blocks connection until element available ortimeoutreached.- Parameters:
timeout-keys- must not be null.- Returns:
- See Also:
-
rPopLPush
Remove the last element from list atsrcKey, append it todstKeyand return its value.- Parameters:
srcKey- must not be null.dstKey- must not be null.- Returns:
- See Also:
-
bRPopLPush
Remove the last element from list atsrcKey, append it todstKeyand return its value (seeDefaultedRedisConnection.rPopLPush(byte[], byte[])).
Blocks connection until element available ortimeoutreached.- Parameters:
timeout-srcKey- must not be null.dstKey- must not be null.- Returns:
- See Also:
-
sAdd
Add givenvaluesto set atkey.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
sRem
Remove givenvaluesfrom set atkeyand return the number of removed elements.- Parameters:
key- must not be null.values-- Returns:
- See Also:
-
sPop
Remove and return a random member from set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
sPop
Remove and returncountrandom members from set atkey.- Parameters:
key- must not be null.count- the number of random members to return.- Returns:
- empty
Listif key does not exist. - Since:
- 2.0
- See Also:
-
sMove
MovevaluefromsrcKeytodestKey- Parameters:
srcKey- must not be null.destKey- must not be null.value-- Returns:
- See Also:
-
sCard
Get size of set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
sIsMember
Check if set atkeycontainsvalue.- Parameters:
key- must not be null.value-- Returns:
- See Also:
-
sMIsMember
Check if set atkeycontains one or morevalues.- Parameters:
key- must not be null.values- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
sInter
Returns the members intersecting all given sets atkeys.- Parameters:
keys- must not be null.- Returns:
- See Also:
-
sInterStore
Intersect all given sets atkeysand store result indestKey.- Parameters:
destKey- must not be null.keys- must not be null.- Returns:
- See Also:
-
sUnion
Union all sets at givenkeys.- Parameters:
keys- must not be null.- Returns:
- See Also:
-
sUnionStore
Union all sets at givenkeysand store result indestKey.- Parameters:
destKey- must not be null.keys- must not be null.- Returns:
- See Also:
-
sDiff
Diff all sets for givenkeys.- Parameters:
keys- must not be null.- Returns:
- See Also:
-
sDiffStore
Diff all sets for givenkeysand store result indestKey.- Parameters:
destKey- must not be null.keys- must not be null.- Returns:
- See Also:
-
sMembers
Get all elements of set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
sRandMember
Get random element from set atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
sRandMember
Getcountrandom elements from set atkey.- Parameters:
key- must not be null.count-- Returns:
- See Also:
-
sScan
Use aCursorto iterate over elements in set atkey.- Parameters:
key- must not be null.options- must not be null.- Returns:
- Since:
- 1.4
- See Also:
-
zAdd
Addvalueto a sorted set atkey, or update itsscoreif it already exists.- Parameters:
key- must not be null.score- the score.value- the value.- Returns:
- See Also:
-
zAdd
- 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.
- Since:
- 2.5
- See Also:
-
zAdd
Addtuplesto a sorted set atkey, or update itsscoreif it already exists.- Parameters:
key- must not be null.tuples- the tuples.- Returns:
- See Also:
-
zAdd
@Nullable Long zAdd(String key, Set<StringRedisConnection.StringTuple> tuples, RedisZSetCommands.ZAddArgs args) - 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.
- Since:
- 2.5
- See Also:
-
zRem
Removevaluesfrom sorted set. Return number of removed elements.- Parameters:
key- must not be null.values- must not be null.- Returns:
- See Also:
-
zIncrBy
Increment the score of element withvaluein sorted set byincrement.- Parameters:
key- must not be null.increment-value- the value.- Returns:
- See Also:
-
zRandMember
Get random element from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zRandMember
Getcountrandom elements from sorted set atkey.- Parameters:
key- must not be null.count- if the providedcountargument is positive, return a list of distinct fields, capped either atcountor the set size. Ifcountis 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.
- Since:
- 2.6
- See Also:
-
zRandMemberWithScore
Get random element from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zRandMemberWithScores
Getcountrandom elements from sorted set atkey.- Parameters:
key- must not be null.count- if the providedcountargument is positive, return a list of distinct fields, capped either atcountor the set size. Ifcountis 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.
- Since:
- 2.6
- See Also:
-
zRank
Determine the index of element withvaluein a sorted set.- Parameters:
key- must not be null.value- the value.- Returns:
- See Also:
-
zRevRank
Determine the index of element withvaluein a sorted set when scored high to low.- Parameters:
key- must not be null.value- the value.- Returns:
- See Also:
-
zRange
Get elements betweenstartandendfrom sorted set.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRangeWithScores
- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRangeByScore
Get elements where score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zRangeByScoreWithScores
- Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zRangeByScore
Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min-max-offset-count-- Returns:
- See Also:
-
zRangeByScoreWithScores
Set<StringRedisConnection.StringTuple> zRangeByScoreWithScores(String key, double min, double max, long offset, long count) - Parameters:
key-min-max-offset-count-- Returns:
- See Also:
-
zRevRange
Get elements in range fromstarttoendfrom sorted set ordered from high to low.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRevRangeWithScores
- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRevRangeByScore
Get elements where score is betweenminandmaxfrom sorted set ordered from high to low.- Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zRevRangeByScoreWithScores
Set<StringRedisConnection.StringTuple> zRevRangeByScoreWithScores(String key, double min, double max) - Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zRevRangeByScore
Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.- Parameters:
key- must not be null.min-max-offset-count-- Returns:
- See Also:
-
zRevRangeByScoreWithScores
Set<StringRedisConnection.StringTuple> zRevRangeByScoreWithScores(String key, double min, double max, long offset, long count) Get set ofTuplein range fromstarttoendwhere score is betweenminandmaxfrom sorted set ordered high -> low.- Parameters:
key- must not be null.min-max-offset-count-- Returns:
- See Also:
-
zCount
Count number of elements within sorted set with scores betweenminandmax.- Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zLexCount
Count number of elements within sorted set with value betweenRange#minandRange#maxapplying lexicographical ordering.- Parameters:
key- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.4
- See Also:
-
zPopMin
Remove and return the value with its score having the lowest score from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zPopMin
Remove and returncountvalues with their score having the lowest score from sorted set atkey.- 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.
- Since:
- 2.6
- See Also:
-
bZPopMin
Remove and return the value with its score having the lowest score from sorted set atkey. Blocks connection until element available ortimeoutreached.- Parameters:
key- must not be null.timeout-unit- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zPopMax
Remove and return the value with its score having the highest score from sorted set atkey.- Parameters:
key- must not be null.- Returns:
- null when the sorted set is empty or used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zPopMax
Remove and returncountvalues with their score having the highest score from sorted set atkey.- 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.
- Since:
- 2.6
- See Also:
-
bZPopMax
Remove and return the value with its score having the highest score from sorted set atkey. Blocks connection until element available ortimeoutreached.- Parameters:
key- must not be null.timeout-unit- must not be null.- Returns:
- can be null.
- Since:
- 2.6
- See Also:
-
zCard
Get the size of sorted set withkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
zScore
Get the score of element withvaluefrom sorted set with keykey.- Parameters:
key- must not be null.value- the value.- Returns:
- See Also:
-
zMScore
Get the scores of elements withvaluesfrom sorted set with keykey.- Parameters:
key- must not be null.values- the values.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zRemRange
Remove elements in range betweenstartandendfrom sorted set withkey.- Parameters:
key- must not be null.start-end-- Returns:
- See Also:
-
zRemRangeByLex
Remove all elements between the lexicographicalRedisZSetCommands.Range.- Parameters:
key- must not be null.range- must not be null.- Returns:
- the number of elements removed, or null when used in pipeline / transaction.
- Since:
- 2.5
- See Also:
-
zRemRangeByScore
Remove elements with scores betweenminandmaxfrom sorted set withkey.- Parameters:
key- must not be null.min-max-- Returns:
- See Also:
-
zDiff
Diff sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zDiffWithScores
Diff sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zDiffStore
Diff sortedsetsand store result in destinationdestKey.- Parameters:
destKey- must not be null.sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zInter
Intersect sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zInterWithScores
Intersect sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zInterWithScores
@Nullable default Set<StringRedisConnection.StringTuple> zInterWithScores(Aggregate aggregate, int[] weights, String... sets) Intersect sortedsets.- Parameters:
aggregate- must not be null.weights- must not be null.sets- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
zInterWithScores
@Nullable Set<StringRedisConnection.StringTuple> zInterWithScores(Aggregate aggregate, Weights weights, String... sets) Intersect sortedsets.- Parameters:
aggregate- must not be null.weights- must not be null.sets- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
zInterStore
Intersect sortedsetsand store result in destinationkey.- Parameters:
destKey- must not be null.sets- must not be null.- Returns:
- See Also:
-
zInterStore
Intersect sortedsetsand store result in destinationkey.- Parameters:
destKey- must not be null.aggregate- must not be null.weights-sets- must not be null.- Returns:
- See Also:
-
zUnion
Union sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zUnionWithScores
Union sortedsets.- Parameters:
sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zUnionWithScores
@Nullable default Set<StringRedisConnection.StringTuple> zUnionWithScores(Aggregate aggregate, int[] weights, String... sets) Union sortedsets.- Parameters:
aggregate- must not be null.weights- must not be null.sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zUnionWithScores
@Nullable Set<StringRedisConnection.StringTuple> zUnionWithScores(Aggregate aggregate, Weights weights, String... sets) Union sortedsets.- Parameters:
aggregate- must not be null.weights- must not be null.sets- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
zUnionStore
Union sortedsetsand store result in destinationkey.- Parameters:
destKey- must not be null.sets- must not be null.- Returns:
- See Also:
-
zUnionStore
Union sortedsetsand store result in destinationkey.- Parameters:
destKey- must not be null.aggregate- must not be null.weights-sets- must not be null.- Returns:
- See Also:
-
zScan
Use aCursorto iterate over elements in sorted set atkey.- Parameters:
key- must not be null.options- must not be null.- Returns:
- Since:
- 1.4
- See Also:
-
zRangeByScore
Get elements where score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min- must not be null.max- must not be null.- Returns:
- Since:
- 1.5
- See Also:
-
zRangeByScore
Get elements in range fromstarttoendwhere score is betweenminandmaxfrom sorted set.- Parameters:
key- must not be null.min- must not be null.max- must not be null.offset-count-- Returns:
- Since:
- 1.5
- See Also:
-
zRangeByLex
Get all the elements in the sorted set at key in lexicographical ordering.- Parameters:
key- must not be null.- Returns:
- Since:
- 1.6
- See Also:
-
zRangeByLex
Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in lexicographical ordering.- Parameters:
key- must not be null.range- must not be null.- Returns:
- Since:
- 1.6
- See Also:
-
zRangeByLex
Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in lexicographical ordering. Result is limited viaLimit.- Parameters:
key- must not be null.range- must not be null.limit- can be null.- Returns:
- Since:
- 1.6
- See Also:
-
zRevRangeByLex
Get all the elements in the sorted set at key in reversed lexicographical ordering.- Parameters:
key- must not be null.- Returns:
- Since:
- 2.4
- See Also:
-
zRevRangeByLex
Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in reversed lexicographical ordering.- Parameters:
key- must not be null.range- must not be null.- Returns:
- Since:
- 2.4
- See Also:
-
zRevRangeByLex
Get all the elements inRedisZSetCommands.Rangefrom the sorted set at key in reversed lexicographical ordering. Result is limited viaLimit.- Parameters:
key- must not be null.range- must not be null.limit- must not be null.- Returns:
- Since:
- 2.4
- See Also:
-
zRangeStoreByLex
This command is like ZRANGE , but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreByLex
This command is like ZRANGE , but stores the result in the dstKey destination key.- 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.
- Since:
- 3.0
- See Also:
-
zRangeStoreRevByLex
This command is like ZRANGE … REV , but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreRevByLex
This command is like ZRANGE … REV , but stores the result in the dstKey destination key.- 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.
- Since:
- 3.0
- See Also:
-
zRangeStoreByScore
@Nullable default Long zRangeStoreByScore(String dstKey, String srcKey, Range<? extends Number> range) This command is like ZRANGE, but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreByScore
@Nullable Long zRangeStoreByScore(String dstKey, String srcKey, Range<? extends Number> range, Limit limit) This command is like ZRANGE, but stores the result in the dstKey destination key.- 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.
- Since:
- 3.0
- See Also:
-
zRangeStoreRevByScore
@Nullable default Long zRangeStoreRevByScore(String dstKey, String srcKey, Range<? extends Number> range) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.- Parameters:
dstKey- must not be null.srcKey- must not be null.range- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 3.0
- See Also:
-
zRangeStoreRevByScore
@Nullable Long zRangeStoreRevByScore(String dstKey, String srcKey, Range<? extends Number> range, Limit limit) This command is like ZRANGE … REV, but stores the result in the dstKey destination key.- 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.
- Since:
- 3.0
- See Also:
-
hSet
Set thevalueof a hashfield.- Parameters:
key- must not be null.field- must not be null.value-- Returns:
- See Also:
-
hSetNX
Set thevalueof a hashfieldonly iffielddoes not exist.- Parameters:
key- must not be null.field- must not be null.value-- Returns:
- See Also:
-
hGet
Get value for givenfieldfrom hash atkey.- Parameters:
key- must not be null.field- must not be null.- Returns:
- See Also:
-
hMGet
Get values for givenfieldsfrom hash atkey.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- See Also:
-
hMSet
Set multiple hash fields to multiple values using data provided inhashes- Parameters:
key- must not be null.hashes- must not be null.- See Also:
-
hIncrBy
Incrementvalueof a hashfieldby the givendelta.- Parameters:
key- must not be null.field- must not be null.delta-- Returns:
- See Also:
-
hIncrBy
Incrementvalueof a hashfieldby the givendelta.- Parameters:
key- must not be null.field-delta-- Returns:
- See Also:
-
hRandField
Return a random field from the hash stored atkey.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
hRandFieldWithValues
Return a random field from the hash along with its value stored atkey.- Parameters:
key- must not be null.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
hRandField
Return a random field from the hash stored atkey. If the providedcountargument is positive, return a list of distinct fields, capped either atcountor the hash size. Ifcountis 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.- 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.
- Since:
- 2.6
- See Also:
-
hRandFieldWithValues
Return a random field from the hash along with its value stored atkey. If the providedcountargument is positive, return a list of distinct fields, capped either atcountor the hash size. Ifcountis 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.- 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.
- Since:
- 2.6
- See Also:
-
hExists
Determine if given hashfieldexists.- Parameters:
key- must not be null.field- must not be null.- Returns:
- See Also:
-
hDel
Delete given hashfields.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- See Also:
-
hLen
Get size of hash atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hKeys
Get key set (fields) of hash atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hVals
Get entry set (values) of hash atfield.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hGetAll
Get entire hash stored atkey.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hScan
Use aCursorto iterate over entries in hash atkey.- Parameters:
key- must not be null.options- must not be null.- Returns:
- Since:
- 1.4
- See Also:
-
hStrLen
Returns the length of the value associated withfieldin the hash stored atkey. If the key or the field do not exist,0is returned.- Parameters:
key- must not be null.field- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.1
-
pfAdd
Adds given values to the HyperLogLog stored at given key.- Parameters:
key- must not be null.values- must not be null.- Returns:
- Since:
- 1.5
- See Also:
-
pfCount
Return the approximated cardinality of the structures observed by the HyperLogLog at key(s).- Parameters:
keys- must not be null.- Returns:
- See Also:
-
pfMerge
Merge N different HyperLogLogs at sourceKeys into a single destinationKey.- Parameters:
destinationKey- must not be null.sourceKeys- must not be null.- See Also:
-
geoAdd
AddPointwith given member name to key.- Parameters:
key- must not be null.point- must not be null.member- must not be null.- Returns:
- Number of elements added.
- Since:
- 1.8
- See Also:
-
geoAdd
AddRedisGeoCommands.GeoLocationto key.- Parameters:
key- must not be null.location- must not be null.- Returns:
- Number of elements added.
- Since:
- 1.8
- See Also:
-
geoAdd
- Parameters:
key- must not be null.memberCoordinateMap- must not be null.- Returns:
- Number of elements added.
- Since:
- 1.8
- See Also:
-
geoAdd
AddRedisGeoCommands.GeoLocations to key- Parameters:
key- must not be null.locations- must not be null.- Returns:
- Number of elements added.
- Since:
- 1.8
- See Also:
-
geoDist
Get theDistancebetween member1 and member2.- Parameters:
key- must not be null.member1- must not be null.member2- must not be null.- Returns:
- can be null.
- Since:
- 1.8
- See Also:
-
geoDist
- 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.
- Since:
- 1.8
- See Also:
-
geoHash
Get geohash representation of the position for one or more members.- Parameters:
key- must not be null.members- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoPos
Get thePointrepresentation of positions for one or more members.- Parameters:
key- must not be null.members- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadius
Get the members within the boundaries of a givenCircle.- Parameters:
key- must not be null.within- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadius
GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadius(String key, Circle within, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircleapplyingRedisGeoCommands.GeoRadiusCommandArgs.- Parameters:
key- must not be null.within- must not be null.args- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadiusByMember
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.- Parameters:
key- must not be null.member- must not be null.radius-- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadiusByMember
GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(String key, String member, Distance radius) Get the members within the circle defined by the members coordinates and givenDistance.- Parameters:
key- must not be null.member- must not be null.radius- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRadiusByMember
GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(String key, String member, Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates and givenDistanceandRedisGeoCommands.GeoRadiusCommandArgs.- Parameters:
key- must not be null.member- must not be null.radius- must not be null.args- must not be null.- Returns:
- never null.
- Since:
- 1.8
- See Also:
-
geoRemove
Remove the members.- Parameters:
key- must not be null.members- must not be null.- Returns:
- Number of members elements removed.
- Since:
- 1.8
- See Also:
-
geoSearch
@Nullable 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. The query's center point is provided byGeoReference.- 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.
- Since:
- 2.6
- See Also:
-
geoSearchStore
@Nullable Long 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 givenshapeand store the result atdestKey. The query's center point is provided byGeoReference.- 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.
- Since:
- 2.6
- See Also:
-
publish
Publishes the given message to the given channel.- 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:
-
subscribe
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.
- Parameters:
listener- message listener, must not be null.channels- channel names, must not be null.- See Also:
-
pSubscribe
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.
- Parameters:
listener- message listener, must not be null.patterns- channel name patterns, must not be null.- See Also:
-
scriptLoad
Load lua script into scripts cache, without executing it.
Execute the script by callingDefaultedRedisConnection.evalSha(byte[], ReturnType, int, byte[]...).- Parameters:
script- must not be null.- Returns:
- See Also:
-
eval
Evaluate givenscript.- Parameters:
script- must not be null.returnType- must not be null.numKeys-keysAndArgs- must not be null.- Returns:
- See Also:
-
evalSha
Evaluate givenscriptSha.- Parameters:
scriptSha- must not be null.returnType- must not be null.numKeys-keysAndArgs- must not be null.- Returns:
- See Also:
-
setClientName
Assign given name to current connection.- Parameters:
name-- Since:
- 1.3
- See Also:
-
getClientList
List<RedisClientInfo> getClientList()Request information and statistics about connected clients.- Specified by:
getClientListin interfaceDefaultedRedisConnection- Specified by:
getClientListin interfaceRedisServerCommands- Returns:
ListofRedisClientInfoobjects.- Since:
- 1.3
- See Also:
-
bitfield
Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey.- Parameters:
key- must not be null.command- must not be null.- Returns:
-
entryIds
-
xAck
Acknowledge one or more record as processed.- Parameters:
key- the stream key.group- name of the consumer group.entryIds- record Id's to acknowledge.- Returns:
- length of acknowledged records. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xAck
-
xAdd
Append a record to the streamkey.- Parameters:
key- the stream key.body- record body.- Returns:
- the record Id. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xAdd
Append the givenStringRecordto the stream stored atRecord.getStream().- Parameters:
record- must not be null.- Returns:
- the record Id. null when used in pipeline / transaction.
- Since:
- 2.2
-
xAdd
Append the givenStringRecordto the stream stored atRecord.getStream().- 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.
- Since:
- 2.3
-
xClaimJustId
List<RecordId> xClaimJustId(String 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.- 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
idsthat changed user. - Since:
- 2.3
- See Also:
-
xClaim
default List<StringRecord> xClaim(String key, String group, String newOwner, Duration minIdleTime, RecordId... recordIds) Change the ownership of a pending message to the given new consumer.- Parameters:
key- the key the stream is stored at.group- the name of the consumer group.newOwner- the name of the new consumer.minIdleTime- must not be null.recordIds- must not be null.- Returns:
- list of
StringRecordthat changed user. - Since:
- 2.3
- See Also:
-
xClaim
List<StringRecord> xClaim(String key, String group, String newOwner, RedisStreamCommands.XClaimOptions options) Change the ownership of a pending message to the given new consumer.- 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
StringRecordthat changed user. - Since:
- 2.3
- See Also:
-
xDel
Removes the specified entries from the stream. Returns the number of items deleted, that may be different from the number of IDs passed in case certain IDs do not exist.- Parameters:
key- the stream key.entryIds- stream record Id's.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xDel
-
xGroupCreate
Create a consumer group.- Parameters:
key- the stream key.readOffset-group- name of the consumer group.- Returns:
- true if successful. null when used in pipeline / transaction.
- Since:
- 2.2
-
xGroupCreate
Create a consumer group.- Parameters:
key- the stream key.readOffset-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.
- Since:
- , 2.3
-
xGroupDelConsumer
Delete a consumer from a consumer group.- Parameters:
key- the stream key.consumer- consumer identified by group name and consumer key.- Returns:
- true if successful. null when used in pipeline / transaction.
- Since:
- 2.2
-
xGroupDestroy
Destroy a consumer group.- Parameters:
key- the stream key.group- name of the consumer group.- Returns:
- true if successful. null when used in pipeline / transaction.
- Since:
- 2.2
-
xInfo
Obtain general information about the stream stored at the specified key.- Parameters:
key- the key the stream is stored at.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.3
-
xInfoGroups
Obtain information about consumer groups associated with the stream stored at the specified key.- Parameters:
key- the key the stream is stored at.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.3
-
xInfoConsumers
Obtain information about every consumer in a specific consumer group for the stream stored at the specified key.- Parameters:
key- the key the stream is stored at.groupName- name of the consumer group.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.3
-
xLen
Get the length of a stream.- Parameters:
key- the stream key.- Returns:
- length of the stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xPending
Obtain thePendingMessagesSummaryfor a given consumer group.- 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.
- Since:
- 2.3
- See Also:
-
xPending
@Nullable PendingMessages xPending(String key, String groupName, String consumerName, Range<String> range, Long count) - Parameters:
key- the key the stream is stored at. Must not be null.groupName- the name of the consumer group. Must not be null.consumerName- 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.
- Since:
- 2.3
- See Also:
-
xPending
- 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.
- Since:
- 2.3
- See Also:
-
xPending
@Nullable PendingMessages xPending(String key, String groupName, RedisStreamCommands.XPendingOptions options) - 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.
- Since:
- 2.3
- See Also:
-
xRange
Read records from a stream within a specificRedisZSetCommands.Range.- Parameters:
key- the stream key.range- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xRange
Read records from a stream within a specificRedisZSetCommands.Rangeapplying aLimit.- 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.
- Since:
- 2.2
- See Also:
-
xReadAsString
Read records from one or moreStreamOffsets.- Parameters:
stream- the streams to read from.- Returns:
- list ith members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadAsString
Read records from one or moreStreamOffsets.- Parameters:
streams- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadAsString
@Nullable default List<StringRecord> xReadAsString(StreamReadOptions readOptions, StreamOffset<String> stream) Read records from one or moreStreamOffsets.- Parameters:
readOptions- read arguments.stream- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadAsString
@Nullable List<StringRecord> xReadAsString(StreamReadOptions readOptions, StreamOffset<String>... streams) Read records from one or moreStreamOffsets.- Parameters:
readOptions- read arguments.streams- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadGroupAsString
@Nullable default List<StringRecord> xReadGroupAsString(Consumer consumer, StreamOffset<String> stream) Read records from one or moreStreamOffsets using a consumer group.- Parameters:
consumer- consumer/group.stream- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadGroupAsString
@Nullable default List<StringRecord> xReadGroupAsString(Consumer consumer, StreamOffset<String>... streams) Read records from one or moreStreamOffsets using a consumer group.- Parameters:
consumer- consumer/group.streams- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadGroupAsString
@Nullable default List<StringRecord> xReadGroupAsString(Consumer consumer, StreamReadOptions readOptions, StreamOffset<String> stream) Read records from one or moreStreamOffsets using a consumer group.- Parameters:
consumer- consumer/group.readOptions- read arguments.stream- the streams to read from.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xReadGroupAsString
@Nullable List<StringRecord> xReadGroupAsString(Consumer consumer, StreamReadOptions readOptions, StreamOffset<String>... streams) Read records from one or moreStreamOffsets using a consumer group.- 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.
- Since:
- 2.2
- See Also:
-
xRevRange
Read records from a stream within a specificRedisZSetCommands.Rangein reverse order.- Parameters:
key- the stream key.range- must not be null.- Returns:
- list with members of the resulting stream. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xRevRange
Read records from a stream within a specificRedisZSetCommands.Rangeapplying aLimitin reverse order.- 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.
- Since:
- 2.2
- See Also:
-
xTrim
Trims the stream tocountelements.- Parameters:
key- the stream key.count- length of the stream.- Returns:
- number of removed entries. null when used in pipeline / transaction.
- Since:
- 2.2
- See Also:
-
xTrim
Trims the stream tocountelements.- 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.
- Since:
- 2.4
- See Also:
-