Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Jedis client to 4.1.1 #11462

Merged
merged 1 commit into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
hashhar marked this conversation as resolved.
Show resolved Hide resolved
keysIterator = keys.iterator();
break;
default:
Expand Down