public interface StreamOperations<K,HK,HV> extends HashMapperProvider<HK,HV>
| Modifier and Type | Method and Description |
|---|---|
default Long |
acknowledge(K key,
String group,
RecordId... recordIds)
Acknowledge one or more records as processed.
|
Long |
acknowledge(K key,
String group,
String... recordIds)
Acknowledge one or more records as processed.
|
default Long |
acknowledge(String group,
Record<K,?> record)
Acknowledge the given record as processed.
|
default RecordId |
add(K key,
Map<? extends HK,? extends HV> content)
Append a record to the stream
key. |
default RecordId |
add(MapRecord<K,? extends HK,? extends HV> record)
Append a record, backed by a
Map holding the field/value pairs, to the stream. |
RecordId |
add(Record<K,?> record)
Append the record, backed by the given value, to the stream.
|
StreamInfo.XInfoConsumers |
consumers(K key,
String group)
Obtain information about every consumer in a specific consumer group for the stream stored at the
specified key.
|
String |
createGroup(K key,
ReadOffset readOffset,
String group)
Create a consumer group.
|
default String |
createGroup(K key,
String group)
Create a consumer group at the
latest offset. |
Long |
delete(K key,
RecordId... recordIds)
Removes the specified records from the stream.
|
default Long |
delete(K key,
String... recordIds)
Removes the specified records from the stream.
|
default Long |
delete(Record<K,?> record)
Removes a given
Record from the stream. |
Boolean |
deleteConsumer(K key,
Consumer consumer)
Delete a consumer from a consumer group.
|
Boolean |
destroyGroup(K key,
String group)
Destroy a consumer group.
|
<V> HashMapper<V,HK,HV> |
getHashMapper(Class<V> targetType)
Get the
HashMapper for a specific type. |
StreamInfo.XInfoGroups |
groups(K key)
Obtain information about consumer groups associated with the stream stored at the specified
key.
|
StreamInfo.XInfoStream |
info(K key)
Obtain general information about the stream stored at the specified key.
|
default PendingMessages |
pending(K key,
Consumer consumer)
Obtained detailed information about all pending messages for a given
Consumer. |
PendingMessages |
pending(K key,
Consumer consumer,
Range<?> range,
long count)
|
PendingMessagesSummary |
pending(K key,
String group)
Obtain the
PendingMessagesSummary for a given consumer group. |
PendingMessages |
pending(K key,
String group,
Range<?> range,
long count)
|
default <V> List<ObjectRecord<K,V>> |
range(Class<V> targetType,
K key,
Range<String> range)
Read all records from a stream within a specific
Range as ObjectRecord. |
default <V> List<ObjectRecord<K,V>> |
range(Class<V> targetType,
K key,
Range<String> range,
RedisZSetCommands.Limit limit)
Read records from a stream within a specific
Range applying a RedisZSetCommands.Limit as ObjectRecord. |
default List<MapRecord<K,HK,HV>> |
range(K key,
Range<String> range)
Read records from a stream within a specific
Range. |
List<MapRecord<K,HK,HV>> |
range(K key,
Range<String> range,
RedisZSetCommands.Limit limit)
Read records from a stream within a specific
Range applying a RedisZSetCommands.Limit. |
default <V> List<ObjectRecord<K,V>> |
read(Class<V> targetType,
Consumer consumer,
StreamOffset<K>... streams)
Read records from one or more
StreamOffsets using a consumer group as ObjectRecord. |
default <V> List<ObjectRecord<K,V>> |
read(Class<V> targetType,
Consumer consumer,
StreamReadOptions readOptions,
StreamOffset<K>... streams)
Read records from one or more
StreamOffsets using a consumer group as ObjectRecord. |
default <V> List<ObjectRecord<K,V>> |
read(Class<V> targetType,
StreamOffset<K>... streams)
Read records from one or more
StreamOffsets as ObjectRecord. |
default <V> List<ObjectRecord<K,V>> |
read(Class<V> targetType,
StreamReadOptions readOptions,
StreamOffset<K>... streams)
Read records from one or more
StreamOffsets as ObjectRecord. |
default List<MapRecord<K,HK,HV>> |
read(Consumer consumer,
StreamOffset<K>... streams)
Read records from one or more
StreamOffsets using a consumer group. |
List<MapRecord<K,HK,HV>> |
read(Consumer consumer,
StreamReadOptions readOptions,
StreamOffset<K>... streams)
Read records from one or more
StreamOffsets using a consumer group. |
default List<MapRecord<K,HK,HV>> |
read(StreamOffset<K>... streams)
Read records from one or more
StreamOffsets. |
List<MapRecord<K,HK,HV>> |
read(StreamReadOptions readOptions,
StreamOffset<K>... streams)
Read records from one or more
StreamOffsets. |
default <V> List<ObjectRecord<K,V>> |
reverseRange(Class<V> targetType,
K key,
Range<String> range)
Read records from a stream within a specific
Range in reverse order as ObjectRecord. |
default <V> List<ObjectRecord<K,V>> |
reverseRange(Class<V> targetType,
K key,
Range<String> range,
RedisZSetCommands.Limit limit)
Read records from a stream within a specific
Range applying a RedisZSetCommands.Limit in reverse order as
ObjectRecord. |
default List<MapRecord<K,HK,HV>> |
reverseRange(K key,
Range<String> range)
Read records from a stream within a specific
Range in reverse order. |
List<MapRecord<K,HK,HV>> |
reverseRange(K key,
Range<String> range,
RedisZSetCommands.Limit limit)
Read records from a stream within a specific
Range applying a RedisZSetCommands.Limit in reverse order. |
Long |
size(K key)
Get the length of a stream.
|
Long |
trim(K key,
long count)
Trims the stream to
count elements. |
@Nullable Long acknowledge(K key, String group, String... recordIds)
key - the stream key.group - name of the consumer group.recordIds - record id's to acknowledge.@Nullable default Long acknowledge(K key, String group, RecordId... recordIds)
key - the stream key.group - name of the consumer group.recordIds - record id's to acknowledge.default Long acknowledge(String group, Record<K,?> record)
group - name of the consumer group.record - the Record to acknowledge.@Nullable default RecordId add(K key, Map<? extends HK,? extends HV> content)
key.key - the stream key.content - record content as Map.@Nullable default RecordId add(MapRecord<K,? extends HK,? extends HV> record)
Map holding the field/value pairs, to the stream.record - the record to append.@Nullable RecordId add(Record<K,?> record)
record - must not be null.MapRecord,
ObjectRecord@Nullable default Long delete(K key, String... recordIds)
key - the stream key.recordIds - stream record Id's.@Nullable default Long delete(Record<K,?> record)
Record from the stream.record - must not be null.Mono emitting the number of removed records.@Nullable Long delete(K key, RecordId... recordIds)
key - the stream key.recordIds - stream record Id's.Mono emitting the number of removed records.default String createGroup(K key, String group)
latest offset. This command creates the stream if it
does not already exist.key - the key the stream is stored at.group - name of the consumer group.@Nullable String createGroup(K key, ReadOffset readOffset, String group)
key - the key the stream is stored at.readOffset - the ReadOffset to apply.group - name of the consumer group.@Nullable Boolean deleteConsumer(K key, Consumer consumer)
key - the stream key.consumer - consumer identified by group name and consumer key.@Nullable Boolean destroyGroup(K key, String group)
key - the stream key.group - name of the consumer group.StreamInfo.XInfoConsumers consumers(K key, String group)
key - the key the stream is stored at.group - name of the consumer group.StreamInfo.XInfoGroups groups(K key)
key - the key the stream is stored at.StreamInfo.XInfoStream info(K key)
key - the key the stream is stored at.@Nullable PendingMessagesSummary pending(K key, String group)
PendingMessagesSummary for a given consumer group.key - the key the stream is stored at. Must not be null.group - the name of the consumer group. Must not be null.default PendingMessages pending(K key, Consumer consumer)
Consumer.key - the key the stream is stored at. Must not be null.consumer - the consumer to fetch PendingMessages for. Must not be null.Consumer or null when used in pipeline / transaction.PendingMessages pending(K key, String group, Range<?> range, long count)
key - the key the stream is stored at. Must not be null.group - the name of the consumer group. Must not be null.range - the range of messages ids to search within. Must not be null.count - limit the number of results.PendingMessages pending(K key, Consumer consumer, Range<?> range, long count)
messages for a given Range and
Consumer within a consumer group.key - the key the stream is stored at. Must not be null.consumer - the name of the Consumer. Must not be null.range - the range of messages ids to search within. Must not be null.count - limit the number of results.Consumer or null when used in pipeline / transaction.@Nullable Long size(K key)
key - the stream key.@Nullable default List<MapRecord<K,HK,HV>> range(K key, Range<String> range)
Range.key - the stream key.range - must not be null.@Nullable List<MapRecord<K,HK,HV>> range(K key, Range<String> range, RedisZSetCommands.Limit limit)
Range applying a RedisZSetCommands.Limit.key - the stream key.range - must not be null.limit - must not be null.default <V> List<ObjectRecord<K,V>> range(Class<V> targetType, K key, Range<String> range)
Range as ObjectRecord.targetType - the target type of the payload.key - the stream key.range - must not be null.default <V> List<ObjectRecord<K,V>> range(Class<V> targetType, K key, Range<String> range, RedisZSetCommands.Limit limit)
Range applying a RedisZSetCommands.Limit as ObjectRecord.targetType - the target type of the payload.key - the stream key.range - must not be null.limit - must not be null.@Nullable default List<MapRecord<K,HK,HV>> read(StreamOffset<K>... streams)
StreamOffsets.streams - the streams to read from.default <V> List<ObjectRecord<K,V>> read(Class<V> targetType, StreamOffset<K>... streams)
StreamOffsets as ObjectRecord.targetType - the target type of the payload.streams - the streams to read from.@Nullable List<MapRecord<K,HK,HV>> read(StreamReadOptions readOptions, StreamOffset<K>... streams)
StreamOffsets.readOptions - read arguments.streams - the streams to read from.@Nullable default <V> List<ObjectRecord<K,V>> read(Class<V> targetType, StreamReadOptions readOptions, StreamOffset<K>... streams)
StreamOffsets as ObjectRecord.targetType - the target type of the payload.readOptions - read arguments.streams - the streams to read from.@Nullable default List<MapRecord<K,HK,HV>> read(Consumer consumer, StreamOffset<K>... streams)
StreamOffsets using a consumer group.consumer - consumer/group.streams - the streams to read from.@Nullable default <V> List<ObjectRecord<K,V>> read(Class<V> targetType, Consumer consumer, StreamOffset<K>... streams)
StreamOffsets using a consumer group as ObjectRecord.targetType - the target type of the payload.consumer - consumer/group.streams - the streams to read from.@Nullable List<MapRecord<K,HK,HV>> read(Consumer consumer, StreamReadOptions readOptions, StreamOffset<K>... streams)
StreamOffsets using a consumer group.consumer - consumer/group.readOptions - read arguments.streams - the streams to read from.@Nullable default <V> List<ObjectRecord<K,V>> read(Class<V> targetType, Consumer consumer, StreamReadOptions readOptions, StreamOffset<K>... streams)
StreamOffsets using a consumer group as ObjectRecord.targetType - the target type of the payload.consumer - consumer/group.readOptions - read arguments.streams - the streams to read from.@Nullable default List<MapRecord<K,HK,HV>> reverseRange(K key, Range<String> range)
Range in reverse order.key - the stream key.range - must not be null.@Nullable List<MapRecord<K,HK,HV>> reverseRange(K key, Range<String> range, RedisZSetCommands.Limit limit)
Range applying a RedisZSetCommands.Limit in reverse order.key - the stream key.range - must not be null.limit - must not be null.default <V> List<ObjectRecord<K,V>> reverseRange(Class<V> targetType, K key, Range<String> range)
Range in reverse order as ObjectRecord.targetType - the target type of the payload.key - the stream key.range - must not be null.default <V> List<ObjectRecord<K,V>> reverseRange(Class<V> targetType, K key, Range<String> range, RedisZSetCommands.Limit limit)
Range applying a RedisZSetCommands.Limit in reverse order as
ObjectRecord.targetType - the target type of the payload.key - the stream key.range - must not be null.limit - must not be null.@Nullable Long trim(K key, long count)
count elements.key - the stream key.count - length of the stream.<V> HashMapper<V,HK,HV> getHashMapper(Class<V> targetType)
HashMapper for a specific type.getHashMapper in interface HashMapperProvider<HK,HV>V - targetType - must not be null.HashMapper suitable for a given type;Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.