diff --git a/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java index 5cf540faa..bb20ff4ad 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java @@ -60,19 +60,18 @@ class DefaultZSetOperations extends AbstractOperations implements ZS } - public void intersectAndStore(K key, K otherKey, K destKey) { - intersectAndStore(key, Collections.singleton(otherKey), destKey); + public Long intersectAndStore(K key, K otherKey, K destKey) { + return intersectAndStore(key, Collections.singleton(otherKey), destKey); } - public void intersectAndStore(K key, Collection otherKeys, K destKey) { + public Long intersectAndStore(K key, Collection otherKeys, K destKey) { final byte[][] rawKeys = rawKeys(key, otherKeys); final byte[] rawDestKey = rawKey(destKey); - execute(new RedisCallback() { + return execute(new RedisCallback() { - public Object doInRedis(RedisConnection connection) { - connection.zInterStore(rawDestKey, rawKeys); - return null; + public Long doInRedis(RedisConnection connection) { + return connection.zInterStore(rawDestKey, rawKeys); } }, true); } @@ -294,19 +293,18 @@ class DefaultZSetOperations extends AbstractOperations implements ZS } - public void unionAndStore(K key, K otherKey, K destKey) { - unionAndStore(key, Collections.singleton(otherKey), destKey); + public Long unionAndStore(K key, K otherKey, K destKey) { + return unionAndStore(key, Collections.singleton(otherKey), destKey); } - public void unionAndStore(K key, Collection otherKeys, K destKey) { + public Long unionAndStore(K key, Collection otherKeys, K destKey) { final byte[][] rawKeys = rawKeys(key, otherKeys); final byte[] rawDestKey = rawKey(destKey); - execute(new RedisCallback() { + return execute(new RedisCallback() { - public Object doInRedis(RedisConnection connection) { - connection.zUnionStore(rawDestKey, rawKeys); - return null; + public Long doInRedis(RedisConnection connection) { + return connection.zUnionStore(rawDestKey, rawKeys); } }, true); } diff --git a/src/main/java/org/springframework/data/redis/core/ZSetOperations.java b/src/main/java/org/springframework/data/redis/core/ZSetOperations.java index 54a363d1e..42ef3aa45 100644 --- a/src/main/java/org/springframework/data/redis/core/ZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/ZSetOperations.java @@ -35,13 +35,13 @@ public interface ZSetOperations { Double getScore(); } - void intersectAndStore(K key, K otherKey, K destKey); + Long intersectAndStore(K key, K otherKey, K destKey); - void intersectAndStore(K key, Collection otherKeys, K destKey); + Long intersectAndStore(K key, Collection otherKeys, K destKey); - void unionAndStore(K key, K otherKey, K destKey); + Long unionAndStore(K key, K otherKey, K destKey); - void unionAndStore(K key, Collection otherKeys, K destKey); + Long unionAndStore(K key, Collection otherKeys, K destKey); Set range(K key, long start, long end);