Package org.redisson.api
Interface RKeysReactive
-
public interface RKeysReactive
- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description reactor.core.publisher.Mono<>
name)
Clear an expire timeout or expire date for object.reactor.core.publisher.Mono<>
name, host, int port, int database, long timeout)
Copy object from source Redis instance to destination Redis instancereactor.core.publisher.Mono<>
count()
Returns the number of keys in the currently-selected databasereactor.core.publisher.Mono<>
... names)
Checks if provided keys existreactor.core.publisher.Mono<>
... keys)
Delete multiple objects by name.reactor.core.publisher.Mono<>
pattern)
Delete multiple objects by a key pattern.reactor.core.publisher.Mono<>
name, long timeToLive, timeUnit)
Set a timeout for object.reactor.core.publisher.Mono<>
name, long timestamp)
Set an expire date for object.reactor.core.publisher.Mono<>
flushall()
Delete all the keys of all the existing databases UsesFLUSHALL
Redis command.reactor.core.publisher.Mono<>
flushallParallel()
Delete all keys of all existing databases in background without blocking server.reactor.core.publisher.Mono<>
flushdb()
Delete all the keys of the currently selected database UsesFLUSHDB
Redis command.reactor.core.publisher.Mono<>
flushdbParallel()
Delete all keys of currently selected database in background without blocking server.reactor.core.publisher.Flux<>
getKeys()
Load keys in incrementally iterate mode.reactor.core.publisher.Flux<>
getKeys(int count)
Load keys in incrementally iterate mode.reactor.core.publisher.Flux<>
pattern)
Find keys by pattern and load it in incrementally iterate mode.reactor.core.publisher.Flux<>
pattern, int count)
Get all keys by pattern using iterator.reactor.core.publisher.Mono<>
key)
Get hash slot identifier for key.reactor.core.publisher.Mono<RType>
key)
Get Redis object type by keyreactor.core.publisher.Mono<>
name, host, int port, int database, long timeout)
Transfer object from source Redis instance to destination Redis instancereactor.core.publisher.Mono<>
name, int database)
Move object to another databasereactor.core.publisher.Mono<>
randomKey()
Get random key UsesRANDOM_KEY
Redis command.reactor.core.publisher.Mono<>
name)
Remaining time to live of Redisson object that has a timeoutreactor.core.publisher.Mono<>
currentName, newName)
Rename current object key tonewName
reactor.core.publisher.Mono<>
oldName, newName)
Rename object witholdName
tonewName
only if new key is not existsreactor.core.publisher.Mono<>
swapdb(int db1, int db2)
Swap two databases.reactor.core.publisher.Mono<>
... names)
Update the last access time of an object.reactor.core.publisher.Mono<>
... keys)
Delete multiple objects by name.
-
-
-
Method Detail
-
move
reactor.core.publisher.Mono<> move( name, int database)
Move object to another database- Parameters:
name
- of objectdatabase
- - Redis database number- Returns:
true
if key was moved elsefalse
-
migrate
reactor.core.publisher.Mono<> migrate( name, host, int port, int database, long timeout)
Transfer object from source Redis instance to destination Redis instance- Parameters:
name
- of objecthost
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in milliseconds- Returns:
- void
-
copy
reactor.core.publisher.Mono<> copy( name, host, int port, int database, long timeout)
Copy object from source Redis instance to destination Redis instance- Parameters:
name
- of objecthost
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in milliseconds- Returns:
- void
-
expire
reactor.core.publisher.Mono<> expire( name, long timeToLive, timeUnit)
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Parameters:
name
- of objecttimeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
reactor.core.publisher.Mono<> expireAt( name, long timestamp)
Set an expire date for object. When expire date comes the key will automatically be deleted.- Parameters:
name
- of objecttimestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
reactor.core.publisher.Mono<> clearExpire( name)
Clear an expire timeout or expire date for object.- Parameters:
name
- of object- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
renamenx
reactor.core.publisher.Mono<> renamenx( oldName, newName)
Rename object witholdName
tonewName
only if new key is not exists- Parameters:
oldName
- - old name of objectnewName
- - new name of object- Returns:
true
if object has been renamed successfully andfalse
otherwise
-
rename
reactor.core.publisher.Mono<> rename( currentName, newName)
Rename current object key tonewName
- Parameters:
currentName
- - current name of objectnewName
- - new name of object- Returns:
- void
-
remainTimeToLive
reactor.core.publisher.Mono<> remainTimeToLive( name)
Remaining time to live of Redisson object that has a timeout- Parameters:
name
- of key- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
touch
reactor.core.publisher.Mono<> touch(... names)
Update the last access time of an object.- Parameters:
names
- of keys- Returns:
- count of objects were touched
-
countExists
reactor.core.publisher.Mono<> countExists(... names)
Checks if provided keys exist- Parameters:
names
- of keys- Returns:
- amount of existing keys
-
getType
reactor.core.publisher.Mono< key)
Get Redis object type by key- Parameters:
key
- - name of key- Returns:
- type of key
-
getKeys
reactor.core.publisher.Flux<> getKeys()
Load keys in incrementally iterate mode. Keys traversed with SCAN operation. Each SCAN operation loads up to 10 keys per request.- Returns:
- keys
-
getKeys
reactor.core.publisher.Flux<> getKeys(int count)
Load keys in incrementally iterate mode. Keys traversed with SCAN operation. Each SCAN operation loads up tocount
keys per request.- Parameters:
count
- - keys loaded per request to Redis- Returns:
- keys
-
getKeysByPattern
reactor.core.publisher.Flux<> getKeysByPattern( pattern)
Find keys by pattern and load it in incrementally iterate mode. Keys traversed with SCAN operation. Each SCAN operation loads up to 10 keys per request.Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo
- Parameters:
pattern
- - match pattern- Returns:
- keys
-
getKeysByPattern
reactor.core.publisher.Flux<> getKeysByPattern( pattern, int count)
Get all keys by pattern using iterator. Keys traversed with SCAN operation. Each SCAN operation loads up tocount
keys per request.Supported glob-style patterns:
h?llo subscribes to hello, hallo and hxllo
h*llo subscribes to hllo and heeeello
h[ae]llo subscribes to hello and hallo, but not hillo
- Parameters:
pattern
- - match patterncount
- - keys loaded per request to Redis- Returns:
- keys
-
getSlot
reactor.core.publisher.Mono<> getSlot( key)
Get hash slot identifier for key. Available for cluster nodes only. UsesKEYSLOT
Redis command.- Parameters:
key
- - name of key- Returns:
- slot number
-
randomKey
reactor.core.publisher.Mono<> randomKey()
Get random key UsesRANDOM_KEY
Redis command.- Returns:
- random key
-
deleteByPattern
reactor.core.publisher.Mono<> deleteByPattern( pattern)
Delete multiple objects by a key pattern. Uses Lua script. Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo- Parameters:
pattern
- - match pattern- Returns:
- deleted objects amount
-
delete
reactor.core.publisher.Mono<> delete(... keys)
Delete multiple objects by name. UsesDEL
Redis command.- Parameters:
keys
- - object names- Returns:
- deleted objects amount
-
unlink
reactor.core.publisher.Mono<> unlink(... keys)
Delete multiple objects by name. Actual removal will happen later asynchronously.Requires Redis 4.0+
- Parameters:
keys
- of objects- Returns:
- number of removed keys
-
count
reactor.core.publisher.Mono<> count()
Returns the number of keys in the currently-selected database- Returns:
- count of keys
-
flushdb
reactor.core.publisher.Mono<> flushdb()
Delete all the keys of the currently selected database UsesFLUSHDB
Redis command.- Returns:
- void
-
swapdb
reactor.core.publisher.Mono<> swapdb(int db1, int db2)
Swap two databases.Requires Redis 4.0+
- Returns:
- void
-
flushall
reactor.core.publisher.Mono<> flushall()
Delete all the keys of all the existing databases UsesFLUSHALL
Redis command.- Returns:
- void
-
flushdbParallel
reactor.core.publisher.Mono<> flushdbParallel()
Delete all keys of currently selected database in background without blocking server.Requires Redis 4.0+
- Returns:
- void
-
flushallParallel
reactor.core.publisher.Mono<> flushallParallel()
Delete all keys of all existing databases in background without blocking server.Requires Redis 4.0+
- Returns:
- void
-
-