diff --git a/spring-data-redis/pom.xml b/spring-data-redis/pom.xml
index 7447c7a8e..dfc296837 100644
--- a/spring-data-redis/pom.xml
+++ b/spring-data-redis/pom.xml
@@ -13,7 +13,7 @@
02112010
- 1.4.0
+ 1.5.0-RC1
@@ -115,12 +115,6 @@
compile
-
- org.springframework.commons
- spring-commons-serializer
- 1.0.0.M1
- compile
-
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java
index 8b227f9d6..e52c2bd4a 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java
@@ -28,7 +28,7 @@ public interface RedisCommands extends RedisTxCommands, RedisStringCommands, Red
Boolean exists(byte[] key);
- Integer del(byte[]... keys);
+ Long del(byte[]... keys);
DataType type(byte[] key);
@@ -40,15 +40,15 @@ public interface RedisCommands extends RedisTxCommands, RedisStringCommands, Red
Boolean renameNX(byte[] oldName, byte[] newName);
- Integer dbSize();
+ Long dbSize();
- Boolean expire(byte[] key, int seconds);
+ Boolean expire(byte[] key, long seconds);
Boolean expireAt(byte[] key, long unixTime);
Boolean persist(byte[] key);
- Integer ttl(byte[] key);
+ Long ttl(byte[] key);
void select(int dbIndex);
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisHashCommands.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisHashCommands.java
index 13a15de10..03fc2ba70 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisHashCommands.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisHashCommands.java
@@ -37,13 +37,13 @@ public interface RedisHashCommands {
void hMSet(byte[] key, Map hashes);
- Integer hIncrBy(byte[] key, byte[] field, int delta);
+ Long hIncrBy(byte[] key, byte[] field, long delta);
Boolean hExists(byte[] key, byte[] field);
Boolean hDel(byte[] key, byte[] field);
- Integer hLen(byte[] key);
+ Long hLen(byte[] key);
Set hKeys(byte[] key);
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisListCommands.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisListCommands.java
index 31094e9a9..030040eb9 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisListCommands.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisListCommands.java
@@ -25,21 +25,21 @@ import java.util.List;
*/
public interface RedisListCommands {
- Integer rPush(byte[] key, byte[] value);
+ Long rPush(byte[] key, byte[] value);
- Integer lPush(byte[] key, byte[] value);
+ Long lPush(byte[] key, byte[] value);
- Integer lLen(byte[] key);
+ Long lLen(byte[] key);
- List lRange(byte[] key, int start, int end);
+ List lRange(byte[] key, long start, long end);
- void lTrim(byte[] key, int start, int end);
+ void lTrim(byte[] key, long start, long end);
- byte[] lIndex(byte[] key, int index);
+ byte[] lIndex(byte[] key, long index);
- void lSet(byte[] key, int index, byte[] value);
+ void lSet(byte[] key, long index, byte[] value);
- Integer lRem(byte[] key, int count, byte[] value);
+ Long lRem(byte[] key, long count, byte[] value);
byte[] lPop(byte[] key);
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSetCommands.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSetCommands.java
index f2a28da88..184cf57ae 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSetCommands.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSetCommands.java
@@ -33,7 +33,7 @@ public interface RedisSetCommands {
Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value);
- Integer sCard(byte[] key);
+ Long sCard(byte[] key);
Boolean sIsMember(byte[] key, byte[] value);
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java
index 53391a170..49fc1d5ab 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java
@@ -36,21 +36,21 @@ public interface RedisStringCommands {
Boolean setNX(byte[] key, byte[] value);
- void setEx(byte[] key, int seconds, byte[] value);
+ void setEx(byte[] key, long seconds, byte[] value);
void mSet(Map tuple);
void mSetNX(Map tuple);
- Integer incr(byte[] key);
+ Long incr(byte[] key);
- Integer incrBy(byte[] key, int value);
+ Long incrBy(byte[] key, long value);
- Integer decr(byte[] key);
+ Long decr(byte[] key);
- Integer decrBy(byte[] key, int value);
+ Long decrBy(byte[] key, long value);
- Integer append(byte[] key, byte[] value);
+ Long append(byte[] key, byte[] value);
- byte[] substr(byte[] key, int start, int end);
+ byte[] substr(byte[] key, long start, long end);
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisZSetCommands.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisZSetCommands.java
index 76eb7ea43..223f53d31 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisZSetCommands.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisZSetCommands.java
@@ -42,41 +42,41 @@ public interface RedisZSetCommands {
Double zIncrBy(byte[] key, double increment, byte[] value);
- Integer zRank(byte[] key, byte[] value);
+ Long zRank(byte[] key, byte[] value);
- Integer zRevRank(byte[] key, byte[] value);
+ Long zRevRank(byte[] key, byte[] value);
- Set zRange(byte[] key, int start, int end);
+ Set zRange(byte[] key, long start, long end);
- Set zRangeWithScore(byte[] key, int start, int end);
+ Set zRangeWithScore(byte[] key, long start, long end);
- Set zRevRange(byte[] key, int start, int end);
+ Set zRevRange(byte[] key, long start, long end);
- Set zRevRangeWithScore(byte[] key, int start, int end);
+ Set zRevRangeWithScore(byte[] key, long start, long end);
Set zRangeByScore(byte[] key, double min, double max);
Set zRangeByScoreWithScore(byte[] key, double min, double max);
- Set zRangeByScore(byte[] key, double min, double max, int offset, int count);
+ Set zRangeByScore(byte[] key, double min, double max, long offset, long count);
- Set zRangeByScoreWithScore(byte[] key, double min, double max, int offset, int count);
+ Set zRangeByScoreWithScore(byte[] key, double min, double max, long offset, long count);
- Integer zCount(byte[] key, double min, double max);
+ Long zCount(byte[] key, double min, double max);
- Integer zCard(byte[] key);
+ Long zCard(byte[] key);
Double zScore(byte[] key, byte[] value);
- Integer zRemRange(byte[] key, int start, int end);
+ Long zRemRange(byte[] key, long start, long end);
- Integer zRemRangeByScore(byte[] key, double min, double max);
+ Long zRemRangeByScore(byte[] key, double min, double max);
- Integer zUnionStore(byte[] destKey, byte[]... sets);
+ Long zUnionStore(byte[] destKey, byte[]... sets);
- Integer zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets);
+ Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets);
- Integer zInterStore(byte[] destKey, byte[]... sets);
+ Long zInterStore(byte[] destKey, byte[]... sets);
- Integer zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets);
+ Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets);
}
\ No newline at end of file
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnection.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnection.java
index e878174df..f1e483e13 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnection.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnection.java
@@ -108,7 +108,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer dbSize() {
+ public Long dbSize() {
try {
if (isQueueing()) {
transaction.dbSize();
@@ -134,7 +134,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer del(byte[]... keys) {
+ public Long del(byte[]... keys) {
try {
if (isQueueing()) {
transaction.del(keys);
@@ -178,10 +178,10 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Boolean expire(byte[] key, int seconds) {
+ public Boolean expire(byte[] key, long seconds) {
try {
if (isQueueing()) {
- transaction.expire(key, seconds);
+ transaction.expire(key, (int) seconds);
return null;
}
return (jedis.expire(key, (int) seconds) == 1);
@@ -289,7 +289,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer ttl(byte[] key) {
+ public Long ttl(byte[] key) {
try {
if (isQueueing()) {
transaction.ttl(key);
@@ -381,7 +381,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer append(byte[] key, byte[] value) {
+ public Long append(byte[] key, byte[] value) {
try {
if (isQueueing()) {
transaction.append(key, value);
@@ -431,12 +431,12 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public void setEx(byte[] key, int time, byte[] value) {
+ public void setEx(byte[] key, long time, byte[] value) {
try {
if (isQueueing()) {
- transaction.setex(key, time, value);
+ transaction.setex(key, (int) time, value);
}
- jedis.setex(key, time, value);
+ jedis.setex(key, (int) time, value);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
@@ -455,20 +455,20 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public byte[] substr(byte[] key, int start, int end) {
+ public byte[] substr(byte[] key, long start, long end) {
try {
if (isQueueing()) {
- transaction.substr(key, start, end);
+ transaction.substr(key, (int) start, (int) end);
return null;
}
- return jedis.substr(key, start, end);
+ return jedis.substr(key, (int) start, (int) end);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Integer decr(byte[] key) {
+ public Long decr(byte[] key) {
try {
if (isQueueing()) {
transaction.decr(key);
@@ -481,20 +481,20 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer decrBy(byte[] key, int value) {
+ public Long decrBy(byte[] key, long value) {
try {
if (isQueueing()) {
- transaction.decrBy(key, value);
+ transaction.decrBy(key, (int) value);
return null;
}
- return jedis.decrBy(key, value);
+ return jedis.decrBy(key, (int) value);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Integer incr(byte[] key) {
+ public Long incr(byte[] key) {
try {
if (isQueueing()) {
transaction.incr(key);
@@ -507,13 +507,13 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer incrBy(byte[] key, int value) {
+ public Long incrBy(byte[] key, long value) {
try {
if (isQueueing()) {
- transaction.incrBy(key, value);
+ transaction.incrBy(key, (int) value);
return null;
}
- return jedis.incrBy(key, value);
+ return jedis.incrBy(key, (int) value);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
@@ -525,7 +525,7 @@ public class JedisConnection implements RedisConnection {
@Override
- public Integer lPush(byte[] key, byte[] value) {
+ public Long lPush(byte[] key, byte[] value) {
try {
if (isQueueing()) {
transaction.lpush(key, value);
@@ -538,7 +538,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer rPush(byte[] key, byte[] value) {
+ public Long rPush(byte[] key, byte[] value) {
try {
if (isQueueing()) {
transaction.rpush(key, value);
@@ -575,20 +575,20 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public byte[] lIndex(byte[] key, int index) {
+ public byte[] lIndex(byte[] key, long index) {
try {
if (isQueueing()) {
- transaction.lindex(key, index);
+ transaction.lindex(key, (int) index);
return null;
}
- return jedis.lindex(key, index);
+ return jedis.lindex(key, (int) index);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Integer lLen(byte[] key) {
+ public Long lLen(byte[] key) {
try {
if (isQueueing()) {
transaction.llen(key);
@@ -614,50 +614,50 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public List lRange(byte[] key, int start, int end) {
+ public List lRange(byte[] key, long start, long end) {
try {
if (isQueueing()) {
- transaction.lrange(key, start, end);
+ transaction.lrange(key, (int) start, (int) end);
return null;
}
- return jedis.lrange(key, start, end);
+ return jedis.lrange(key, (int) start, (int) end);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Integer lRem(byte[] key, int count, byte[] value) {
+ public Long lRem(byte[] key, long count, byte[] value) {
try {
if (isQueueing()) {
- transaction.lrem(key, count, value);
+ transaction.lrem(key, (int) count, value);
return null;
}
- return jedis.lrem(key, count, value);
+ return jedis.lrem(key, (int) count, value);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public void lSet(byte[] key, int index, byte[] value) {
+ public void lSet(byte[] key, long index, byte[] value) {
try {
if (isQueueing()) {
- transaction.lset(key, index, value);
+ transaction.lset(key, (int) index, value);
}
- jedis.lset(key, index, value);
+ jedis.lset(key, (int) index, value);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public void lTrim(byte[] key, int start, int end) {
+ public void lTrim(byte[] key, long start, long end) {
try {
if (isQueueing()) {
- transaction.ltrim(key, start, end);
+ transaction.ltrim(key, (int) start, (int) end);
}
- jedis.ltrim(key, start, end);
+ jedis.ltrim(key, (int) start, (int) end);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
@@ -708,7 +708,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer sCard(byte[] key) {
+ public Long sCard(byte[] key) {
try {
if (isQueueing()) {
transaction.scard(key);
@@ -891,7 +891,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer zCard(byte[] key) {
+ public Long zCard(byte[] key) {
try {
if (isQueueing()) {
transaction.zcard(key);
@@ -904,7 +904,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer zCount(byte[] key, double min, double max) {
+ public Long zCount(byte[] key, double min, double max) {
try {
if (isQueueing()) {
throw new UnsupportedOperationException();
@@ -929,7 +929,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
+ public Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
try {
if (isQueueing()) {
throw new UnsupportedOperationException();
@@ -943,7 +943,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer zInterStore(byte[] destKey, byte[]... sets) {
+ public Long zInterStore(byte[] destKey, byte[]... sets) {
try {
if (isQueueing()) {
throw new UnsupportedOperationException();
@@ -955,26 +955,26 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Set zRange(byte[] key, int start, int end) {
+ public Set zRange(byte[] key, long start, long end) {
try {
if (isQueueing()) {
- transaction.zrange(key, start, end);
+ transaction.zrange(key, (int) start, (int) end);
return null;
}
- return jedis.zrange(key, start, end);
+ return jedis.zrange(key, (int) start, (int) end);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Set zRangeWithScore(byte[] key, int start, int end) {
+ public Set zRangeWithScore(byte[] key, long start, long end) {
try {
if (isQueueing()) {
- transaction.zrangeWithScores(key, start, end);
+ transaction.zrangeWithScores(key, (int) start, (int) end);
return null;
}
- return JedisUtils.convertJedisTuple(jedis.zrangeWithScores(key, start, end));
+ return JedisUtils.convertJedisTuple(jedis.zrangeWithScores(key, (int) start, (int) end));
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
@@ -1005,44 +1005,44 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Set zRevRangeWithScore(byte[] key, int start, int end) {
+ public Set zRevRangeWithScore(byte[] key, long start, long end) {
try {
if (isQueueing()) {
- transaction.zrangeWithScores(key, start, end);
+ transaction.zrangeWithScores(key, (int) start, (int) end);
return null;
}
- return JedisUtils.convertJedisTuple(jedis.zrangeByScoreWithScores(key, start, end));
+ return JedisUtils.convertJedisTuple(jedis.zrangeByScoreWithScores(key, (int) start, (int) end));
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Set zRangeByScore(byte[] key, double min, double max, int offset, int count) {
+ public Set zRangeByScore(byte[] key, double min, double max, long offset, long count) {
try {
if (isQueueing()) {
throw new UnsupportedOperationException();
}
- return jedis.zrangeByScore(key, min, max, offset, count);
+ return jedis.zrangeByScore(key, min, max, (int) offset, (int) count);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Set zRangeByScoreWithScore(byte[] key, double min, double max, int offset, int count) {
+ public Set zRangeByScoreWithScore(byte[] key, double min, double max, long offset, long count) {
try {
if (isQueueing()) {
throw new UnsupportedOperationException();
}
- return JedisUtils.convertJedisTuple(jedis.zrangeByScoreWithScores(key, min, max, offset, count));
+ return JedisUtils.convertJedisTuple(jedis.zrangeByScoreWithScores(key, min, max, (int) offset, (int) count));
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Integer zRank(byte[] key, byte[] value) {
+ public Long zRank(byte[] key, byte[] value) {
try {
if (isQueueing()) {
transaction.zrank(key, value);
@@ -1068,19 +1068,19 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer zRemRange(byte[] key, int start, int end) {
+ public Long zRemRange(byte[] key, long start, long end) {
try {
if (isQueueing()) {
throw new UnsupportedOperationException();
}
- return jedis.zremrangeByRank(key, start, end);
+ return jedis.zremrangeByRank(key, (int) start, (int) end);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Integer zRemRangeByScore(byte[] key, double min, double max) {
+ public Long zRemRangeByScore(byte[] key, double min, double max) {
try {
if (isQueueing()) {
throw new UnsupportedOperationException();
@@ -1092,20 +1092,20 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Set zRevRange(byte[] key, int start, int end) {
+ public Set zRevRange(byte[] key, long start, long end) {
try {
if (isQueueing()) {
- transaction.zrevrange(key, start, end);
+ transaction.zrevrange(key, (int) start, (int) end);
return null;
}
- return jedis.zrevrange(key, start, end);
+ return jedis.zrevrange(key, (int) start, (int) end);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
- public Integer zRevRank(byte[] key, byte[] value) {
+ public Long zRevRank(byte[] key, byte[] value) {
try {
if (isQueueing()) {
transaction.zrevrank(key, value);
@@ -1131,7 +1131,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
+ public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
try {
if (isQueueing()) {
throw new UnsupportedOperationException();
@@ -1145,7 +1145,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer zUnionStore(byte[] destKey, byte[]... sets) {
+ public Long zUnionStore(byte[] destKey, byte[]... sets) {
try {
if (isQueueing()) {
throw new UnsupportedOperationException();
@@ -1239,13 +1239,13 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer hIncrBy(byte[] key, byte[] field, int delta) {
+ public Long hIncrBy(byte[] key, byte[] field, long delta) {
try {
if (isQueueing()) {
- transaction.hincrBy(key, field, delta);
+ transaction.hincrBy(key, field, (int) delta);
return null;
}
- return jedis.hincrBy(key, field, delta);
+ return jedis.hincrBy(key, field, (int) delta);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
@@ -1265,7 +1265,7 @@ public class JedisConnection implements RedisConnection {
}
@Override
- public Integer hLen(byte[] key) {
+ public Long hLen(byte[] key) {
try {
if (isQueueing()) {
transaction.hlen(key);
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java
index 33e8e6d82..527f236bf 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java
@@ -16,13 +16,13 @@
package org.springframework.data.keyvalue.redis.connection.jedis;
-import java.util.concurrent.TimeoutException;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.commons.pool.impl.GenericObjectPool;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessException;
+import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.data.keyvalue.redis.connection.RedisConnection;
import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory;
import org.springframework.util.Assert;
@@ -99,8 +99,8 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean,
return pool.getResource();
}
return new Jedis(getShardInfo());
- } catch (TimeoutException ex) {
- throw JedisUtils.convertJedisAccessException(ex);
+ } catch (Exception ex) {
+ throw new DataAccessResourceFailureException("Cannot get Jedis connection", ex);
}
}
@@ -115,15 +115,18 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean,
if (usePool) {
int size = getPoolSize();
- pool = new JedisPool(shardInfo);
- pool.setResourcesNumber(size);
- pool.init();
+ pool = new JedisPool(new GenericObjectPool.Config(), shardInfo.getHost(), shardInfo.getPort(),
+ shardInfo.getTimeout(), shardInfo.getPassword());
}
}
public void destroy() {
if (usePool && pool != null) {
- pool.destroy();
+ try {
+ pool.destroy();
+ } catch (Exception ex) {
+ log.warn("Cannot properly close Jedis pool", ex);
+ }
pool = null;
}
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisUtils.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisUtils.java
index fd20c36f8..924e9e382 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisUtils.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisUtils.java
@@ -70,8 +70,8 @@ public abstract class JedisUtils {
return status != null && (OK_CODE.equals(status) || OK_MULTI_CODE.equals(status));
}
- static Boolean convertCodeReply(Integer code) {
- return (code != null ? code == 1 : null);
+ static Boolean convertCodeReply(Number code) {
+ return (code != null ? code.intValue() == 1 : null);
}
static Set convertJedisTuple(Set tuples) {
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnection.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnection.java
index 2cc0810d1..d4f939d0c 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnection.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnection.java
@@ -76,9 +76,9 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer dbSize() {
+ public Long dbSize() {
try {
- return Integer.valueOf((int) jredis.dbsize());
+ return jredis.dbsize();
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -94,9 +94,9 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer del(byte[]... keys) {
+ public Long del(byte[]... keys) {
try {
- return Integer.valueOf((int) jredis.del(JredisUtils.convertMultiple(charset, keys)));
+ return jredis.del(JredisUtils.convertMultiple(charset, keys));
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -126,9 +126,9 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Boolean expire(byte[] key, int seconds) {
+ public Boolean expire(byte[] key, long seconds) {
try {
- return jredis.expire(JredisUtils.convert(charset, key), seconds);
+ return jredis.expire(JredisUtils.convert(charset, key), (int) seconds);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -195,9 +195,9 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer ttl(byte[] key) {
+ public Long ttl(byte[] key) {
try {
- return Integer.valueOf((int) jredis.ttl(JredisUtils.convert(charset, key)));
+ return jredis.ttl(JredisUtils.convert(charset, key));
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -254,9 +254,9 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer append(byte[] key, byte[] value) {
+ public Long append(byte[] key, byte[] value) {
try {
- return Integer.valueOf((int) jredis.append(JredisUtils.convert(charset, key), value));
+ return jredis.append(JredisUtils.convert(charset, key), value);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -290,7 +290,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public void setEx(byte[] key, int seconds, byte[] value) {
+ public void setEx(byte[] key, long seconds, byte[] value) {
throw new UnsupportedOperationException();
}
@@ -304,7 +304,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public byte[] substr(byte[] key, int start, int end) {
+ public byte[] substr(byte[] key, long start, long end) {
try {
return jredis.substr(JredisUtils.convert(charset, key), (long) start, (long) end);
} catch (RedisException ex) {
@@ -313,36 +313,36 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer decr(byte[] key) {
+ public Long decr(byte[] key) {
try {
- return (int) jredis.decr(JredisUtils.convert(charset, key));
+ return jredis.decr(JredisUtils.convert(charset, key));
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
}
@Override
- public Integer decrBy(byte[] key, int value) {
+ public Long decrBy(byte[] key, long value) {
try {
- return (int) jredis.decrby(JredisUtils.convert(charset, key), value);
+ return jredis.decrby(JredisUtils.convert(charset, key), (int) value);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
}
@Override
- public Integer incr(byte[] key) {
+ public Long incr(byte[] key) {
try {
- return (int) jredis.incr(JredisUtils.convert(charset, key));
+ return jredis.incr(JredisUtils.convert(charset, key));
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
}
@Override
- public Integer incrBy(byte[] key, int value) {
+ public Long incrBy(byte[] key, long value) {
try {
- return (int) jredis.incrby(JredisUtils.convert(charset, key), value);
+ return jredis.incrby(JredisUtils.convert(charset, key), (int) value);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -363,7 +363,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public byte[] lIndex(byte[] key, int index) {
+ public byte[] lIndex(byte[] key, long index) {
try {
return jredis.lindex(JredisUtils.convert(charset, key), (long) index);
} catch (RedisException ex) {
@@ -372,9 +372,9 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer lLen(byte[] key) {
+ public Long lLen(byte[] key) {
try {
- return Integer.valueOf((int) jredis.llen(JredisUtils.convert(charset, key)));
+ return jredis.llen(JredisUtils.convert(charset, key));
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -390,7 +390,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer lPush(byte[] key, byte[] value) {
+ public Long lPush(byte[] key, byte[] value) {
try {
jredis.lpush(JredisUtils.convert(charset, key), value);
return null;
@@ -400,7 +400,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public List lRange(byte[] key, int start, int end) {
+ public List lRange(byte[] key, long start, long end) {
try {
List lrange = jredis.lrange(JredisUtils.convert(charset, key), start, end);
@@ -411,16 +411,16 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer lRem(byte[] key, int count, byte[] value) {
+ public Long lRem(byte[] key, long count, byte[] value) {
try {
- return Integer.valueOf((int) jredis.lrem(JredisUtils.convert(charset, key), value, count));
+ return jredis.lrem(JredisUtils.convert(charset, key), value, (int) count);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
}
@Override
- public void lSet(byte[] key, int index, byte[] value) {
+ public void lSet(byte[] key, long index, byte[] value) {
try {
jredis.lset(JredisUtils.convert(charset, key), index, value);
} catch (RedisException ex) {
@@ -429,7 +429,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public void lTrim(byte[] key, int start, int end) {
+ public void lTrim(byte[] key, long start, long end) {
try {
jredis.ltrim(JredisUtils.convert(charset, key), start, end);
} catch (RedisException ex) {
@@ -456,7 +456,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer rPush(byte[] key, byte[] value) {
+ public Long rPush(byte[] key, byte[] value) {
try {
jredis.rpush(JredisUtils.convert(charset, key), value);
return null;
@@ -479,9 +479,9 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer sCard(byte[] key) {
+ public Long sCard(byte[] key) {
try {
- return Integer.valueOf((int) jredis.scard(JredisUtils.convert(charset, key)));
+ return jredis.scard(JredisUtils.convert(charset, key));
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -630,18 +630,18 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer zCard(byte[] key) {
+ public Long zCard(byte[] key) {
try {
- return Integer.valueOf((int) jredis.zcard(JredisUtils.convert(charset, key)));
+ return jredis.zcard(JredisUtils.convert(charset, key));
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
}
@Override
- public Integer zCount(byte[] key, double min, double max) {
+ public Long zCount(byte[] key, double min, double max) {
try {
- return Integer.valueOf((int) jredis.zcount(JredisUtils.convert(charset, key), min, max));
+ return jredis.zcount(JredisUtils.convert(charset, key), min, max);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -657,17 +657,17 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
+ public Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
throw new UnsupportedOperationException();
}
@Override
- public Integer zInterStore(byte[] destKey, byte[]... sets) {
+ public Long zInterStore(byte[] destKey, byte[]... sets) {
throw new UnsupportedOperationException();
}
@Override
- public Set zRange(byte[] key, int start, int end) {
+ public Set zRange(byte[] key, long start, long end) {
try {
return new LinkedHashSet(jredis.zrange(JredisUtils.convert(charset, key), (long) start, (long) end));
} catch (RedisException ex) {
@@ -676,7 +676,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Set zRangeWithScore(byte[] key, int start, int end) {
+ public Set zRangeWithScore(byte[] key, long start, long end) {
throw new UnsupportedOperationException();
}
@@ -696,19 +696,19 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Set zRangeByScore(byte[] key, double min, double max, int offset, int count) {
+ public Set zRangeByScore(byte[] key, double min, double max, long offset, long count) {
throw new UnsupportedOperationException();
}
@Override
- public Set zRangeByScoreWithScore(byte[] key, double min, double max, int offset, int count) {
+ public Set zRangeByScoreWithScore(byte[] key, double min, double max, long offset, long count) {
throw new UnsupportedOperationException();
}
@Override
- public Integer zRank(byte[] key, byte[] value) {
+ public Long zRank(byte[] key, byte[] value) {
try {
- return Integer.valueOf((int) jredis.zrank(JredisUtils.convert(charset, key), value));
+ return jredis.zrank(JredisUtils.convert(charset, key), value);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -724,25 +724,25 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer zRemRange(byte[] key, int start, int end) {
+ public Long zRemRange(byte[] key, long start, long end) {
try {
- return Integer.valueOf((int) jredis.zremrangebyrank(JredisUtils.convert(charset, key), start, end));
+ return jredis.zremrangebyrank(JredisUtils.convert(charset, key), start, end);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
}
@Override
- public Integer zRemRangeByScore(byte[] key, double min, double max) {
+ public Long zRemRangeByScore(byte[] key, double min, double max) {
try {
- return Integer.valueOf((int) jredis.zremrangebyscore(JredisUtils.convert(charset, key), min, max));
+ return jredis.zremrangebyscore(JredisUtils.convert(charset, key), min, max);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
}
@Override
- public Set zRevRange(byte[] key, int start, int end) {
+ public Set zRevRange(byte[] key, long start, long end) {
try {
return new LinkedHashSet(jredis.zrevrange(JredisUtils.convert(charset, key), start, end));
} catch (RedisException ex) {
@@ -751,14 +751,14 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Set zRevRangeWithScore(byte[] key, int start, int end) {
+ public Set zRevRangeWithScore(byte[] key, long start, long end) {
throw new UnsupportedOperationException();
}
@Override
- public Integer zRevRank(byte[] key, byte[] value) {
+ public Long zRevRank(byte[] key, byte[] value) {
try {
- return Integer.valueOf((int) jredis.zrevrank(JredisUtils.convert(charset, key), value));
+ return jredis.zrevrank(JredisUtils.convert(charset, key), value);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
@@ -779,12 +779,12 @@ public class JredisConnection implements RedisConnection {
//
@Override
- public Integer zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
+ public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
throw new UnsupportedOperationException();
}
@Override
- public Integer zUnionStore(byte[] destKey, byte[]... sets) {
+ public Long zUnionStore(byte[] destKey, byte[]... sets) {
throw new UnsupportedOperationException();
}
@@ -825,7 +825,7 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer hIncrBy(byte[] key, byte[] field, int delta) {
+ public Long hIncrBy(byte[] key, byte[] field, long delta) {
throw new UnsupportedOperationException();
}
@@ -840,9 +840,9 @@ public class JredisConnection implements RedisConnection {
}
@Override
- public Integer hLen(byte[] key) {
+ public Long hLen(byte[] key) {
try {
- return Integer.valueOf((int) jredis.hlen(JredisUtils.convert(charset, key)));
+ return jredis.hlen(JredisUtils.convert(charset, key));
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundHashOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundHashOperations.java
index a8a54df8b..00aea0816 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundHashOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundHashOperations.java
@@ -30,7 +30,7 @@ public interface BoundHashOperations extends KeyBound {
boolean hasKey(Object key);
- Integer increment(HK key, int delta);
+ Long increment(HK key, long delta);
HV get(Object key);
@@ -44,7 +44,7 @@ public interface BoundHashOperations extends KeyBound {
Collection values();
- Integer length();
+ Long size();
void delete(Object key);
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundListOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundListOperations.java
index ebca7cc13..d28f3d1e3 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundListOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundListOperations.java
@@ -26,23 +26,23 @@ public interface BoundListOperations extends KeyBound {
RedisOperations getOperations();
- List range(int start, int end);
+ List range(long start, long end);
- void trim(int start, int end);
+ void trim(long start, long end);
- Integer length();
+ Long size();
- Integer leftPush(V value);
+ Long leftPush(V value);
- Integer rightPush(V value);
+ Long rightPush(V value);
V leftPop();
V rightPop();
- Integer remove(int i, Object value);
+ Long remove(long i, Object value);
- V index(int index);
+ V index(long index);
- void set(int index, V value);
+ void set(long index, V value);
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundSetOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundSetOperations.java
index 3a9ae4b07..337aa8232 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundSetOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundSetOperations.java
@@ -41,11 +41,11 @@ public interface BoundSetOperations extends KeyBound {
Boolean add(V value);
- boolean isMember(Object o);
+ Boolean isMember(Object o);
Set members();
- boolean remove(Object o);
+ Boolean remove(Object o);
- int size();
+ Long size();
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundValueOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundValueOperations.java
index 3af2455a4..8c64d2a56 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundValueOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundValueOperations.java
@@ -32,6 +32,6 @@ public interface BoundValueOperations extends KeyBound {
V getAndSet(V value);
- V increment(int delta);
+ V increment(long delta);
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundZSetOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundZSetOperations.java
index 8db4ba749..a5d71a9b2 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundZSetOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundZSetOperations.java
@@ -30,27 +30,27 @@ public interface BoundZSetOperations extends KeyBound {
void intersectAndStore(K destKey, K... keys);
- Set range(int start, int end);
+ Set range(long start, long end);
Set rangeByScore(double min, double max);
- Set reverseRange(int start, int end);
+ Set reverseRange(long start, long end);
- void removeRange(int start, int end);
+ void removeRange(long start, long end);
void removeRangeByScore(double min, double max);
void unionAndStore(K destKey, K... keys);
- boolean add(V value, double score);
+ Boolean add(V value, double score);
- Integer rank(Object o);
+ Long rank(Object o);
- Integer reverseRank(Object o);
+ Long reverseRank(Object o);
- boolean remove(Object o);
+ Boolean remove(Object o);
- int size();
+ Long size();
Double score(Object o);
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundHashOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundHashOperations.java
index 9d5d650b0..3b626cf88 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundHashOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundHashOperations.java
@@ -65,7 +65,7 @@ class DefaultBoundHashOperations extends DefaultKeyBound implement
}
@Override
- public Integer increment(HK key, int delta) {
+ public Long increment(HK key, long delta) {
return ops.increment(getKey(), key, delta);
}
@@ -75,7 +75,7 @@ class DefaultBoundHashOperations extends DefaultKeyBound implement
}
@Override
- public Integer length() {
+ public Long size() {
return ops.size(getKey());
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundListOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundListOperations.java
index 51c8168c4..2d8a4e4bd 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundListOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundListOperations.java
@@ -45,7 +45,7 @@ class DefaultBoundListOperations extends DefaultKeyBound implements Bou
}
@Override
- public V index(int index) {
+ public V index(long index) {
return ops.index(getKey(), index);
}
@@ -55,22 +55,22 @@ class DefaultBoundListOperations extends DefaultKeyBound implements Bou
}
@Override
- public Integer leftPush(V value) {
+ public Long leftPush(V value) {
return ops.leftPush(getKey(), value);
}
@Override
- public Integer length() {
+ public Long size() {
return ops.size(getKey());
}
@Override
- public List range(int start, int end) {
+ public List range(long start, long end) {
return ops.range(getKey(), start, end);
}
@Override
- public Integer remove(int i, Object value) {
+ public Long remove(long i, Object value) {
return ops.remove(getKey(), i, value);
}
@@ -80,17 +80,17 @@ class DefaultBoundListOperations extends DefaultKeyBound implements Bou
}
@Override
- public Integer rightPush(V value) {
+ public Long rightPush(V value) {
return ops.rightPush(getKey(), value);
}
@Override
- public void trim(int start, int end) {
+ public void trim(long start, long end) {
ops.trim(getKey(), start, end);
}
@Override
- public void set(int index, V value) {
+ public void set(long index, V value) {
ops.set(getKey(), index, value);
}
}
\ No newline at end of file
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundSetOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundSetOperations.java
index 910af3682..48358634f 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundSetOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundSetOperations.java
@@ -70,7 +70,7 @@ class DefaultBoundSetOperations extends DefaultKeyBound implements Boun
}
@Override
- public boolean isMember(Object o) {
+ public Boolean isMember(Object o) {
return ops.isMember(getKey(), o);
}
@@ -80,12 +80,12 @@ class DefaultBoundSetOperations extends DefaultKeyBound implements Boun
}
@Override
- public boolean remove(Object o) {
+ public Boolean remove(Object o) {
return ops.remove(getKey(), o);
}
@Override
- public int size() {
+ public Long size() {
return ops.size(getKey());
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundValueOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundValueOperations.java
index 2afc97e48..d5813550c 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundValueOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundValueOperations.java
@@ -46,7 +46,7 @@ class DefaultBoundValueOperations extends DefaultKeyBound implements Bo
}
@Override
- public V increment(int delta) {
+ public V increment(long delta) {
return ops.increment(getKey(), delta);
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundZSetOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundZSetOperations.java
index e0d7f9ba9..a0468dfe8 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundZSetOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundZSetOperations.java
@@ -39,7 +39,7 @@ class DefaultBoundZSetOperations extends DefaultKeyBound implements Bou
}
@Override
- public boolean add(V value, double score) {
+ public Boolean add(V value, double score) {
return ops.add(getKey(), value, score);
}
@@ -54,7 +54,7 @@ class DefaultBoundZSetOperations extends DefaultKeyBound implements Bou
}
@Override
- public Set range(int start, int end) {
+ public Set range(long start, long end) {
return ops.range(getKey(), start, end);
}
@@ -64,12 +64,12 @@ class DefaultBoundZSetOperations extends DefaultKeyBound implements Bou
}
@Override
- public Integer rank(Object o) {
+ public Long rank(Object o) {
return ops.rank(getKey(), o);
}
@Override
- public Integer reverseRank(Object o) {
+ public Long reverseRank(Object o) {
return ops.reverseRank(getKey(), o);
}
@@ -79,12 +79,12 @@ class DefaultBoundZSetOperations extends DefaultKeyBound implements Bou
}
@Override
- public boolean remove(Object o) {
+ public Boolean remove(Object o) {
return ops.remove(getKey(), o);
}
@Override
- public void removeRange(int start, int end) {
+ public void removeRange(long start, long end) {
ops.removeRange(getKey(), start, end);
}
@@ -94,12 +94,12 @@ class DefaultBoundZSetOperations extends DefaultKeyBound implements Bou
}
@Override
- public Set reverseRange(int start, int end) {
+ public Set reverseRange(long start, long end) {
return ops.reverseRange(getKey(), start, end);
}
@Override
- public int size() {
+ public Long size() {
return ops.size(getKey());
}
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperations.java
index 39407c43c..7668648a3 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperations.java
@@ -34,11 +34,11 @@ public interface HashOperations {
Collection multiGet(H key, Set hashKeys);
- Integer increment(H key, HK hashKey, int delta);
+ Long increment(H key, HK hashKey, long delta);
Set keys(H key);
- Integer size(H key);
+ Long size(H key);
void multiSet(H key, Map extends HK, ? extends HV> m);
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperations.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperations.java
index 92d3073ce..31c644940 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperations.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperations.java
@@ -24,21 +24,21 @@ import java.util.List;
*/
public interface ListOperations {
- List range(K key, int start, int end);
+ List range(K key, long start, long end);
- void trim(K key, int start, int end);
+ void trim(K key, long start, long end);
- Integer size(K key);
+ Long size(K key);
- Integer leftPush(K key, V value);
+ Long leftPush(K key, V value);
- Integer rightPush(K key, V value);
+ Long rightPush(K key, V value);
- void set(K key, int index, V value);
+ void set(K key, long index, V value);
- Integer remove(K key, int i, Object value);
+ Long remove(K key, long i, Object value);
- V index(K key, int index);
+ V index(K key, long index);
V leftPop(K key);
diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisTemplate.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisTemplate.java
index bd34d1a00..e1150bcf0 100644
--- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisTemplate.java
+++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisTemplate.java
@@ -537,12 +537,12 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public V increment(K key, final int delta) {
+ public V increment(K key, final long delta) {
final byte[] rawKey = rawKey(key);
// TODO add conversion service in here ?
- return (V) execute(new RedisCallback() {
+ return (V) execute(new RedisCallback() {
@Override
- public Integer doInRedis(RedisConnection connection) {
+ public Long doInRedis(RedisConnection connection) {
if (delta == 1) {
return connection.incr(rawKey);
}
@@ -731,7 +731,7 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public V index(K key, final int index) {
+ public V index(K key, final long index) {
return execute(new ValueDeserializingRedisCallback(key) {
@Override
protected byte[] inRedis(byte[] rawKey, RedisConnection connection) {
@@ -751,30 +751,30 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public Integer leftPush(K key, V value) {
+ public Long leftPush(K key, V value) {
final byte[] rawKey = rawKey(key);
final byte[] rawValue = rawValue(value);
- return execute(new RedisCallback() {
+ return execute(new RedisCallback() {
@Override
- public Integer doInRedis(RedisConnection connection) {
+ public Long doInRedis(RedisConnection connection) {
return connection.lPush(rawKey, rawValue);
}
}, true);
}
@Override
- public Integer size(K key) {
+ public Long size(K key) {
final byte[] rawKey = rawKey(key);
- return execute(new RedisCallback() {
+ return execute(new RedisCallback() {
@Override
- public Integer doInRedis(RedisConnection connection) {
+ public Long doInRedis(RedisConnection connection) {
return connection.lLen(rawKey);
}
}, true);
}
@Override
- public List range(K key, final int start, final int end) {
+ public List range(K key, final long start, final long end) {
final byte[] rawKey = rawKey(key);
return execute(new RedisCallback>() {
@Override
@@ -785,12 +785,12 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public Integer remove(K key, final int count, Object value) {
+ public Long remove(K key, final long count, Object value) {
final byte[] rawKey = rawKey(key);
final byte[] rawValue = rawValue(value);
- return execute(new RedisCallback() {
+ return execute(new RedisCallback() {
@Override
- public Integer doInRedis(RedisConnection connection) {
+ public Long doInRedis(RedisConnection connection) {
return connection.lRem(rawKey, count, rawValue);
}
}, true);
@@ -807,19 +807,19 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public Integer rightPush(K key, V value) {
+ public Long rightPush(K key, V value) {
final byte[] rawKey = rawKey(key);
final byte[] rawValue = rawValue(value);
- return execute(new RedisCallback() {
+ return execute(new RedisCallback() {
@Override
- public Integer doInRedis(RedisConnection connection) {
+ public Long doInRedis(RedisConnection connection) {
return connection.rPush(rawKey, rawValue);
}
}, true);
}
@Override
- public void set(K key, final int index, V value) {
+ public void set(K key, final long index, V value) {
final byte[] rawValue = rawValue(value);
execute(new ValueDeserializingRedisCallback(key) {
@Override
@@ -831,7 +831,7 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public void trim(K key, final int start, final int end) {
+ public void trim(K key, final long start, final long end) {
execute(new ValueDeserializingRedisCallback(key) {
@Override
protected byte[] inRedis(byte[] rawKey, RedisConnection connection) {
@@ -943,7 +943,7 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public boolean isMember(K key, Object o) {
+ public Boolean isMember(K key, Object o) {
final byte[] rawKey = rawKey(key);
final byte[] rawValue = rawValue(o);
return execute(new RedisCallback() {
@@ -968,7 +968,7 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public boolean remove(K key, Object o) {
+ public Boolean remove(K key, Object o) {
final byte[] rawKey = rawKey(key);
final byte[] rawValue = rawValue(o);
return execute(new RedisCallback() {
@@ -980,11 +980,11 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public int size(K key) {
+ public Long size(K key) {
final byte[] rawKey = rawKey(key);
- return execute(new RedisCallback() {
+ return execute(new RedisCallback() {
@Override
- public Integer doInRedis(RedisConnection connection) {
+ public Long doInRedis(RedisConnection connection) {
return connection.sCard(rawKey);
}
}, true);
@@ -1034,7 +1034,7 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
private class DefaultZSetOperations implements ZSetOperations {
@Override
- public boolean add(final K key, final V value, final double score) {
+ public Boolean add(final K key, final V value, final double score) {
final byte[] rawKey = rawKey(key);
final byte[] rawValue = rawValue(value);
@@ -1065,7 +1065,7 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public Set range(K key, final int start, final int end) {
+ public Set range(K key, final long start, final long end) {
final byte[] rawKey = rawKey(key);
Set rawValues = execute(new RedisCallback>() {
@@ -1093,33 +1093,33 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public Integer rank(K key, Object o) {
+ public Long rank(K key, Object o) {
final byte[] rawKey = rawKey(key);
final byte[] rawValue = rawValue(o);
- return execute(new RedisCallback() {
+ return execute(new RedisCallback() {
@Override
- public Integer doInRedis(RedisConnection connection) {
+ public Long doInRedis(RedisConnection connection) {
return connection.zRank(rawKey, rawValue);
}
}, true);
}
@Override
- public Integer reverseRank(K key, Object o) {
+ public Long reverseRank(K key, Object o) {
final byte[] rawKey = rawKey(key);
final byte[] rawValue = rawValue(o);
- return execute(new RedisCallback() {
+ return execute(new RedisCallback() {
@Override
- public Integer doInRedis(RedisConnection connection) {
+ public Long doInRedis(RedisConnection connection) {
return connection.zRevRank(rawKey, rawValue);
}
}, true);
}
@Override
- public boolean remove(K key, Object o) {
+ public Boolean remove(K key, Object o) {
final byte[] rawKey = rawKey(key);
final byte[] rawValue = rawValue(o);
@@ -1132,7 +1132,7 @@ public class RedisTemplate extends RedisAccessor implements RedisOperation
}
@Override
- public void removeRange(K key, final int start, final int end) {
+ public void removeRange(K key, final long start, final long end) {
final byte[] rawKey = rawKey(key);
execute(new RedisCallback