K
- key typeV
- value typepublic class RedissonStream<K,V> extends RedissonObject implements RStream<K,V>
codec, commandExecutor
Constructor and Description |
---|
RedissonStream(Codec codec,
CommandAsyncExecutor connectionManager,
String name) |
RedissonStream(CommandAsyncExecutor connectionManager,
String name) |
Modifier and Type | Method and Description |
---|---|
StreamId |
add(K key,
V value)
Appends a new entry and returns generated Stream ID
|
StreamId |
add(K key,
V value,
int trimLen,
boolean trimStrict)
Appends a new entry and returns generated Stream ID.
|
void |
add(StreamId id,
K key,
V value)
Appends a new entry by specified Stream ID
|
void |
add(StreamId id,
K key,
V value,
int trimLen,
boolean trimStrict)
Appends a new entry by specified Stream ID.
|
StreamId |
addAll(Map<K,V> entries)
Appends new entries and returns generated Stream ID
|
StreamId |
addAll(Map<K,V> entries,
int trimLen,
boolean trimStrict)
Appends new entries and returns generated Stream ID.
|
void |
addAll(StreamId id,
Map<K,V> entries)
Appends new entries by specified Stream ID
|
void |
addAll(StreamId id,
Map<K,V> entries,
int trimLen,
boolean trimStrict)
Appends new entries by specified Stream ID.
|
RFuture<StreamId> |
addAllAsync(Map<K,V> entries)
Appends new entries and returns generated Stream ID
|
RFuture<StreamId> |
addAllAsync(Map<K,V> entries,
int trimLen,
boolean trimStrict)
Appends new entries and returns generated Stream ID.
|
RFuture<Void> |
addAllAsync(StreamId id,
Map<K,V> entries)
Appends new entries by specified Stream ID
|
RFuture<Void> |
addAllAsync(StreamId id,
Map<K,V> entries,
int trimLen,
boolean trimStrict)
Appends new entries by specified Stream ID.
|
RFuture<StreamId> |
addAsync(K key,
V value)
Appends a new entry and returns generated Stream ID
|
RFuture<StreamId> |
addAsync(K key,
V value,
int trimLen,
boolean trimStrict)
Appends a new entry and returns generated Stream ID.
|
RFuture<Void> |
addAsync(StreamId id,
K key,
V value)
Appends a new entry by specified Stream ID
|
RFuture<Void> |
addAsync(StreamId id,
K key,
V value,
int trimLen,
boolean trimStrict)
Appends a new entry by specified Stream ID.
|
protected void |
checkKey(Object key) |
protected void |
checkValue(Object value) |
boolean |
clearExpire()
Clear an expire timeout or expire date for object.
|
RFuture<Boolean> |
clearExpireAsync()
Clear an expire timeout or expire date for object in async mode.
|
boolean |
expire(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object.
|
RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit)
Set a timeout for object in async mode.
|
boolean |
expireAt(Date timestamp)
Set an expire date for object.
|
boolean |
expireAt(long timestamp)
Set an expire date for object.
|
RFuture<Boolean> |
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.
|
RFuture<Boolean> |
expireAtAsync(long timestamp)
Set an expire date for object in async mode.
|
Map<StreamId,Map<K,V>> |
range(int count,
StreamId startId,
StreamId endId)
Read stream data in range by specified start Stream ID (included) and end Stream ID (included).
|
Map<StreamId,Map<K,V>> |
range(StreamId startId,
StreamId endId)
Read stream data in range by specified start Stream ID (included) and end Stream ID (included).
|
RFuture<Map<StreamId,Map<K,V>>> |
rangeAsync(int count,
StreamId startId,
StreamId endId)
Read stream data in range by specified start Stream ID (included) and end Stream ID (included).
|
RFuture<Map<StreamId,Map<K,V>>> |
rangeAsync(StreamId startId,
StreamId endId)
Read stream data in range by specified start Stream ID (included) and end Stream ID (included).
|
Map<StreamId,Map<K,V>> |
rangeReversed(int count,
StreamId startId,
StreamId endId)
Read stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).
|
Map<StreamId,Map<K,V>> |
rangeReversed(StreamId startId,
StreamId endId)
Read stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).
|
RFuture<Map<StreamId,Map<K,V>>> |
rangeReversedAsync(int count,
StreamId startId,
StreamId endId)
Read stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).
|
RFuture<Map<StreamId,Map<K,V>>> |
rangeReversedAsync(StreamId startId,
StreamId endId)
Read stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).
|
Map<String,Map<StreamId,Map<K,V>>> |
read(Collection<String> keys,
StreamId... ids)
Read stream data by specified collection of keys including this stream and Stream ID per key.
|
Map<String,Map<StreamId,Map<K,V>>> |
read(int count,
Collection<String> keys,
StreamId... ids)
Read stream data by specified collection of keys including this stream and Stream ID per key.
|
Map<String,Map<StreamId,Map<K,V>>> |
read(int count,
long timeout,
TimeUnit unit,
Collection<String> keys,
StreamId... ids)
Read stream data by specified collection of keys including this stream and Stream ID per key.
|
Map<StreamId,Map<K,V>> |
read(int count,
long timeout,
TimeUnit unit,
StreamId... ids)
Read stream data by specified collection of Stream IDs.
|
Map<StreamId,Map<K,V>> |
read(int count,
StreamId... ids)
Read stream data by specified collection of Stream IDs.
|
Map<String,Map<StreamId,Map<K,V>>> |
read(long timeout,
TimeUnit unit,
Collection<String> keys,
StreamId... ids)
Read stream data by specified collection of keys including this stream and Stream ID per key.
|
Map<StreamId,Map<K,V>> |
read(long timeout,
TimeUnit unit,
StreamId... ids)
Read stream data by specified collection of Stream IDs.
|
Map<StreamId,Map<K,V>> |
read(StreamId... ids)
Read stream data by specified collection of Stream IDs.
|
RFuture<Map<String,Map<StreamId,Map<K,V>>>> |
readAsync(Collection<String> keys,
StreamId... ids)
Read stream data by specified collection of keys including this stream and Stream ID per key.
|
RFuture<Map<String,Map<StreamId,Map<K,V>>>> |
readAsync(int count,
Collection<String> keys,
StreamId... ids)
Read stream data by specified collection of keys including this stream and Stream ID per key.
|
RFuture<Map<String,Map<StreamId,Map<K,V>>>> |
readAsync(int count,
long timeout,
TimeUnit unit,
Collection<String> keys,
StreamId... ids)
Read stream data by specified collection of keys including this stream and Stream ID per key.
|
RFuture<Map<StreamId,Map<K,V>>> |
readAsync(int count,
long timeout,
TimeUnit unit,
StreamId... ids)
Read stream data by specified collection of Stream IDs.
|
RFuture<Map<StreamId,Map<K,V>>> |
readAsync(int count,
StreamId... ids)
Read stream data by specified collection of Stream IDs.
|
RFuture<Map<String,Map<StreamId,Map<K,V>>>> |
readAsync(long timeout,
TimeUnit unit,
Collection<String> keys,
StreamId... ids)
Read stream data by specified collection of keys including this stream and Stream ID per key.
|
RFuture<Map<StreamId,Map<K,V>>> |
readAsync(long timeout,
TimeUnit unit,
StreamId... ids)
Read stream data by specified collection of Stream IDs.
|
RFuture<Map<StreamId,Map<K,V>>> |
readAsync(StreamId... ids)
Read stream data by specified collection of Stream IDs.
|
long |
remainTimeToLive()
Remaining time to live of Redisson object that has a timeout
|
RFuture<Long> |
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeout
|
long |
size()
Returns number of entries in stream
|
RFuture<Long> |
sizeAsync()
Returns number of entries in stream
|
await, copy, copyAsync, delete, deleteAsync, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getName, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, rename, renameAsync, renamenx, renamenxAsync, suffixName, toSeconds, touch, touchAsync, unlink, unlinkAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearExpire, expire, expireAt, expireAt, remainTimeToLive
copy, delete, getCodec, getName, isExists, migrate, move, rename, renamenx, touch, unlink
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
copyAsync, deleteAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, touchAsync, unlinkAsync
public RedissonStream(Codec codec, CommandAsyncExecutor connectionManager, String name)
public RedissonStream(CommandAsyncExecutor connectionManager, String name)
protected void checkKey(Object key)
protected void checkValue(Object value)
public StreamId addAll(Map<K,V> entries)
RStream
public RFuture<StreamId> addAllAsync(Map<K,V> entries)
RStreamAsync
addAllAsync
in interface RStreamAsync<K,V>
entries
- - entries to addpublic void addAll(StreamId id, Map<K,V> entries)
RStream
public RFuture<Void> addAllAsync(StreamId id, Map<K,V> entries)
RStreamAsync
addAllAsync
in interface RStreamAsync<K,V>
id
- - Stream IDentries
- - entries to addpublic StreamId addAll(Map<K,V> entries, int trimLen, boolean trimStrict)
RStream
trimLen
size.
If trimStrict
is false
then trims to few tens of entries more than specified length to trim.public RFuture<StreamId> addAllAsync(Map<K,V> entries, int trimLen, boolean trimStrict)
RStreamAsync
trimLen
size.
If trimStrict
is false
then trims to few tens of entries more than specified length to trim.addAllAsync
in interface RStreamAsync<K,V>
entries
- - entries to addtrimLen
- - length to trimtrimStrict
- - if false
then trims to few tens of entries more than specified length to trimpublic void addAll(StreamId id, Map<K,V> entries, int trimLen, boolean trimStrict)
RStream
trimLen
size.
If trimStrict
is false
then trims to few tens of entries more than specified length to trim.public RFuture<Void> addAllAsync(StreamId id, Map<K,V> entries, int trimLen, boolean trimStrict)
RStreamAsync
trimLen
size.
If trimStrict
is false
then trims to few tens of entries more than specified length to trim.addAllAsync
in interface RStreamAsync<K,V>
id
- - Stream IDentries
- - entries to addtrimLen
- - length to trimtrimStrict
- - if false
then trims to few tens of entries more than specified length to trimpublic long size()
RStream
public RFuture<Long> sizeAsync()
RStreamAsync
sizeAsync
in interface RStreamAsync<K,V>
public Map<StreamId,Map<K,V>> read(int count, StreamId... ids)
RStream
public RFuture<Map<String,Map<StreamId,Map<K,V>>>> readAsync(int count, Collection<String> keys, StreamId... ids)
RStreamAsync
readAsync
in interface RStreamAsync<K,V>
count
- - stream data size limitkeys
- - collection of keysids
- - collection of Stream IDspublic Map<StreamId,Map<K,V>> read(int count, long timeout, TimeUnit unit, StreamId... ids)
RStream
timeout
interval.public RFuture<Map<String,Map<StreamId,Map<K,V>>>> readAsync(int count, long timeout, TimeUnit unit, Collection<String> keys, StreamId... ids)
RStreamAsync
timeout
interval.readAsync
in interface RStreamAsync<K,V>
count
- - stream data size limittimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitkeys
- - collection of keysids
- - collection of Stream IDspublic RFuture<StreamId> addAsync(K key, V value)
RStreamAsync
addAsync
in interface RStreamAsync<K,V>
key
- - key of entryvalue
- - value of entrypublic RFuture<Void> addAsync(StreamId id, K key, V value)
RStreamAsync
addAsync
in interface RStreamAsync<K,V>
id
- - Stream IDkey
- - key of entryvalue
- - value of entrypublic RFuture<StreamId> addAsync(K key, V value, int trimLen, boolean trimStrict)
RStreamAsync
trimLen
size.
If trimStrict
is false
then trims to few tens of entries more than specified length to trim.addAsync
in interface RStreamAsync<K,V>
key
- - key of entryvalue
- - value of entrytrimLen
- - length to trimtrimStrict
- - if false
then trims to few tens of entries more than specified length to trimpublic RFuture<Void> addAsync(StreamId id, K key, V value, int trimLen, boolean trimStrict)
RStreamAsync
trimLen
size.
If trimStrict
is false
then trims to few tens of entries more than specified length to trim.addAsync
in interface RStreamAsync<K,V>
id
- - Stream IDkey
- - key of entryvalue
- - value of entrytrimLen
- - length to trimtrimStrict
- - if false
then trims to few tens of entries more than specified length to trimpublic StreamId add(K key, V value)
RStream
public void add(StreamId id, K key, V value)
RStream
public StreamId add(K key, V value, int trimLen, boolean trimStrict)
RStream
trimLen
size.
If trimStrict
is false
then trims to few tens of entries more than specified length to trim.public void add(StreamId id, K key, V value, int trimLen, boolean trimStrict)
RStream
trimLen
size.
If trimStrict
is false
then trims to few tens of entries more than specified length to trim.public RFuture<Map<StreamId,Map<K,V>>> readAsync(int count, StreamId... ids)
RStreamAsync
readAsync
in interface RStreamAsync<K,V>
count
- - stream data size limitids
- - collection of Stream IDspublic RFuture<Map<StreamId,Map<K,V>>> readAsync(int count, long timeout, TimeUnit unit, StreamId... ids)
RStreamAsync
timeout
interval.readAsync
in interface RStreamAsync<K,V>
count
- - stream data size limittimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitids
- - collection of Stream IDspublic Map<String,Map<StreamId,Map<K,V>>> read(int count, Collection<String> keys, StreamId... ids)
RStream
public Map<String,Map<StreamId,Map<K,V>>> read(int count, long timeout, TimeUnit unit, Collection<String> keys, StreamId... ids)
RStream
timeout
interval.public RFuture<Map<StreamId,Map<K,V>>> rangeAsync(int count, StreamId startId, StreamId endId)
RStreamAsync
rangeAsync
in interface RStreamAsync<K,V>
count
- - stream data size limitstartId
- - start Stream IDendId
- - end Stream IDpublic Map<StreamId,Map<K,V>> range(int count, StreamId startId, StreamId endId)
RStream
public RFuture<Map<StreamId,Map<K,V>>> rangeReversedAsync(int count, StreamId startId, StreamId endId)
RStreamAsync
rangeReversedAsync
in interface RStreamAsync<K,V>
count
- - stream data size limitstartId
- - start Stream IDendId
- - end Stream IDpublic Map<StreamId,Map<K,V>> rangeReversed(int count, StreamId startId, StreamId endId)
RStream
rangeReversed
in interface RStream<K,V>
count
- - stream data size limitstartId
- - start Stream IDendId
- - end Stream IDpublic RFuture<Map<StreamId,Map<K,V>>> readAsync(StreamId... ids)
RStreamAsync
readAsync
in interface RStreamAsync<K,V>
ids
- - collection of Stream IDspublic RFuture<Map<StreamId,Map<K,V>>> readAsync(long timeout, TimeUnit unit, StreamId... ids)
RStreamAsync
timeout
interval.readAsync
in interface RStreamAsync<K,V>
timeout
- - time interval to wait for stream data availabilityunit
- - time interval unitids
- - collection of Stream IDspublic RFuture<Map<String,Map<StreamId,Map<K,V>>>> readAsync(Collection<String> keys, StreamId... ids)
RStreamAsync
readAsync
in interface RStreamAsync<K,V>
keys
- - collection of keysids
- - collection of Stream IDspublic RFuture<Map<String,Map<StreamId,Map<K,V>>>> readAsync(long timeout, TimeUnit unit, Collection<String> keys, StreamId... ids)
RStreamAsync
timeout
interval.readAsync
in interface RStreamAsync<K,V>
timeout
- - time interval to wait for stream data availabilityunit
- - time interval unitkeys
- - collection of keysids
- - collection of Stream IDspublic RFuture<Map<StreamId,Map<K,V>>> rangeAsync(StreamId startId, StreamId endId)
RStreamAsync
rangeAsync
in interface RStreamAsync<K,V>
startId
- - start Stream IDendId
- - end Stream IDpublic RFuture<Map<StreamId,Map<K,V>>> rangeReversedAsync(StreamId startId, StreamId endId)
RStreamAsync
rangeReversedAsync
in interface RStreamAsync<K,V>
startId
- - start Stream IDendId
- - end Stream IDpublic Map<StreamId,Map<K,V>> read(StreamId... ids)
RStream
public Map<StreamId,Map<K,V>> read(long timeout, TimeUnit unit, StreamId... ids)
RStream
timeout
interval.public Map<String,Map<StreamId,Map<K,V>>> read(Collection<String> keys, StreamId... ids)
RStream
public Map<String,Map<StreamId,Map<K,V>>> read(long timeout, TimeUnit unit, Collection<String> keys, StreamId... ids)
RStream
timeout
interval.public Map<StreamId,Map<K,V>> range(StreamId startId, StreamId endId)
RStream
public Map<StreamId,Map<K,V>> rangeReversed(StreamId startId, StreamId endId)
RStream
rangeReversed
in interface RStream<K,V>
startId
- - start Stream IDendId
- - end Stream IDpublic boolean expire(long timeToLive, TimeUnit timeUnit)
RExpirable
expire
in interface RExpirable
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsync
expireAsync
in interface RExpirableAsync
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic boolean expireAt(long timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire date in seconds (Unix timestamp)true
if the timeout was set and false
if notpublic boolean expireAt(Date timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic boolean clearExpire()
RExpirable
clearExpire
in interface RExpirable
true
if timeout was removed
false
if object does not exist or does not have an associated timeoutpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsync
clearExpireAsync
in interface RExpirableAsync
true
if the timeout was cleared and false
if notpublic long remainTimeToLive()
RExpirable
remainTimeToLive
in interface RExpirable
public RFuture<Long> remainTimeToLiveAsync()
RExpirableAsync
remainTimeToLiveAsync
in interface RExpirableAsync
Copyright © 2014–2018 The Redisson Project. All rights reserved.