public interface RKeys extends RKeysAsync
Modifier and Type | Method and Description |
---|---|
long |
count()
Returns the number of keys in the currently-selected database
|
long |
countExists(String... names)
Checks if provided keys exist
|
long |
delete(String... keys)
Delete multiple objects by name
|
long |
deleteByPattern(String pattern)
Delete multiple objects by a key pattern.
|
Collection<String> |
findKeysByPattern(String pattern)
Find keys by key search pattern
Supported glob-style patterns:
h?
|
void |
flushall()
Delete all keys of all existing databases
|
void |
flushdb()
Delete all keys of currently selected database
|
Iterable<String> |
getKeys()
Get all keys using iterator.
|
Iterable<String> |
getKeysByPattern(String pattern)
Get all keys by pattern using iterator.
|
Iterable<String> |
getKeysByPattern(String pattern,
int count)
Get all keys by pattern using iterator.
|
int |
getSlot(String key)
Get hash slot identifier for key.
|
RType |
getType(String key)
Get Redis object type by key
|
String |
randomKey()
Get random key
|
long |
touch(String... names)
Update the last access time of an object.
|
countAsync, countExistsAsync, deleteAsync, deleteByPatternAsync, findKeysByPatternAsync, flushallAsync, flushdbAsync, getSlotAsync, getTypeAsync, randomKeyAsync, touchAsync
long touch(String... names)
long countExists(String... names)
names
- of keysRType getType(String key)
key
- - name of keyint getSlot(String key)
key
- - name of keyIterable<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 patternIterable<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 RedisIterable<String> getKeys()
String randomKey()
Collection<String> findKeysByPattern(String pattern)
pattern
- - match patternlong deleteByPattern(String pattern)
Method executes in NON atomic way in cluster mode due to lua script limitations.
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 patternlong delete(String... keys)
keys
- - object nameslong count()
void flushdb()
void flushall()
Copyright © 2014–2017 The Redisson Project. All rights reserved.