DATAREDIS-624 - Upgrade to Lettuce 5.0.0.BUILD-SNAPSHOT.

Upgrade to Lettuce using Reactor 3.1.0.BUILD-SNAPSHOT, requires change to io.lettuce:lettuce-core, so we also needed to change imports from com.lambdaworks.redis to io.lettuce.core.

Original pull request: #245.
This commit is contained in:
Christoph Strobl
2017-04-12 10:59:02 +02:00
committed by Mark Paluch
parent 2c14460643
commit 87d6aa2042
38 changed files with 371 additions and 304 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2016 the original author or authors.
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,12 +15,11 @@
*/
package org.springframework.data.redis.connection.lettuce;
import com.lambdaworks.redis.RedisClient;
import com.lambdaworks.redis.RedisURI;
import com.lambdaworks.redis.api.StatefulRedisConnection;
import com.lambdaworks.redis.api.async.RedisAsyncCommands;
import com.lambdaworks.redis.codec.RedisCodec;
import com.lambdaworks.redis.pubsub.StatefulRedisPubSubConnection;
import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisURI;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.codec.RedisCodec;
import io.lettuce.core.pubsub.StatefulRedisPubSubConnection;
/**
* Extension of {@link RedisClient} that calls auth on all new connections using the supplied credentials
@@ -43,7 +42,7 @@ public class AuthenticatingRedisClient extends RedisClient {
/*
* (non-Javadoc)
* @see com.lambdaworks.redis.RedisClient#connect(com.lambdaworks.redis.codec.RedisCodec)
* @see io.lettuce.core.RedisClient#connect(io.lettuce.core.codec.RedisCodec)
*/
@Override
public <K, V> StatefulRedisConnection<K, V> connect(RedisCodec<K, V> codec) {
@@ -52,7 +51,7 @@ public class AuthenticatingRedisClient extends RedisClient {
/*
* (non-Javadoc)
* @see com.lambdaworks.redis.RedisClient#connectPubSub(com.lambdaworks.redis.codec.RedisCodec)
* @see io.lettuce.core.RedisClient#connectPubSub(io.lettuce.core.codec.RedisCodec)
*/
@Override
public <K, V> StatefulRedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2016 the original author or authors.
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,12 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisURI;
import io.lettuce.core.api.StatefulConnection;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.resource.ClientResources;
import java.util.concurrent.TimeUnit;
import org.apache.commons.pool2.BasePooledObjectFactory;
@@ -28,12 +34,6 @@ import org.springframework.data.redis.connection.RedisSentinelConfiguration;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import com.lambdaworks.redis.RedisClient;
import com.lambdaworks.redis.RedisURI;
import com.lambdaworks.redis.api.StatefulConnection;
import com.lambdaworks.redis.api.StatefulRedisConnection;
import com.lambdaworks.redis.resource.ClientResources;
/**
* Default implementation of {@link LettucePool}.
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,17 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.KeyValue;
import io.lettuce.core.RedisException;
import io.lettuce.core.api.StatefulConnection;
import io.lettuce.core.cluster.RedisClusterClient;
import io.lettuce.core.cluster.SlotHash;
import io.lettuce.core.cluster.api.StatefulRedisClusterConnection;
import io.lettuce.core.cluster.api.sync.RedisClusterCommands;
import io.lettuce.core.cluster.models.partitions.Partitions;
import io.lettuce.core.codec.ByteArrayCodec;
import io.lettuce.core.codec.RedisCodec;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -56,17 +67,6 @@ import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import com.lambdaworks.redis.KeyValue;
import com.lambdaworks.redis.RedisException;
import com.lambdaworks.redis.api.StatefulConnection;
import com.lambdaworks.redis.cluster.RedisClusterClient;
import com.lambdaworks.redis.cluster.SlotHash;
import com.lambdaworks.redis.cluster.api.StatefulRedisClusterConnection;
import com.lambdaworks.redis.cluster.api.sync.RedisClusterCommands;
import com.lambdaworks.redis.cluster.models.partitions.Partitions;
import com.lambdaworks.redis.codec.ByteArrayCodec;
import com.lambdaworks.redis.codec.RedisCodec;
/**
* @author Christoph Strobl
* @author Mark Paluch

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011-2016 the original author or authors.
* Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,11 +15,70 @@
*/
package org.springframework.data.redis.connection.lettuce;
import static com.lambdaworks.redis.protocol.CommandType.*;
import static io.lettuce.core.protocol.CommandType.*;
import io.lettuce.core.AbstractRedisClient;
import io.lettuce.core.GeoArgs;
import io.lettuce.core.GeoCoordinates;
import io.lettuce.core.GeoWithin;
import io.lettuce.core.KeyScanCursor;
import io.lettuce.core.LettuceFutures;
import io.lettuce.core.MapScanCursor;
import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisException;
import io.lettuce.core.RedisFuture;
import io.lettuce.core.RedisURI;
import io.lettuce.core.ScanArgs;
import io.lettuce.core.ScoredValue;
import io.lettuce.core.ScoredValueScanCursor;
import io.lettuce.core.SortArgs;
import io.lettuce.core.TransactionResult;
import io.lettuce.core.ValueScanCursor;
import io.lettuce.core.ZStoreArgs;
import io.lettuce.core.api.StatefulConnection;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.async.RedisAsyncCommands;
import io.lettuce.core.api.async.RedisHLLAsyncCommands;
import io.lettuce.core.api.sync.RedisCommands;
import io.lettuce.core.api.sync.RedisHLLCommands;
import io.lettuce.core.cluster.api.StatefulRedisClusterConnection;
import io.lettuce.core.cluster.api.async.RedisClusterAsyncCommands;
import io.lettuce.core.cluster.api.sync.RedisClusterCommands;
import io.lettuce.core.codec.ByteArrayCodec;
import io.lettuce.core.codec.RedisCodec;
import io.lettuce.core.output.BooleanOutput;
import io.lettuce.core.output.ByteArrayOutput;
import io.lettuce.core.output.CommandOutput;
import io.lettuce.core.output.DateOutput;
import io.lettuce.core.output.DoubleOutput;
import io.lettuce.core.output.IntegerOutput;
import io.lettuce.core.output.KeyListOutput;
import io.lettuce.core.output.KeyValueOutput;
import io.lettuce.core.output.MapOutput;
import io.lettuce.core.output.MultiOutput;
import io.lettuce.core.output.StatusOutput;
import io.lettuce.core.output.ValueListOutput;
import io.lettuce.core.output.ValueOutput;
import io.lettuce.core.output.ValueSetOutput;
import io.lettuce.core.protocol.Command;
import io.lettuce.core.protocol.CommandArgs;
import io.lettuce.core.protocol.CommandType;
import io.lettuce.core.pubsub.StatefulRedisPubSubConnection;
import io.lettuce.core.sentinel.api.StatefulRedisSentinelConnection;
import java.lang.reflect.Constructor;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -38,7 +97,17 @@ import org.springframework.data.geo.Point;
import org.springframework.data.redis.ExceptionTranslationStrategy;
import org.springframework.data.redis.FallbackExceptionTranslationStrategy;
import org.springframework.data.redis.RedisConnectionFailureException;
import org.springframework.data.redis.connection.*;
import org.springframework.data.redis.connection.AbstractRedisConnection;
import org.springframework.data.redis.connection.DataType;
import org.springframework.data.redis.connection.FutureResult;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.data.redis.connection.RedisNode;
import org.springframework.data.redis.connection.RedisPipelineException;
import org.springframework.data.redis.connection.RedisSentinelConnection;
import org.springframework.data.redis.connection.RedisSubscribedConnectionException;
import org.springframework.data.redis.connection.ReturnType;
import org.springframework.data.redis.connection.SortParameters;
import org.springframework.data.redis.connection.Subscription;
import org.springframework.data.redis.connection.convert.Converters;
import org.springframework.data.redis.connection.convert.ListConverter;
import org.springframework.data.redis.connection.convert.TransactionResultConverter;
@@ -54,25 +123,6 @@ import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ObjectUtils;
import com.lambdaworks.redis.*;
import com.lambdaworks.redis.api.StatefulConnection;
import com.lambdaworks.redis.api.StatefulRedisConnection;
import com.lambdaworks.redis.api.async.RedisAsyncCommands;
import com.lambdaworks.redis.api.async.RedisHLLAsyncCommands;
import com.lambdaworks.redis.api.sync.RedisCommands;
import com.lambdaworks.redis.api.sync.RedisHLLCommands;
import com.lambdaworks.redis.cluster.api.StatefulRedisClusterConnection;
import com.lambdaworks.redis.cluster.api.async.RedisClusterAsyncCommands;
import com.lambdaworks.redis.cluster.api.sync.RedisClusterCommands;
import com.lambdaworks.redis.codec.ByteArrayCodec;
import com.lambdaworks.redis.codec.RedisCodec;
import com.lambdaworks.redis.output.*;
import com.lambdaworks.redis.protocol.Command;
import com.lambdaworks.redis.protocol.CommandArgs;
import com.lambdaworks.redis.protocol.CommandType;
import com.lambdaworks.redis.pubsub.StatefulRedisPubSubConnection;
import com.lambdaworks.redis.sentinel.api.StatefulRedisSentinelConnection;
/**
* {@code RedisConnection} implementation on top of <a href="https://github.com/mp911de/lettuce">Lettuce</a> Redis
* client.
@@ -115,13 +165,13 @@ public class LettuceConnection extends AbstractRedisConnection {
private boolean convertPipelineAndTxResults = true;
@SuppressWarnings("rawtypes")
private class LettuceResult extends FutureResult<com.lambdaworks.redis.protocol.RedisCommand<?, ?, ?>> {
private class LettuceResult extends FutureResult<io.lettuce.core.protocol.RedisCommand<?, ?, ?>> {
public <T> LettuceResult(Future<T> resultHolder, Converter<T, ?> converter) {
super((com.lambdaworks.redis.protocol.RedisCommand) resultHolder, converter);
super((io.lettuce.core.protocol.RedisCommand) resultHolder, converter);
}
public LettuceResult(Future resultHolder) {
super((com.lambdaworks.redis.protocol.RedisCommand) resultHolder);
super((io.lettuce.core.protocol.RedisCommand) resultHolder);
}
@SuppressWarnings("unchecked")
@@ -414,7 +464,7 @@ public class LettuceConnection extends AbstractRedisConnection {
if (isPipelined) {
isPipelined = false;
List<com.lambdaworks.redis.protocol.RedisCommand<?, ?, ?>> futures = new ArrayList<com.lambdaworks.redis.protocol.RedisCommand<?, ?, ?>>();
List<io.lettuce.core.protocol.RedisCommand<?, ?, ?>> futures = new ArrayList<io.lettuce.core.protocol.RedisCommand<?, ?, ?>>();
for (LettuceResult result : ppline) {
futures.add(result.getResultHolder());
}
@@ -3666,7 +3716,7 @@ public class LettuceConnection extends AbstractRedisConnection {
throw new UnsupportedOperationException("'SCAN' cannot be called in pipeline / transaction mode.");
}
com.lambdaworks.redis.ScanCursor scanCursor = getScanCursor(cursorId);
io.lettuce.core.ScanCursor scanCursor = getScanCursor(cursorId);
ScanArgs scanArgs = getScanArgs(options);
KeyScanCursor<byte[]> keyScanCursor = getConnection().scan(scanCursor, scanArgs);
@@ -3711,7 +3761,7 @@ public class LettuceConnection extends AbstractRedisConnection {
throw new UnsupportedOperationException("'HSCAN' cannot be called in pipeline / transaction mode.");
}
com.lambdaworks.redis.ScanCursor scanCursor = getScanCursor(cursorId);
io.lettuce.core.ScanCursor scanCursor = getScanCursor(cursorId);
ScanArgs scanArgs = getScanArgs(options);
MapScanCursor<byte[], byte[]> mapScanCursor = getConnection().hscan(key, scanCursor, scanArgs);
@@ -3755,7 +3805,7 @@ public class LettuceConnection extends AbstractRedisConnection {
throw new UnsupportedOperationException("'SSCAN' cannot be called in pipeline / transaction mode.");
}
com.lambdaworks.redis.ScanCursor scanCursor = getScanCursor(cursorId);
io.lettuce.core.ScanCursor scanCursor = getScanCursor(cursorId);
ScanArgs scanArgs = getScanArgs(options);
ValueScanCursor<byte[]> valueScanCursor = getConnection().sscan(key, scanCursor, scanArgs);
@@ -3799,7 +3849,7 @@ public class LettuceConnection extends AbstractRedisConnection {
throw new UnsupportedOperationException("'ZSCAN' cannot be called in pipeline / transaction mode.");
}
com.lambdaworks.redis.ScanCursor scanCursor = getScanCursor(cursorId);
io.lettuce.core.ScanCursor scanCursor = getScanCursor(cursorId);
ScanArgs scanArgs = getScanArgs(options);
ScoredValueScanCursor<byte[]> scoredValueScanCursor = getConnection().zscan(key, scanCursor, scanArgs);
@@ -4004,8 +4054,8 @@ public class LettuceConnection extends AbstractRedisConnection {
return new byte[0][0];
}
private com.lambdaworks.redis.ScanCursor getScanCursor(long cursorId) {
return com.lambdaworks.redis.ScanCursor.of(Long.toString(cursorId));
private io.lettuce.core.ScanCursor getScanCursor(long cursorId) {
return io.lettuce.core.ScanCursor.of(Long.toString(cursorId));
}
private ScanArgs getScanArgs(ScanOptions options) {

View File

@@ -15,6 +15,14 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.AbstractRedisClient;
import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisException;
import io.lettuce.core.RedisURI;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.cluster.RedisClusterClient;
import io.lettuce.core.resource.ClientResources;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -29,19 +37,20 @@ import org.springframework.dao.InvalidDataAccessResourceUsageException;
import org.springframework.data.redis.ExceptionTranslationStrategy;
import org.springframework.data.redis.PassThroughExceptionTranslationStrategy;
import org.springframework.data.redis.RedisConnectionFailureException;
import org.springframework.data.redis.connection.*;
import org.springframework.data.redis.connection.ClusterCommandExecutor;
import org.springframework.data.redis.connection.Pool;
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
import org.springframework.data.redis.connection.RedisClusterConfiguration;
import org.springframework.data.redis.connection.RedisClusterConnection;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisNode;
import org.springframework.data.redis.connection.RedisSentinelConfiguration;
import org.springframework.data.redis.connection.RedisSentinelConnection;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
import com.lambdaworks.redis.AbstractRedisClient;
import com.lambdaworks.redis.RedisClient;
import com.lambdaworks.redis.RedisException;
import com.lambdaworks.redis.RedisURI;
import com.lambdaworks.redis.api.StatefulRedisConnection;
import com.lambdaworks.redis.cluster.RedisClusterClient;
import com.lambdaworks.redis.resource.ClientResources;
/**
* Connection factory creating <a href="http://github.com/mp911de/lettuce">Lettuce</a>-based connections.
* <p>
@@ -211,11 +220,11 @@ public class LettuceConnectionFactory
*/
@Override
public LettuceReactiveRedisClusterConnection getReactiveClusterConnection() {
if(!isClusterAware()) {
if (!isClusterAware()) {
throw new InvalidDataAccessApiUsageException("Cluster is not configured!");
}
return new LettuceReactiveRedisClusterConnection((RedisClusterClient)client);
return new LettuceReactiveRedisClusterConnection((RedisClusterClient) client);
}
public void initConnection() {

View File

@@ -15,8 +15,34 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.GeoArgs;
import io.lettuce.core.GeoCoordinates;
import io.lettuce.core.GeoWithin;
import io.lettuce.core.KeyValue;
import io.lettuce.core.Limit;
import io.lettuce.core.Range;
import io.lettuce.core.RedisURI;
import io.lettuce.core.ScoredValue;
import io.lettuce.core.ScriptOutputType;
import io.lettuce.core.SetArgs;
import io.lettuce.core.SortArgs;
import io.lettuce.core.TransactionResult;
import io.lettuce.core.cluster.models.partitions.Partitions;
import io.lettuce.core.cluster.models.partitions.RedisClusterNode.NodeFlag;
import io.lettuce.core.protocol.LettuceCharsets;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -60,11 +86,6 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import com.lambdaworks.redis.*;
import com.lambdaworks.redis.cluster.models.partitions.Partitions;
import com.lambdaworks.redis.cluster.models.partitions.RedisClusterNode.NodeFlag;
import com.lambdaworks.redis.protocol.LettuceCharsets;
/**
* Lettuce type converters
*
@@ -92,7 +113,7 @@ abstract public class LettuceConverters extends Converters {
private static final Converter<List<byte[]>, List<Tuple>> BYTES_LIST_TO_TUPLE_LIST_CONVERTER;
private static final Converter<String[], List<RedisClientInfo>> STRING_TO_LIST_OF_CLIENT_INFO = new StringToRedisClientInfoConverter();
private static final Converter<Partitions, List<RedisClusterNode>> PARTITIONS_TO_CLUSTER_NODES;
private static Converter<com.lambdaworks.redis.cluster.models.partitions.RedisClusterNode, RedisClusterNode> CLUSTER_NODE_TO_CLUSTER_NODE_CONVERTER;
private static Converter<io.lettuce.core.cluster.models.partitions.RedisClusterNode, RedisClusterNode> CLUSTER_NODE_TO_CLUSTER_NODE_CONVERTER;
private static final Converter<List<byte[]>, Long> BYTES_LIST_TO_TIME_CONVERTER;
private static final Converter<GeoCoordinates, Point> GEO_COORDINATE_TO_POINT_CONVERTER;
private static final ListConverter<GeoCoordinates, Point> GEO_COORDINATE_LIST_TO_POINT_LIST_CONVERTER;
@@ -237,7 +258,7 @@ abstract public class LettuceConverters extends Converters {
return Collections.emptyList();
}
List<RedisClusterNode> nodes = new ArrayList<RedisClusterNode>();
for (com.lambdaworks.redis.cluster.models.partitions.RedisClusterNode node : source.getPartitions()) {
for (io.lettuce.core.cluster.models.partitions.RedisClusterNode node : source.getPartitions()) {
nodes.add(CLUSTER_NODE_TO_CLUSTER_NODE_CONVERTER.convert(node));
}
@@ -246,10 +267,10 @@ abstract public class LettuceConverters extends Converters {
};
CLUSTER_NODE_TO_CLUSTER_NODE_CONVERTER = new Converter<com.lambdaworks.redis.cluster.models.partitions.RedisClusterNode, RedisClusterNode>() {
CLUSTER_NODE_TO_CLUSTER_NODE_CONVERTER = new Converter<io.lettuce.core.cluster.models.partitions.RedisClusterNode, RedisClusterNode>() {
@Override
public RedisClusterNode convert(com.lambdaworks.redis.cluster.models.partitions.RedisClusterNode source) {
public RedisClusterNode convert(io.lettuce.core.cluster.models.partitions.RedisClusterNode source) {
Set<Flag> flags = parseFlags(source.getFlags());
@@ -314,10 +335,11 @@ abstract public class LettuceConverters extends Converters {
}
};
GEO_COORDINATE_TO_POINT_CONVERTER = new Converter<com.lambdaworks.redis.GeoCoordinates, Point>() {
GEO_COORDINATE_TO_POINT_CONVERTER = new Converter<io.lettuce.core.GeoCoordinates, Point>() {
@Override
public Point convert(com.lambdaworks.redis.GeoCoordinates geoCoordinate) {
return geoCoordinate != null ? new Point(geoCoordinate.getX().doubleValue(), geoCoordinate.getY().doubleValue()) : null;
public Point convert(io.lettuce.core.GeoCoordinates geoCoordinate) {
return geoCoordinate != null ? new Point(geoCoordinate.getX().doubleValue(), geoCoordinate.getY().doubleValue())
: null;
}
};
GEO_COORDINATE_LIST_TO_POINT_LIST_CONVERTER = new ListConverter<GeoCoordinates, Point>(
@@ -547,13 +569,14 @@ abstract public class LettuceConverters extends Converters {
}
/**
* Convert a {@link org.springframework.data.redis.connection.RedisZSetCommands.Limit} to a lettuce {@link com.lambdaworks.redis.Limit}.
* Convert a {@link org.springframework.data.redis.connection.RedisZSetCommands.Limit} to a lettuce
* {@link io.lettuce.core.Limit}.
*
* @param limit
* @return a lettuce {@link com.lambdaworks.redis.Limit}.
* @return a lettuce {@link io.lettuce.core.Limit}.
* @since 2.0
*/
public static com.lambdaworks.redis.Limit toLimit(RedisZSetCommands.Limit limit){
public static io.lettuce.core.Limit toLimit(RedisZSetCommands.Limit limit) {
return Limit.create(limit.getOffset(), limit.getCount());
}
@@ -565,7 +588,7 @@ abstract public class LettuceConverters extends Converters {
* @since 2.0
*/
public static <T> Range<T> toRange(org.springframework.data.redis.connection.RedisZSetCommands.Range range) {
return Range.from(lowerBoundaryOf(range), upperBoundaryOf(range));
return Range.from(lowerBoundaryOf(range), upperBoundaryOf(range));
}
/**
@@ -581,12 +604,14 @@ abstract public class LettuceConverters extends Converters {
}
@SuppressWarnings("unchecked")
private static <T> Range.Boundary<T> lowerBoundaryOf(org.springframework.data.redis.connection.RedisZSetCommands.Range range) {
private static <T> Range.Boundary<T> lowerBoundaryOf(
org.springframework.data.redis.connection.RedisZSetCommands.Range range) {
return (Range.Boundary<T>) rangeToBoundaryArgumentConverter(false).convert(range);
}
@SuppressWarnings("unchecked")
private static <T> Range.Boundary<T> upperBoundaryOf(org.springframework.data.redis.connection.RedisZSetCommands.Range range) {
private static <T> Range.Boundary<T> upperBoundaryOf(
org.springframework.data.redis.connection.RedisZSetCommands.Range range) {
return (Range.Boundary<T>) rangeToBoundaryArgumentConverter(true).convert(range);
}
@@ -752,8 +777,7 @@ abstract public class LettuceConverters extends Converters {
* @return
* @since 1.7
*/
public static RedisClusterNode toRedisClusterNode(
com.lambdaworks.redis.cluster.models.partitions.RedisClusterNode source) {
public static RedisClusterNode toRedisClusterNode(io.lettuce.core.cluster.models.partitions.RedisClusterNode source) {
return CLUSTER_NODE_TO_CLUSTER_NODE_CONVERTER.convert(source);
}
@@ -867,7 +891,7 @@ abstract public class LettuceConverters extends Converters {
public GeoResults<GeoLocation<byte[]>> convert(Set<byte[]> source) {
if (CollectionUtils.isEmpty(source)) {
return new GeoResults<GeoLocation<byte[]>>(Collections.<GeoResult<GeoLocation<byte[]>>>emptyList());
return new GeoResults<GeoLocation<byte[]>>(Collections.<GeoResult<GeoLocation<byte[]>>> emptyList());
}
List<GeoResult<GeoLocation<byte[]>>> results = new ArrayList<GeoResult<GeoLocation<byte[]>>>(source.size());
@@ -896,7 +920,7 @@ abstract public class LettuceConverters extends Converters {
* @return
* @since 1.8
*/
public static ListConverter<com.lambdaworks.redis.GeoCoordinates, Point> geoCoordinatesToPointConverter() {
public static ListConverter<io.lettuce.core.GeoCoordinates, Point> geoCoordinatesToPointConverter() {
return GEO_COORDINATE_LIST_TO_POINT_LIST_CONVERTER;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,13 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.RedisCommandExecutionException;
import io.lettuce.core.RedisCommandInterruptedException;
import io.lettuce.core.RedisCommandTimeoutException;
import io.lettuce.core.RedisConnectionException;
import io.lettuce.core.RedisException;
import io.netty.channel.ChannelException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
@@ -24,14 +31,6 @@ import org.springframework.dao.QueryTimeoutException;
import org.springframework.data.redis.RedisConnectionFailureException;
import org.springframework.data.redis.RedisSystemException;
import com.lambdaworks.redis.RedisCommandExecutionException;
import com.lambdaworks.redis.RedisCommandInterruptedException;
import com.lambdaworks.redis.RedisCommandTimeoutException;
import com.lambdaworks.redis.RedisConnectionException;
import com.lambdaworks.redis.RedisException;
import io.netty.channel.ChannelException;
/**
* Converts Lettuce Exceptions to {@link DataAccessException}s
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011-2013 the original author or authors.
* Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,12 +16,12 @@
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.pubsub.RedisPubSubListener;
import org.springframework.data.redis.connection.DefaultMessage;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.util.Assert;
import com.lambdaworks.redis.pubsub.RedisPubSubListener;
/**
* MessageListener wrapper around Lettuce {@link RedisPubSubListener}.
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2016 the original author or authors.
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +16,10 @@
package org.springframework.data.redis.connection.lettuce;
import org.springframework.data.redis.connection.Pool;
import io.lettuce.core.AbstractRedisClient;
import io.lettuce.core.api.StatefulConnection;
import com.lambdaworks.redis.AbstractRedisClient;
import com.lambdaworks.redis.api.StatefulConnection;
import org.springframework.data.redis.connection.Pool;
/**
* Pool of Lettuce {@link StatefulConnection}s

View File

@@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.RedisException;
import io.lettuce.core.api.reactive.RedisKeyReactiveCommands;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -30,9 +31,6 @@ import org.springframework.data.redis.connection.ReactiveRedisConnection.Boolean
import org.springframework.data.redis.connection.RedisClusterNode;
import org.springframework.util.Assert;
import com.lambdaworks.redis.RedisException;
import com.lambdaworks.redis.api.reactive.RedisKeyReactiveCommands;
/**
* @author Christoph Strobl
* @author Mark Paluch

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,13 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.GeoArgs;
import io.lettuce.core.GeoCoordinates;
import io.lettuce.core.GeoWithin;
import io.lettuce.core.Value;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
@@ -35,14 +42,6 @@ import org.springframework.data.redis.connection.RedisGeoCommands;
import org.springframework.data.redis.connection.RedisGeoCommands.GeoLocation;
import org.springframework.util.Assert;
import com.lambdaworks.redis.GeoArgs;
import com.lambdaworks.redis.GeoCoordinates;
import com.lambdaworks.redis.GeoWithin;
import com.lambdaworks.redis.Value;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* @author Christoph Strobl
* @since 2.0

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,10 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.KeyValue;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.List;
@@ -32,11 +36,6 @@ import org.springframework.data.redis.connection.ReactiveRedisConnection.Numeric
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import com.lambdaworks.redis.KeyValue;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* @author Christoph Strobl
* @author Mark Paluch

View File

@@ -15,6 +15,7 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.api.reactive.RedisKeyReactiveCommands;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -32,8 +33,6 @@ import org.springframework.data.redis.connection.ReactiveRedisConnection.MultiVa
import org.springframework.data.redis.connection.ReactiveRedisConnection.NumericResponse;
import org.springframework.util.Assert;
import com.lambdaworks.redis.api.reactive.RedisKeyReactiveCommands;
/**
* @author Christoph Strobl
* @author Mark Paluch

View File

@@ -15,6 +15,12 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.api.reactive.RedisReactiveCommands;
import io.lettuce.core.cluster.RedisClusterClient;
import io.lettuce.core.cluster.api.StatefulRedisClusterConnection;
import io.lettuce.core.cluster.api.reactive.RedisClusterReactiveCommands;
import reactor.core.publisher.Flux;
import java.nio.ByteBuffer;
import org.springframework.data.redis.connection.ReactiveRedisClusterConnection;
@@ -22,13 +28,6 @@ import org.springframework.data.redis.connection.RedisNode;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import com.lambdaworks.redis.api.reactive.RedisReactiveCommands;
import com.lambdaworks.redis.cluster.RedisClusterClient;
import com.lambdaworks.redis.cluster.api.StatefulRedisClusterConnection;
import com.lambdaworks.redis.cluster.api.reactive.RedisClusterReactiveCommands;
import reactor.core.publisher.Flux;
/**
* @author Christoph Strobl
* @author Mark Paluch

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,26 +15,34 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.AbstractRedisClient;
import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulConnection;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.cluster.RedisClusterClient;
import io.lettuce.core.cluster.api.StatefulRedisClusterConnection;
import io.lettuce.core.cluster.api.reactive.RedisClusterReactiveCommands;
import io.lettuce.core.codec.RedisCodec;
import reactor.core.publisher.Flux;
import java.nio.ByteBuffer;
import java.util.function.Function;
import org.reactivestreams.Publisher;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.InvalidDataAccessResourceUsageException;
import org.springframework.data.redis.connection.*;
import org.springframework.data.redis.connection.ReactiveGeoCommands;
import org.springframework.data.redis.connection.ReactiveHashCommands;
import org.springframework.data.redis.connection.ReactiveHyperLogLogCommands;
import org.springframework.data.redis.connection.ReactiveKeyCommands;
import org.springframework.data.redis.connection.ReactiveListCommands;
import org.springframework.data.redis.connection.ReactiveNumberCommands;
import org.springframework.data.redis.connection.ReactiveRedisConnection;
import org.springframework.data.redis.connection.ReactiveSetCommands;
import org.springframework.data.redis.connection.ReactiveStringCommands;
import org.springframework.data.redis.connection.ReactiveZSetCommands;
import org.springframework.util.Assert;
import com.lambdaworks.redis.AbstractRedisClient;
import com.lambdaworks.redis.RedisClient;
import com.lambdaworks.redis.api.StatefulConnection;
import com.lambdaworks.redis.api.StatefulRedisConnection;
import com.lambdaworks.redis.cluster.RedisClusterClient;
import com.lambdaworks.redis.cluster.api.StatefulRedisClusterConnection;
import com.lambdaworks.redis.cluster.api.reactive.RedisClusterReactiveCommands;
import com.lambdaworks.redis.codec.RedisCodec;
import reactor.core.publisher.Flux;
/**
* @author Christoph Strobl
* @since 2.0

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,10 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.SetArgs;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.nio.ByteBuffer;
import java.util.List;
@@ -29,11 +33,6 @@ import org.springframework.data.redis.connection.ReactiveRedisConnection.RangeCo
import org.springframework.data.redis.connection.ReactiveStringCommands;
import org.springframework.util.Assert;
import com.lambdaworks.redis.SetArgs;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* @author Christoph Strobl
* @author Mark Paluch

View File

@@ -15,6 +15,13 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.Range;
import io.lettuce.core.Range.Boundary;
import io.lettuce.core.ScoredValue;
import io.lettuce.core.ZAddArgs;
import io.lettuce.core.ZStoreArgs;
import io.lettuce.core.codec.StringCodec;
import io.lettuce.core.protocol.LettuceCharsets;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -37,14 +44,6 @@ import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import com.lambdaworks.redis.Range;
import com.lambdaworks.redis.Range.Boundary;
import com.lambdaworks.redis.ScoredValue;
import com.lambdaworks.redis.ZAddArgs;
import com.lambdaworks.redis.ZStoreArgs;
import com.lambdaworks.redis.codec.StringCodec;
import com.lambdaworks.redis.protocol.LettuceCharsets;
/**
* @author Christoph Strobl
* @author Mark Paluch

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,12 @@
*/
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisURI.Builder;
import io.lettuce.core.resource.ClientResources;
import io.lettuce.core.sentinel.api.StatefulRedisSentinelConnection;
import io.lettuce.core.sentinel.api.sync.RedisSentinelCommands;
import java.io.IOException;
import java.util.List;
@@ -26,12 +32,6 @@ import org.springframework.data.redis.connection.RedisSentinelConnection;
import org.springframework.data.redis.connection.RedisServer;
import org.springframework.util.Assert;
import com.lambdaworks.redis.RedisClient;
import com.lambdaworks.redis.RedisURI.Builder;
import com.lambdaworks.redis.resource.ClientResources;
import com.lambdaworks.redis.sentinel.api.StatefulRedisSentinelConnection;
import com.lambdaworks.redis.sentinel.api.sync.RedisSentinelCommands;
/**
* @author Christoph Strobl
* @author Mark Paluch

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011-2013 the original author or authors.
* Copyright 2011-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,11 +16,11 @@
package org.springframework.data.redis.connection.lettuce;
import io.lettuce.core.pubsub.StatefulRedisPubSubConnection;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.data.redis.connection.util.AbstractSubscription;
import com.lambdaworks.redis.pubsub.StatefulRedisPubSubConnection;
/**
* Message subscription on top of Lettuce.
*