From 06e976a284d21604177243f581867889211bf5fa Mon Sep 17 00:00:00 2001 From: Mateusz Gajewski Date: Mon, 14 Mar 2022 11:44:51 +0100 Subject: [PATCH] Update Jedis client to 4.1.1 --- plugin/trino-redis/pom.xml | 8 +------- .../io/trino/plugin/redis/RedisRecordCursor.java | 13 ++++++------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/plugin/trino-redis/pom.xml b/plugin/trino-redis/pom.xml index 8946f522076b..054e0779e242 100644 --- a/plugin/trino-redis/pom.xml +++ b/plugin/trino-redis/pom.xml @@ -102,13 +102,7 @@ redis.clients jedis - 2.6.2 - - - org.ow2.asm - asm-util - - + 4.1.1 diff --git a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisRecordCursor.java b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisRecordCursor.java index 96d7820e9b53..fcfc8f846160 100644 --- a/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisRecordCursor.java +++ b/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisRecordCursor.java @@ -23,8 +23,8 @@ import io.trino.spi.type.Type; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; -import redis.clients.jedis.ScanParams; -import redis.clients.jedis.ScanResult; +import redis.clients.jedis.params.ScanParams; +import redis.clients.jedis.resps.ScanResult; import java.nio.charset.StandardCharsets; import java.util.HashMap; @@ -32,7 +32,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import static com.google.common.base.Preconditions.checkArgument; @@ -40,7 +39,7 @@ import static io.trino.decoder.FieldValueProviders.bytesValueProvider; import static io.trino.decoder.FieldValueProviders.longValueProvider; import static java.lang.String.format; -import static redis.clients.jedis.ScanParams.SCAN_POINTER_START; +import static redis.clients.jedis.params.ScanParams.SCAN_POINTER_START; public class RedisRecordCursor implements RecordCursor @@ -116,7 +115,7 @@ public boolean hasUnscannedData() // no more keys are unscanned when // when redis scan command // returns 0 string cursor - return (!redisCursor.getStringCursor().equals("0")); + return (!redisCursor.getCursor().equals("0")); } @Override @@ -295,7 +294,7 @@ private boolean fetchKeys() case STRING: { String cursor = SCAN_POINTER_START; if (redisCursor != null) { - cursor = redisCursor.getStringCursor(); + cursor = redisCursor.getCursor(); } log.debug("Scanning new Redis keys from cursor %s . %d values read so far", cursor, totalValues); @@ -306,7 +305,7 @@ private boolean fetchKeys() } break; case ZSET: - Set keys = jedis.zrange(split.getKeyName(), split.getStart(), split.getEnd()); + List keys = jedis.zrange(split.getKeyName(), split.getStart(), split.getEnd()); keysIterator = keys.iterator(); break; default: