public interface RKeysRx
Modifier and Type | Method and Description |
---|---|
io.reactivex.rxjava3.core.Single<Boolean> |
clearExpire(String name)
Clear an expire timeout or expire date for object.
|
io.reactivex.rxjava3.core.Completable |
copy(String name,
String host,
int port,
int database,
long timeout)
Copy object from source Redis instance to destination Redis instance
|
io.reactivex.rxjava3.core.Single<Long> |
count()
Returns the number of keys in the currently-selected database
|
io.reactivex.rxjava3.core.Single<Long> |
countExists(String... names)
Checks if provided keys exist
|
io.reactivex.rxjava3.core.Single<Long> |
delete(String... keys)
Delete multiple objects by name.
|
io.reactivex.rxjava3.core.Single<Long> |
deleteByPattern(String pattern)
Delete multiple objects by a key pattern.
|
io.reactivex.rxjava3.core.Single<Boolean> |
expire(String name,
long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
io.reactivex.rxjava3.core.Single<Boolean> |
expireAt(String name,
long timestamp)
Set an expire date for object.
|
io.reactivex.rxjava3.core.Completable |
flushall()
Delete all the keys of all the existing databases
Uses
FLUSHALL Redis command. |
io.reactivex.rxjava3.core.Completable |
flushallParallel()
Delete all keys of all existing databases
in background without blocking server.
|
io.reactivex.rxjava3.core.Completable |
flushdb()
Delete all the keys of the currently selected database
Uses
FLUSHDB Redis command. |
io.reactivex.rxjava3.core.Completable |
flushdbParallel()
Delete all keys of currently selected database
in background without blocking server.
|
io.reactivex.rxjava3.core.Flowable<String> |
getKeys()
Load keys in incrementally iterate mode.
|
io.reactivex.rxjava3.core.Flowable<String> |
getKeys(int count)
Load keys in incrementally iterate mode.
|
io.reactivex.rxjava3.core.Flowable<String> |
getKeysByPattern(String pattern)
Find keys by pattern and load it in incrementally iterate mode.
|
io.reactivex.rxjava3.core.Flowable<String> |
getKeysByPattern(String pattern,
int count)
Get all keys by pattern using iterator.
|
io.reactivex.rxjava3.core.Single<Integer> |
getSlot(String key)
Get hash slot identifier for key.
|
io.reactivex.rxjava3.core.Single<RType> |
getType(String key)
Get Redis object type by key
|
io.reactivex.rxjava3.core.Completable |
migrate(String name,
String host,
int port,
int database,
long timeout)
Transfer object from source Redis instance to destination Redis instance
|
io.reactivex.rxjava3.core.Single<Boolean> |
move(String name,
int database)
Move object to another database
|
io.reactivex.rxjava3.core.Maybe<String> |
randomKey()
Get random key
Uses
RANDOM_KEY Redis command. |
io.reactivex.rxjava3.core.Single<Long> |
remainTimeToLive(String name)
Remaining time to live of Redisson object that has a timeout
|
io.reactivex.rxjava3.core.Completable |
rename(String currentName,
String newName)
Rename current object key to
newName |
io.reactivex.rxjava3.core.Single<Boolean> |
renamenx(String oldName,
String newName)
Rename object with
oldName to newName
only if new key is not exists |
io.reactivex.rxjava3.core.Completable |
swapdb(int db1,
int db2)
Swap two databases.
|
io.reactivex.rxjava3.core.Single<Long> |
touch(String... names)
Update the last access time of an object.
|
io.reactivex.rxjava3.core.Single<Long> |
unlink(String... keys)
Delete multiple objects by name.
|
io.reactivex.rxjava3.core.Single<Boolean> move(String name, int database)
name
- of objectdatabase
- - Redis database numbertrue
if key was moved else false
io.reactivex.rxjava3.core.Completable migrate(String name, String host, int port, int database, long timeout)
name
- of objecthost
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in millisecondsio.reactivex.rxjava3.core.Completable copy(String name, String host, int port, int database, long timeout)
name
- of objecthost
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in millisecondsio.reactivex.rxjava3.core.Single<Boolean> expire(String name, long timeToLive, TimeUnit timeUnit)
name
- of objecttimeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notio.reactivex.rxjava3.core.Single<Boolean> expireAt(String name, long timestamp)
name
- of objecttimestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notio.reactivex.rxjava3.core.Single<Boolean> clearExpire(String name)
name
- of objecttrue
if timeout was removed
false
if object does not exist or does not have an associated timeoutio.reactivex.rxjava3.core.Single<Boolean> renamenx(String oldName, String newName)
oldName
to newName
only if new key is not existsoldName
- - old name of objectnewName
- - new name of objecttrue
if object has been renamed successfully and false
otherwiseio.reactivex.rxjava3.core.Completable rename(String currentName, String newName)
newName
currentName
- - current name of objectnewName
- - new name of objectio.reactivex.rxjava3.core.Single<Long> remainTimeToLive(String name)
name
- of keyio.reactivex.rxjava3.core.Single<Long> touch(String... names)
names
- of keysio.reactivex.rxjava3.core.Single<Long> countExists(String... names)
names
- of keysio.reactivex.rxjava3.core.Single<RType> getType(String key)
key
- - name of keyio.reactivex.rxjava3.core.Flowable<String> getKeys()
io.reactivex.rxjava3.core.Flowable<String> getKeys(int count)
count
keys per request.count
- - keys loaded per request to Redisio.reactivex.rxjava3.core.Flowable<String> getKeysByPattern(String pattern)
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
pattern
- - match patternio.reactivex.rxjava3.core.Flowable<String> getKeysByPattern(String pattern, int count)
count
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
pattern
- - match patterncount
- - keys loaded per request to Redisio.reactivex.rxjava3.core.Single<Integer> getSlot(String key)
KEYSLOT
Redis command.key
- - name of keyio.reactivex.rxjava3.core.Maybe<String> randomKey()
RANDOM_KEY
Redis command.io.reactivex.rxjava3.core.Single<Long> deleteByPattern(String pattern)
pattern
- - match patternio.reactivex.rxjava3.core.Single<Long> delete(String... keys)
DEL
Redis command.keys
- - object namesio.reactivex.rxjava3.core.Single<Long> unlink(String... keys)
Requires Redis 4.0+
keys
- of objectsio.reactivex.rxjava3.core.Single<Long> count()
io.reactivex.rxjava3.core.Completable flushdb()
FLUSHDB
Redis command.io.reactivex.rxjava3.core.Completable swapdb(int db1, int db2)
Requires Redis 4.0+
io.reactivex.rxjava3.core.Completable flushall()
FLUSHALL
Redis command.io.reactivex.rxjava3.core.Completable flushdbParallel()
Requires Redis 4.0+
io.reactivex.rxjava3.core.Completable flushallParallel()
Requires Redis 4.0+
Copyright © 2014–2021 Redisson. All rights reserved.