redis.clients.jedis.commands.StreamPipelineCommands Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis Show documentation
Show all versions of jedis Show documentation
Jedis is a blazingly small and sane Redis java client.
The newest version!
package redis.clients.jedis.commands;
import java.util.List;
import java.util.Map;
import redis.clients.jedis.Response;
import redis.clients.jedis.StreamEntryID;
import redis.clients.jedis.params.*;
import redis.clients.jedis.resps.*;
public interface StreamPipelineCommands {
/**
* XADD key ID field string [field string ...]
*
* @return the ID of the added entry
*/
Response xadd(String key, StreamEntryID id, Map hash);
/**
* XADD key [NOMKSTREAM] [MAXLEN|MINID [=|~] threshold [LIMIT count]] *|ID field value [field value ...]
*
* @return the ID of the added entry
*/
// Legacy
default Response xadd(String key, Map hash, XAddParams params) {
return xadd(key, params, hash);
}
Response xadd(String key, XAddParams params, Map hash);
/**
* XLEN key
*
* @return length of stream
*/
Response xlen(String key);
/**
* XRANGE key start end
*
* @param key key
* @param start minimum {@link StreamEntryID} for the retrieved range, passing null
will indicate minimum ID possible in the stream
* @param end maximum {@link StreamEntryID} for the retrieved range, passing null
will indicate maximum ID possible in the stream
* @return The entries with IDs matching the specified range.
*/
Response> xrange(String key, StreamEntryID start, StreamEntryID end);
/**
* XRANGE key start end COUNT count
*
* @param key key
* @param start minimum {@link StreamEntryID} for the retrieved range, passing null
will indicate minimum ID possible in the stream
* @param end maximum {@link StreamEntryID} for the retrieved range, passing null
will indicate maximum ID possible in the stream
* @param count maximum number of entries returned
* @return The entries with IDs matching the specified range.
*/
Response> xrange(String key, StreamEntryID start, StreamEntryID end, int count);
/**
* XREVRANGE key end start
*
* @param key key
* @param start minimum {@link StreamEntryID} for the retrieved range, passing null
will indicate minimum ID possible in the stream
* @param end maximum {@link StreamEntryID} for the retrieved range, passing null
will indicate maximum ID possible in the stream
* @return the entries with IDs matching the specified range, from the higher ID to the lower ID matching.
*/
Response> xrevrange(String key, StreamEntryID end, StreamEntryID start);
/**
* XREVRANGE key end start COUNT count
*
* @param key key
* @param start minimum {@link StreamEntryID} for the retrieved range, passing null
will indicate minimum ID possible in the stream
* @param end maximum {@link StreamEntryID} for the retrieved range, passing null
will indicate maximum ID possible in the stream
* @param count The entries with IDs matching the specified range.
* @return the entries with IDs matching the specified range, from the higher ID to the lower ID matching.
*/
Response> xrevrange(String key, StreamEntryID end, StreamEntryID start, int count);
Response> xrange(String key, String start, String end);
Response> xrange(String key, String start, String end, int count);
Response> xrevrange(String key, String end, String start);
Response> xrevrange(String key, String end, String start, int count);
/**
* XACK key group ID [ID ...]
*/
Response xack(String key, String group, StreamEntryID... ids);
/**
* {@code XGROUP CREATE key groupName }
*/
Response xgroupCreate( String key, String groupName, StreamEntryID id, boolean makeStream);
/**
* {@code XGROUP SETID key groupName }
*/
Response xgroupSetID( String key, String groupName, StreamEntryID id);
/**
* XGROUP DESTROY key groupName
*/
Response xgroupDestroy(String key, String groupName);
/**
* XGROUP CREATECONSUMER key groupName consumerName
*/
Response xgroupCreateConsumer( String key, String groupName, String consumerName);
/**
* XGROUP DELCONSUMER key groupName consumerName
*/
Response xgroupDelConsumer( String key, String groupName, String consumerName);
/**
* XPENDING key group
*/
Response xpending(String key, String groupName);
/**
* XPENDING key group [[IDLE min-idle-time] start end count [consumer]]
*/
Response> xpending(String key, String groupName, XPendingParams params);
/**
* XDEL key ID [ID ...]
*/
Response xdel(String key, StreamEntryID... ids);
/**
* XTRIM key MAXLEN [~] count
*/
Response xtrim(String key, long maxLen, boolean approximate);
/**
* XTRIM key MAXLEN|MINID [=|~] threshold [LIMIT count]
*/
Response xtrim(String key, XTrimParams params);
/**
* {@code XCLAIM key group consumer min-idle-time ...
* [IDLE ] [TIME ] [RETRYCOUNT ]
* [FORCE]}
*/
Response> xclaim(String key, String group, String consumerName, long minIdleTime,
XClaimParams params, StreamEntryID... ids);
/**
* {@code XCLAIM key group consumer min-idle-time ...
* [IDLE ] [TIME ] [RETRYCOUNT ]
* [FORCE] JUSTID}
*/
Response> xclaimJustId(String key, String group, String consumerName, long minIdleTime,
XClaimParams params, StreamEntryID... ids);
/**
* XAUTOCLAIM key group consumer min-idle-time start [COUNT count]
*
* @param key Stream Key
* @param group Consumer Group
* @param consumerName Consumer name to transfer the auto claimed entries
* @param minIdleTime Entries pending more than minIdleTime will be transferred ownership
* @param start {@link StreamEntryID} - Entries ≥ start will be transferred ownership, passing
* {@code null} will indicate '-'
* @param params {@link XAutoClaimParams}
*/
Response>> xautoclaim(String key, String group, String consumerName,
long minIdleTime, StreamEntryID start, XAutoClaimParams params);
/**
* XAUTOCLAIM key group consumer min-idle-time start [COUNT count] JUSTID
*
* @param key Stream Key
* @param group Consumer Group
* @param consumerName Consumer name to transfer the auto claimed entries
* @param minIdleTime Entries pending more than minIdleTime will be transferred ownership
* @param start {@link StreamEntryID} - Entries ≥ start will be transferred ownership, passing
* {@code null} will indicate '-'
* @param params {@link XAutoClaimParams}
*/
Response>> xautoclaimJustId(String key, String group, String consumerName,
long minIdleTime, StreamEntryID start, XAutoClaimParams params);
/**
* Introspection command used in order to retrieve different information about the stream
* @param key Stream name
* @return {@link StreamInfo} that contains information about the stream
*/
Response xinfoStream(String key);
/**
* Introspection command used in order to retrieve all information about the stream
* @param key Stream name
* @return {@link StreamFullInfo} that contains information about the stream
*/
Response xinfoStreamFull(String key);
/**
* Introspection command used in order to retrieve all information about the stream
* @param key Stream name
* @param count stream info count
* @return {@link StreamFullInfo} that contains information about the stream
*/
Response xinfoStreamFull(String key, int count);
/**
* Introspection command used in order to retrieve different information about groups in the stream
* @param key Stream name
* @return List of {@link StreamGroupInfo} containing information about groups
*/
Response> xinfoGroups(String key);
/**
* Introspection command used in order to retrieve different information about consumers in the group
* @param key Stream name
* @param group Group name
* @return List of {@link StreamConsumersInfo} containing information about consumers that belong
* to the group
* @deprecated Use {@link #xinfoConsumers2(java.lang.String, java.lang.String)}.
*/
@Deprecated // keep it till at least Jedis 6/7
Response> xinfoConsumers(String key, String group);
/**
* Introspection command used in order to retrieve different information about consumers in the group
* @param key Stream name
* @param group Group name
* @return List of {@link StreamConsumerInfo} containing information about consumers that belong
* to the group
*/
Response> xinfoConsumers2(String key, String group);
/**
* XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]
*/
Response>>> xread(XReadParams xReadParams,
Map streams);
/**
* XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]
*/
Response