public interface MultiKeyCommands
String lmove(String srcKey, String dstKey, ListDirection from, ListDirection to)
String blmove(String srcKey, String dstKey, ListDirection from, ListDirection to, double timeout)
KeyedListElement blpop(double timeout, String... keys)
KeyedListElement brpop(double timeout, String... keys)
KeyedZSetElement bzpopmax(double timeout, String... keys)
KeyedZSetElement bzpopmin(double timeout, String... keys)
Set<String> keys(String pattern)
scan(String, ScanParams)
or sets.
While the time complexity for this operation is O(N), the constant times are fairly low. For example, Redis running on an entry level laptop can scan a 1 million key database in 40 milliseconds.
Glob style patterns examples:
Use \ to escape special chars if you want to match them verbatim.
Time complexity: O(n) (with n being the number of keys in the DB, and assuming keys and pattern of limited length)
pattern
- Long sort(String key, SortingParams sortingParameters, String dstkey)
String unwatch()
void subscribe(JedisPubSub jedisPubSub, String... channels)
void psubscribe(JedisPubSub jedisPubSub, String... patterns)
String randomKey()
ScanResult<String> scan(String cursor)
cursor
- scan(String, ScanParams)
ScanResult<String> scan(String cursor, ScanParams params)
Since this command allows for incremental iteration, returning only a small number of elements
per call, it can be used in production without the downside of commands like
keys(String)
or JedisCommands.smembers(String)
)} that may block the server
for a long time (even several seconds) when called against big collections of keys or elements.
SCAN basic usage
SCAN is a cursor based iterator. This means that at every call of the command, the server
returns an updated cursor that the user needs to use as the cursor argument in the next call.
An iteration starts when the cursor is set to 0, and terminates when the cursor returned by the
server is 0.
Scan guarantees
The SCAN command, and the other commands in the SCAN family, are able to provide to the user a
set of guarantees associated to full iterations.
Time complexity: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the DB.
cursor
- The cursor.params
- the scan parameters. For example a glob-style match patternScanResult<String> scan(String cursor, ScanParams params, String type)
long pfcount(String... keys)
@Deprecated List<Map.Entry<String,List<StreamEntry>>> xread(int count, long block, Map.Entry<String,StreamEntryID>... streams)
block
param. Use
xread(redis.clients.jedis.params.XReadParams, java.util.Map)
.count
- block
- streams
- List<Map.Entry<String,List<StreamEntry>>> xread(XReadParams xReadParams, Map<String,StreamEntryID> streams)
@Deprecated List<Map.Entry<String,List<StreamEntry>>> xreadGroup(String groupname, String consumer, int count, long block, boolean noAck, Map.Entry<String,StreamEntryID>... streams)
block
param. Use
xreadGroup(java.lang.String, java.lang.String, redis.clients.jedis.params.XReadGroupParams, java.util.Map)
.groupname
- consumer
- count
- block
- noAck
- streams
- List<Map.Entry<String,List<StreamEntry>>> xreadGroup(String groupname, String consumer, XReadGroupParams xReadGroupParams, Map<String,StreamEntryID> streams)
Long georadiusStore(String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
Long georadiusByMemberStore(String key, String member, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
LCSMatchResult strAlgoLCSKeys(String keyA, String keyB, StrAlgoLCSParams params)
Copyright © 2022. All rights reserved.