use of org.redisson.client.protocol.decoder.ListScanResultReplayDecoder in project redisson by redisson.
the class RedissonLiveObjectService method findIds.
@Override
public <K> Iterable<K> findIds(Class<?> entityClass, int count) {
NamingScheme namingScheme = commandExecutor.getObjectBuilder().getNamingScheme(entityClass);
String pattern = namingScheme.getNamePattern(entityClass);
RedissonKeys keys = new RedissonKeys(commandExecutor);
RedisCommand<ListScanResult<String>> command = new RedisCommand<>("SCAN", new ListMultiDecoder2(new ListScanResultReplayDecoder(), new ObjectListReplayDecoder<Object>()), new Convertor<Object>() {
@Override
public Object convert(Object obj) {
if (!(obj instanceof String)) {
return obj;
}
return namingScheme.resolveId(obj.toString());
}
});
return keys.getKeysByPattern(command, pattern, 0, count);
}
Aggregations