removed @Override annotations that cause problems in JDK 5 on interface methods
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.springframework.data.keyvalue.redis.config;
|
||||
|
||||
import org.springframework.beans.factory.xml.NamespaceHandler;
|
||||
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
|
||||
|
||||
/**
|
||||
@@ -25,7 +24,6 @@ import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
|
||||
*/
|
||||
class RedisNamespaceHandler extends NamespaceHandlerSupport {
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
registerBeanDefinitionParser("listener-container", new RedisListenerContainerParser());
|
||||
}
|
||||
|
||||
@@ -32,12 +32,10 @@ public class DefaultMessage implements Message {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getChannel() {
|
||||
return (channel != null ? channel.clone() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getBody() {
|
||||
return (body != null ? body.clone() : null);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ public class DefaultSortParameters implements SortParameters {
|
||||
setGetPattern(getPattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getByPattern() {
|
||||
return byPattern;
|
||||
}
|
||||
@@ -77,7 +76,6 @@ public class DefaultSortParameters implements SortParameters {
|
||||
this.byPattern = byPattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Range getLimit() {
|
||||
return limit;
|
||||
}
|
||||
@@ -86,7 +84,6 @@ public class DefaultSortParameters implements SortParameters {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[][] getGetPattern() {
|
||||
return getPattern.toArray(new byte[getPattern.size()][]);
|
||||
}
|
||||
@@ -103,7 +100,6 @@ public class DefaultSortParameters implements SortParameters {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order getOrder() {
|
||||
return order;
|
||||
}
|
||||
@@ -112,7 +108,6 @@ public class DefaultSortParameters implements SortParameters {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isAlphabetic() {
|
||||
return alphabetic;
|
||||
}
|
||||
|
||||
@@ -621,518 +621,415 @@ public class DefaultStringRedisConnection implements StringRedisConnection {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long append(String key, String value) {
|
||||
return delegate.append(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> bLPop(int timeout, String... keys) {
|
||||
return deserialize(delegate.bLPop(timeout, serializeMulti(keys)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> bRPop(int timeout, String... keys) {
|
||||
return deserialize(delegate.bRPop(timeout, serializeMulti(keys)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String bRPopLPush(int timeout, String srcKey, String dstKey) {
|
||||
return deserialize(delegate.bRPopLPush(timeout, serialize(srcKey), serialize(dstKey)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long decr(String key) {
|
||||
return delegate.decr(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long decrBy(String key, long value) {
|
||||
return delegate.decrBy(serialize(key), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long del(String... keys) {
|
||||
return delegate.del(serializeMulti(keys));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String echo(String message) {
|
||||
return deserialize(delegate.echo(serialize(message)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean exists(String key) {
|
||||
return delegate.exists(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(String key, long seconds) {
|
||||
return delegate.expire(serialize(key), seconds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(String key, long unixTime) {
|
||||
return delegate.expireAt(serialize(key), unixTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(String key) {
|
||||
return deserialize(delegate.get(serialize(key)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getBit(String key, long offset) {
|
||||
return delegate.getBit(serialize(key), offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRange(String key, long start, long end) {
|
||||
return deserialize(delegate.getRange(serialize(key), start, end));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSet(String key, String value) {
|
||||
return deserialize(delegate.getSet(serialize(key), serialize(value)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hDel(String key, String field) {
|
||||
return delegate.hDel(serialize(key), serialize(field));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hExists(String key, String field) {
|
||||
return delegate.hExists(serialize(key), serialize(field));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String hGet(String key, String field) {
|
||||
return deserialize(delegate.hGet(serialize(key), serialize(field)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> hGetAll(String key) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long hIncrBy(String key, String field, long delta) {
|
||||
return delegate.hIncrBy(serialize(key), serialize(field), delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> hKeys(String key) {
|
||||
return deserialize(delegate.hKeys(serialize(key)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long hLen(String key) {
|
||||
return delegate.hLen(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> hMGet(String key, String... fields) {
|
||||
return deserialize(delegate.hMGet(serialize(key), serializeMulti(fields)));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void hMSet(String key, Map<String, String> hashes) {
|
||||
delegate.hMSet(serialize(key), serialize(hashes));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hSet(String key, String field, String value) {
|
||||
return delegate.hSet(serialize(key), serialize(field), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hSetNX(String key, String field, String value) {
|
||||
return delegate.hSetNX(serialize(key), serialize(field), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> hVals(String key) {
|
||||
return deserialize(delegate.hVals(serialize(key)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long incr(String key) {
|
||||
return delegate.incr(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long incrBy(String key, long value) {
|
||||
return delegate.incrBy(serialize(key), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> keys(String pattern) {
|
||||
return deserialize(delegate.keys(serialize(pattern)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String lIndex(String key, long index) {
|
||||
return deserialize(delegate.lIndex(serialize(key), index));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lInsert(String key, Position where, String pivot, String value) {
|
||||
return delegate.lInsert(serialize(key), where, serialize(pivot), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lLen(String key) {
|
||||
return delegate.lLen(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String lPop(String key) {
|
||||
return deserialize(delegate.lPop(serialize(key)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lPush(String key, String value) {
|
||||
return delegate.lPush(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lPushX(String key, String value) {
|
||||
return delegate.lPushX(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> lRange(String key, long start, long end) {
|
||||
return deserialize(delegate.lRange(serialize(key), start, end));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lRem(String key, long count, String value) {
|
||||
return delegate.lRem(serialize(key), count, serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lSet(String key, long index, String value) {
|
||||
delegate.lSet(serialize(key), index, serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lTrim(String key, long start, long end) {
|
||||
delegate.lTrim(serialize(key), start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> mGet(String... keys) {
|
||||
return deserialize(delegate.mGet(serializeMulti(keys)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mSetNXString(Map<String, String> tuple) {
|
||||
delegate.mSetNX(serialize(tuple));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mSetString(Map<String, String> tuple) {
|
||||
delegate.mSet(serialize(tuple));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist(String key) {
|
||||
return delegate.persist(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean move(String key, int dbIndex) {
|
||||
return delegate.move(serialize(key), dbIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pSubscribe(MessageListener listener, String... patterns) {
|
||||
delegate.pSubscribe(listener, serializeMulti(patterns));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long publish(String channel, String message) {
|
||||
return delegate.publish(serialize(channel), serialize(message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(String oldName, String newName) {
|
||||
delegate.rename(serialize(oldName), serialize(newName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean renameNX(String oldName, String newName) {
|
||||
return delegate.renameNX(serialize(oldName), serialize(newName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String rPop(String key) {
|
||||
return deserialize(delegate.rPop(serialize(key)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String rPopLPush(String srcKey, String dstKey) {
|
||||
return deserialize(delegate.rPopLPush(serialize(srcKey), serialize(dstKey)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPush(String key, String value) {
|
||||
return delegate.rPush(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPushX(String key, String value) {
|
||||
return delegate.rPushX(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sAdd(String key, String value) {
|
||||
return delegate.sAdd(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sCard(String key) {
|
||||
return delegate.sCard(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> sDiff(String... keys) {
|
||||
return deserialize(delegate.sDiff(serializeMulti(keys)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sDiffStore(String destKey, String... keys) {
|
||||
delegate.sDiffStore(serialize(destKey), serializeMulti(keys));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(String key, String value) {
|
||||
delegate.set(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBit(String key, long offset, boolean value) {
|
||||
delegate.setBit(serialize(key), offset, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEx(String key, long seconds, String value) {
|
||||
delegate.setEx(serialize(key), seconds, serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean setNX(String key, String value) {
|
||||
return delegate.setNX(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRange(String key, String value, long start) {
|
||||
delegate.setRange(serialize(key), serialize(value), start);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> sInter(String... keys) {
|
||||
return deserialize(delegate.sInter(serializeMulti(keys)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sInterStore(String destKey, String... keys) {
|
||||
delegate.sInterStore(serialize(destKey), serializeMulti(keys));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sIsMember(String key, String value) {
|
||||
return delegate.sIsMember(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> sMembers(String key) {
|
||||
return deserialize(delegate.sMembers(serialize(key)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sMove(String srcKey, String destKey, String value) {
|
||||
return delegate.sMove(serialize(srcKey), serialize(destKey), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sort(String key, SortParameters params, String storeKey) {
|
||||
return delegate.sort(serialize(key), params, serialize(storeKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> sort(String key, SortParameters params) {
|
||||
return deserialize(delegate.sort(serialize(key), params));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sPop(String key) {
|
||||
return deserialize(delegate.sPop(serialize(key)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sRandMember(String key) {
|
||||
return deserialize(delegate.sRandMember(serialize(key)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sRem(String key, String value) {
|
||||
return delegate.sRem(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long strLen(String key) {
|
||||
return delegate.strLen(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscribe(MessageListener listener, String... channels) {
|
||||
delegate.subscribe(listener, serializeMulti(channels));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> sUnion(String... keys) {
|
||||
return deserialize(delegate.sUnion(serializeMulti(keys)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sUnionStore(String destKey, String... keys) {
|
||||
delegate.sUnionStore(serialize(destKey), serializeMulti(keys));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long ttl(String key) {
|
||||
return delegate.ttl(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType type(String key) {
|
||||
return delegate.type(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean zAdd(String key, double score, String value) {
|
||||
return delegate.zAdd(serialize(key), score, serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zCard(String key) {
|
||||
return delegate.zCard(serialize(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zCount(String key, double min, double max) {
|
||||
return delegate.zCount(serialize(key), min, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double zIncrBy(String key, double increment, String value) {
|
||||
return delegate.zIncrBy(serialize(key), increment, serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zInterStore(String destKey, Aggregate aggregate, int[] weights, String... sets) {
|
||||
return delegate.zInterStore(serialize(destKey), aggregate, weights, serializeMulti(sets));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zInterStore(String destKey, String... sets) {
|
||||
return delegate.zInterStore(serialize(destKey), serializeMulti(sets));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> zRange(String key, long start, long end) {
|
||||
return deserialize(delegate.zRange(serialize(key), start, end));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> zRangeByScore(String key, double min, double max, long offset, long count) {
|
||||
return deserialize(delegate.zRangeByScore(serialize(key), min, max, offset, count));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> zRangeByScore(String key, double min, double max) {
|
||||
return deserialize(delegate.zRangeByScore(serialize(key), min, max));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<StringTuple> zRangeByScoreWithScore(String key, double min, double max, long offset, long count) {
|
||||
return deserializeTuple(delegate.zRangeByScoreWithScore(serialize(key), min, max, offset, count));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<StringTuple> zRangeByScoreWithScore(String key, double min, double max) {
|
||||
return deserializeTuple(delegate.zRangeByScoreWithScore(serialize(key), min, max));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<StringTuple> zRangeWithScore(String key, long start, long end) {
|
||||
return deserializeTuple(delegate.zRangeWithScore(serialize(key), start, end));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRank(String key, String value) {
|
||||
return delegate.zRank(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean zRem(String key, String value) {
|
||||
return delegate.zRem(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRemRange(String key, long start, long end) {
|
||||
return delegate.zRemRange(serialize(key), start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRemRangeByScore(String key, double min, double max) {
|
||||
return delegate.zRemRangeByScore(serialize(key), min, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> zRevRange(String key, long start, long end) {
|
||||
return deserialize(delegate.zRevRange(serialize(key), start, end));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<StringTuple> zRevRangeWithScore(String key, long start, long end) {
|
||||
return deserializeTuple(delegate.zRevRangeWithScore(serialize(key), start, end));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRevRank(String key, String value) {
|
||||
return delegate.zRevRank(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double zScore(String key, String value) {
|
||||
return delegate.zScore(serialize(key), serialize(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zUnionStore(String destKey, Aggregate aggregate, int[] weights, String... sets) {
|
||||
return delegate.zUnionStore(serialize(destKey), aggregate, weights, serializeMulti(sets));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zUnionStore(String destKey, String... sets) {
|
||||
return delegate.zUnionStore(serialize(destKey), serializeMulti(sets));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> closePipeline() {
|
||||
return delegate.closePipeline();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPipelined() {
|
||||
return delegate.isPipelined();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openPipeline() {
|
||||
delegate.openPipeline();
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ public class DefaultStringTuple extends DefaultTuple implements StringTuple {
|
||||
this.valueAsString = valueAsString;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValueAsString() {
|
||||
return valueAsString;
|
||||
}
|
||||
|
||||
@@ -39,12 +39,10 @@ public class DefaultTuple implements Tuple {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,6 @@ public class JedisConnection implements RedisConnection {
|
||||
return new UncategorizedKeyvalueStoreException("Unknown jedis exception", ex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws DataAccessException {
|
||||
// return the connection to the pool
|
||||
try {
|
||||
@@ -154,12 +153,10 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Jedis getNativeConnection() {
|
||||
return jedis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed() {
|
||||
try {
|
||||
return !jedis.isConnected();
|
||||
@@ -168,17 +165,14 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isQueueing() {
|
||||
return client.isInMulti();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPipelined() {
|
||||
return (pipeline != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openPipeline() {
|
||||
if (pipeline == null) {
|
||||
pipeline = jedis.pipelined();
|
||||
@@ -186,7 +180,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<Object> closePipeline() {
|
||||
if (pipeline != null) {
|
||||
List execute = pipeline.execute();
|
||||
@@ -197,7 +190,6 @@ public class JedisConnection implements RedisConnection {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> sort(byte[] key, SortParameters params) {
|
||||
|
||||
SortingParams sortParams = JedisUtils.convertSortParams(params);
|
||||
@@ -229,7 +221,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sort(byte[] key, SortParameters params, byte[] sortKey) {
|
||||
|
||||
SortingParams sortParams = JedisUtils.convertSortParams(params);
|
||||
@@ -261,7 +252,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long dbSize() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -278,7 +268,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void flushDb() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -294,7 +283,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flushAll() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -310,7 +298,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bgSave() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -326,7 +313,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bgWriteAof() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -342,7 +328,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -358,7 +343,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getConfig(String param) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -374,7 +358,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Properties info() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -389,7 +372,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lastSave() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -405,7 +387,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfig(String param, String value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -422,7 +403,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void resetConfigStats() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -438,7 +418,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -453,7 +432,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] echo(byte[] message) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -469,7 +447,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String ping() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -485,7 +462,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long del(byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -502,7 +478,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void discard() {
|
||||
try {
|
||||
client.discard();
|
||||
@@ -511,7 +486,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> exec() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -524,7 +498,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean exists(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -541,7 +514,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(byte[] key, long seconds) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -558,7 +530,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(byte[] key, long unixTime) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -575,7 +546,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> keys(byte[] pattern) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -592,7 +562,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multi() {
|
||||
if (isQueueing()) {
|
||||
return;
|
||||
@@ -608,7 +577,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -625,7 +593,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean move(byte[] key, int dbIndex) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -642,7 +609,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] randomKey() {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -658,7 +624,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(byte[] oldName, byte[] newName) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -675,7 +640,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean renameNX(byte[] oldName, byte[] newName) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -692,7 +656,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void select(int dbIndex) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -708,7 +671,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long ttl(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -725,7 +687,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType type(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -742,7 +703,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unwatch() {
|
||||
try {
|
||||
jedis.unwatch();
|
||||
@@ -751,7 +711,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(byte[]... keys) {
|
||||
if (isQueueing()) {
|
||||
// ignore (as watch not allowed in multi)
|
||||
@@ -775,7 +734,6 @@ public class JedisConnection implements RedisConnection {
|
||||
// String commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public byte[] get(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -793,7 +751,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -811,7 +768,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public byte[] getSet(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -828,7 +784,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long append(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -845,7 +800,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> mGet(byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -862,7 +816,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mSet(Map<byte[], byte[]> tuples) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -879,7 +832,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mSetNX(Map<byte[], byte[]> tuples) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -896,7 +848,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEx(byte[] key, long time, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -913,7 +864,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean setNX(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -930,7 +880,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -947,7 +896,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long decr(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -964,7 +912,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long decrBy(byte[] key, long value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -981,7 +928,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long incr(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -998,7 +944,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long incrBy(byte[] key, long value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1015,7 +960,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getBit(byte[] key, long offset) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1032,7 +976,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBit(byte[] key, long offset, boolean value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1049,12 +992,10 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRange(byte[] key, byte[] value, long start) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long strLen(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1074,7 +1015,6 @@ public class JedisConnection implements RedisConnection {
|
||||
// List commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Long lPush(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1091,7 +1031,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPush(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1108,7 +1047,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> bLPop(int timeout, byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1129,7 +1067,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> bRPop(int timeout, byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1150,7 +1087,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] lIndex(byte[] key, long index) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1167,7 +1103,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1185,7 +1120,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lLen(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1202,7 +1136,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] lPop(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1219,7 +1152,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> lRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1236,7 +1168,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lRem(byte[] key, long count, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1253,7 +1184,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lSet(byte[] key, long index, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1270,7 +1200,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lTrim(byte[] key, long start, long end) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1287,7 +1216,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] rPop(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1304,7 +1232,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1321,7 +1248,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1337,7 +1263,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lPushX(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1353,7 +1278,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPushX(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1374,7 +1298,6 @@ public class JedisConnection implements RedisConnection {
|
||||
// Set commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Boolean sAdd(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1391,7 +1314,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sCard(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1408,7 +1330,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sDiff(byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1425,7 +1346,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sDiffStore(byte[] destKey, byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1442,7 +1362,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sInter(byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1459,7 +1378,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sInterStore(byte[] destKey, byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1476,7 +1394,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sIsMember(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1493,7 +1410,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sMembers(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1510,7 +1426,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1527,7 +1442,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] sPop(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1544,7 +1458,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] sRandMember(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1561,7 +1474,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sRem(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1578,7 +1490,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sUnion(byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1595,7 +1506,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sUnionStore(byte[] destKey, byte[]... keys) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1616,7 +1526,6 @@ public class JedisConnection implements RedisConnection {
|
||||
// ZSet commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Boolean zAdd(byte[] key, double score, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1633,7 +1542,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zCard(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1650,7 +1558,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zCount(byte[] key, double min, double max) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1666,7 +1573,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double zIncrBy(byte[] key, double increment, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1683,7 +1589,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1701,7 +1606,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zInterStore(byte[] destKey, byte[]... sets) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1717,7 +1621,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1734,7 +1637,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRangeWithScore(byte[] key, long start, long end) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1751,7 +1653,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRangeByScore(byte[] key, double min, double max) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1767,7 +1668,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRangeByScoreWithScore(byte[] key, double min, double max) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1783,7 +1683,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRevRangeWithScore(byte[] key, long start, long end) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1799,7 +1698,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRangeByScore(byte[] key, double min, double max, long offset, long count) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1815,7 +1713,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRangeByScoreWithScore(byte[] key, double min, double max, long offset, long count) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1831,7 +1728,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRank(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1848,7 +1744,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean zRem(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1865,7 +1760,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRemRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1881,7 +1775,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRemRangeByScore(byte[] key, double min, double max) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1897,7 +1790,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRevRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1914,7 +1806,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRevRank(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1931,7 +1822,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double zScore(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1948,7 +1838,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1966,7 +1855,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zUnionStore(byte[] destKey, byte[]... sets) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1986,7 +1874,6 @@ public class JedisConnection implements RedisConnection {
|
||||
// Hash commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Boolean hSet(byte[] key, byte[] field, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2003,7 +1890,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hSetNX(byte[] key, byte[] field, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2020,7 +1906,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hDel(byte[] key, byte[] field) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2037,7 +1922,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hExists(byte[] key, byte[] field) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2054,7 +1938,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] hGet(byte[] key, byte[] field) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2071,7 +1954,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<byte[], byte[]> hGetAll(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2088,7 +1970,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long hIncrBy(byte[] key, byte[] field, long delta) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2105,7 +1986,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> hKeys(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2122,7 +2002,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long hLen(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2139,7 +2018,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> hMGet(byte[] key, byte[]... fields) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2156,7 +2034,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hMSet(byte[] key, Map<byte[], byte[]> tuple) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2173,7 +2050,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> hVals(byte[] key) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2194,7 +2070,6 @@ public class JedisConnection implements RedisConnection {
|
||||
//
|
||||
// Pub/Sub functionality
|
||||
//
|
||||
@Override
|
||||
public Long publish(byte[] channel, byte[] message) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -2209,17 +2084,14 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Subscription getSubscription() {
|
||||
return subscription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSubscribed() {
|
||||
return (subscription != null && subscription.isAlive());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pSubscribe(MessageListener listener, byte[]... patterns) {
|
||||
if (isSubscribed()) {
|
||||
throw new RedisSubscribedConnectionException(
|
||||
@@ -2244,7 +2116,6 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscribe(MessageListener listener, byte[]... channels) {
|
||||
if (isSubscribed()) {
|
||||
throw new RedisSubscribedConnectionException(
|
||||
|
||||
@@ -22,7 +22,6 @@ 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;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -150,7 +149,6 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean,
|
||||
null, dbIndex)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataAccessException translateExceptionIfPossible(RuntimeException ex) {
|
||||
return JedisUtils.convertJedisAccessException(ex);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ public class JredisConnection implements RedisConnection {
|
||||
return new UncategorizedKeyvalueStoreException("Unknown JRedis exception", ex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws RedisSystemException {
|
||||
isClosed = true;
|
||||
|
||||
@@ -89,37 +88,30 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JRedis getNativeConnection() {
|
||||
return jredis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed() {
|
||||
return isClosed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isQueueing() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPipelined() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openPipeline() {
|
||||
throw new UnsupportedOperationException("Pipelining not supported by JRedis");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> closePipeline() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> sort(byte[] key, SortParameters params) {
|
||||
Sort sort = jredis.sort(JredisUtils.decode(key));
|
||||
JredisUtils.applySortingParams(sort, params, null);
|
||||
@@ -130,7 +122,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sort(byte[] key, SortParameters params, byte[] storeKey) {
|
||||
Sort sort = jredis.sort(JredisUtils.decode(key));
|
||||
JredisUtils.applySortingParams(sort, params, null);
|
||||
@@ -141,7 +132,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long dbSize() {
|
||||
try {
|
||||
return jredis.dbsize();
|
||||
@@ -150,7 +140,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flushDb() {
|
||||
try {
|
||||
jredis.flushdb();
|
||||
@@ -159,7 +148,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flushAll() {
|
||||
try {
|
||||
jredis.flushall();
|
||||
@@ -168,7 +156,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] echo(byte[] message) {
|
||||
try {
|
||||
return jredis.echo(message);
|
||||
@@ -177,7 +164,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String ping() {
|
||||
try {
|
||||
jredis.ping();
|
||||
@@ -187,7 +173,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bgSave() {
|
||||
try {
|
||||
jredis.bgsave();
|
||||
@@ -196,7 +181,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bgWriteAof() {
|
||||
try {
|
||||
jredis.bgrewriteaof();
|
||||
@@ -205,7 +189,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
try {
|
||||
jredis.save();
|
||||
@@ -214,12 +197,10 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getConfig(String pattern) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Properties info() {
|
||||
try {
|
||||
return JredisUtils.info(jredis.info());
|
||||
@@ -228,7 +209,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lastSave() {
|
||||
try {
|
||||
return jredis.lastsave();
|
||||
@@ -237,22 +217,18 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfig(String param, String value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetConfigStats() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long del(byte[]... keys) {
|
||||
try {
|
||||
return jredis.del(JredisUtils.decodeMultiple(keys));
|
||||
@@ -261,7 +237,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void discard() {
|
||||
try {
|
||||
jredis.discard();
|
||||
@@ -270,12 +245,10 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> exec() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean exists(byte[] key) {
|
||||
try {
|
||||
return jredis.exists(JredisUtils.decode(key));
|
||||
@@ -284,7 +257,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(byte[] key, long seconds) {
|
||||
try {
|
||||
return jredis.expire(JredisUtils.decode(key), (int) seconds);
|
||||
@@ -293,7 +265,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(byte[] key, long unixTime) {
|
||||
try {
|
||||
return jredis.expireat(JredisUtils.decode(key), unixTime);
|
||||
@@ -302,7 +273,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> keys(byte[] pattern) {
|
||||
try {
|
||||
return JredisUtils.convertToSet(jredis.keys(JredisUtils.decode(pattern)));
|
||||
@@ -311,18 +281,15 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multi() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist(byte[] key) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean move(byte[] key, int dbIndex) {
|
||||
try {
|
||||
return jredis.move(JredisUtils.decode(key), dbIndex);
|
||||
@@ -331,7 +298,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] randomKey() {
|
||||
try {
|
||||
return JredisUtils.encode(jredis.randomkey());
|
||||
@@ -340,7 +306,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(byte[] oldName, byte[] newName) {
|
||||
try {
|
||||
jredis.rename(JredisUtils.decode(oldName), JredisUtils.decode(newName));
|
||||
@@ -349,7 +314,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean renameNX(byte[] oldName, byte[] newName) {
|
||||
try {
|
||||
return jredis.renamenx(JredisUtils.decode(oldName), JredisUtils.decode(newName));
|
||||
@@ -358,12 +322,10 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void select(int dbIndex) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long ttl(byte[] key) {
|
||||
try {
|
||||
return jredis.ttl(JredisUtils.decode(key));
|
||||
@@ -372,7 +334,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType type(byte[] key) {
|
||||
try {
|
||||
return JredisUtils.convertDataType(jredis.type(JredisUtils.decode(key)));
|
||||
@@ -381,12 +342,10 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unwatch() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(byte[]... keys) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -395,7 +354,6 @@ public class JredisConnection implements RedisConnection {
|
||||
// String operations
|
||||
//
|
||||
|
||||
@Override
|
||||
public byte[] get(byte[] key) {
|
||||
try {
|
||||
return jredis.get(JredisUtils.decode(key));
|
||||
@@ -404,7 +362,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(byte[] key, byte[] value) {
|
||||
try {
|
||||
jredis.set(JredisUtils.decode(key), value);
|
||||
@@ -413,7 +370,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getSet(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.getset(JredisUtils.decode(key), value);
|
||||
@@ -422,7 +378,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long append(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.append(JredisUtils.decode(key), value);
|
||||
@@ -431,7 +386,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> mGet(byte[]... keys) {
|
||||
try {
|
||||
return jredis.mget(JredisUtils.decodeMultiple(keys));
|
||||
@@ -440,7 +394,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mSet(Map<byte[], byte[]> tuple) {
|
||||
try {
|
||||
jredis.mset(JredisUtils.decodeMap(tuple));
|
||||
@@ -449,7 +402,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mSetNX(Map<byte[], byte[]> tuple) {
|
||||
try {
|
||||
jredis.msetnx(JredisUtils.decodeMap(tuple));
|
||||
@@ -458,12 +410,10 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEx(byte[] key, long seconds, byte[] value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean setNX(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.setnx(JredisUtils.decode(key), value);
|
||||
@@ -472,7 +422,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
return jredis.substr(JredisUtils.decode(key), start, end);
|
||||
@@ -481,7 +430,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long decr(byte[] key) {
|
||||
try {
|
||||
return jredis.decr(JredisUtils.decode(key));
|
||||
@@ -490,7 +438,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long decrBy(byte[] key, long value) {
|
||||
try {
|
||||
return jredis.decrby(JredisUtils.decode(key), (int) value);
|
||||
@@ -499,7 +446,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long incr(byte[] key) {
|
||||
try {
|
||||
return jredis.incr(JredisUtils.decode(key));
|
||||
@@ -508,7 +454,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long incrBy(byte[] key, long value) {
|
||||
try {
|
||||
return jredis.incrby(JredisUtils.decode(key), (int) value);
|
||||
@@ -517,22 +462,18 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getBit(byte[] key, long offset) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBit(byte[] key, long offset, boolean value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRange(byte[] key, byte[] value, long start) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long strLen(byte[] key) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -541,17 +482,14 @@ public class JredisConnection implements RedisConnection {
|
||||
// List commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public List<byte[]> bLPop(int timeout, byte[]... keys) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> bRPop(int timeout, byte[]... keys) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] lIndex(byte[] key, long index) {
|
||||
try {
|
||||
return jredis.lindex(JredisUtils.decode(key), index);
|
||||
@@ -560,7 +498,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lLen(byte[] key) {
|
||||
try {
|
||||
return jredis.llen(JredisUtils.decode(key));
|
||||
@@ -569,7 +506,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] lPop(byte[] key) {
|
||||
try {
|
||||
return jredis.lpop(JredisUtils.decode(key));
|
||||
@@ -578,7 +514,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lPush(byte[] key, byte[] value) {
|
||||
try {
|
||||
jredis.lpush(JredisUtils.decode(key), value);
|
||||
@@ -588,7 +523,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> lRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
List<byte[]> lrange = jredis.lrange(JredisUtils.decode(key), start, end);
|
||||
@@ -599,7 +533,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lRem(byte[] key, long count, byte[] value) {
|
||||
try {
|
||||
return jredis.lrem(JredisUtils.decode(key), value, (int) count);
|
||||
@@ -608,7 +541,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lSet(byte[] key, long index, byte[] value) {
|
||||
try {
|
||||
jredis.lset(JredisUtils.decode(key), index, value);
|
||||
@@ -617,7 +549,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lTrim(byte[] key, long start, long end) {
|
||||
try {
|
||||
jredis.ltrim(JredisUtils.decode(key), start, end);
|
||||
@@ -626,7 +557,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] rPop(byte[] key) {
|
||||
try {
|
||||
return jredis.rpop(JredisUtils.decode(key));
|
||||
@@ -635,7 +565,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) {
|
||||
try {
|
||||
return jredis.rpoplpush(JredisUtils.decode(srcKey), JredisUtils.decode(dstKey));
|
||||
@@ -644,7 +573,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPush(byte[] key, byte[] value) {
|
||||
try {
|
||||
jredis.rpush(JredisUtils.decode(key), value);
|
||||
@@ -654,22 +582,18 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lPushX(byte[] key, byte[] value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPushX(byte[] key, byte[] value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -679,7 +603,6 @@ public class JredisConnection implements RedisConnection {
|
||||
// Set commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Boolean sAdd(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.sadd(JredisUtils.decode(key), value);
|
||||
@@ -688,7 +611,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sCard(byte[] key) {
|
||||
try {
|
||||
return jredis.scard(JredisUtils.decode(key));
|
||||
@@ -697,7 +619,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sDiff(byte[]... keys) {
|
||||
String destKey = JredisUtils.decode(keys[0]);
|
||||
String[] sets = JredisUtils.decodeMultiple(Arrays.copyOfRange(keys, 1, keys.length));
|
||||
@@ -710,7 +631,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sDiffStore(byte[] destKey, byte[]... keys) {
|
||||
String destSet = JredisUtils.decode(destKey);
|
||||
String[] sets = JredisUtils.decodeMultiple(keys);
|
||||
@@ -722,7 +642,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sInter(byte[]... keys) {
|
||||
String set1 = JredisUtils.decode(keys[0]);
|
||||
String[] sets = JredisUtils.decodeMultiple(Arrays.copyOfRange(keys, 1, keys.length));
|
||||
@@ -735,7 +654,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sInterStore(byte[] destKey, byte[]... keys) {
|
||||
String destSet = JredisUtils.decode(destKey);
|
||||
String[] sets = JredisUtils.decodeMultiple(keys);
|
||||
@@ -747,7 +665,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sIsMember(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.sismember(JredisUtils.decode(key), value);
|
||||
@@ -756,7 +673,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sMembers(byte[] key) {
|
||||
try {
|
||||
return new LinkedHashSet<byte[]>(jredis.smembers(JredisUtils.decode(key)));
|
||||
@@ -765,7 +681,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value) {
|
||||
try {
|
||||
return jredis.smove(JredisUtils.decode(srcKey), JredisUtils.decode(destKey), value);
|
||||
@@ -774,7 +689,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] sPop(byte[] key) {
|
||||
try {
|
||||
return jredis.spop(JredisUtils.decode(key));
|
||||
@@ -783,7 +697,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] sRandMember(byte[] key) {
|
||||
try {
|
||||
return jredis.srandmember(JredisUtils.decode(key));
|
||||
@@ -792,7 +705,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sRem(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.srem(JredisUtils.decode(key), value);
|
||||
@@ -801,7 +713,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sUnion(byte[]... keys) {
|
||||
String set1 = JredisUtils.decode(keys[0]);
|
||||
String[] sets = JredisUtils.decodeMultiple(Arrays.copyOfRange(keys, 1, keys.length));
|
||||
@@ -813,7 +724,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sUnionStore(byte[] destKey, byte[]... keys) {
|
||||
String destSet = JredisUtils.decode(destKey);
|
||||
String[] sets = JredisUtils.decodeMultiple(keys);
|
||||
@@ -830,7 +740,6 @@ public class JredisConnection implements RedisConnection {
|
||||
// ZSet commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Boolean zAdd(byte[] key, double score, byte[] value) {
|
||||
try {
|
||||
return jredis.zadd(JredisUtils.decode(key), score, value);
|
||||
@@ -839,7 +748,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zCard(byte[] key) {
|
||||
try {
|
||||
return jredis.zcard(JredisUtils.decode(key));
|
||||
@@ -848,7 +756,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zCount(byte[] key, double min, double max) {
|
||||
try {
|
||||
return jredis.zcount(JredisUtils.decode(key), min, max);
|
||||
@@ -857,7 +764,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double zIncrBy(byte[] key, double increment, byte[] value) {
|
||||
try {
|
||||
return jredis.zincrby(JredisUtils.decode(key), increment, value);
|
||||
@@ -866,17 +772,14 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zInterStore(byte[] destKey, byte[]... sets) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
return new LinkedHashSet<byte[]>(jredis.zrange(JredisUtils.decode(key), start, end));
|
||||
@@ -885,13 +788,11 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRangeWithScore(byte[] key, long start, long end) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRangeByScore(byte[] key, double min, double max) {
|
||||
try {
|
||||
return new LinkedHashSet<byte[]>(jredis.zrangebyscore(JredisUtils.decode(key), min, max));
|
||||
@@ -900,22 +801,18 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRangeByScoreWithScore(byte[] key, double min, double max) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRangeByScore(byte[] key, double min, double max, long offset, long count) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRangeByScoreWithScore(byte[] key, double min, double max, long offset, long count) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRank(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.zrank(JredisUtils.decode(key), value);
|
||||
@@ -924,7 +821,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean zRem(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.zrem(JredisUtils.decode(key), value);
|
||||
@@ -933,7 +829,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRemRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
return jredis.zremrangebyrank(JredisUtils.decode(key), start, end);
|
||||
@@ -942,7 +837,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRemRangeByScore(byte[] key, double min, double max) {
|
||||
try {
|
||||
return jredis.zremrangebyscore(JredisUtils.decode(key), min, max);
|
||||
@@ -951,7 +845,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRevRange(byte[] key, long start, long end) {
|
||||
try {
|
||||
return new LinkedHashSet<byte[]>(jredis.zrevrange(JredisUtils.decode(key), start, end));
|
||||
@@ -960,12 +853,10 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRevRangeWithScore(byte[] key, long start, long end) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRevRank(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.zrevrank(JredisUtils.decode(key), value);
|
||||
@@ -974,7 +865,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double zScore(byte[] key, byte[] value) {
|
||||
try {
|
||||
return jredis.zscore(JredisUtils.decode(key), value);
|
||||
@@ -988,17 +878,14 @@ public class JredisConnection implements RedisConnection {
|
||||
// Hash commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zUnionStore(byte[] destKey, byte[]... sets) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hDel(byte[] key, byte[] field) {
|
||||
try {
|
||||
return jredis.hdel(JredisUtils.decode(key), JredisUtils.decode(field));
|
||||
@@ -1007,7 +894,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hExists(byte[] key, byte[] field) {
|
||||
try {
|
||||
return jredis.hexists(JredisUtils.decode(key), JredisUtils.decode(field));
|
||||
@@ -1016,7 +902,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] hGet(byte[] key, byte[] field) {
|
||||
try {
|
||||
return jredis.hget(JredisUtils.decode(key), JredisUtils.decode(field));
|
||||
@@ -1025,7 +910,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<byte[], byte[]> hGetAll(byte[] key) {
|
||||
try {
|
||||
return JredisUtils.encodeMap(jredis.hgetall(JredisUtils.decode(key)));
|
||||
@@ -1034,12 +918,10 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long hIncrBy(byte[] key, byte[] field, long delta) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> hKeys(byte[] key) {
|
||||
try {
|
||||
return new LinkedHashSet<byte[]>(JredisUtils.convertToSet(jredis.hkeys(JredisUtils.decode(key))));
|
||||
@@ -1048,7 +930,6 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long hLen(byte[] key) {
|
||||
try {
|
||||
return jredis.hlen(JredisUtils.decode(key));
|
||||
@@ -1057,17 +938,14 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> hMGet(byte[] key, byte[]... fields) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hMSet(byte[] key, Map<byte[], byte[]> values) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hSet(byte[] key, byte[] field, byte[] value) {
|
||||
try {
|
||||
return jredis.hset(JredisUtils.decode(key), JredisUtils.decode(field), value);
|
||||
@@ -1076,12 +954,10 @@ public class JredisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hSetNX(byte[] key, byte[] field, byte[] value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> hVals(byte[] key) {
|
||||
try {
|
||||
return jredis.hvals(JredisUtils.decode(key));
|
||||
@@ -1094,27 +970,22 @@ public class JredisConnection implements RedisConnection {
|
||||
// PubSub commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Subscription getSubscription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSubscribed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pSubscribe(MessageListener listener, byte[]... patterns) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long publish(byte[] channel, byte[] message) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscribe(MessageListener listener, byte[]... channels) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,6 @@ public class JredisConnectionFactory implements InitializingBean, DisposableBean
|
||||
this.connectionSpec = connectionSpec;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (connectionSpec == null) {
|
||||
Assert.hasText(hostName);
|
||||
@@ -95,7 +94,6 @@ public class JredisConnectionFactory implements InitializingBean, DisposableBean
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
if (usePool && pool != null) {
|
||||
pool.quit();
|
||||
@@ -104,7 +102,6 @@ public class JredisConnectionFactory implements InitializingBean, DisposableBean
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RedisConnection getConnection() {
|
||||
return postProcessConnection(new JredisConnection((usePool ? pool : new JRedisClient(connectionSpec))));
|
||||
}
|
||||
@@ -122,7 +119,6 @@ public class JredisConnectionFactory implements InitializingBean, DisposableBean
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataAccessException translateExceptionIfPossible(RuntimeException ex) {
|
||||
if (ex instanceof ClientRuntimeException) {
|
||||
return JredisUtils.convertJredisAccessException((ClientRuntimeException) ex);
|
||||
|
||||
@@ -76,7 +76,6 @@ public class RjcConnection implements RedisConnection {
|
||||
return new UncategorizedKeyvalueStoreException("Unknown rjc exception", ex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws DataAccessException {
|
||||
isClosed = true;
|
||||
|
||||
@@ -89,27 +88,22 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isClosed() {
|
||||
return isClosed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Session getNativeConnection() {
|
||||
return session;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isQueueing() {
|
||||
return client.isInMulti();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPipelined() {
|
||||
return (pipeline != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openPipeline() {
|
||||
if (pipeline == null) {
|
||||
pipeline = client;
|
||||
@@ -117,7 +111,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<Object> closePipeline() {
|
||||
if (pipeline != null) {
|
||||
List execute = client.getAll();
|
||||
@@ -128,7 +121,6 @@ public class RjcConnection implements RedisConnection {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> sort(byte[] key, SortParameters params) {
|
||||
|
||||
SortingParams sortParams = RjcUtils.convertSortParams(params);
|
||||
@@ -152,7 +144,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sort(byte[] key, SortParameters params, byte[] sortKey) {
|
||||
|
||||
SortingParams sortParams = RjcUtils.convertSortParams(params);
|
||||
@@ -177,7 +168,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long dbSize() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -191,7 +181,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void flushDb() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -204,7 +193,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flushAll() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -217,7 +205,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bgSave() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -230,7 +217,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bgWriteAof() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -243,7 +229,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -256,7 +241,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getConfig(String param) {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -269,7 +253,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Properties info() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -282,7 +265,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lastSave() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -295,7 +277,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConfig(String param, String value) {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -309,7 +290,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void resetConfigStats() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -323,7 +303,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -336,7 +315,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] echo(byte[] message) {
|
||||
String stringMsg = RjcUtils.decode(message);
|
||||
try {
|
||||
@@ -350,7 +328,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String ping() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -362,7 +339,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long del(byte[]... keys) {
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
|
||||
@@ -377,7 +353,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void discard() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -391,7 +366,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> exec() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -404,7 +378,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean exists(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -419,7 +392,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(byte[] key, long seconds) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -434,7 +406,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(byte[] key, long unixTime) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -449,7 +420,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> keys(byte[] pattern) {
|
||||
String stringKey = RjcUtils.decode(pattern);
|
||||
|
||||
@@ -464,7 +434,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multi() {
|
||||
if (isQueueing()) {
|
||||
return;
|
||||
@@ -480,7 +449,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -495,7 +463,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean move(byte[] key, int dbIndex) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -510,7 +477,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] randomKey() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -523,7 +489,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(byte[] oldName, byte[] newName) {
|
||||
String stringOldKey = RjcUtils.decode(oldName);
|
||||
String stringNewKey = RjcUtils.decode(newName);
|
||||
@@ -539,7 +504,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean renameNX(byte[] oldName, byte[] newName) {
|
||||
String stringOldKey = RjcUtils.decode(oldName);
|
||||
String stringNewKey = RjcUtils.decode(newName);
|
||||
@@ -555,7 +519,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void select(int dbIndex) {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -568,7 +531,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long ttl(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -583,7 +545,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType type(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -598,7 +559,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unwatch() {
|
||||
try {
|
||||
if (isPipelined()) {
|
||||
@@ -612,7 +572,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(byte[]... keys) {
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
|
||||
@@ -636,7 +595,6 @@ public class RjcConnection implements RedisConnection {
|
||||
// String commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public byte[] get(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -652,7 +610,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -669,7 +626,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public byte[] getSet(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -685,7 +641,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long append(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -701,7 +656,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> mGet(byte[]... keys) {
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
|
||||
@@ -716,7 +670,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mSet(Map<byte[], byte[]> tuples) {
|
||||
String[] decodeMap = RjcUtils.flatten(tuples);
|
||||
|
||||
@@ -731,7 +684,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mSetNX(Map<byte[], byte[]> tuples) {
|
||||
String[] decodeMap = RjcUtils.flatten(tuples);
|
||||
|
||||
@@ -747,7 +699,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEx(byte[] key, long time, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -763,7 +714,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean setNX(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -779,7 +729,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getRange(byte[] key, long start, long end) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -794,7 +743,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long decr(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -809,7 +757,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long decrBy(byte[] key, long value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -824,7 +771,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long incr(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -840,7 +786,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long incrBy(byte[] key, long value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -856,7 +801,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getBit(byte[] key, long offset) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -871,7 +815,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBit(byte[] key, long offset, boolean value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -886,7 +829,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRange(byte[] key, byte[] value, long offset) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -902,7 +844,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long strLen(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -921,7 +862,6 @@ public class RjcConnection implements RedisConnection {
|
||||
// List commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Long lPush(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -937,7 +877,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPush(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -954,7 +893,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> bLPop(int timeout, byte[]... keys) {
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
|
||||
@@ -969,7 +907,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> bRPop(int timeout, byte[]... keys) {
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
|
||||
@@ -984,7 +921,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] lIndex(byte[] key, long index) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -1000,7 +936,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1018,7 +953,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lLen(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -1034,7 +968,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] lPop(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -1050,7 +983,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> lRange(byte[] key, long start, long end) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -1066,7 +998,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lRem(byte[] key, long count, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1083,7 +1014,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lSet(byte[] key, long index, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1099,7 +1029,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lTrim(byte[] key, long start, long end) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -1115,7 +1044,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] rPop(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -1131,7 +1059,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) {
|
||||
String stringKey = RjcUtils.decode(srcKey);
|
||||
String stringDest = RjcUtils.decode(dstKey);
|
||||
@@ -1148,7 +1075,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) {
|
||||
String stringKey = RjcUtils.decode(srcKey);
|
||||
String stringDest = RjcUtils.decode(dstKey);
|
||||
@@ -1164,7 +1090,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lPushX(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1179,7 +1104,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPushX(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1199,7 +1123,6 @@ public class RjcConnection implements RedisConnection {
|
||||
// Set commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Boolean sAdd(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1216,7 +1139,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sCard(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -1232,7 +1154,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sDiff(byte[]... keys) {
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
|
||||
@@ -1248,7 +1169,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sDiffStore(byte[] destKey, byte[]... keys) {
|
||||
String stringKey = RjcUtils.decode(destKey);
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
@@ -1265,7 +1185,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sInter(byte[]... keys) {
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
try {
|
||||
@@ -1280,7 +1199,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sInterStore(byte[] destKey, byte[]... keys) {
|
||||
String stringKey = RjcUtils.decode(destKey);
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
@@ -1296,7 +1214,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sIsMember(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1313,7 +1230,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sMembers(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1328,7 +1244,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value) {
|
||||
String stringSrc = RjcUtils.decode(srcKey);
|
||||
String stringDest = RjcUtils.decode(destKey);
|
||||
@@ -1346,7 +1261,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] sPop(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1361,7 +1275,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] sRandMember(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1376,7 +1289,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sRem(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1393,7 +1305,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> sUnion(byte[]... keys) {
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
|
||||
@@ -1409,7 +1320,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sUnionStore(byte[] destKey, byte[]... keys) {
|
||||
String stringKey = RjcUtils.decode(destKey);
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(keys);
|
||||
@@ -1430,7 +1340,6 @@ public class RjcConnection implements RedisConnection {
|
||||
// ZSet commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Boolean zAdd(byte[] key, double score, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1446,7 +1355,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zCard(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -1461,7 +1369,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zCount(byte[] key, double min, double max) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1476,7 +1383,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double zIncrBy(byte[] key, double increment, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1492,7 +1398,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
|
||||
String stringKey = RjcUtils.decode(destKey);
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(sets);
|
||||
@@ -1510,7 +1415,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zInterStore(byte[] destKey, byte[]... sets) {
|
||||
String stringKey = RjcUtils.decode(destKey);
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(sets);
|
||||
@@ -1526,7 +1430,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRange(byte[] key, long start, long end) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1541,7 +1444,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRangeWithScore(byte[] key, long start, long end) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1556,7 +1458,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRangeByScore(byte[] key, double min, double max) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String minString = Double.toString(min);
|
||||
@@ -1573,7 +1474,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRangeByScoreWithScore(byte[] key, double min, double max) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String minString = Double.toString(min);
|
||||
@@ -1590,7 +1490,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRevRangeWithScore(byte[] key, long start, long end) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String minString = Long.toString(start);
|
||||
@@ -1608,7 +1507,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRangeByScore(byte[] key, double min, double max, long offset, long count) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String minString = Double.toString(min);
|
||||
@@ -1626,7 +1524,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Tuple> zRangeByScoreWithScore(byte[] key, double min, double max, long offset, long count) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String minString = Double.toString(min);
|
||||
@@ -1644,7 +1541,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRank(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1660,7 +1556,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean zRem(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1676,7 +1571,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRemRange(byte[] key, long start, long end) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1690,7 +1584,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRemRangeByScore(byte[] key, double min, double max) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String minString = Double.toString(min);
|
||||
@@ -1707,7 +1600,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> zRevRange(byte[] key, long start, long end) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1722,7 +1614,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zRevRank(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1738,7 +1629,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double zScore(byte[] key, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringValue = RjcUtils.decode(value);
|
||||
@@ -1754,7 +1644,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
|
||||
String stringKey = RjcUtils.decode(destKey);
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(destKey);
|
||||
@@ -1772,7 +1661,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long zUnionStore(byte[] destKey, byte[]... sets) {
|
||||
String stringKey = RjcUtils.decode(destKey);
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(sets);
|
||||
@@ -1792,7 +1680,6 @@ public class RjcConnection implements RedisConnection {
|
||||
// Hash commands
|
||||
//
|
||||
|
||||
@Override
|
||||
public Boolean hSet(byte[] key, byte[] field, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringField = RjcUtils.decode(field);
|
||||
@@ -1809,7 +1696,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hSetNX(byte[] key, byte[] field, byte[] value) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringField = RjcUtils.decode(field);
|
||||
@@ -1826,7 +1712,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hDel(byte[] key, byte[] field) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringField = RjcUtils.decode(field);
|
||||
@@ -1842,7 +1727,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hExists(byte[] key, byte[] field) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringField = RjcUtils.decode(field);
|
||||
@@ -1858,7 +1742,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] hGet(byte[] key, byte[] field) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringField = RjcUtils.decode(field);
|
||||
@@ -1874,7 +1757,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<byte[], byte[]> hGetAll(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
|
||||
@@ -1889,7 +1771,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long hIncrBy(byte[] key, byte[] field, long delta) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String stringField = RjcUtils.decode(field);
|
||||
@@ -1905,7 +1786,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<byte[]> hKeys(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1919,7 +1799,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long hLen(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1933,7 +1812,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> hMGet(byte[] key, byte[]... fields) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
String[] stringKeys = RjcUtils.decodeMultiple(fields);
|
||||
@@ -1949,7 +1827,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hMSet(byte[] key, Map<byte[], byte[]> tuple) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
Map<String, String> stringTuple = RjcUtils.decodeMap(tuple);
|
||||
@@ -1965,7 +1842,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<byte[]> hVals(byte[] key) {
|
||||
String stringKey = RjcUtils.decode(key);
|
||||
try {
|
||||
@@ -1984,7 +1860,6 @@ public class RjcConnection implements RedisConnection {
|
||||
//
|
||||
// Pub/Sub functionality
|
||||
//
|
||||
@Override
|
||||
public Long publish(byte[] channel, byte[] message) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
@@ -1999,17 +1874,14 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Subscription getSubscription() {
|
||||
return subscription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSubscribed() {
|
||||
return (subscription != null && subscription.isAlive());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pSubscribe(MessageListener listener, byte[]... patterns) {
|
||||
if (isSubscribed()) {
|
||||
throw new RedisSubscribedConnectionException(
|
||||
@@ -2033,7 +1905,6 @@ public class RjcConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscribe(MessageListener listener, byte[]... channels) {
|
||||
if (isSubscribed()) {
|
||||
throw new RedisSubscribedConnectionException(
|
||||
|
||||
@@ -85,7 +85,6 @@ public class RjcConnectionFactory implements InitializingBean, DisposableBean, R
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisConnection getConnection() {
|
||||
return postProcessConnection(new RjcConnection(dataSource.getConnection(), dbIndex));
|
||||
}
|
||||
@@ -102,7 +101,6 @@ public class RjcConnectionFactory implements InitializingBean, DisposableBean, R
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataAccessException translateExceptionIfPossible(RuntimeException ex) {
|
||||
return RjcUtils.convertRjcAccessException(ex);
|
||||
}
|
||||
|
||||
@@ -32,12 +32,10 @@ class RjcMessageListener implements MessageListener, PMessageListener {
|
||||
this.listener = messageListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String channel, String message) {
|
||||
listener.onMessage(new DefaultMessage(RjcUtils.encode(channel), RjcUtils.encode(message)), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String pattern, String channel, String message) {
|
||||
listener.onMessage(new DefaultMessage(RjcUtils.encode(channel), RjcUtils.encode(message)),
|
||||
RjcUtils.encode(pattern));
|
||||
|
||||
@@ -31,7 +31,6 @@ class SingleDataSource implements DataSource {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisConnection getConnection() {
|
||||
return connection;
|
||||
}
|
||||
|
||||
@@ -98,26 +98,22 @@ public abstract class AbstractSubscription implements Subscription {
|
||||
*/
|
||||
protected abstract void doClose();
|
||||
|
||||
@Override
|
||||
public MessageListener getListener() {
|
||||
return listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<byte[]> getChannels() {
|
||||
synchronized (channels) {
|
||||
return clone(channels);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<byte[]> getPatterns() {
|
||||
synchronized (patterns) {
|
||||
return clone(patterns);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pSubscribe(byte[]... patterns) {
|
||||
checkPulse();
|
||||
|
||||
@@ -130,13 +126,11 @@ public abstract class AbstractSubscription implements Subscription {
|
||||
doPsubscribe(patterns);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pUnsubscribe() {
|
||||
pUnsubscribe((byte[][]) null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void subscribe(byte[]... channels) {
|
||||
checkPulse();
|
||||
|
||||
@@ -149,12 +143,10 @@ public abstract class AbstractSubscription implements Subscription {
|
||||
doSubscribe(channels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsubscribe() {
|
||||
unsubscribe((byte[][]) null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pUnsubscribe(byte[]... patts) {
|
||||
if (!isAlive()) {
|
||||
return;
|
||||
@@ -184,7 +176,6 @@ public abstract class AbstractSubscription implements Subscription {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsubscribe(byte[]... chans) {
|
||||
if (!isAlive()) {
|
||||
return;
|
||||
@@ -214,7 +205,6 @@ public abstract class AbstractSubscription implements Subscription {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAlive() {
|
||||
return alive.get();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ abstract class AbstractOperations<K, V> {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final V doInRedis(RedisConnection connection) {
|
||||
byte[] result = inRedis(rawKey(key), connection);
|
||||
return deserializeValue(result);
|
||||
|
||||
@@ -41,72 +41,58 @@ class DefaultBoundHashOperations<H, HK, HV> extends DefaultBoundKeyOperations<H>
|
||||
this.ops = operations.opsForHash();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Object key) {
|
||||
ops.delete(getKey(), key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HV get(Object key) {
|
||||
return ops.get(getKey(), key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<HV> multiGet(Collection<HK> hashKeys) {
|
||||
return ops.multiGet(getKey(), hashKeys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisOperations<H, ?> getOperations() {
|
||||
return ops.getOperations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasKey(Object key) {
|
||||
return ops.hasKey(getKey(), key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long increment(HK key, long delta) {
|
||||
return ops.increment(getKey(), key, delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<HK> keys() {
|
||||
return ops.keys(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size() {
|
||||
return ops.size(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putAll(Map<? extends HK, ? extends HV> m) {
|
||||
ops.putAll(getKey(), m);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void put(HK key, HV value) {
|
||||
ops.put(getKey(), key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean putIfAbsent(HK key, HV value) {
|
||||
return ops.putIfAbsent(getKey(), key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<HV> values() {
|
||||
return ops.values(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<HK, HV> entries() {
|
||||
return ops.entries(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.HASH;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ abstract class DefaultBoundKeyOperations<K> implements BoundKeyOperations<K> {
|
||||
this.ops = operations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public K getKey() {
|
||||
return key;
|
||||
}
|
||||
@@ -44,27 +43,22 @@ abstract class DefaultBoundKeyOperations<K> implements BoundKeyOperations<K> {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(long timeout, TimeUnit unit) {
|
||||
return ops.expire(key, timeout, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(Date date) {
|
||||
return ops.expireAt(key, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getExpire() {
|
||||
return ops.getExpire(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist() {
|
||||
return ops.persist(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(K newKey) {
|
||||
ops.rename(key, newKey);
|
||||
key = newKey;
|
||||
|
||||
@@ -42,92 +42,74 @@ class DefaultBoundListOperations<K, V> extends DefaultBoundKeyOperations<K> impl
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RedisOperations<K, V> getOperations() {
|
||||
return ops.getOperations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public V index(long index) {
|
||||
return ops.index(getKey(), index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V leftPop() {
|
||||
return ops.leftPop(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public V leftPop(long timeout, TimeUnit unit) {
|
||||
return ops.leftPop(getKey(), timeout, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long leftPush(V value) {
|
||||
return ops.leftPush(getKey(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long leftPushIfPresent(V value) {
|
||||
return ops.leftPushIfPresent(getKey(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long leftPush(V pivot, V value) {
|
||||
return ops.leftPush(getKey(), pivot, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size() {
|
||||
return ops.size(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<V> range(long start, long end) {
|
||||
return ops.range(getKey(), start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long remove(long i, Object value) {
|
||||
return ops.remove(getKey(), i, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V rightPop() {
|
||||
return ops.rightPop(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public V rightPop(long timeout, TimeUnit unit) {
|
||||
return ops.rightPop(getKey(), timeout, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rightPushIfPresent(V value) {
|
||||
return ops.rightPushIfPresent(getKey(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rightPush(V value) {
|
||||
return ops.rightPush(getKey(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rightPush(V pivot, V value) {
|
||||
return ops.rightPush(getKey(), pivot, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trim(long start, long end) {
|
||||
ops.trim(getKey(), start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(long index, V value) {
|
||||
ops.set(getKey(), index, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.LIST;
|
||||
}
|
||||
|
||||
@@ -42,114 +42,92 @@ class DefaultBoundSetOperations<K, V> extends DefaultBoundKeyOperations<K> imple
|
||||
this.ops = operations.opsForSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean add(V value) {
|
||||
return ops.add(getKey(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> diff(K key) {
|
||||
return ops.difference(getKey(), key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> diff(Collection<K> keys) {
|
||||
return ops.difference(getKey(), keys);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void diffAndStore(K key, K destKey) {
|
||||
ops.differenceAndStore(getKey(), key, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void diffAndStore(Collection<K> keys, K destKey) {
|
||||
ops.differenceAndStore(getKey(), keys, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisOperations<K, V> getOperations() {
|
||||
return ops.getOperations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> intersect(K key) {
|
||||
return ops.intersect(getKey(), key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> intersect(Collection<K> keys) {
|
||||
return ops.intersect(getKey(), keys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intersectAndStore(K key, K destKey) {
|
||||
ops.intersectAndStore(getKey(), key, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intersectAndStore(Collection<K> keys, K destKey) {
|
||||
ops.intersectAndStore(getKey(), keys, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isMember(Object o) {
|
||||
return ops.isMember(getKey(), o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> members() {
|
||||
return ops.members(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean move(K destKey, V value) {
|
||||
return ops.move(getKey(), value, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V randomMember() {
|
||||
return ops.randomMember(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean remove(Object o) {
|
||||
return ops.remove(getKey(), o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V pop() {
|
||||
return ops.pop(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size() {
|
||||
return ops.size(getKey());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Set<V> union(K key) {
|
||||
return ops.union(getKey(), key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> union(Collection<K> keys) {
|
||||
return ops.union(getKey(), keys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unionAndStore(K key, K destKey) {
|
||||
ops.unionAndStore(getKey(), key, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unionAndStore(Collection<K> keys, K destKey) {
|
||||
ops.unionAndStore(getKey(), keys, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.SET;
|
||||
}
|
||||
|
||||
@@ -37,62 +37,50 @@ class DefaultBoundValueOperations<K, V> extends DefaultBoundKeyOperations<K> imp
|
||||
this.ops = operations.opsForValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get() {
|
||||
return ops.get(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public V getAndSet(V value) {
|
||||
return ops.getAndSet(getKey(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long increment(long delta) {
|
||||
return ops.increment(getKey(), delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer append(String value) {
|
||||
return ops.append(getKey(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(long start, long end) {
|
||||
return ops.get(getKey(), start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(V value, long timeout, TimeUnit unit) {
|
||||
ops.set(getKey(), value, timeout, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(V value) {
|
||||
ops.set(getKey(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean setIfAbsent(V value) {
|
||||
return ops.setIfAbsent(getKey(), value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(V value, long offset) {
|
||||
ops.set(getKey(), value, offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size() {
|
||||
return ops.size(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisOperations<K, V> getOperations() {
|
||||
return ops.getOperations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.STRING;
|
||||
}
|
||||
|
||||
@@ -41,97 +41,78 @@ class DefaultBoundZSetOperations<K, V> extends DefaultBoundKeyOperations<K> impl
|
||||
this.ops = operations.opsForZSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean add(V value, double score) {
|
||||
return ops.add(getKey(), value, score);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double incrementScore(V value, double delta) {
|
||||
return ops.incrementScore(getKey(), value, delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisOperations<K, V> getOperations() {
|
||||
return ops.getOperations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intersectAndStore(K destKey, K otherKey) {
|
||||
ops.intersectAndStore(getKey(), otherKey, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intersectAndStore(Collection<K> otherKeys, K destKey) {
|
||||
ops.intersectAndStore(getKey(), otherKeys, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> range(long start, long end) {
|
||||
return ops.range(getKey(), start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> rangeByScore(double min, double max) {
|
||||
return ops.rangeByScore(getKey(), min, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rank(Object o) {
|
||||
return ops.rank(getKey(), o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long reverseRank(Object o) {
|
||||
return ops.reverseRank(getKey(), o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double score(Object o) {
|
||||
return ops.score(getKey(), o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean remove(Object o) {
|
||||
return ops.remove(getKey(), o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRange(long start, long end) {
|
||||
ops.removeRange(getKey(), start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRangeByScore(double min, double max) {
|
||||
ops.removeRangeByScore(getKey(), min, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> reverseRange(long start, long end) {
|
||||
return ops.reverseRange(getKey(), start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count(double min, double max) {
|
||||
return ops.count(getKey(), min, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size() {
|
||||
return ops.size(getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unionAndStore(K otherKey, K destKey) {
|
||||
ops.unionAndStore(getKey(), otherKey, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unionAndStore(Collection<K> otherKeys, K destKey) {
|
||||
ops.unionAndStore(getKey(), otherKeys, destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.ZSET;
|
||||
}
|
||||
|
||||
@@ -37,13 +37,11 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public HV get(K key, Object hashKey) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawHashKey = rawHashKey(hashKey);
|
||||
|
||||
byte[] rawHashValue = execute(new RedisCallback<byte[]>() {
|
||||
@Override
|
||||
public byte[] doInRedis(RedisConnection connection) {
|
||||
return connection.hGet(rawKey, rawHashKey);
|
||||
}
|
||||
@@ -52,26 +50,22 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
return (HV) deserializeHashValue(rawHashValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hasKey(K key, Object hashKey) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawHashKey = rawHashKey(hashKey);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.hExists(rawKey, rawHashKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long increment(K key, HK hashKey, final long delta) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawHashKey = rawHashKey(hashKey);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.hIncrBy(rawKey, rawHashKey, delta);
|
||||
}
|
||||
@@ -79,12 +73,10 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<HK> keys(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {
|
||||
@Override
|
||||
public Set<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.hKeys(rawKey);
|
||||
}
|
||||
@@ -93,19 +85,16 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
return deserializeHashKeys(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.hLen(rawKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putAll(K key, Map<? extends HK, ? extends HV> m) {
|
||||
if (m.isEmpty()) {
|
||||
return;
|
||||
@@ -120,7 +109,6 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
}
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.hMSet(rawKey, hashes);
|
||||
return null;
|
||||
@@ -129,7 +117,6 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<HV> multiGet(K key, Collection<HK> fields) {
|
||||
if (fields.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
@@ -145,7 +132,6 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
}
|
||||
|
||||
List<byte[]> rawValues = execute(new RedisCallback<List<byte[]>>() {
|
||||
@Override
|
||||
public List<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.hMGet(rawKey, rawHashKeys);
|
||||
}
|
||||
@@ -154,14 +140,12 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
return deserializeHashValues(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void put(K key, HK hashKey, HV value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawHashKey = rawHashKey(hashKey);
|
||||
final byte[] rawHashValue = rawHashValue(value);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.hSet(rawKey, rawHashKey, rawHashValue);
|
||||
return null;
|
||||
@@ -169,14 +153,12 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean putIfAbsent(K key, HK hashKey, HV value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawHashKey = rawHashKey(hashKey);
|
||||
final byte[] rawHashValue = rawHashValue(value);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.hSetNX(rawKey, rawHashKey, rawHashValue);
|
||||
}
|
||||
@@ -184,12 +166,10 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<HV> values(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
List<byte[]> rawValues = execute(new RedisCallback<List<byte[]>>() {
|
||||
@Override
|
||||
public List<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.hVals(rawKey);
|
||||
}
|
||||
@@ -198,13 +178,11 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
return deserializeHashValues(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(K key, Object hashKey) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawHashKey = rawHashKey(hashKey);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.hDel(rawKey, rawHashKey);
|
||||
return null;
|
||||
@@ -212,12 +190,10 @@ class DefaultHashOperations<K, HK, HV> extends AbstractOperations<K, Object> imp
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<HK, HV> entries(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
Map<byte[], byte[]> entries = execute(new RedisCallback<Map<byte[], byte[]>>() {
|
||||
@Override
|
||||
public Map<byte[], byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.hGetAll(rawKey);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ class DefaultListOperations<K, V> extends AbstractOperations<K, V> implements Li
|
||||
super(template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V index(K key, final long index) {
|
||||
return execute(new ValueDeserializingRedisCallback(key) {
|
||||
@Override
|
||||
@@ -42,7 +41,6 @@ class DefaultListOperations<K, V> extends AbstractOperations<K, V> implements Li
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V leftPop(K key) {
|
||||
return execute(new ValueDeserializingRedisCallback(key) {
|
||||
@Override
|
||||
@@ -52,7 +50,6 @@ class DefaultListOperations<K, V> extends AbstractOperations<K, V> implements Li
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V leftPop(K key, long timeout, TimeUnit unit) {
|
||||
final int tm = (int) unit.toSeconds(timeout);
|
||||
|
||||
@@ -64,79 +61,65 @@ class DefaultListOperations<K, V> extends AbstractOperations<K, V> implements Li
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long leftPush(K key, V value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.lPush(rawKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long leftPushIfPresent(K key, V value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.lPushX(rawKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long leftPush(K key, V pivot, V value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawPivot = rawValue(pivot);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.lInsert(rawKey, Position.BEFORE, rawPivot, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.lLen(rawKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<V> range(K key, final long start, final long end) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
return execute(new RedisCallback<List<V>>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<V> doInRedis(RedisConnection connection) {
|
||||
return deserializeValues(connection.lRange(rawKey, start, end));
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long remove(K key, final long count, Object value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.lRem(rawKey, count, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V rightPop(K key) {
|
||||
return execute(new ValueDeserializingRedisCallback(key) {
|
||||
@Override
|
||||
@@ -146,7 +129,6 @@ class DefaultListOperations<K, V> extends AbstractOperations<K, V> implements Li
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V rightPop(K key, long timeout, TimeUnit unit) {
|
||||
final int tm = (int) unit.toSeconds(timeout);
|
||||
|
||||
@@ -158,45 +140,38 @@ class DefaultListOperations<K, V> extends AbstractOperations<K, V> implements Li
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rightPush(K key, V value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.rPush(rawKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rightPushIfPresent(K key, V value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.rPushX(rawKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rightPush(K key, V pivot, V value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawPivot = rawValue(pivot);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.lInsert(rawKey, Position.AFTER, rawPivot, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V rightPopAndLeftPush(K sourceKey, K destinationKey) {
|
||||
final byte[] rawDestKey = rawKey(destinationKey);
|
||||
|
||||
@@ -208,7 +183,6 @@ class DefaultListOperations<K, V> extends AbstractOperations<K, V> implements Li
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V rightPopAndLeftPush(K sourceKey, K destinationKey, long timeout, TimeUnit unit) {
|
||||
final int tm = (int) unit.toSeconds(timeout);
|
||||
final byte[] rawDestKey = rawKey(destinationKey);
|
||||
@@ -221,7 +195,6 @@ class DefaultListOperations<K, V> extends AbstractOperations<K, V> implements Li
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(K key, final long index, V value) {
|
||||
final byte[] rawValue = rawValue(value);
|
||||
execute(new ValueDeserializingRedisCallback(key) {
|
||||
@@ -233,7 +206,6 @@ class DefaultListOperations<K, V> extends AbstractOperations<K, V> implements Li
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trim(K key, final long start, final long end) {
|
||||
execute(new ValueDeserializingRedisCallback(key) {
|
||||
@Override
|
||||
|
||||
@@ -32,29 +32,23 @@ class DefaultSetOperations<K, V> extends AbstractOperations<K, V> implements Set
|
||||
super(template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean add(K key, V value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.sAdd(rawKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> difference(K key, K otherKey) {
|
||||
return difference(key, Collections.singleton(otherKey));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<V> difference(final K key, final Collection<K> otherKeys) {
|
||||
final byte[][] rawKeys = rawKeys(key, otherKeys);
|
||||
Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {
|
||||
@Override
|
||||
public Set<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.sDiff(rawKeys);
|
||||
}
|
||||
@@ -63,17 +57,14 @@ class DefaultSetOperations<K, V> extends AbstractOperations<K, V> implements Set
|
||||
return deserializeValues(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void differenceAndStore(K key, K otherKey, K destKey) {
|
||||
differenceAndStore(key, Collections.singleton(otherKey), destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void differenceAndStore(final K key, final Collection<K> otherKeys, K destKey) {
|
||||
final byte[][] rawKeys = rawKeys(key, otherKeys);
|
||||
final byte[] rawDestKey = rawKey(destKey);
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.sDiffStore(rawDestKey, rawKeys);
|
||||
return null;
|
||||
@@ -81,17 +72,13 @@ class DefaultSetOperations<K, V> extends AbstractOperations<K, V> implements Set
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> intersect(K key, K otherKey) {
|
||||
return intersect(key, Collections.singleton(otherKey));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<V> intersect(K key, Collection<K> otherKeys) {
|
||||
final byte[][] rawKeys = rawKeys(key, otherKeys);
|
||||
Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {
|
||||
@Override
|
||||
public Set<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.sInter(rawKeys);
|
||||
}
|
||||
@@ -100,17 +87,14 @@ class DefaultSetOperations<K, V> extends AbstractOperations<K, V> implements Set
|
||||
return deserializeValues(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intersectAndStore(K key, K otherKey, K destKey) {
|
||||
intersectAndStore(key, Collections.singleton(otherKey), destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intersectAndStore(K key, Collection<K> otherKeys, K destKey) {
|
||||
final byte[][] rawKeys = rawKeys(key, otherKeys);
|
||||
final byte[] rawDestKey = rawKey(destKey);
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.sInterStore(rawDestKey, rawKeys);
|
||||
return null;
|
||||
@@ -118,24 +102,19 @@ class DefaultSetOperations<K, V> extends AbstractOperations<K, V> implements Set
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isMember(K key, Object o) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(o);
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.sIsMember(rawKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<V> members(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {
|
||||
@Override
|
||||
public Set<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.sMembers(rawKey);
|
||||
}
|
||||
@@ -144,21 +123,18 @@ class DefaultSetOperations<K, V> extends AbstractOperations<K, V> implements Set
|
||||
return deserializeValues(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean move(K key, V value, K destKey) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawDestKey = rawKey(destKey);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.sMove(rawKey, rawDestKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V randomMember(K key) {
|
||||
|
||||
return execute(new ValueDeserializingRedisCallback(key) {
|
||||
@@ -169,19 +145,16 @@ class DefaultSetOperations<K, V> extends AbstractOperations<K, V> implements Set
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean remove(K key, Object o) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(o);
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.sRem(rawKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V pop(K key) {
|
||||
return execute(new ValueDeserializingRedisCallback(key) {
|
||||
@Override
|
||||
@@ -191,28 +164,22 @@ class DefaultSetOperations<K, V> extends AbstractOperations<K, V> implements Set
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.sCard(rawKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<V> union(K key, K otherKey) {
|
||||
return union(key, Collections.singleton(otherKey));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<V> union(K key, Collection<K> otherKeys) {
|
||||
final byte[][] rawKeys = rawKeys(key, otherKeys);
|
||||
Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {
|
||||
@Override
|
||||
public Set<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.sUnion(rawKeys);
|
||||
}
|
||||
@@ -221,17 +188,14 @@ class DefaultSetOperations<K, V> extends AbstractOperations<K, V> implements Set
|
||||
return deserializeValues(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unionAndStore(K key, K otherKey, K destKey) {
|
||||
unionAndStore(key, Collections.singleton(otherKey), destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unionAndStore(K key, Collection<K> otherKeys, K destKey) {
|
||||
final byte[][] rawKeys = rawKeys(key, otherKeys);
|
||||
final byte[] rawDestKey = rawKey(destKey);
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.sUnionStore(rawDestKey, rawKeys);
|
||||
return null;
|
||||
|
||||
@@ -36,7 +36,6 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
super(template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(final Object key) {
|
||||
|
||||
return execute(new ValueDeserializingRedisCallback(key) {
|
||||
@@ -47,7 +46,6 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V getAndSet(K key, V newValue) {
|
||||
final byte[] rawValue = rawValue(newValue);
|
||||
return execute(new ValueDeserializingRedisCallback(key) {
|
||||
@@ -58,12 +56,10 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long increment(K key, final long delta) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
// TODO add conversion service in here ?
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
if (delta == 1) {
|
||||
return connection.incr(rawKey);
|
||||
@@ -82,25 +78,21 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer append(K key, String value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawString = rawString(value);
|
||||
|
||||
return execute(new RedisCallback<Integer>() {
|
||||
@Override
|
||||
public Integer doInRedis(RedisConnection connection) {
|
||||
return connection.append(rawKey, rawString).intValue();
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(K key, final long start, final long end) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
byte[] rawReturn = execute(new RedisCallback<byte[]>() {
|
||||
@Override
|
||||
public byte[] doInRedis(RedisConnection connection) {
|
||||
return connection.getRange(rawKey, start, end);
|
||||
}
|
||||
@@ -109,8 +101,6 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
return deserializeString(rawReturn);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<V> multiGet(Collection<K> keys) {
|
||||
if (keys.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
@@ -124,7 +114,6 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}
|
||||
|
||||
List<byte[]> rawValues = execute(new RedisCallback<List<byte[]>>() {
|
||||
@Override
|
||||
public List<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.mGet(rawKeys);
|
||||
}
|
||||
@@ -133,7 +122,6 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
return deserializeValues(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multiSet(Map<? extends K, ? extends V> m) {
|
||||
if (m.isEmpty()) {
|
||||
return;
|
||||
@@ -146,7 +134,6 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.mSet(rawKeys);
|
||||
return null;
|
||||
@@ -154,7 +141,6 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multiSetIfAbsent(Map<? extends K, ? extends V> m) {
|
||||
if (m.isEmpty()) {
|
||||
return;
|
||||
@@ -167,7 +153,6 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.mSetNX(rawKeys);
|
||||
return null;
|
||||
@@ -175,7 +160,6 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(K key, V value) {
|
||||
final byte[] rawValue = rawValue(value);
|
||||
execute(new ValueDeserializingRedisCallback(key) {
|
||||
@@ -187,14 +171,12 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(K key, V value, long timeout, TimeUnit unit) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
final long rawTimeout = unit.toSeconds(timeout);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
connection.setEx(rawKey, (int) rawTimeout, rawValue);
|
||||
return null;
|
||||
@@ -202,13 +184,11 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean setIfAbsent(K key, V value) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
return connection.setNX(rawKey, rawValue);
|
||||
}
|
||||
@@ -216,13 +196,11 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void set(K key, final V value, final long offset) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.setRange(rawKey, rawValue, offset);
|
||||
return null;
|
||||
@@ -230,12 +208,10 @@ class DefaultValueOperations<K, V> extends AbstractOperations<K, V> implements V
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.strLen(rawKey);
|
||||
}
|
||||
|
||||
@@ -32,43 +32,36 @@ class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZS
|
||||
super(template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean add(final K key, final V value, final double score) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.zAdd(rawKey, score, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double incrementScore(K key, V value, final double delta) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(value);
|
||||
|
||||
return execute(new RedisCallback<Double>() {
|
||||
@Override
|
||||
public Double doInRedis(RedisConnection connection) {
|
||||
return connection.zIncrBy(rawKey, delta, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intersectAndStore(K key, K otherKey, K destKey) {
|
||||
intersectAndStore(key, Collections.singleton(otherKey), destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void intersectAndStore(K key, Collection<K> otherKeys, K destKey) {
|
||||
final byte[][] rawKeys = rawKeys(key, otherKeys);
|
||||
final byte[] rawDestKey = rawKey(destKey);
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.zInterStore(rawDestKey, rawKeys);
|
||||
return null;
|
||||
@@ -76,13 +69,10 @@ class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZS
|
||||
}, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<V> range(K key, final long start, final long end) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {
|
||||
@Override
|
||||
public Set<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.zRange(rawKey, start, end);
|
||||
}
|
||||
@@ -91,13 +81,10 @@ class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZS
|
||||
return deserializeValues(rawValues);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<V> rangeByScore(K key, final double min, final double max) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {
|
||||
@Override
|
||||
public Set<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.zRangeByScore(rawKey, min, max);
|
||||
}
|
||||
@@ -106,13 +93,11 @@ class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZS
|
||||
return deserializeValues(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rank(K key, Object o) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(o);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
Long zRank = connection.zRank(rawKey, rawValue);
|
||||
return (zRank != null && zRank.longValue() >= 0 ? zRank : null);
|
||||
@@ -120,13 +105,11 @@ class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZS
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long reverseRank(K key, Object o) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(o);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
Long zRank = connection.zRevRank(rawKey, rawValue);
|
||||
return (zRank != null && zRank.longValue() >= 0 ? zRank : null);
|
||||
@@ -134,24 +117,20 @@ class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZS
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean remove(K key, Object o) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(o);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.zRem(rawKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRange(K key, final long start, final long end) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.zRemRange(rawKey, start, end);
|
||||
return null;
|
||||
@@ -159,11 +138,9 @@ class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZS
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRangeByScore(K key, final double min, final double max) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.zRemRangeByScore(rawKey, min, max);
|
||||
return null;
|
||||
@@ -171,13 +148,10 @@ class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZS
|
||||
}, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<V> reverseRange(K key, final long start, final long end) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
Set<byte[]> rawValues = execute(new RedisCallback<Set<byte[]>>() {
|
||||
@Override
|
||||
public Set<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.zRevRange(rawKey, start, end);
|
||||
}
|
||||
@@ -186,54 +160,45 @@ class DefaultZSetOperations<K, V> extends AbstractOperations<K, V> implements ZS
|
||||
return deserializeValues(rawValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double score(K key, Object o) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final byte[] rawValue = rawValue(o);
|
||||
|
||||
return execute(new RedisCallback<Double>() {
|
||||
@Override
|
||||
public Double doInRedis(RedisConnection connection) {
|
||||
return connection.zScore(rawKey, rawValue);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count(K key, final double min, final double max) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.zCount(rawKey, min, max);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long size(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return connection.zCard(rawKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unionAndStore(K key, K otherKey, K destKey) {
|
||||
unionAndStore(key, Collections.singleton(otherKey), destKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unionAndStore(K key, Collection<K> otherKeys, K destKey) {
|
||||
final byte[][] rawKeys = rawKeys(key, otherKeys);
|
||||
final byte[] rawDestKey = rawKey(destKey);
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.zUnionStore(rawDestKey, rawKeys);
|
||||
return null;
|
||||
|
||||
@@ -173,7 +173,6 @@ public abstract class RedisConnectionUtils {
|
||||
this.conn = conn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVoid() {
|
||||
return isVoid;
|
||||
}
|
||||
@@ -182,12 +181,10 @@ public abstract class RedisConnectionUtils {
|
||||
return conn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unbound() {
|
||||
this.isVoid = true;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,6 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
zSetOps = new DefaultZSetOperations<K, V>(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T execute(RedisCallback<T> action) {
|
||||
return execute(action, isExposeConnection());
|
||||
}
|
||||
@@ -192,7 +191,6 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T> T execute(SessionCallback<T> session) {
|
||||
RedisConnectionFactory factory = getConnectionFactory();
|
||||
// bind connection
|
||||
@@ -425,23 +423,19 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
//
|
||||
// RedisOperations
|
||||
//
|
||||
@Override
|
||||
public List<Object> exec() {
|
||||
return execute(new RedisCallback<List<Object>>() {
|
||||
|
||||
@Override
|
||||
public List<Object> doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
return connection.exec();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.del(rawKey);
|
||||
return null;
|
||||
@@ -449,12 +443,10 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Collection<K> keys) {
|
||||
final byte[][] rawKeys = rawKeys(keys);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.del(rawKeys);
|
||||
return null;
|
||||
@@ -462,45 +454,38 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hasKey(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.exists(rawKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(K key, long timeout, TimeUnit unit) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final int rawTimeout = (int) unit.toSeconds(timeout);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.expire(rawKey, rawTimeout);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(K key, Date date) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
final long rawTimeout = date.getTime();
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.expireAt(rawKey, rawTimeout);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convertAndSend(String channel, Object message) {
|
||||
Assert.hasText(channel, "a non-empty channel is required");
|
||||
|
||||
@@ -508,7 +493,6 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
final byte[] rawMessage = rawValue(message);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.publish(rawChannel, rawMessage);
|
||||
return null;
|
||||
@@ -521,12 +505,10 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
// Value operations
|
||||
//
|
||||
|
||||
@Override
|
||||
public Long getExpire(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) {
|
||||
return Long.valueOf(connection.ttl(rawKey));
|
||||
}
|
||||
@@ -534,12 +516,10 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Set<K> keys(K pattern) {
|
||||
final byte[] rawKey = rawKey(pattern);
|
||||
|
||||
Collection<byte[]> rawKeys = execute(new RedisCallback<Collection<byte[]>>() {
|
||||
@Override
|
||||
public Collection<byte[]> doInRedis(RedisConnection connection) {
|
||||
return connection.keys(rawKey);
|
||||
}
|
||||
@@ -548,34 +528,28 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
return (Set<K>) SerializationUtils.deserialize(rawKeys, keySerializer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.persist(rawKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean move(K key, final int dbIndex) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.move(rawKey, dbIndex);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public K randomKey() {
|
||||
byte[] rawKey = execute(new RedisCallback<byte[]>() {
|
||||
@Override
|
||||
public byte[] doInRedis(RedisConnection connection) {
|
||||
return connection.randomKey();
|
||||
}
|
||||
@@ -584,13 +558,11 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
return deserializeKey(rawKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(K oldKey, K newKey) {
|
||||
final byte[] rawOldKey = rawKey(oldKey);
|
||||
final byte[] rawNewKey = rawKey(newKey);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.rename(rawOldKey, rawNewKey);
|
||||
return null;
|
||||
@@ -598,35 +570,29 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean renameIfAbsent(K oldKey, K newKey) {
|
||||
final byte[] rawOldKey = rawKey(oldKey);
|
||||
final byte[] rawNewKey = rawKey(newKey);
|
||||
|
||||
return execute(new RedisCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean doInRedis(RedisConnection connection) {
|
||||
return connection.renameNX(rawOldKey, rawNewKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType type(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
return execute(new RedisCallback<DataType>() {
|
||||
@Override
|
||||
public DataType doInRedis(RedisConnection connection) {
|
||||
return connection.type(rawKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multi() {
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
connection.multi();
|
||||
return null;
|
||||
@@ -634,11 +600,9 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void discard() {
|
||||
execute(new RedisCallback<Object>() {
|
||||
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
connection.discard();
|
||||
return null;
|
||||
@@ -646,12 +610,10 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(K key) {
|
||||
final byte[] rawKey = rawKey(key);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.watch(rawKey);
|
||||
return null;
|
||||
@@ -659,12 +621,10 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(Collection<K> keys) {
|
||||
final byte[][] rawKeys = rawKeys(keys);
|
||||
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.watch(rawKeys);
|
||||
return null;
|
||||
@@ -672,10 +632,8 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unwatch() {
|
||||
execute(new RedisCallback<Object>() {
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
connection.unwatch();
|
||||
return null;
|
||||
@@ -686,18 +644,15 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
// Sort operations
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<V> sort(SortQuery<K> query) {
|
||||
return sort(query, valueSerializer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<T> sort(SortQuery<K> query, RedisSerializer<T> resultSerializer) {
|
||||
final byte[] rawKey = rawKey(query.getKey());
|
||||
final SortParameters params = QueryUtils.convertQuery(query, stringSerializer);
|
||||
|
||||
List<byte[]> vals = execute(new RedisCallback<List<byte[]>>() {
|
||||
@Override
|
||||
public List<byte[]> doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
return connection.sort(rawKey, params);
|
||||
}
|
||||
@@ -707,12 +662,10 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> List<T> sort(SortQuery<K> query, BulkMapper<T, V> bulkMapper) {
|
||||
return sort(query, bulkMapper, valueSerializer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, S> List<T> sort(SortQuery<K> query, BulkMapper<T, S> bulkMapper, RedisSerializer<S> resultSerializer) {
|
||||
List<S> values = sort(query, resultSerializer);
|
||||
|
||||
@@ -733,66 +686,54 @@ public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperation
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long sort(SortQuery<K> query, K storeKey) {
|
||||
final byte[] rawStoreKey = rawKey(storeKey);
|
||||
final byte[] rawKey = rawKey(query.getKey());
|
||||
final SortParameters params = QueryUtils.convertQuery(query, stringSerializer);
|
||||
|
||||
return execute(new RedisCallback<Long>() {
|
||||
@Override
|
||||
public Long doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
return connection.sort(rawKey, params, rawStoreKey);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoundValueOperations<K, V> boundValueOps(K key) {
|
||||
return new DefaultBoundValueOperations<K, V>(key, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueOperations<K, V> opsForValue() {
|
||||
return valueOps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListOperations<K, V> opsForList() {
|
||||
return listOps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoundListOperations<K, V> boundListOps(K key) {
|
||||
return new DefaultBoundListOperations<K, V>(key, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoundSetOperations<K, V> boundSetOps(K key) {
|
||||
return new DefaultBoundSetOperations<K, V>(key, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SetOperations<K, V> opsForSet() {
|
||||
return setOps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoundZSetOperations<K, V> boundZSetOps(K key) {
|
||||
return new DefaultBoundZSetOperations<K, V>(key, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZSetOperations<K, V> opsForZSet() {
|
||||
return zSetOps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <HK, HV> BoundHashOperations<K, HK, HV> boundHashOps(K key) {
|
||||
return new DefaultBoundHashOperations<K, HK, HV>(key, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <HK, HV> HashOperations<K, HK, HV> opsForHash() {
|
||||
return new DefaultHashOperations<K, HK, HV>(this);
|
||||
}
|
||||
|
||||
@@ -40,36 +40,30 @@ class DefaultSortCriterion<K> implements SortCriterion<K> {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortCriterion<K> alphabetical(boolean alpha) {
|
||||
this.alpha = Boolean.valueOf(alpha);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortQuery<K> build() {
|
||||
return new DefaultSortQuery<K>(key, by, limit, order, alpha, getKeys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortCriterion<K> limit(long offset, long count) {
|
||||
this.limit = new Range(offset, count);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortCriterion<K> limit(Range range) {
|
||||
this.limit = range;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortCriterion<K> order(Order order) {
|
||||
this.order = order;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortCriterion<K> get(String getPattern) {
|
||||
this.getKeys.add(getPattern);
|
||||
return this;
|
||||
|
||||
@@ -43,32 +43,26 @@ class DefaultSortQuery<K> implements SortQuery<K> {
|
||||
this.gets = gets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBy() {
|
||||
return by;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Range getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isAlphabetic() {
|
||||
return alpha;
|
||||
}
|
||||
|
||||
@Override
|
||||
public K getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getGetPattern() {
|
||||
return gets;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ public class BeanUtilsHashMapper<T> implements HashMapper<T, String, String> {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T fromHash(Map<String, String> hash) {
|
||||
T instance = org.springframework.beans.BeanUtils.instantiate(type);
|
||||
try {
|
||||
@@ -43,7 +42,6 @@ public class BeanUtilsHashMapper<T> implements HashMapper<T, String, String> {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> toHash(T object) {
|
||||
try {
|
||||
return BeanUtils.describe(object);
|
||||
|
||||
@@ -33,13 +33,11 @@ public class DecoratingStringHashMapper<T> implements HashMapper<T, String, Stri
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public T fromHash(Map<String, String> hash) {
|
||||
Map h = hash;
|
||||
return delegate.fromHash(h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> toHash(T object) {
|
||||
Map<?, ?> hash = delegate.toHash(object);
|
||||
Map<String, String> flatten = new LinkedHashMap<String, String>(hash.size());
|
||||
|
||||
@@ -42,12 +42,10 @@ public class JacksonHashMapper<T> implements HashMapper<T, String, Object> {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public T fromHash(Map<String, Object> hash) {
|
||||
return (T) mapper.convertValue(hash, userType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> toHash(T object) {
|
||||
return mapper.convertValue(object, mapType);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,6 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
private volatile RedisSerializer<String> serializer = new StringRedisSerializer();
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (taskExecutor == null) {
|
||||
manageExecutor = true;
|
||||
@@ -137,7 +136,6 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
return new SimpleAsyncTaskExecutor(threadNamePrefix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
initialized = false;
|
||||
|
||||
@@ -154,29 +152,24 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoStartup() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(Runnable callback) {
|
||||
stop();
|
||||
callback.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPhase() {
|
||||
// start the latest
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRunning() {
|
||||
return running;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
if (!running) {
|
||||
running = true;
|
||||
@@ -198,7 +191,6 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if (isRunning()) {
|
||||
running = false;
|
||||
@@ -301,7 +293,6 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
this.connectionFactory = connectionFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanName(String name) {
|
||||
this.beanName = name;
|
||||
}
|
||||
@@ -510,12 +501,10 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
private long WAIT = 500;
|
||||
private long ROUNDS = 3;
|
||||
|
||||
@Override
|
||||
public boolean isLongLived() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// wait for subscription to be initialized
|
||||
boolean done = false;
|
||||
@@ -543,12 +532,10 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
private volatile RedisConnection connection;
|
||||
private final Object localMonitor = new Object();
|
||||
|
||||
@Override
|
||||
public boolean isLongLived() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
connection = connectionFactory.getConnection();
|
||||
try {
|
||||
@@ -695,7 +682,6 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
*/
|
||||
private class DispatchMessageListener implements MessageListener {
|
||||
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
// do channel matching first
|
||||
byte[] channel = message.getChannel();
|
||||
@@ -720,7 +706,6 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
private void dispatchChannels(Collection<MessageListener> ch, final Message message) {
|
||||
for (final MessageListener messageListener : ch) {
|
||||
taskExecutor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
processMessage(messageListener, message, null);
|
||||
}
|
||||
@@ -731,7 +716,6 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
|
||||
private void dispatchPatterns(Collection<MessageListener> pt, final Message message, final byte[] pattern) {
|
||||
for (final MessageListener messageListener : pt) {
|
||||
taskExecutor.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
processMessage(messageListener, message, pattern.clone());
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.data.keyvalue.redis.connection.Message;
|
||||
import org.springframework.data.keyvalue.redis.connection.MessageListener;
|
||||
import org.springframework.data.keyvalue.redis.serializer.JdkSerializationRedisSerializer;
|
||||
import org.springframework.data.keyvalue.redis.serializer.RedisSerializer;
|
||||
import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -166,8 +165,6 @@ public class MessageListenerAdapter implements MessageListener {
|
||||
* @param message the incoming Redis message
|
||||
* @see #handleListenerException
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
try {
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ public class GenericToStringSerializer<T> implements RedisSerializer<T>, BeanFac
|
||||
converter = new Converter(typeConverter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T deserialize(byte[] bytes) {
|
||||
if (bytes == null) {
|
||||
return null;
|
||||
@@ -74,7 +73,6 @@ public class GenericToStringSerializer<T> implements RedisSerializer<T>, BeanFac
|
||||
return converter.convert(string, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] serialize(T object) {
|
||||
if (object == null) {
|
||||
return null;
|
||||
@@ -83,7 +81,6 @@ public class GenericToStringSerializer<T> implements RedisSerializer<T>, BeanFac
|
||||
return string.getBytes(charset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
if (converter == null && beanFactory instanceof ConfigurableBeanFactory) {
|
||||
ConfigurableBeanFactory cFB = (ConfigurableBeanFactory) beanFactory;
|
||||
|
||||
@@ -44,7 +44,6 @@ public class JacksonJsonRedisSerializer<T> implements RedisSerializer<T> {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public T deserialize(byte[] bytes) throws SerializationException {
|
||||
if (SerializationUtils.isEmpty(bytes)) {
|
||||
return null;
|
||||
@@ -56,7 +55,6 @@ public class JacksonJsonRedisSerializer<T> implements RedisSerializer<T> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] serialize(Object t) throws SerializationException {
|
||||
if (t == null) {
|
||||
return SerializationUtils.EMPTY_ARRAY;
|
||||
|
||||
@@ -32,7 +32,6 @@ public class JdkSerializationRedisSerializer implements RedisSerializer<Object>
|
||||
private Converter<byte[], Object> deserializer = new DeserializingConverter();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object deserialize(byte[] bytes) {
|
||||
if (SerializationUtils.isEmpty(bytes)) {
|
||||
return null;
|
||||
@@ -45,7 +44,6 @@ public class JdkSerializationRedisSerializer implements RedisSerializer<Object>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] serialize(Object object) {
|
||||
if (object == null) {
|
||||
return SerializationUtils.EMPTY_ARRAY;
|
||||
|
||||
@@ -50,7 +50,6 @@ public class OxmSerializer implements InitializingBean, RedisSerializer<Object>
|
||||
afterPropertiesSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(marshaller, "non-null marshaller required");
|
||||
Assert.notNull(unmarshaller, "non-null unmarshaller required");
|
||||
@@ -70,7 +69,6 @@ public class OxmSerializer implements InitializingBean, RedisSerializer<Object>
|
||||
this.unmarshaller = unmarshaller;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object deserialize(byte[] bytes) throws SerializationException {
|
||||
if (SerializationUtils.isEmpty(bytes)) {
|
||||
return null;
|
||||
@@ -83,7 +81,6 @@ public class OxmSerializer implements InitializingBean, RedisSerializer<Object>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] serialize(Object t) throws SerializationException {
|
||||
if (t == null) {
|
||||
return SerializationUtils.EMPTY_ARRAY;
|
||||
|
||||
@@ -42,12 +42,10 @@ public class StringRedisSerializer implements RedisSerializer<String> {
|
||||
this.charset = charset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String deserialize(byte[] bytes) {
|
||||
return (bytes == null ? null : new String(bytes, charset));
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] serialize(String string) {
|
||||
return (string == null ? null : string.getBytes(charset));
|
||||
}
|
||||
|
||||
@@ -162,7 +162,6 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey
|
||||
return generalOps.execute(new SessionCallback<Boolean>() {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Boolean execute(RedisOperations operations) {
|
||||
for (;;) {
|
||||
operations.watch(Collections.singleton(key));
|
||||
@@ -239,59 +238,57 @@ public class RedisAtomicInteger extends Number implements Serializable, BoundKey
|
||||
* Returns the String representation of the current value.
|
||||
* @return the String representation of the current value.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return Integer.toString(get());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int intValue() {
|
||||
return get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long longValue() {
|
||||
return (long) get();
|
||||
}
|
||||
|
||||
public float floatValue() {
|
||||
return (float) get();
|
||||
}
|
||||
|
||||
public double doubleValue() {
|
||||
return (double) get();
|
||||
return get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float floatValue() {
|
||||
return get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double doubleValue() {
|
||||
return get();
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(long timeout, TimeUnit unit) {
|
||||
return generalOps.expire(key, timeout, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(Date date) {
|
||||
return generalOps.expireAt(key, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getExpire() {
|
||||
return generalOps.getExpire(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist() {
|
||||
return generalOps.persist(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(String newKey) {
|
||||
generalOps.rename(key, newKey);
|
||||
key = newKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.STRING;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,6 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe
|
||||
return generalOps.execute(new SessionCallback<Boolean>() {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Boolean execute(RedisOperations operations) {
|
||||
for (;;) {
|
||||
operations.watch(Collections.singleton(key));
|
||||
@@ -242,59 +241,57 @@ public class RedisAtomicLong extends Number implements Serializable, BoundKeyOpe
|
||||
*
|
||||
* @return the String representation of the current value.
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return Long.toString(get());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int intValue() {
|
||||
return (int) get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long longValue() {
|
||||
return get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float floatValue() {
|
||||
return (float) get();
|
||||
}
|
||||
|
||||
public double doubleValue() {
|
||||
return (double) get();
|
||||
return get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double doubleValue() {
|
||||
return get();
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(long timeout, TimeUnit unit) {
|
||||
return generalOps.expire(key, timeout, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(Date date) {
|
||||
return generalOps.expireAt(key, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getExpire() {
|
||||
return generalOps.getExpire(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist() {
|
||||
return generalOps.persist(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(String newKey) {
|
||||
generalOps.rename(key, newKey);
|
||||
key = newKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.STRING;
|
||||
}
|
||||
|
||||
@@ -40,12 +40,10 @@ public abstract class AbstractRedisCollection<E> extends AbstractCollection<E> i
|
||||
this.operations = operations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisOperations<String, E> getOperations() {
|
||||
return operations;
|
||||
}
|
||||
@@ -59,8 +57,10 @@ public abstract class AbstractRedisCollection<E> extends AbstractCollection<E> i
|
||||
return modified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract boolean add(E e);
|
||||
|
||||
@Override
|
||||
public abstract void clear();
|
||||
|
||||
@Override
|
||||
@@ -72,6 +72,7 @@ public abstract class AbstractRedisCollection<E> extends AbstractCollection<E> i
|
||||
return contains;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract boolean remove(Object o);
|
||||
|
||||
|
||||
@@ -84,6 +85,7 @@ public abstract class AbstractRedisCollection<E> extends AbstractCollection<E> i
|
||||
return modified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retainAll(Collection<?> c) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -119,27 +121,22 @@ public abstract class AbstractRedisCollection<E> extends AbstractCollection<E> i
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(long timeout, TimeUnit unit) {
|
||||
return operations.expire(key, timeout, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(Date date) {
|
||||
return operations.expireAt(key, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getExpire() {
|
||||
return operations.getExpire(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist() {
|
||||
return operations.persist(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(final String newKey) {
|
||||
CollectionUtils.rename(key, newKey, operations);
|
||||
key = newKey;
|
||||
|
||||
@@ -56,7 +56,6 @@ abstract class CollectionUtils {
|
||||
static <K> void rename(final K key, final K newKey, RedisOperations<K, ?> operations) {
|
||||
operations.execute(new SessionCallback<Object>() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object execute(RedisOperations operations) throws DataAccessException {
|
||||
do {
|
||||
operations.watch(key);
|
||||
@@ -76,7 +75,6 @@ abstract class CollectionUtils {
|
||||
|
||||
static <K> Boolean renameIfAbsent(final K key, final K newKey, RedisOperations<K, ?> operations) {
|
||||
return operations.execute(new SessionCallback<Boolean>() {
|
||||
@Override
|
||||
public Boolean execute(RedisOperations operations) throws DataAccessException {
|
||||
List<Object> exec = null;
|
||||
do {
|
||||
|
||||
@@ -47,8 +47,6 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
|
||||
private volatile boolean capped = false;
|
||||
|
||||
private volatile long defaultWait = 0;
|
||||
|
||||
private class DefaultRedisListIterator extends RedisIterator<E> {
|
||||
|
||||
public DefaultRedisListIterator(Iterator<E> delegate) {
|
||||
@@ -102,12 +100,10 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
capped = (maxSize > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<E> range(long start, long end) {
|
||||
return listOps.range(start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisList<E> trim(int start, int end) {
|
||||
listOps.trim(start, end);
|
||||
return this;
|
||||
@@ -153,7 +149,6 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
return (result != null && result.longValue() > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(int index, E element) {
|
||||
if (index == 0) {
|
||||
listOps.leftPush(element);
|
||||
@@ -176,7 +171,6 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
throw new IllegalArgumentException("Redis supports insertion only at the beginning or the end of the list");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(int index, Collection<? extends E> c) {
|
||||
// insert collection in reverse
|
||||
if (index == 0) {
|
||||
@@ -206,7 +200,6 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
throw new IllegalArgumentException("Redis supports insertion only at the beginning or the end of the list");
|
||||
}
|
||||
|
||||
@Override
|
||||
public E get(int index) {
|
||||
if (index < 0 || index > size()) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
@@ -214,40 +207,33 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
return listOps.index(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int indexOf(Object o) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int lastIndexOf(Object o) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListIterator<E> listIterator() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListIterator<E> listIterator(int index) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public E remove(int index) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public E set(int index, E e) {
|
||||
E object = get(index);
|
||||
listOps.set(index, e);
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<E> subList(int fromIndex, int toIndex) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -256,7 +242,6 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
// Queue methods
|
||||
//
|
||||
|
||||
@Override
|
||||
public E element() {
|
||||
E value = peek();
|
||||
if (value == null)
|
||||
@@ -266,7 +251,6 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean offer(E e) {
|
||||
listOps.rightPush(e);
|
||||
cap();
|
||||
@@ -274,19 +258,16 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public E peek() {
|
||||
return listOps.index(0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public E poll() {
|
||||
return listOps.leftPop();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public E remove() {
|
||||
E value = poll();
|
||||
if (value == null)
|
||||
@@ -299,30 +280,25 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
// Dequeue
|
||||
//
|
||||
|
||||
@Override
|
||||
public void addFirst(E e) {
|
||||
listOps.leftPush(e);
|
||||
cap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLast(E e) {
|
||||
add(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<E> descendingIterator() {
|
||||
List<E> content = content();
|
||||
Collections.reverse(content);
|
||||
return new DefaultRedisListIterator(content.iterator());
|
||||
}
|
||||
|
||||
@Override
|
||||
public E getFirst() {
|
||||
return element();
|
||||
}
|
||||
|
||||
@Override
|
||||
public E getLast() {
|
||||
E e = peekLast();
|
||||
if (e == null) {
|
||||
@@ -331,39 +307,32 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
return e;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean offerFirst(E e) {
|
||||
addFirst(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean offerLast(E e) {
|
||||
addLast(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public E peekFirst() {
|
||||
return peek();
|
||||
}
|
||||
|
||||
@Override
|
||||
public E peekLast() {
|
||||
return listOps.index(-1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E pollFirst() {
|
||||
return poll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public E pollLast() {
|
||||
return listOps.rightPop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public E pop() {
|
||||
E e = poll();
|
||||
if (e == null) {
|
||||
@@ -372,22 +341,18 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
return e;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void push(E e) {
|
||||
addFirst(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E removeFirst() {
|
||||
return pop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeFirstOccurrence(Object o) {
|
||||
return remove(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E removeLast() {
|
||||
E e = pollLast();
|
||||
if (e == null) {
|
||||
@@ -396,7 +361,6 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
return e;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeLastOccurrence(Object o) {
|
||||
Long result = listOps.remove(-1, o);
|
||||
return (result != null && result.longValue() > 0);
|
||||
@@ -407,7 +371,6 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
// BlockingQueue
|
||||
//
|
||||
|
||||
@Override
|
||||
public int drainTo(Collection<? super E> c, int maxElements) {
|
||||
if (this.equals(c)) {
|
||||
throw new IllegalArgumentException("Cannot drain a queue to itself");
|
||||
@@ -423,33 +386,27 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
return loop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int drainTo(Collection<? super E> c) {
|
||||
return drainTo(c, size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException {
|
||||
return offer(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E poll(long timeout, TimeUnit unit) throws InterruptedException {
|
||||
E element = listOps.leftPop(timeout, unit);
|
||||
return (element == null ? null : element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void put(E e) throws InterruptedException {
|
||||
offer(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remainingCapacity() {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public E take() throws InterruptedException {
|
||||
return poll(0, TimeUnit.SECONDS);
|
||||
}
|
||||
@@ -459,48 +416,39 @@ public class DefaultRedisList<E> extends AbstractRedisCollection<E> implements R
|
||||
// BlockingDeque
|
||||
//
|
||||
|
||||
@Override
|
||||
public boolean offerFirst(E e, long timeout, TimeUnit unit) throws InterruptedException {
|
||||
return offerFirst(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean offerLast(E e, long timeout, TimeUnit unit) throws InterruptedException {
|
||||
return offerLast(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E pollFirst(long timeout, TimeUnit unit) throws InterruptedException {
|
||||
return poll(timeout, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E pollLast(long timeout, TimeUnit unit) throws InterruptedException {
|
||||
E element = listOps.rightPop(timeout, unit);
|
||||
return (element == null ? null : element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putFirst(E e) throws InterruptedException {
|
||||
add(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putLast(E e) throws InterruptedException {
|
||||
put(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public E takeFirst() throws InterruptedException {
|
||||
return take();
|
||||
}
|
||||
|
||||
@Override
|
||||
public E takeLast() throws InterruptedException {
|
||||
return pollLast(0, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.LIST;
|
||||
}
|
||||
|
||||
@@ -47,17 +47,14 @@ public class DefaultRedisMap<K, V> implements RedisMap<K, V> {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public K getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public V getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public V setValue(V value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -82,32 +79,26 @@ public class DefaultRedisMap<K, V> implements RedisMap<K, V> {
|
||||
this.hashOps = boundOps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long increment(K key, long delta) {
|
||||
return hashOps.increment(key, delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisOperations<String, ?> getOperations() {
|
||||
return hashOps.getOperations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
getOperations().delete(Collections.singleton(getKey()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsKey(Object key) {
|
||||
return hashOps.hasKey(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsValue(Object value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<java.util.Map.Entry<K, V>> entrySet() {
|
||||
Set<K> keySet = keySet();
|
||||
Collection<V> multiGet = hashOps.multiGet(keySet);
|
||||
@@ -123,46 +114,38 @@ public class DefaultRedisMap<K, V> implements RedisMap<K, V> {
|
||||
return entries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(Object key) {
|
||||
return hashOps.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<K> keySet() {
|
||||
return hashOps.keys();
|
||||
}
|
||||
|
||||
@Override
|
||||
public V put(K key, V value) {
|
||||
V oldV = get(key);
|
||||
hashOps.put(key, value);
|
||||
return oldV;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putAll(Map<? extends K, ? extends V> m) {
|
||||
hashOps.putAll(m);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V remove(Object key) {
|
||||
V v = get(key);
|
||||
hashOps.delete(key);
|
||||
return v;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return hashOps.size().intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<V> values() {
|
||||
return hashOps.values();
|
||||
}
|
||||
@@ -194,7 +177,6 @@ public class DefaultRedisMap<K, V> implements RedisMap<K, V> {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public V putIfAbsent(K key, V value) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -216,7 +198,6 @@ public class DefaultRedisMap<K, V> implements RedisMap<K, V> {
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Object key, Object value) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -242,7 +223,6 @@ public class DefaultRedisMap<K, V> implements RedisMap<K, V> {
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replace(K key, V oldValue, V newValue) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -268,7 +248,6 @@ public class DefaultRedisMap<K, V> implements RedisMap<K, V> {
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public V replace(K key, V value) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -294,38 +273,31 @@ public class DefaultRedisMap<K, V> implements RedisMap<K, V> {
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expire(long timeout, TimeUnit unit) {
|
||||
return hashOps.expire(timeout, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean expireAt(Date date) {
|
||||
return hashOps.expireAt(date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getExpire() {
|
||||
return hashOps.getExpire();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean persist() {
|
||||
return hashOps.persist();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return hashOps.getKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rename(String newKey) {
|
||||
hashOps.rename(newKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return hashOps.getType();
|
||||
}
|
||||
|
||||
@@ -68,68 +68,56 @@ public class DefaultRedisSet<E> extends AbstractRedisCollection<E> implements Re
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Set<E> diff(RedisSet<?> set) {
|
||||
return boundSetOps.diff(set.getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> diff(Collection<? extends RedisSet<?>> sets) {
|
||||
return boundSetOps.diff(CollectionUtils.extractKeys(sets));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RedisSet<E> diffAndStore(RedisSet<?> set, String destKey) {
|
||||
boundSetOps.diffAndStore(set.getKey(), destKey);
|
||||
return new DefaultRedisSet<E>(boundSetOps.getOperations().boundSetOps(destKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisSet<E> diffAndStore(Collection<? extends RedisSet<?>> sets, String destKey) {
|
||||
boundSetOps.diffAndStore(CollectionUtils.extractKeys(sets), destKey);
|
||||
return new DefaultRedisSet<E>(boundSetOps.getOperations().boundSetOps(destKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> intersect(RedisSet<?> set) {
|
||||
return boundSetOps.intersect(set.getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> intersect(Collection<? extends RedisSet<?>> sets) {
|
||||
return boundSetOps.intersect(CollectionUtils.extractKeys(sets));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisSet<E> intersectAndStore(RedisSet<?> set, String destKey) {
|
||||
boundSetOps.intersectAndStore(set.getKey(), destKey);
|
||||
return new DefaultRedisSet<E>(boundSetOps.getOperations().boundSetOps(destKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisSet<E> intersectAndStore(Collection<? extends RedisSet<?>> sets, String destKey) {
|
||||
boundSetOps.intersectAndStore(CollectionUtils.extractKeys(sets), destKey);
|
||||
return new DefaultRedisSet<E>(boundSetOps.getOperations().boundSetOps(destKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> union(RedisSet<?> set) {
|
||||
return boundSetOps.union(set.getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> union(Collection<? extends RedisSet<?>> sets) {
|
||||
return boundSetOps.union(CollectionUtils.extractKeys(sets));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisSet<E> unionAndStore(RedisSet<?> set, String destKey) {
|
||||
boundSetOps.unionAndStore(set.getKey(), destKey);
|
||||
return new DefaultRedisSet<E>(boundSetOps.getOperations().boundSetOps(destKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisSet<E> unionAndStore(Collection<? extends RedisSet<?>> sets, String destKey) {
|
||||
boundSetOps.unionAndStore(CollectionUtils.extractKeys(sets), destKey);
|
||||
return new DefaultRedisSet<E>(boundSetOps.getOperations().boundSetOps(destKey));
|
||||
@@ -168,8 +156,7 @@ public class DefaultRedisSet<E> extends AbstractRedisCollection<E> implements Re
|
||||
return boundSetOps.size().intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.SET;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,52 +91,43 @@ public class DefaultRedisZSet<E> extends AbstractRedisCollection<E> implements R
|
||||
this.defaultScore = defaultScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisZSet<E> intersectAndStore(RedisZSet<?> set, String destKey) {
|
||||
boundZSetOps.intersectAndStore(set.getKey(), destKey);
|
||||
return new DefaultRedisZSet<E>(boundZSetOps.getOperations().boundZSetOps(destKey), getDefaultScore());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisZSet<E> intersectAndStore(Collection<? extends RedisZSet<?>> sets, String destKey) {
|
||||
boundZSetOps.intersectAndStore(CollectionUtils.extractKeys(sets), destKey);
|
||||
return new DefaultRedisZSet<E>(boundZSetOps.getOperations().boundZSetOps(destKey), getDefaultScore());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> range(long start, long end) {
|
||||
return boundZSetOps.range(start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> reverseRange(long start, long end) {
|
||||
return boundZSetOps.reverseRange(start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> rangeByScore(double min, double max) {
|
||||
return boundZSetOps.rangeByScore(min, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisZSet<E> remove(long start, long end) {
|
||||
boundZSetOps.removeRange(start, end);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisZSet<E> removeByScore(double min, double max) {
|
||||
boundZSetOps.removeRangeByScore(min, max);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisZSet<E> unionAndStore(RedisZSet<?> set, String destKey) {
|
||||
boundZSetOps.unionAndStore(set.getKey(), destKey);
|
||||
return new DefaultRedisZSet<E>(boundZSetOps.getOperations().boundZSetOps(destKey), getDefaultScore());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedisZSet<E> unionAndStore(Collection<? extends RedisZSet<?>> sets, String destKey) {
|
||||
boundZSetOps.unionAndStore(CollectionUtils.extractKeys(sets), destKey);
|
||||
return new DefaultRedisZSet<E>(boundZSetOps.getOperations().boundZSetOps(destKey), getDefaultScore());
|
||||
@@ -147,7 +138,6 @@ public class DefaultRedisZSet<E> extends AbstractRedisCollection<E> implements R
|
||||
return add(e, getDefaultScore());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(E e, double score) {
|
||||
return boundZSetOps.add(e, score);
|
||||
}
|
||||
@@ -177,12 +167,10 @@ public class DefaultRedisZSet<E> extends AbstractRedisCollection<E> implements R
|
||||
return boundZSetOps.size().intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getDefaultScore() {
|
||||
return defaultScore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public E first() {
|
||||
Iterator<E> iterator = boundZSetOps.range(0, 0).iterator();
|
||||
if (iterator.hasNext())
|
||||
@@ -190,7 +178,6 @@ public class DefaultRedisZSet<E> extends AbstractRedisCollection<E> implements R
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public E last() {
|
||||
Iterator<E> iterator = boundZSetOps.reverseRange(0, 0).iterator();
|
||||
if (iterator.hasNext())
|
||||
@@ -198,22 +185,18 @@ public class DefaultRedisZSet<E> extends AbstractRedisCollection<E> implements R
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rank(Object o) {
|
||||
return boundZSetOps.rank(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long reverseRank(Object o) {
|
||||
return boundZSetOps.reverseRank(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double score(Object o) {
|
||||
return boundZSetOps.score(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType getType() {
|
||||
return DataType.ZSET;
|
||||
}
|
||||
|
||||
@@ -27,9 +27,7 @@ public class StubErrorHandler implements ErrorHandler {
|
||||
|
||||
public BlockingDeque<Throwable> throwables = new LinkedBlockingDeque<Throwable>();
|
||||
|
||||
@Override
|
||||
public void handleError(Throwable t) {
|
||||
throwables.add(t);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -196,7 +196,6 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
final BlockingDeque<Message> queue = new LinkedBlockingDeque<Message>();
|
||||
|
||||
final MessageListener ml = new MessageListener() {
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
queue.add(message);
|
||||
System.out.println("received message");
|
||||
@@ -212,13 +211,12 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
final AtomicBoolean flag = new AtomicBoolean(true);
|
||||
|
||||
Runnable listener = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
subConn.subscribe(ml, channel);
|
||||
System.out.println("Subscribed");
|
||||
while (flag.get()) {
|
||||
try {
|
||||
Thread.currentThread().sleep(2000);
|
||||
Thread.sleep(2000);
|
||||
} catch (Exception ex) {
|
||||
return;
|
||||
}
|
||||
@@ -251,7 +249,6 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
|
||||
MessageListener listener = new MessageListener() {
|
||||
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
assertArrayEquals(expectedChannel, message.getChannel());
|
||||
assertArrayEquals(expectedMessage, message.getBody());
|
||||
@@ -259,11 +256,10 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
};
|
||||
|
||||
Thread th = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// sleep 1 second to let the registration happen
|
||||
try {
|
||||
Thread.currentThread().sleep(1000);
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
@@ -288,7 +284,6 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
|
||||
MessageListener listener = new MessageListener() {
|
||||
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
assertArrayEquals(expectedPattern, pattern);
|
||||
assertArrayEquals(expectedMessage, message.getBody());
|
||||
@@ -297,11 +292,10 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
};
|
||||
|
||||
Thread th = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// sleep 1 second to let the registration happen
|
||||
try {
|
||||
Thread.currentThread().sleep(1000);
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ public class SessionTest {
|
||||
final StringRedisTemplate template = new StringRedisTemplate(factory);
|
||||
|
||||
template.execute(new SessionCallback<Object>() {
|
||||
@Override
|
||||
public Object execute(RedisOperations operations) {
|
||||
checkConnection(template, conn);
|
||||
template.discard();
|
||||
@@ -50,8 +49,6 @@ public class SessionTest {
|
||||
|
||||
private void checkConnection(RedisTemplate<?, ?> template, final RedisConnection expectedConnection) {
|
||||
template.execute(new RedisCallback<Object>() {
|
||||
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) throws DataAccessException {
|
||||
assertSame(expectedConnection, connection);
|
||||
return null;
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.springframework.data.keyvalue.redis.connection.MessageListener;
|
||||
*/
|
||||
public class ThrowableMessageListener implements MessageListener {
|
||||
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
throw new IllegalStateException("throwing exception for message " + message);
|
||||
}
|
||||
|
||||
@@ -90,8 +90,6 @@ public abstract class AbstractRedisCollectionTests<T> {
|
||||
// remove the collection entirely since clear() doesn't always work
|
||||
collection.getOperations().delete(Collections.singleton(collection.getKey()));
|
||||
template.execute(new RedisCallback<Object>() {
|
||||
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.flushDb();
|
||||
return null;
|
||||
|
||||
@@ -92,8 +92,6 @@ public abstract class AbstractRedisMapTests<K, V> {
|
||||
// remove the collection entirely since clear() doesn't always work
|
||||
map.getOperations().delete(Collections.singleton(map.getKey()));
|
||||
template.execute(new RedisCallback<Object>() {
|
||||
|
||||
@Override
|
||||
public Object doInRedis(RedisConnection connection) {
|
||||
connection.flushDb();
|
||||
return null;
|
||||
|
||||
@@ -27,7 +27,6 @@ public class PersonObjectFactory implements ObjectFactory<Person> {
|
||||
|
||||
private int counter = 0;
|
||||
|
||||
@Override
|
||||
public Person instance() {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
return new Person(uuid, uuid, ++counter, new Address(uuid, counter));
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.UUID;
|
||||
*/
|
||||
public class StringObjectFactory implements ObjectFactory<String> {
|
||||
|
||||
@Override
|
||||
public String instance() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user