DATAREDIS-749 - Upgrade to Jedis 3.0.0 M1.
Upgrade dependency version to 3.0.0 M1. Adapt to API changes. Original pull request: #374.
This commit is contained in:
@@ -24,8 +24,8 @@ import redis.clients.jedis.Protocol;
|
||||
import redis.clients.jedis.Protocol.Command;
|
||||
import redis.clients.jedis.Queable;
|
||||
import redis.clients.jedis.Response;
|
||||
import redis.clients.util.RedisOutputStream;
|
||||
import redis.clients.util.SafeEncoder;
|
||||
import redis.clients.jedis.util.RedisOutputStream;
|
||||
import redis.clients.jedis.util.SafeEncoder;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -19,7 +19,7 @@ import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import redis.clients.jedis.GeoCoordinate;
|
||||
import redis.clients.jedis.GeoUnit;
|
||||
import redis.clients.jedis.params.geo.GeoRadiusParam;
|
||||
import redis.clients.jedis.params.GeoRadiusParam;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -258,7 +258,7 @@ class JedisClusterGeoCommands implements RedisGeoCommands {
|
||||
Assert.notNull(args, "Args must not be null!");
|
||||
|
||||
GeoUnit geoUnit = JedisConverters.toGeoUnit(radius.getMetric());
|
||||
redis.clients.jedis.params.geo.GeoRadiusParam geoRadiusParam = JedisConverters.toGeoRadiusParam(args);
|
||||
redis.clients.jedis.params.GeoRadiusParam geoRadiusParam = JedisConverters.toGeoRadiusParam(args);
|
||||
|
||||
try {
|
||||
return JedisConverters.geoRadiusResponseToGeoResultsConverter(radius.getMetric())
|
||||
|
||||
@@ -282,7 +282,7 @@ class JedisClusterHashCommands implements RedisHashCommands {
|
||||
|
||||
redis.clients.jedis.ScanResult<Map.Entry<byte[], byte[]>> result = connection.getCluster().hscan(key,
|
||||
JedisConverters.toBytes(cursorId), params);
|
||||
return new ScanIteration<>(Long.valueOf(result.getStringCursor()), result.getResult());
|
||||
return new ScanIteration<>(Long.valueOf(result.getCursor()), result.getResult());
|
||||
}
|
||||
}.open();
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands {
|
||||
|
||||
ScanParams params = JedisConverters.toScanParams(options);
|
||||
redis.clients.jedis.ScanResult<String> result = client.scan(Long.toString(cursorId), params);
|
||||
return new ScanIteration<>(Long.valueOf(result.getStringCursor()),
|
||||
return new ScanIteration<>(Long.valueOf(result.getCursor()),
|
||||
JedisConverters.stringListToByteList().convert(result.getResult()));
|
||||
}
|
||||
}.open();
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.data.redis.connection.jedis;
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import redis.clients.jedis.BinaryJedis;
|
||||
import redis.clients.jedis.Jedis;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -447,7 +448,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands {
|
||||
public List<RedisClientInfo> getClientList() {
|
||||
|
||||
Collection<String> map = connection.getClusterCommandExecutor()
|
||||
.executeCommandOnAllNodes((JedisClusterCommandCallback<String>) BinaryJedis::clientList).resultsAsList();
|
||||
.executeCommandOnAllNodes((JedisClusterCommandCallback<String>) Jedis::clientList).resultsAsList();
|
||||
|
||||
ArrayList<RedisClientInfo> result = new ArrayList<>();
|
||||
for (String infos : map) {
|
||||
@@ -464,7 +465,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands {
|
||||
public List<RedisClientInfo> getClientList(RedisClusterNode node) {
|
||||
|
||||
return JedisConverters
|
||||
.toListOfRedisClientInformation(executeCommandOnSingleNode(BinaryJedis::clientList, node).getValue());
|
||||
.toListOfRedisClientInformation(executeCommandOnSingleNode(Jedis::clientList, node).getValue());
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -510,7 +511,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands {
|
||||
|
||||
RedisClusterNode node = connection.getTopologyProvider().getTopology().lookup(target.getHost(), target.getPort());
|
||||
|
||||
executeCommandOnSingleNode(client -> client.migrate(JedisConverters.toBytes(target.getHost()), target.getPort(),
|
||||
executeCommandOnSingleNode(client -> client.migrate(target.getHost(), target.getPort(),
|
||||
key, dbIndex, timeoutToUse), node);
|
||||
}
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ class JedisClusterSetCommands implements RedisSetCommands {
|
||||
ScanParams params = JedisConverters.toScanParams(options);
|
||||
redis.clients.jedis.ScanResult<byte[]> result = connection.getCluster().sscan(key,
|
||||
JedisConverters.toBytes(cursorId), params);
|
||||
return new ScanIteration<>(Long.valueOf(result.getStringCursor()), result.getResult());
|
||||
return new ScanIteration<>(Long.valueOf(result.getCursor()), result.getResult());
|
||||
}
|
||||
}.open();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import redis.clients.jedis.BinaryJedis;
|
||||
import redis.clients.jedis.Connection;
|
||||
import redis.clients.jedis.params.SetParams;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -157,12 +158,12 @@ class JedisClusterStringCommands implements RedisStringCommands {
|
||||
}
|
||||
} else {
|
||||
|
||||
byte[] nxxx = JedisConverters.toSetCommandNxXxArgument(option);
|
||||
byte[] expx = JedisConverters.toSetCommandExPxArgument(expiration);
|
||||
SetParams params = JedisConverters.toSetCommandNxXxArgument(option, null);
|
||||
JedisConverters.toSetCommandExPxArgument(expiration, params);
|
||||
|
||||
try {
|
||||
return Converters
|
||||
.stringToBoolean(connection.getCluster().set(key, value, nxxx, expx, expiration.getExpirationTime()));
|
||||
.stringToBoolean(connection.getCluster().set(key, value, params));
|
||||
} catch (Exception ex) {
|
||||
throw convertJedisAccessException(ex);
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands {
|
||||
|
||||
if (ClusterSlotHashUtil.isSameSlotForAllKeys(allKeys)) {
|
||||
|
||||
ZParams zparams = new ZParams().weightsByDouble(weights.toArray())
|
||||
ZParams zparams = new ZParams().weights(weights.toArray())
|
||||
.aggregate(ZParams.Aggregate.valueOf(aggregate.name()));
|
||||
|
||||
try {
|
||||
@@ -698,7 +698,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands {
|
||||
|
||||
if (ClusterSlotHashUtil.isSameSlotForAllKeys(allKeys)) {
|
||||
|
||||
ZParams zparams = new ZParams().weightsByDouble(weights.toArray())
|
||||
ZParams zparams = new ZParams().weights(weights.toArray())
|
||||
.aggregate(ZParams.Aggregate.valueOf(aggregate.name()));
|
||||
|
||||
try {
|
||||
@@ -729,7 +729,7 @@ class JedisClusterZSetCommands implements RedisZSetCommands {
|
||||
|
||||
redis.clients.jedis.ScanResult<redis.clients.jedis.Tuple> result = connection.getCluster().zscan(key,
|
||||
JedisConverters.toBytes(cursorId), params);
|
||||
return new ScanIteration<>(Long.valueOf(result.getStringCursor()),
|
||||
return new ScanIteration<>(Long.valueOf(result.getCursor()),
|
||||
JedisConverters.tuplesToTuples().convert(result.getResult()));
|
||||
}
|
||||
}.open();
|
||||
|
||||
@@ -23,7 +23,7 @@ import redis.clients.jedis.Pipeline;
|
||||
import redis.clients.jedis.Response;
|
||||
import redis.clients.jedis.Transaction;
|
||||
import redis.clients.jedis.exceptions.JedisDataException;
|
||||
import redis.clients.util.Pool;
|
||||
import redis.clients.jedis.util.Pool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -74,7 +74,6 @@ public class JedisConnection extends AbstractRedisConnection {
|
||||
/**
|
||||
* flag indicating whether the connection needs to be dropped or not
|
||||
*/
|
||||
private boolean broken = false;
|
||||
private volatile @Nullable JedisSubscription subscription;
|
||||
private volatile @Nullable Pipeline pipeline;
|
||||
private final int dbIndex;
|
||||
@@ -133,17 +132,7 @@ public class JedisConnection extends AbstractRedisConnection {
|
||||
}
|
||||
|
||||
protected DataAccessException convertJedisAccessException(Exception ex) {
|
||||
|
||||
if (ex instanceof NullPointerException) {
|
||||
// An NPE before flush will leave data in the OutputStream of a pooled connection
|
||||
broken = true;
|
||||
}
|
||||
|
||||
DataAccessException exception = EXCEPTION_TRANSLATION.translate(ex);
|
||||
if (exception instanceof RedisConnectionFailureException) {
|
||||
broken = true;
|
||||
}
|
||||
|
||||
return exception != null ? exception : new RedisSystemException(ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
@@ -293,12 +282,7 @@ public class JedisConnection extends AbstractRedisConnection {
|
||||
|
||||
// return the connection to the pool
|
||||
if (pool != null) {
|
||||
|
||||
if (broken) {
|
||||
pool.returnBrokenResource(jedis);
|
||||
} else {
|
||||
jedis.close();
|
||||
}
|
||||
jedis.close();
|
||||
return;
|
||||
}
|
||||
// else close the connection normally (doing the try/catch dance)
|
||||
|
||||
@@ -24,7 +24,7 @@ import redis.clients.jedis.JedisPoolConfig;
|
||||
import redis.clients.jedis.JedisSentinelPool;
|
||||
import redis.clients.jedis.JedisShardInfo;
|
||||
import redis.clients.jedis.Protocol;
|
||||
import redis.clients.util.Pool;
|
||||
import redis.clients.jedis.util.Pool;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -15,15 +15,16 @@
|
||||
*/
|
||||
package org.springframework.data.redis.connection.jedis;
|
||||
|
||||
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
||||
import redis.clients.jedis.BitOP;
|
||||
import redis.clients.jedis.GeoCoordinate;
|
||||
import redis.clients.jedis.GeoRadiusResponse;
|
||||
import redis.clients.jedis.GeoUnit;
|
||||
import redis.clients.jedis.ListPosition;
|
||||
import redis.clients.jedis.ScanParams;
|
||||
import redis.clients.jedis.SortingParams;
|
||||
import redis.clients.jedis.params.geo.GeoRadiusParam;
|
||||
import redis.clients.util.SafeEncoder;
|
||||
import redis.clients.jedis.params.GeoRadiusParam;
|
||||
import redis.clients.jedis.params.SetParams;
|
||||
import redis.clients.jedis.util.SafeEncoder;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
@@ -402,9 +403,9 @@ abstract public class JedisConverters extends Converters {
|
||||
return EXCEPTION_CONVERTER.convert(ex);
|
||||
}
|
||||
|
||||
public static LIST_POSITION toListPosition(Position source) {
|
||||
public static ListPosition toListPosition(Position source) {
|
||||
Assert.notNull(source, "list positions are mandatory");
|
||||
return (Position.AFTER.equals(source) ? LIST_POSITION.AFTER : LIST_POSITION.BEFORE);
|
||||
return (Position.AFTER.equals(source) ? ListPosition.AFTER : ListPosition.BEFORE);
|
||||
}
|
||||
|
||||
public static byte[][] toByteArrays(Map<byte[], byte[]> source) {
|
||||
@@ -509,9 +510,13 @@ abstract public class JedisConverters extends Converters {
|
||||
* @return
|
||||
* @since 1.7
|
||||
*/
|
||||
public static byte[] toSetCommandExPxArgument(Expiration expiration) {
|
||||
return EXPIRATION_TO_COMMAND_OPTION_CONVERTER.convert(expiration);
|
||||
}
|
||||
public static SetParams toSetCommandExPxArgument(Expiration expiration, SetParams params) {
|
||||
params = params==null? SetParams.setParams() : params;
|
||||
if(expiration.getTimeUnit() == TimeUnit.MILLISECONDS) {
|
||||
return params.px(expiration.getExpirationTime());
|
||||
}
|
||||
return params.ex((int)expiration.getExpirationTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a given {@link SetOption} to the according {@code SET} command argument.<br />
|
||||
@@ -528,8 +533,16 @@ abstract public class JedisConverters extends Converters {
|
||||
* @return
|
||||
* @since 1.7
|
||||
*/
|
||||
public static byte[] toSetCommandNxXxArgument(SetOption option) {
|
||||
return SET_OPTION_TO_COMMAND_OPTION_CONVERTER.convert(option);
|
||||
public static SetParams toSetCommandNxXxArgument(SetOption option, SetParams params) {
|
||||
params = params==null? SetParams.setParams() : params;
|
||||
switch(option) {
|
||||
case SET_IF_PRESENT:
|
||||
return params.xx();
|
||||
case SET_IF_ABSENT:
|
||||
return params.nx();
|
||||
default:
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] boundaryToBytes(Boundary boundary, byte[] inclPrefix, byte[] exclPrefix) {
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.data.redis.ClusterRedirectException;
|
||||
import org.springframework.data.redis.RedisConnectionFailureException;
|
||||
import org.springframework.data.redis.TooManyClusterRedirectionsException;
|
||||
|
||||
import redis.clients.jedis.exceptions.JedisClusterMaxRedirectionsException;
|
||||
import redis.clients.jedis.exceptions.JedisClusterMaxAttemptsException;
|
||||
import redis.clients.jedis.exceptions.JedisConnectionException;
|
||||
import redis.clients.jedis.exceptions.JedisDataException;
|
||||
import redis.clients.jedis.exceptions.JedisException;
|
||||
@@ -57,7 +57,7 @@ public class JedisExceptionConverter implements Converter<Exception, DataAccessE
|
||||
ex);
|
||||
}
|
||||
|
||||
if (ex instanceof JedisClusterMaxRedirectionsException) {
|
||||
if (ex instanceof JedisClusterMaxAttemptsException) {
|
||||
return new TooManyClusterRedirectionsException(ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ class JedisGeoCommands implements RedisGeoCommands {
|
||||
Assert.notNull(within, "Within must not be null!");
|
||||
Assert.notNull(args, "Args must not be null!");
|
||||
|
||||
redis.clients.jedis.params.geo.GeoRadiusParam geoRadiusParam = JedisConverters.toGeoRadiusParam(args);
|
||||
redis.clients.jedis.params.GeoRadiusParam geoRadiusParam = JedisConverters.toGeoRadiusParam(args);
|
||||
Converter<List<redis.clients.jedis.GeoRadiusResponse>, GeoResults<GeoLocation<byte[]>>> converter = JedisConverters
|
||||
.geoRadiusResponseToGeoResultsConverter(within.getRadius().getMetric());
|
||||
|
||||
@@ -381,7 +381,7 @@ class JedisGeoCommands implements RedisGeoCommands {
|
||||
GeoUnit geoUnit = JedisConverters.toGeoUnit(radius.getMetric());
|
||||
Converter<List<redis.clients.jedis.GeoRadiusResponse>, GeoResults<GeoLocation<byte[]>>> converter = JedisConverters
|
||||
.geoRadiusResponseToGeoResultsConverter(radius.getMetric());
|
||||
redis.clients.jedis.params.geo.GeoRadiusParam geoRadiusParam = JedisConverters.toGeoRadiusParam(args);
|
||||
redis.clients.jedis.params.GeoRadiusParam geoRadiusParam = JedisConverters.toGeoRadiusParam(args);
|
||||
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
|
||||
@@ -403,7 +403,7 @@ class JedisHashCommands implements RedisHashCommands {
|
||||
|
||||
ScanResult<Entry<byte[], byte[]>> result = connection.getJedis().hscan(key, JedisConverters.toBytes(cursorId),
|
||||
params);
|
||||
return new ScanIteration<>(Long.valueOf(result.getStringCursor()), result.getResult());
|
||||
return new ScanIteration<>(Long.valueOf(result.getCursor()), result.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -228,7 +228,7 @@ class JedisKeyCommands implements RedisKeyCommands {
|
||||
|
||||
ScanParams params = JedisConverters.toScanParams(options);
|
||||
redis.clients.jedis.ScanResult<String> result = connection.getJedis().scan(Long.toString(cursorId), params);
|
||||
return new ScanIteration<>(Long.valueOf(result.getStringCursor()),
|
||||
return new ScanIteration<>(Long.valueOf(result.getCursor()),
|
||||
JedisConverters.stringListToByteList().convert(result.getResult()));
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.redis.connection.jedis;
|
||||
|
||||
import redis.clients.util.SafeEncoder;
|
||||
import redis.clients.jedis.util.SafeEncoder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -495,15 +495,15 @@ class JedisServerCommands implements RedisServerCommands {
|
||||
if (isPipelined()) {
|
||||
|
||||
pipeline(connection.newJedisResult(connection.getRequiredPipeline()
|
||||
.migrate(JedisConverters.toBytes(target.getHost()), target.getPort(), key, dbIndex, timeoutToUse)));
|
||||
.migrate(target.getHost(), target.getPort(), key, dbIndex, timeoutToUse)));
|
||||
return;
|
||||
}
|
||||
if (isQueueing()) {
|
||||
transaction(connection.newJedisResult(connection.getRequiredTransaction()
|
||||
.migrate(JedisConverters.toBytes(target.getHost()), target.getPort(), key, dbIndex, timeoutToUse)));
|
||||
.migrate(target.getHost(), target.getPort(), key, dbIndex, timeoutToUse)));
|
||||
return;
|
||||
}
|
||||
connection.getJedis().migrate(JedisConverters.toBytes(target.getHost()), target.getPort(), key, dbIndex,
|
||||
connection.getJedis().migrate(target.getHost(), target.getPort(), key, dbIndex,
|
||||
timeoutToUse);
|
||||
} catch (Exception ex) {
|
||||
throw convertJedisAccessException(ex);
|
||||
|
||||
@@ -479,7 +479,7 @@ class JedisSetCommands implements RedisSetCommands {
|
||||
|
||||
redis.clients.jedis.ScanResult<byte[]> result = connection.getJedis().sscan(key,
|
||||
JedisConverters.toBytes(cursorId), params);
|
||||
return new ScanIteration<>(Long.valueOf(result.getStringCursor()), result.getResult());
|
||||
return new ScanIteration<>(Long.valueOf(result.getCursor()), result.getResult());
|
||||
}
|
||||
|
||||
protected void doClose() {
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import redis.clients.jedis.BitPosParams;
|
||||
import redis.clients.jedis.Client;
|
||||
import redis.clients.jedis.params.SetParams;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -165,8 +166,7 @@ class JedisStringCommands implements RedisStringCommands {
|
||||
} else {
|
||||
|
||||
try {
|
||||
|
||||
byte[] nxxx = JedisConverters.toSetCommandNxXxArgument(option);
|
||||
SetParams nxxx = JedisConverters.toSetCommandNxXxArgument(option, null);
|
||||
|
||||
if (isPipelined()) {
|
||||
|
||||
@@ -198,8 +198,8 @@ class JedisStringCommands implements RedisStringCommands {
|
||||
}
|
||||
} else {
|
||||
|
||||
byte[] nxxx = JedisConverters.toSetCommandNxXxArgument(option);
|
||||
byte[] expx = JedisConverters.toSetCommandExPxArgument(expiration);
|
||||
SetParams params = JedisConverters.toSetCommandNxXxArgument(option, null);
|
||||
JedisConverters.toSetCommandExPxArgument(expiration, params);
|
||||
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -211,7 +211,7 @@ class JedisStringCommands implements RedisStringCommands {
|
||||
}
|
||||
|
||||
pipeline(connection.newJedisResult(
|
||||
connection.getRequiredPipeline().set(key, value, nxxx, expx, (int) expiration.getExpirationTime()),
|
||||
connection.getRequiredPipeline().set(key, value, params),
|
||||
Converters.stringToBooleanConverter(), () -> false));
|
||||
return null;
|
||||
}
|
||||
@@ -223,13 +223,12 @@ class JedisStringCommands implements RedisStringCommands {
|
||||
}
|
||||
|
||||
transaction(connection.newJedisResult(
|
||||
connection.getRequiredTransaction().set(key, value, nxxx, expx, (int) expiration.getExpirationTime()),
|
||||
connection.getRequiredTransaction().set(key, value, params),
|
||||
Converters.stringToBooleanConverter(), () -> false));
|
||||
return null;
|
||||
}
|
||||
|
||||
return Converters
|
||||
.stringToBoolean(connection.getJedis().set(key, value, nxxx, expx, expiration.getExpirationTime()));
|
||||
return Converters.stringToBoolean(connection.getJedis().set(key, value, params));
|
||||
|
||||
} catch (Exception ex) {
|
||||
throw convertJedisAccessException(ex);
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.data.redis.connection.jedis;
|
||||
|
||||
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
||||
import redis.clients.jedis.BinaryJedisPubSub;
|
||||
import redis.clients.jedis.ListPosition;
|
||||
import redis.clients.jedis.Protocol;
|
||||
import redis.clients.jedis.SortingParams;
|
||||
import redis.clients.jedis.exceptions.JedisConnectionException;
|
||||
import redis.clients.jedis.exceptions.JedisDataException;
|
||||
import redis.clients.jedis.exceptions.JedisException;
|
||||
import redis.clients.util.SafeEncoder;
|
||||
import redis.clients.jedis.util.SafeEncoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
@@ -215,9 +215,9 @@ public abstract class JedisUtils {
|
||||
return (value ? ONE : ZERO);
|
||||
}
|
||||
|
||||
static LIST_POSITION convertPosition(Position where) {
|
||||
static ListPosition convertPosition(Position where) {
|
||||
Assert.notNull(where, "list positions are mandatory");
|
||||
return (Position.AFTER.equals(where) ? LIST_POSITION.AFTER : LIST_POSITION.BEFORE);
|
||||
return (Position.AFTER.equals(where) ? ListPosition.AFTER : ListPosition.BEFORE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -594,7 +594,7 @@ class JedisZSetCommands implements RedisZSetCommands {
|
||||
.format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length));
|
||||
|
||||
try {
|
||||
ZParams zparams = new ZParams().weightsByDouble(weights.toArray())
|
||||
ZParams zparams = new ZParams().weights(weights.toArray())
|
||||
.aggregate(ZParams.Aggregate.valueOf(aggregate.name()));
|
||||
|
||||
if (isPipelined()) {
|
||||
@@ -651,7 +651,7 @@ class JedisZSetCommands implements RedisZSetCommands {
|
||||
.format("The number of weights (%d) must match the number of source sets (%d)!", weights.size(), sets.length));
|
||||
|
||||
try {
|
||||
ZParams zparams = new ZParams().weightsByDouble(weights.toArray())
|
||||
ZParams zparams = new ZParams().weights(weights.toArray())
|
||||
.aggregate(ZParams.Aggregate.valueOf(aggregate.name()));
|
||||
|
||||
if (isPipelined()) {
|
||||
@@ -727,7 +727,7 @@ class JedisZSetCommands implements RedisZSetCommands {
|
||||
|
||||
ScanResult<redis.clients.jedis.Tuple> result = connection.getJedis().zscan(key,
|
||||
JedisConverters.toBytes(cursorId), params);
|
||||
return new ScanIteration<>(Long.valueOf(result.getStringCursor()),
|
||||
return new ScanIteration<>(Long.valueOf(result.getCursor()),
|
||||
JedisConverters.tuplesToTuples().convert(result.getResult()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user