make set *store ops to return the resulting set size
DATAREDIS-86
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -39,15 +39,15 @@ public interface RedisSetCommands {
|
||||
|
||||
Set<byte[]> sInter(byte[]... keys);
|
||||
|
||||
void sInterStore(byte[] destKey, byte[]... keys);
|
||||
Long sInterStore(byte[] destKey, byte[]... keys);
|
||||
|
||||
Set<byte[]> sUnion(byte[]... keys);
|
||||
|
||||
void sUnionStore(byte[] destKey, byte[]... keys);
|
||||
Long sUnionStore(byte[] destKey, byte[]... keys);
|
||||
|
||||
Set<byte[]> sDiff(byte[]... keys);
|
||||
|
||||
void sDiffStore(byte[] destKey, byte[]... keys);
|
||||
Long sDiffStore(byte[] destKey, byte[]... keys);
|
||||
|
||||
Set<byte[]> sMembers(byte[] key);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user