diff --git a/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java index 191b87cfc..97012ddaa 100644 --- a/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java @@ -372,8 +372,8 @@ public class DefaultStringRedisConnection implements StringRedisConnection { return delegate.sDiff(keys); } - public void sDiffStore(byte[] destKey, byte[]... keys) { - delegate.sDiffStore(destKey, keys); + public Long sDiffStore(byte[] destKey, byte[]... keys) { + return delegate.sDiffStore(destKey, keys); } public void select(int dbIndex) { @@ -412,8 +412,8 @@ public class DefaultStringRedisConnection implements StringRedisConnection { return delegate.sInter(keys); } - public void sInterStore(byte[] destKey, byte[]... keys) { - delegate.sInterStore(destKey, keys); + public Long sInterStore(byte[] destKey, byte[]... keys) { + return delegate.sInterStore(destKey, keys); } public Boolean sIsMember(byte[] key, byte[] value) { @@ -460,8 +460,8 @@ public class DefaultStringRedisConnection implements StringRedisConnection { return delegate.sUnion(keys); } - public void sUnionStore(byte[] destKey, byte[]... keys) { - delegate.sUnionStore(destKey, keys); + public Long sUnionStore(byte[] destKey, byte[]... keys) { + return delegate.sUnionStore(destKey, keys); } public Long ttl(byte[] key) { diff --git a/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java index f3ec271ef..3c07ae99b 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java @@ -39,15 +39,15 @@ public interface RedisSetCommands { Set sInter(byte[]... keys); - void sInterStore(byte[] destKey, byte[]... keys); + Long sInterStore(byte[] destKey, byte[]... keys); Set sUnion(byte[]... keys); - void sUnionStore(byte[] destKey, byte[]... keys); + Long sUnionStore(byte[] destKey, byte[]... keys); Set sDiff(byte[]... keys); - void sDiffStore(byte[] destKey, byte[]... keys); + Long sDiffStore(byte[] destKey, byte[]... keys); Set sMembers(byte[] key); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java index 7899ab558..bd764940b 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java @@ -1423,17 +1423,17 @@ public class JedisConnection implements RedisConnection { } - public void sDiffStore(byte[] destKey, byte[]... keys) { + public Long sDiffStore(byte[] destKey, byte[]... keys) { try { if (isQueueing()) { transaction.sdiffstore(destKey, keys); - return; + return null; } if (isPipelined()) { pipeline.sdiffstore(destKey, keys); - return; + return null; } - jedis.sdiffstore(destKey, keys); + return jedis.sdiffstore(destKey, keys); } catch (Exception ex) { throw convertJedisAccessException(ex); } @@ -1457,17 +1457,17 @@ public class JedisConnection implements RedisConnection { } - public void sInterStore(byte[] destKey, byte[]... keys) { + public Long sInterStore(byte[] destKey, byte[]... keys) { try { if (isQueueing()) { transaction.sinterstore(destKey, keys); - return; + return null; } if (isPipelined()) { pipeline.sinterstore(destKey, keys); - return; + return null; } - jedis.sinterstore(destKey, keys); + return jedis.sinterstore(destKey, keys); } catch (Exception ex) { throw convertJedisAccessException(ex); } @@ -1593,17 +1593,17 @@ public class JedisConnection implements RedisConnection { } - public void sUnionStore(byte[] destKey, byte[]... keys) { + public Long sUnionStore(byte[] destKey, byte[]... keys) { try { if (isQueueing()) { transaction.sunionstore(destKey, keys); - return; + return null; } if (isPipelined()) { pipeline.sunionstore(destKey, keys); - return; + return null; } - jedis.sunionstore(destKey, keys); + return jedis.sunionstore(destKey, keys); } catch (Exception ex) { throw convertJedisAccessException(ex); } diff --git a/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java b/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java index e7d4a3a92..2ea1d5556 100644 --- a/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java @@ -710,12 +710,13 @@ public class JredisConnection implements RedisConnection { } - public void sDiffStore(byte[] destKey, byte[]... keys) { + public Long sDiffStore(byte[] destKey, byte[]... keys) { String destSet = JredisUtils.decode(destKey); String[] sets = JredisUtils.decodeMultiple(keys); try { jredis.sdiffstore(destSet, sets); + return Long.valueOf(-1); } catch (Exception ex) { throw convertJredisAccessException(ex); } @@ -735,12 +736,13 @@ public class JredisConnection implements RedisConnection { } - public void sInterStore(byte[] destKey, byte[]... keys) { + public Long sInterStore(byte[] destKey, byte[]... keys) { String destSet = JredisUtils.decode(destKey); String[] sets = JredisUtils.decodeMultiple(keys); try { jredis.sinterstore(destSet, sets); + return Long.valueOf(-1); } catch (Exception ex) { throw convertJredisAccessException(ex); } @@ -813,12 +815,13 @@ public class JredisConnection implements RedisConnection { } - public void sUnionStore(byte[] destKey, byte[]... keys) { + public Long sUnionStore(byte[] destKey, byte[]... keys) { String destSet = JredisUtils.decode(destKey); String[] sets = JredisUtils.decodeMultiple(keys); try { jredis.sunionstore(destSet, sets); + return Long.valueOf(-1); } catch (Exception ex) { throw convertJredisAccessException(ex); } diff --git a/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java b/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java index 19c7a6fc6..67a3b5801 100644 --- a/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java @@ -1254,7 +1254,7 @@ public class RjcConnection implements RedisConnection { } - public void sDiffStore(byte[] destKey, byte[]... keys) { + public Long sDiffStore(byte[] destKey, byte[]... keys) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -1262,9 +1262,9 @@ public class RjcConnection implements RedisConnection { if (isPipelined()) { pipeline.sdiffstore(stringKey, stringKeys); - return; + return null; } - session.sdiffstore(stringKey, stringKeys); + return session.sdiffstore(stringKey, stringKeys); } catch (Exception ex) { throw convertRjcAccessException(ex); } @@ -1286,16 +1286,16 @@ public class RjcConnection implements RedisConnection { } - public void sInterStore(byte[] destKey, byte[]... keys) { + public Long sInterStore(byte[] destKey, byte[]... keys) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(keys); try { if (isPipelined()) { pipeline.sinterstore(stringKey, stringKeys); - return; + return null; } - session.sinterstore(stringKey, stringKeys); + return session.sinterstore(stringKey, stringKeys); } catch (Exception ex) { throw convertRjcAccessException(ex); } @@ -1415,7 +1415,7 @@ public class RjcConnection implements RedisConnection { } - public void sUnionStore(byte[] destKey, byte[]... keys) { + public Long sUnionStore(byte[] destKey, byte[]... keys) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -1423,9 +1423,9 @@ public class RjcConnection implements RedisConnection { if (isPipelined()) { pipeline.sunionstore(stringKey, stringKeys); - return; + return null; } - session.sunionstore(stringKey, stringKeys); + return session.sunionstore(stringKey, stringKeys); } catch (Exception ex) { throw convertRjcAccessException(ex); }