Skip to content

Commit

Permalink
Update Jedis client to 4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo authored and hashhar committed Mar 14, 2022
1 parent 21d4224 commit 211c594
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
8 changes: 1 addition & 7 deletions plugin/trino-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,7 @@
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.6.2</version>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId>
</exclusion>
</exclusions>
<version>4.1.1</version>
</dependency>

<!-- used by tests but also needed transitively -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,23 @@
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;
import java.util.Iterator;
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;
import static io.trino.decoder.FieldValueProviders.booleanValueProvider;
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -306,7 +305,7 @@ private boolean fetchKeys()
}
break;
case ZSET:
Set<String> keys = jedis.zrange(split.getKeyName(), split.getStart(), split.getEnd());
List<String> keys = jedis.zrange(split.getKeyName(), split.getStart(), split.getEnd());
keysIterator = keys.iterator();
break;
default:
Expand Down

0 comments on commit 211c594

Please sign in to comment.