Interface ReactiveHashCommands
- All Known Subinterfaces:
ReactiveClusterHashCommands
public interface ReactiveHashCommands
Redis Hash commands executed using reactive infrastructure.
- Since:
- 2.0
- Author:
- Christoph Strobl, Mark Paluch, Tihomir Mateev
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classReactiveRedisConnection.Commandfor hash-bound operations.static classstatic classHEXISTSReactiveRedisConnection.Command.static classstatic classHRANDFIELDReactiveRedisConnection.Command.static classstatic class -
Method Summary
Modifier and TypeMethodDescriptionhDel(ByteBuffer key, ByteBuffer field) Delete given hash field.hDel(ByteBuffer key, Collection<ByteBuffer> fields) Delete given hash fields.hDel(Publisher<ReactiveHashCommands.HDelCommand> commands) Delete given hash fields.hExists(ByteBuffer key, ByteBuffer field) Determine if given hash field exists.hExists(Publisher<ReactiveHashCommands.HExistsCommand> commands) Determine if given hash field exists.hExpire(ByteBuffer key, Duration duration, ByteBuffer field) Expire a given field after a givenDurationof time, measured in milliseconds, has passed.hExpire(ByteBuffer key, Duration duration, List<ByteBuffer> fields) hExpireAt(ByteBuffer key, Instant expireAt, ByteBuffer field) Expire a given field in a givenInstantof time, indicated as an absolute Unix timestamp in seconds since Unix epochhExpireAt(ByteBuffer key, Instant expireAt, List<ByteBuffer> fields) Expire aListof field in a givenInstantof time, indicated as an absolute Unix timestamp in seconds since Unix epochdefault Mono<ByteBuffer>hGet(ByteBuffer key, ByteBuffer field) Get value for given field from hash at key.default Flux<Map.Entry<ByteBuffer,ByteBuffer>> hGetAll(ByteBuffer key) Get entire hash stored at key.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,Flux<Map.Entry<ByteBuffer, ByteBuffer>>>> hGetAll(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get entire hash stored at key.default Flux<ByteBuffer>hKeys(ByteBuffer key) Get key set (fields) of hash at key.hKeys(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get key set (fields) of hash at key.hLen(ByteBuffer key) Get size of hash at key.hLen(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get size of hash at key.default Mono<List<ByteBuffer>>hMGet(ByteBuffer key, Collection<ByteBuffer> fields) Get values for given fields from hash at key.hMGet(Publisher<ReactiveHashCommands.HGetCommand> commands) Get values for given fields from hash at key.hMSet(ByteBuffer key, Map<ByteBuffer, ByteBuffer> fieldValueMap) Set multiple hash fields to multiple values using data provided in fieldValueMap.hPersist(ByteBuffer key, ByteBuffer field) Persist a given field removing any associated expiration, measured as absolute Unix timestamp in seconds since Unix epochhPersist(ByteBuffer key, List<ByteBuffer> fields) Persist a givenListof field removing any associated expiration.Persist a givenListof field removing any associated expiration.hpExpire(ByteBuffer key, Duration duration, ByteBuffer field) Expire a given field after a givenDurationof time, measured in milliseconds, has passed.hpExpire(ByteBuffer key, Duration duration, List<ByteBuffer> fields) hpExpireAt(ByteBuffer key, Instant expireAt, ByteBuffer field) Expire a given field in a givenInstantof time, indicated as an absolute Unix timestamp in milliseconds since Unix epochhpExpireAt(ByteBuffer key, Instant expireAt, List<ByteBuffer> fields) Expire aListof field in a givenInstantof time, indicated as an absolute Unix timestamp in milliseconds since Unix epochhpTtl(ByteBuffer key, ByteBuffer field) Returns the time-to-live of a given field in milliseconds.hpTtl(ByteBuffer key, List<ByteBuffer> fields) Returns the time-to-live of all the given field in theListin milliseconds.hpTtl(Publisher<ReactiveHashCommands.HashFieldsCommand> commands) Returns the time-to-live of all the given field in theListin milliseconds.default Mono<ByteBuffer>hRandField(ByteBuffer key) Return a random field from the hash stored atkey.default Flux<ByteBuffer>hRandField(ByteBuffer key, long count) Return a random field from the hash stored atkey.Flux<ReactiveRedisConnection.CommandResponse<ReactiveHashCommands.HRandFieldCommand,Flux<ByteBuffer>>> Get random fields of hash at key.default Mono<Map.Entry<ByteBuffer,ByteBuffer>> Return a random field from the hash along with its value stored atkey.default Flux<Map.Entry<ByteBuffer,ByteBuffer>> hRandFieldWithValues(ByteBuffer key, long count) Return a random field from the hash along with its value stored atkey.Flux<ReactiveRedisConnection.CommandResponse<ReactiveHashCommands.HRandFieldCommand,Flux<Map.Entry<ByteBuffer, ByteBuffer>>>> Get random fields along their values of hash at key.default Flux<Map.Entry<ByteBuffer,ByteBuffer>> hScan(ByteBuffer key) Use aFluxto iterate over entries in the hash atkey.default Flux<Map.Entry<ByteBuffer,ByteBuffer>> hScan(ByteBuffer key, ScanOptions options) Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,Flux<Map.Entry<ByteBuffer, ByteBuffer>>>> hScan(Publisher<ReactiveRedisConnection.KeyScanCommand> commands) Use aFluxto iterate over entries in the hash atkey.hSet(ByteBuffer key, ByteBuffer field, ByteBuffer value) Set the value of a hash field.hSet(Publisher<ReactiveHashCommands.HSetCommand> commands) Set the value of a hash field.hSetNX(ByteBuffer key, ByteBuffer field, ByteBuffer value) Set the value of a hash field.hStrLen(ByteBuffer key, ByteBuffer field) Get the length of the value associated withfield.hStrLen(Publisher<ReactiveHashCommands.HStrLenCommand> commands) Get the length of the value associated withfield.hTtl(ByteBuffer key, ByteBuffer field) Returns the time-to-live of a given field in seconds.hTtl(ByteBuffer key, List<ByteBuffer> fields) Returns the time-to-live of all the given field in theListin seconds.hTtl(Publisher<ReactiveHashCommands.HashFieldsCommand> commands) Returns the time-to-live of all the given field in theListin seconds.default Flux<ByteBuffer>hVals(ByteBuffer key) Get entry set (values) of hash at key.hVals(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get entry set (values) of hash at key.
-
Method Details
-
hSet
Set the value of a hash field.- Parameters:
key- must not be null.field- must not be null.value- must not be null.- Returns:
- See Also:
-
hSetNX
Set the value of a hash field.- Parameters:
key- must not be null.field- must not be null.value- must not be null.- Returns:
- See Also:
-
hMSet
Set multiple hash fields to multiple values using data provided in fieldValueMap.- Parameters:
key- must not be null.fieldValueMap- must not be null.- Returns:
- See Also:
-
hSet
Flux<ReactiveRedisConnection.BooleanResponse<ReactiveHashCommands.HSetCommand>> hSet(Publisher<ReactiveHashCommands.HSetCommand> commands) Set the value of a hash field.- Parameters:
commands- must not be null.- Returns:
- See Also:
-
hGet
Get value for given field from hash at key.- Parameters:
key- must not be null.field- must not be null.- Returns:
- See Also:
-
hMGet
Get values for given fields from hash at key. Values are in the order of the requested keys. Absent field values are represented using null in the resultingList.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- See Also:
-
hMGet
Flux<ReactiveRedisConnection.MultiValueResponse<ReactiveHashCommands.HGetCommand,ByteBuffer>> hMGet(Publisher<ReactiveHashCommands.HGetCommand> commands) Get values for given fields from hash at key. Values are in the order of the requested keys. Absent field values are represented using null in the resultingList.- Parameters:
commands- must not be null.- Returns:
- See Also:
-
hExists
Determine if given hash field exists.- Parameters:
key- must not be null.field- must not be null.- Returns:
- See Also:
-
hExists
Flux<ReactiveRedisConnection.BooleanResponse<ReactiveHashCommands.HExistsCommand>> hExists(Publisher<ReactiveHashCommands.HExistsCommand> commands) Determine if given hash field exists.- Parameters:
commands-- Returns:
- See Also:
-
hDel
Delete given hash field.- Parameters:
key- must not be null.field- must not be null.- Returns:
- See Also:
-
hDel
Delete given hash fields.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- See Also:
-
hDel
Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HDelCommand,Long>> hDel(Publisher<ReactiveHashCommands.HDelCommand> commands) Delete given hash fields.- Parameters:
commands- must not be null.- Returns:
- See Also:
-
hLen
Get size of hash at key.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hLen
Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,Long>> hLen(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get size of hash at key.- Parameters:
commands- must not be null.- Returns:
- See Also:
-
hRandField
Return a random field from the hash stored atkey.- Parameters:
key- must not be null.- Returns:
- 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:
- 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:
- 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:
-
hRandField
Flux<ReactiveRedisConnection.CommandResponse<ReactiveHashCommands.HRandFieldCommand,Flux<ByteBuffer>>> hRandField(Publisher<ReactiveHashCommands.HRandFieldCommand> commands) Get random fields of hash at key.- Parameters:
commands- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
hRandFieldWithValues
Flux<ReactiveRedisConnection.CommandResponse<ReactiveHashCommands.HRandFieldCommand,Flux<Map.Entry<ByteBuffer, hRandFieldWithValuesByteBuffer>>>> (Publisher<ReactiveHashCommands.HRandFieldCommand> commands) Get random fields along their values of hash at key.- Parameters:
commands- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
hKeys
Get key set (fields) of hash at key.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hKeys
Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,Flux<ByteBuffer>>> hKeys(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get key set (fields) of hash at key.- Parameters:
commands- must not be null.- Returns:
- See Also:
-
hVals
Get entry set (values) of hash at key.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hVals
Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,Flux<ByteBuffer>>> hVals(Publisher<ReactiveRedisConnection.KeyCommand> commands) Get entry set (values) of hash at key.- Parameters:
commands- must not be null.- Returns:
- See Also:
-
hGetAll
Get entire hash stored at key.- Parameters:
key- must not be null.- Returns:
- See Also:
-
hGetAll
Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,Flux<Map.Entry<ByteBuffer, hGetAllByteBuffer>>>> (Publisher<ReactiveRedisConnection.KeyCommand> commands) Get entire hash stored at key.- Parameters:
commands- must not be null.- Returns:
- See Also:
-
hScan
Use aFluxto iterate over entries in the hash atkey. The resultingFluxacts as a cursor and issuesHSCANcommands itself as long as the subscriber signals demand.- Parameters:
key- must not be null.- Returns:
- the
Fluxemittingentriesone by one. - Throws:
IllegalArgumentException- in case the given key is null.- Since:
- 2.1
- See Also:
-
hScan
Use aFluxto iterate over entries in the hash atkeygivenScanOptions. The resultingFluxacts as a cursor and issuesHSCANcommands itself as long as the subscriber signals demand.- Parameters:
key- must not be null.options- must not be null. UseScanOptions.NONEinstead.- Returns:
- the
Fluxemitting the rawentriesone by one. - Throws:
IllegalArgumentException- in case one of the required arguments is null.- Since:
- 2.1
- See Also:
-
hScan
Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,Flux<Map.Entry<ByteBuffer, hScanByteBuffer>>>> (Publisher<ReactiveRedisConnection.KeyScanCommand> commands) Use aFluxto iterate over entries in the hash atkey. The resultingFluxacts as a cursor and issuesHSCANcommands itself as long as the subscriber signals demand.- Parameters:
commands- must not be null.- Returns:
- the
FluxemittingReactiveRedisConnection.CommandResponseone by one. - Since:
- 2.1
- See Also:
-
hStrLen
Get the length of the value associated withfield. If either thekeyor thefielddo not exist,0is emitted.- Parameters:
key- must not be null.field- must not be null.- Returns:
- never null.
- Since:
- 2.1
-
hStrLen
Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HStrLenCommand,Long>> hStrLen(Publisher<ReactiveHashCommands.HStrLenCommand> commands) Get the length of the value associated withfield. If either thekeyor thefielddo not exist,0is emitted.- Parameters:
commands- must not be null.- Returns:
- never null.
- Since:
- 2.1
-
hExpire
Expire a given field after a givenDurationof time, measured in milliseconds, has passed.- Parameters:
key- must not be null.field- must not be null.duration- must not be null.- Returns:
- a
Monoemitting the expiration result -2indicating the specific field is deleted already due to expiration, or provided expiry interval is 0;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hExpire
- Parameters:
key- must not be null.fields- must not be null.duration- must not be null.- Returns:
- a
Fluxemitting the expiration results one by one,2indicating the specific field is deleted already due to expiration, or provided expiry interval is 0;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
applyHashFieldExpiration
Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HashExpireCommand,Long>> applyHashFieldExpiration(Publisher<ReactiveHashCommands.HashExpireCommand> commands) - Parameters:
commands- must not be null.- Returns:
- a
Fluxemitting the expiration results one by one,2indicating the specific field is deleted already due to expiration, or provided expiry interval is 0;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hpExpire
Expire a given field after a givenDurationof time, measured in milliseconds, has passed.- Parameters:
key- must not be null.field- must not be null.duration- must not be null.- Returns:
- a
Monoemitting the expiration result -2indicating the specific field is deleted already due to expiration, or provided expiry interval is 0;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hpExpire
- Parameters:
key- must not be null.fields- must not be null.duration- must not be null.- Returns:
- a
Fluxemitting the expiration results one by one,2indicating the specific field is deleted already due to expiration, or provided expiry interval is 0;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hExpireAt
Expire a given field in a givenInstantof time, indicated as an absolute Unix timestamp in seconds since Unix epoch- Parameters:
key- must not be null.field- must not be null.expireAt- must not be null.- Returns:
- a
Monoemitting the expiration result -2indicating the specific field is deleted already due to expiration, or provided expiry interval is in the past;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hExpireAt
Expire aListof field in a givenInstantof time, indicated as an absolute Unix timestamp in seconds since Unix epoch- Parameters:
key- must not be null.fields- must not be null.expireAt- must not be null.- Returns:
- a
Fluxemitting the expiration results one by one,2indicating the specific field is deleted already due to expiration, or provided expiry interval is in the past;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hpExpireAt
Expire a given field in a givenInstantof time, indicated as an absolute Unix timestamp in milliseconds since Unix epoch- Parameters:
key- must not be null.field- must not be null.expireAt- must not be null.- Returns:
- a
Monoemitting the expiration result -2indicating the specific field is deleted already due to expiration, or provided expiry interval is in the past;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hpExpireAt
Expire aListof field in a givenInstantof time, indicated as an absolute Unix timestamp in milliseconds since Unix epoch- Parameters:
key- must not be null.fields- must not be null.expireAt- must not be null.- Returns:
- a
Fluxemitting the expiration results one by one,2indicating the specific field is deleted already due to expiration, or provided expiry interval is in the past;1indicating expiration time is set/updated;0indicating the expiration time is not set (a provided NX | XX | GT | LT condition is not met);-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hPersist
Persist a given field removing any associated expiration, measured as absolute Unix timestamp in seconds since Unix epoch- Parameters:
key- must not be null.field- must not be null.- Returns:
- a
Monoemitting the persist result -1indicating expiration time is removed;-1field has no expiration time to be removed;-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hPersist
Persist a givenListof field removing any associated expiration.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- a
Fluxemitting the persisting results one by one -1indicating expiration time is removed;-1field has no expiration time to be removed;-2indicating there is no such field; - Since:
- 3.5
- See Also:
-
hPersist
Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HashFieldsCommand,Long>> hPersist(Publisher<ReactiveHashCommands.HashFieldsCommand> commands) Persist a givenListof field removing any associated expiration.- Parameters:
commands- must not be null.- Returns:
- a
Fluxemitting the persisting results one by one -1indicating expiration time is removed;-1field has no expiration time to be removed;-2indicating there is no such field; * @since 3.5 - See Also:
-
hTtl
Returns the time-to-live of a given field in seconds.- Parameters:
key- must not be null.field- must not be null.- Returns:
- a
Monoemitting the TTL result - the time to live in seconds; or a negative value to signal an error. The command returns-1if the key exists but has no associated expiration time. The command returns-2if the key does not exist; - Since:
- 3.5
- See Also:
-
hTtl
Returns the time-to-live of all the given field in theListin seconds.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- a
Fluxemitting the TTL results one by one - the time to live in seconds; or a negative value to signal an error. The command returns-1if the key exists but has no associated expiration time. The command returns-2if the key does not exist; - Since:
- 3.5
- See Also:
-
hTtl
Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HashFieldsCommand,Long>> hTtl(Publisher<ReactiveHashCommands.HashFieldsCommand> commands) Returns the time-to-live of all the given field in theListin seconds.- Parameters:
commands- must not be null.- Returns:
- a
Fluxemitting the persisting results one by one - the time to live in seconds; or a negative value to signal an error. The command returns-1if the key exists but has no associated expiration time. The command returns-2if the key does not exist; - Since:
- 3.5
- See Also:
-
hpTtl
Returns the time-to-live of a given field in milliseconds.- Parameters:
key- must not be null.field- must not be null.- Returns:
- a
Monoemitting the TTL result - the time to live in milliseconds; or a negative value to signal an error. The command returns-1if the key exists but has no associated expiration time. The command returns-2if the key does not exist; - Since:
- 3.5
- See Also:
-
hpTtl
Returns the time-to-live of all the given field in theListin milliseconds.- Parameters:
key- must not be null.fields- must not be null.- Returns:
- a
Fluxemitting the TTL results one by one - the time to live in milliseconds; or a negative value to signal an error. The command returns-1if the key exists but has no associated expiration time. The command returns-2if the key does not exist; - Since:
- 3.5
- See Also:
-
hpTtl
Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HashFieldsCommand,Long>> hpTtl(Publisher<ReactiveHashCommands.HashFieldsCommand> commands) Returns the time-to-live of all the given field in theListin milliseconds.- Parameters:
commands- must not be null.- Returns:
- a
Fluxemitting the persisting results one by one - the time to live in milliseconds; or a negative value to signal an error. The command returns-1if the key exists but has no associated expiration time. The command returns-2if the key does not exist; - Since:
- 3.5
- See Also:
-