|
|
@ -130,6 +130,16 @@ public class RedissonStream<K, V> extends RedissonExpirable implements RStream<K
|
|
|
|
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.XPENDING_ENTRIES, getName(), groupName, startId, endId, count);
|
|
|
|
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.XPENDING_ENTRIES, getName(), groupName, startId, endId, count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public RFuture<List<PendingEntry>> listPendingAsync(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) {
|
|
|
|
|
|
|
|
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.XPENDING_ENTRIES, getName(), groupName, "IDLE", idleTimeUnit.toMillis(idleTime), startId, endId, count);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public RFuture<List<PendingEntry>> listPendingAsync(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) {
|
|
|
|
|
|
|
|
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.XPENDING_ENTRIES, getName(), groupName, "IDLE", idleTimeUnit.toMillis(idleTime), startId, endId, count, consumerName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<PendingEntry> listPending(String groupName, StreamMessageId startId, StreamMessageId endId, int count) {
|
|
|
|
public List<PendingEntry> listPending(String groupName, StreamMessageId startId, StreamMessageId endId, int count) {
|
|
|
|
return get(listPendingAsync(groupName, startId, endId, count));
|
|
|
|
return get(listPendingAsync(groupName, startId, endId, count));
|
|
|
@ -140,6 +150,16 @@ public class RedissonStream<K, V> extends RedissonExpirable implements RStream<K
|
|
|
|
return get(listPendingAsync(groupName, consumerName, startId, endId, count));
|
|
|
|
return get(listPendingAsync(groupName, consumerName, startId, endId, count));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<PendingEntry> listPending(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) {
|
|
|
|
|
|
|
|
return get(listPendingAsync(groupName, startId, endId, idleTime, idleTimeUnit, count));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<PendingEntry> listPending(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) {
|
|
|
|
|
|
|
|
return get(listPendingAsync(groupName, consumerName, startId, endId, idleTime, idleTimeUnit, count));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<StreamMessageId> fastClaim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit,
|
|
|
|
public List<StreamMessageId> fastClaim(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit,
|
|
|
|
StreamMessageId... ids) {
|
|
|
|
StreamMessageId... ids) {
|
|
|
@ -1004,10 +1024,50 @@ public class RedissonStream<K, V> extends RedissonExpirable implements RStream<K
|
|
|
|
"table.insert(result, value[1]);" +
|
|
|
|
"table.insert(result, value[1]);" +
|
|
|
|
"end; " +
|
|
|
|
"end; " +
|
|
|
|
"return result;",
|
|
|
|
"return result;",
|
|
|
|
Collections.<Object>singletonList(getName()),
|
|
|
|
Collections.singletonList(getName()),
|
|
|
|
groupName, startId, endId, count, consumerName);
|
|
|
|
groupName, startId, endId, count, consumerName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public RFuture<Map<StreamMessageId, Map<K, V>>> pendingRangeAsync(String groupName, StreamMessageId startId,
|
|
|
|
|
|
|
|
StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) {
|
|
|
|
|
|
|
|
return commandExecutor.evalReadAsync(getName(), codec, EVAL_XRANGE,
|
|
|
|
|
|
|
|
"local pendingData = redis.call('xpending', KEYS[1], ARGV[1], 'IDLE', ARGV[2], ARGV[3], ARGV[4], ARGV[5]);" +
|
|
|
|
|
|
|
|
"local result = {}; " +
|
|
|
|
|
|
|
|
"for i = 1, #pendingData, 1 do " +
|
|
|
|
|
|
|
|
"local value = redis.call('xrange', KEYS[1], pendingData[i][1], pendingData[i][1]);" +
|
|
|
|
|
|
|
|
"table.insert(result, value[1]);" +
|
|
|
|
|
|
|
|
"end; " +
|
|
|
|
|
|
|
|
"return result;",
|
|
|
|
|
|
|
|
Collections.singletonList(getName()),
|
|
|
|
|
|
|
|
groupName, idleTimeUnit.toMillis(idleTime), startId, endId, count);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public RFuture<Map<StreamMessageId, Map<K, V>>> pendingRangeAsync(String groupName, String consumerName,
|
|
|
|
|
|
|
|
StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) {
|
|
|
|
|
|
|
|
return commandExecutor.evalReadAsync(getName(), codec, EVAL_XRANGE,
|
|
|
|
|
|
|
|
"local pendingData = redis.call('xpending', KEYS[1], ARGV[1], 'IDLE', ARGV[2], ARGV[3], ARGV[4], ARGV[5], ARGV[6]);" +
|
|
|
|
|
|
|
|
"local result = {}; " +
|
|
|
|
|
|
|
|
"for i = 1, #pendingData, 1 do " +
|
|
|
|
|
|
|
|
"local value = redis.call('xrange', KEYS[1], pendingData[i][1], pendingData[i][1]);" +
|
|
|
|
|
|
|
|
"table.insert(result, value[1]);" +
|
|
|
|
|
|
|
|
"end; " +
|
|
|
|
|
|
|
|
"return result;",
|
|
|
|
|
|
|
|
Collections.singletonList(getName()),
|
|
|
|
|
|
|
|
groupName, idleTimeUnit.toMillis(idleTime), startId, endId, count, consumerName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public Map<StreamMessageId, Map<K, V>> pendingRange(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) {
|
|
|
|
|
|
|
|
return get(pendingRangeAsync(groupName, startId, endId, idleTime, idleTimeUnit, count));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public Map<StreamMessageId, Map<K, V>> pendingRange(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) {
|
|
|
|
|
|
|
|
return get(pendingRangeAsync(groupName, consumerName, startId, endId, idleTime, idleTimeUnit, count));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<StreamMessageId, Map<K, V>> pendingRange(String groupName, String consumerName, StreamMessageId startId,
|
|
|
|
public Map<StreamMessageId, Map<K, V>> pendingRange(String groupName, String consumerName, StreamMessageId startId,
|
|
|
|
StreamMessageId endId, int count) {
|
|
|
|
StreamMessageId endId, int count) {
|
|
|
|