public class RedissonKeys extends Object implements RKeys
Constructor and Description |
---|
RedissonKeys(CommandAsyncExecutor commandExecutor) |
Modifier and Type | Method and Description |
---|---|
long |
count()
Returns the number of keys in the currently-selected database
|
RFuture<Long> |
countAsync()
Returns the number of keys in the currently-selected database in async mode
|
long |
countExists(String... names)
Checks if provided keys exist
|
RFuture<Long> |
countExistsAsync(String... names)
Checks if provided keys exist
|
long |
delete(String... keys)
Delete multiple objects by name
|
RFuture<Long> |
deleteAsync(String... keys)
Delete multiple objects by name
|
long |
deleteByPattern(String pattern)
Delete multiple objects by a key pattern.
|
RFuture<Long> |
deleteByPatternAsync(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?
|
RFuture<Collection<String>> |
findKeysByPatternAsync(String pattern)
Find keys by key search pattern in async mode
Supported glob-style patterns:
h?
|
void |
flushall()
Delete all keys of all existing databases
|
RFuture<Void> |
flushallAsync()
Delete all keys of all existing databases
|
void |
flushdb()
Delete all keys of currently selected database
|
RFuture<Void> |
flushdbAsync()
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.
|
RFuture<Integer> |
getSlotAsync(String key)
Get hash slot identifier for key in async mode.
|
RType |
getType(String key)
Get Redis object type by key
|
RFuture<RType> |
getTypeAsync(String key)
Get Redis object type by key
|
String |
randomKey()
Get random key
|
RFuture<String> |
randomKeyAsync()
Get random key in async mode
|
long |
touch(String... names)
Update the last access time of an object.
|
RFuture<Long> |
touchAsync(String... names)
Update the last access time of an object.
|
public RedissonKeys(CommandAsyncExecutor commandExecutor)
public RType getType(String key)
RKeys
public RFuture<RType> getTypeAsync(String key)
RKeysAsync
getTypeAsync
in interface RKeysAsync
key
- - name of keypublic int getSlot(String key)
RKeys
public RFuture<Integer> getSlotAsync(String key)
RKeysAsync
getSlotAsync
in interface RKeysAsync
key
- - name of keypublic Iterable<String> getKeysByPattern(String pattern)
RKeys
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
getKeysByPattern
in interface RKeys
pattern
- - match patternpublic Iterable<String> getKeysByPattern(String pattern, int count)
RKeys
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
getKeysByPattern
in interface RKeys
pattern
- - match patterncount
- - keys loaded per request to Redispublic Iterable<String> getKeys()
RKeys
public long touch(String... names)
RKeys
public RFuture<Long> touchAsync(String... names)
RKeysAsync
touchAsync
in interface RKeysAsync
public long countExists(String... names)
RKeys
countExists
in interface RKeys
names
- of keyspublic RFuture<Long> countExistsAsync(String... names)
RKeysAsync
countExistsAsync
in interface RKeysAsync
names
- of keyspublic RFuture<String> randomKeyAsync()
RKeysAsync
randomKeyAsync
in interface RKeysAsync
public Collection<String> findKeysByPattern(String pattern)
RKeys
findKeysByPattern
in interface RKeys
pattern
- - match patternpublic RFuture<Collection<String>> findKeysByPatternAsync(String pattern)
RKeysAsync
findKeysByPatternAsync
in interface RKeysAsync
pattern
- - match patternpublic long deleteByPattern(String pattern)
RKeys
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
deleteByPattern
in interface RKeys
pattern
- - match patternpublic RFuture<Long> deleteByPatternAsync(String pattern)
RKeysAsync
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
deleteByPatternAsync
in interface RKeysAsync
pattern
- - match patternpublic long delete(String... keys)
RKeys
public RFuture<Long> deleteAsync(String... keys)
RKeysAsync
deleteAsync
in interface RKeysAsync
keys
- - object namespublic long count()
RKeys
public RFuture<Long> countAsync()
RKeysAsync
countAsync
in interface RKeysAsync
public void flushdb()
RKeys
public RFuture<Void> flushdbAsync()
RKeysAsync
flushdbAsync
in interface RKeysAsync
public void flushall()
RKeys
public RFuture<Void> flushallAsync()
RKeysAsync
flushallAsync
in interface RKeysAsync
Copyright © 2014–2017 The Redisson Project. All rights reserved.