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, unlinkAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearExpire, expire, expireAt, expireAt, remainTimeToLivecopy, delete, getCodec, getName, isExists, migrate, move, rename, renamenx, touch, unlinkclearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsynccopyAsync, deleteAsync, isExistsAsync, migrateAsync, moveAsync, renameAsync, renamenxAsync, touchAsync, unlinkAsyncpublic 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)
RStreampublic RFuture<StreamId> addAllAsync(Map<K,V> entries)
RStreamAsyncaddAllAsync in interface RStreamAsync<K,V>entries - - entries to addpublic void addAll(StreamId id, Map<K,V> entries)
RStreampublic RFuture<Void> addAllAsync(StreamId id, Map<K,V> entries)
RStreamAsyncaddAllAsync in interface RStreamAsync<K,V>id - - Stream IDentries - - entries to addpublic StreamId addAll(Map<K,V> entries, int trimLen, boolean trimStrict)
RStreamtrimLen 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)
RStreamAsynctrimLen 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)
RStreamtrimLen 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)
RStreamAsynctrimLen 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()
RStreampublic RFuture<Long> sizeAsync()
RStreamAsyncsizeAsync in interface RStreamAsync<K,V>public Map<StreamId,Map<K,V>> read(int count, StreamId... ids)
RStreampublic RFuture<Map<String,Map<StreamId,Map<K,V>>>> readAsync(int count, Collection<String> keys, StreamId... ids)
RStreamAsyncreadAsync 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)
RStreamtimeout interval.public RFuture<Map<String,Map<StreamId,Map<K,V>>>> readAsync(int count, long timeout, TimeUnit unit, Collection<String> keys, StreamId... ids)
RStreamAsynctimeout 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)
RStreamAsyncaddAsync in interface RStreamAsync<K,V>key - - key of entryvalue - - value of entrypublic RFuture<Void> addAsync(StreamId id, K key, V value)
RStreamAsyncaddAsync 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)
RStreamAsynctrimLen 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)
RStreamAsynctrimLen 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)
RStreampublic void add(StreamId id, K key, V value)
RStreampublic StreamId add(K key, V value, int trimLen, boolean trimStrict)
RStreamtrimLen 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)
RStreamtrimLen 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)
RStreamAsyncreadAsync 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)
RStreamAsynctimeout 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)
RStreampublic Map<String,Map<StreamId,Map<K,V>>> read(int count, long timeout, TimeUnit unit, Collection<String> keys, StreamId... ids)
RStreamtimeout interval.public RFuture<Map<StreamId,Map<K,V>>> rangeAsync(int count, StreamId startId, StreamId endId)
RStreamAsyncrangeAsync 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)
RStreampublic RFuture<Map<StreamId,Map<K,V>>> rangeReversedAsync(int count, StreamId startId, StreamId endId)
RStreamAsyncrangeReversedAsync 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)
RStreamrangeReversed 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)
RStreamAsyncreadAsync in interface RStreamAsync<K,V>ids - - collection of Stream IDspublic RFuture<Map<StreamId,Map<K,V>>> readAsync(long timeout, TimeUnit unit, StreamId... ids)
RStreamAsynctimeout 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)
RStreamAsyncreadAsync 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)
RStreamAsynctimeout 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)
RStreamAsyncrangeAsync in interface RStreamAsync<K,V>startId - - start Stream IDendId - - end Stream IDpublic RFuture<Map<StreamId,Map<K,V>>> rangeReversedAsync(StreamId startId, StreamId endId)
RStreamAsyncrangeReversedAsync in interface RStreamAsync<K,V>startId - - start Stream IDendId - - end Stream IDpublic Map<StreamId,Map<K,V>> read(StreamId... ids)
RStreampublic Map<StreamId,Map<K,V>> read(long timeout, TimeUnit unit, StreamId... ids)
RStreamtimeout interval.public Map<String,Map<StreamId,Map<K,V>>> read(Collection<String> keys, StreamId... ids)
RStreampublic Map<String,Map<StreamId,Map<K,V>>> read(long timeout, TimeUnit unit, Collection<String> keys, StreamId... ids)
RStreamtimeout interval.public Map<StreamId,Map<K,V>> range(StreamId startId, StreamId endId)
RStreampublic Map<StreamId,Map<K,V>> rangeReversed(StreamId startId, StreamId endId)
RStreamrangeReversed in interface RStream<K,V>startId - - start Stream IDendId - - end Stream IDpublic boolean expire(long timeToLive,
TimeUnit timeUnit)
RExpirableexpire in interface RExpirabletimeToLive - - 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)
RExpirableAsyncexpireAsync in interface RExpirableAsynctimeToLive - - timeout before object will be deletedtimeUnit - - timeout time unittrue if the timeout was set and false if notpublic boolean expireAt(long timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire date in milliseconds (Unix timestamp)true if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire date in seconds (Unix timestamp)true if the timeout was set and false if notpublic boolean expireAt(Date timestamp)
RExpirableexpireAt in interface RExpirabletimestamp - - expire datetrue if the timeout was set and false if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsyncexpireAtAsync in interface RExpirableAsynctimestamp - - expire datetrue if the timeout was set and false if notpublic boolean clearExpire()
RExpirableclearExpire in interface RExpirabletrue if timeout was removed
false if object does not exist or does not have an associated timeoutpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsyncclearExpireAsync in interface RExpirableAsynctrue if the timeout was cleared and false if notpublic long remainTimeToLive()
RExpirableremainTimeToLive in interface RExpirablepublic RFuture<Long> remainTimeToLiveAsync()
RExpirableAsyncremainTimeToLiveAsync in interface RExpirableAsyncCopyright © 2014–2018 The Redisson Project. All rights reserved.