From 2fc50d466d1eed951e52bea3130ccd90aa07478e Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Thu, 21 Jun 2012 18:35:13 +0300 Subject: [PATCH] add execute native for RjcConnection --- .../redis/connection/rjc/RjcConnection.java | 276 +++++++++--------- 1 file changed, 143 insertions(+), 133 deletions(-) diff --git a/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java b/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java index 67a3b5801..621dc9591 100644 --- a/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java @@ -28,6 +28,7 @@ import org.idevlab.rjc.SessionFactoryImpl; import org.idevlab.rjc.SortingParams; import org.idevlab.rjc.ZParams; import org.idevlab.rjc.message.RedisNodeSubscriber; +import org.idevlab.rjc.protocol.Protocol.Command; import org.springframework.dao.DataAccessException; import org.springframework.data.redis.RedisSystemException; import org.springframework.data.redis.connection.DataType; @@ -36,6 +37,8 @@ import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.connection.RedisSubscribedConnectionException; import org.springframework.data.redis.connection.SortParameters; import org.springframework.data.redis.connection.Subscription; +import org.springframework.util.Assert; +import org.springframework.util.ObjectUtils; /** * {@code RedisConnection} implementation on top of rjc library. @@ -49,6 +52,7 @@ public class RjcConnection implements RedisConnection { private final Client client; private final Session session; + private final org.idevlab.rjc.ds.RedisConnection connection; private volatile Client pipeline; private volatile RjcSubscription subscription; @@ -60,6 +64,7 @@ public class RjcConnection implements RedisConnection { subscriber = new RedisNodeSubscriber(); subscriber.setDataSource(new SingleDataSource(new CloseSuppressingRjcConnection(connection))); client = new Client(connection); + this.connection = connection; this.dbIndex = dbIndex; @@ -76,7 +81,13 @@ public class RjcConnection implements RedisConnection { return new RedisSystemException("Unknown rjc exception", ex); } - + public Object execute(String command, byte[]... args) { + Assert.hasText(command, "a valid command needs to be specified"); + connection.sendCommand(Command.valueOf(command.trim().toUpperCase()), + (ObjectUtils.isEmpty(args) ? new byte[0][] : args)); + return connection.getAll(); + } + public void close() throws DataAccessException { isClosed = true; @@ -94,27 +105,27 @@ public class RjcConnection implements RedisConnection { } - + public boolean isClosed() { return isClosed; } - + public Session getNativeConnection() { return session; } - + public boolean isQueueing() { return client.isInMulti(); } - + public boolean isPipelined() { return (pipeline != null); } - + public void openPipeline() { if (pipeline == null) { pipeline = client; @@ -122,7 +133,6 @@ public class RjcConnection implements RedisConnection { } @SuppressWarnings("unchecked") - public List closePipeline() { if (pipeline != null) { List execute = client.getAll(); @@ -133,7 +143,7 @@ public class RjcConnection implements RedisConnection { return Collections.emptyList(); } - + public List sort(byte[] key, SortParameters params) { SortingParams sortParams = RjcUtils.convertSortParams(params); @@ -157,7 +167,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long sort(byte[] key, SortParameters params, byte[] sortKey) { SortingParams sortParams = RjcUtils.convertSortParams(params); @@ -182,7 +192,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long dbSize() { try { if (isPipelined()) { @@ -196,7 +206,7 @@ public class RjcConnection implements RedisConnection { } - + public void flushDb() { try { if (isPipelined()) { @@ -209,7 +219,7 @@ public class RjcConnection implements RedisConnection { } } - + public void flushAll() { try { if (isPipelined()) { @@ -222,7 +232,7 @@ public class RjcConnection implements RedisConnection { } } - + public void bgSave() { try { if (isPipelined()) { @@ -235,7 +245,7 @@ public class RjcConnection implements RedisConnection { } } - + public void bgWriteAof() { try { if (isPipelined()) { @@ -248,7 +258,7 @@ public class RjcConnection implements RedisConnection { } } - + public void save() { try { if (isPipelined()) { @@ -261,7 +271,7 @@ public class RjcConnection implements RedisConnection { } } - + public List getConfig(String param) { try { if (isPipelined()) { @@ -274,7 +284,7 @@ public class RjcConnection implements RedisConnection { } } - + public Properties info() { try { if (isPipelined()) { @@ -287,7 +297,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long lastSave() { try { if (isPipelined()) { @@ -300,7 +310,7 @@ public class RjcConnection implements RedisConnection { } } - + public void setConfig(String param, String value) { try { if (isPipelined()) { @@ -314,7 +324,7 @@ public class RjcConnection implements RedisConnection { } - + public void resetConfigStats() { try { if (isPipelined()) { @@ -328,7 +338,7 @@ public class RjcConnection implements RedisConnection { } } - + public void shutdown() { try { if (isPipelined()) { @@ -341,7 +351,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] echo(byte[] message) { String stringMsg = RjcUtils.decode(message); try { @@ -355,7 +365,7 @@ public class RjcConnection implements RedisConnection { } } - + public String ping() { try { if (isPipelined()) { @@ -367,7 +377,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long del(byte[]... keys) { String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -382,7 +392,7 @@ public class RjcConnection implements RedisConnection { } } - + public void discard() { try { if (isPipelined()) { @@ -396,7 +406,7 @@ public class RjcConnection implements RedisConnection { } } - + public List exec() { try { if (isPipelined()) { @@ -409,7 +419,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean exists(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -424,7 +434,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean expire(byte[] key, long seconds) { String stringKey = RjcUtils.decode(key); @@ -439,7 +449,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean expireAt(byte[] key, long unixTime) { String stringKey = RjcUtils.decode(key); @@ -454,7 +464,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set keys(byte[] pattern) { String stringKey = RjcUtils.decode(pattern); @@ -469,7 +479,7 @@ public class RjcConnection implements RedisConnection { } } - + public void multi() { if (isQueueing()) { return; @@ -485,7 +495,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean persist(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -500,7 +510,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean move(byte[] key, int dbIndex) { String stringKey = RjcUtils.decode(key); @@ -515,7 +525,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] randomKey() { try { if (isPipelined()) { @@ -528,7 +538,7 @@ public class RjcConnection implements RedisConnection { } } - + public void rename(byte[] oldName, byte[] newName) { String stringOldKey = RjcUtils.decode(oldName); String stringNewKey = RjcUtils.decode(newName); @@ -544,7 +554,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean renameNX(byte[] oldName, byte[] newName) { String stringOldKey = RjcUtils.decode(oldName); String stringNewKey = RjcUtils.decode(newName); @@ -560,7 +570,7 @@ public class RjcConnection implements RedisConnection { } } - + public void select(int dbIndex) { try { if (isPipelined()) { @@ -573,7 +583,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long ttl(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -588,7 +598,7 @@ public class RjcConnection implements RedisConnection { } } - + public DataType type(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -603,7 +613,7 @@ public class RjcConnection implements RedisConnection { } } - + public void unwatch() { try { if (isPipelined()) { @@ -617,7 +627,7 @@ public class RjcConnection implements RedisConnection { } } - + public void watch(byte[]... keys) { String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -641,7 +651,7 @@ public class RjcConnection implements RedisConnection { // String commands // - + public byte[] get(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -657,7 +667,7 @@ public class RjcConnection implements RedisConnection { } } - + public void set(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -674,7 +684,7 @@ public class RjcConnection implements RedisConnection { } - + public byte[] getSet(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -690,7 +700,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long append(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -706,7 +716,7 @@ public class RjcConnection implements RedisConnection { } } - + public List mGet(byte[]... keys) { String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -721,7 +731,7 @@ public class RjcConnection implements RedisConnection { } } - + public void mSet(Map tuples) { String[] decodeMap = RjcUtils.flatten(tuples); @@ -736,7 +746,7 @@ public class RjcConnection implements RedisConnection { } } - + public void mSetNX(Map tuples) { String[] decodeMap = RjcUtils.flatten(tuples); @@ -752,7 +762,7 @@ public class RjcConnection implements RedisConnection { } } - + public void setEx(byte[] key, long time, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -768,7 +778,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean setNX(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -784,7 +794,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] getRange(byte[] key, long start, long end) { String stringKey = RjcUtils.decode(key); @@ -799,7 +809,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long decr(byte[] key) { String stringKey = RjcUtils.decode(key); try { @@ -814,7 +824,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long decrBy(byte[] key, long value) { String stringKey = RjcUtils.decode(key); try { @@ -829,7 +839,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long incr(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -845,7 +855,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long incrBy(byte[] key, long value) { String stringKey = RjcUtils.decode(key); @@ -861,7 +871,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean getBit(byte[] key, long offset) { String stringKey = RjcUtils.decode(key); @@ -876,7 +886,7 @@ public class RjcConnection implements RedisConnection { } } - + public void setBit(byte[] key, long offset, boolean value) { String stringKey = RjcUtils.decode(key); @@ -891,7 +901,7 @@ public class RjcConnection implements RedisConnection { } } - + public void setRange(byte[] key, byte[] value, long offset) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -907,7 +917,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long strLen(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -926,7 +936,7 @@ public class RjcConnection implements RedisConnection { // List commands // - + public Long lPush(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -942,7 +952,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long rPush(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -959,7 +969,7 @@ public class RjcConnection implements RedisConnection { } } - + public List bLPop(int timeout, byte[]... keys) { String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -974,7 +984,7 @@ public class RjcConnection implements RedisConnection { } } - + public List bRPop(int timeout, byte[]... keys) { String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -989,7 +999,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] lIndex(byte[] key, long index) { String stringKey = RjcUtils.decode(key); @@ -1005,7 +1015,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1023,7 +1033,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long lLen(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -1039,7 +1049,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] lPop(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -1055,7 +1065,7 @@ public class RjcConnection implements RedisConnection { } } - + public List lRange(byte[] key, long start, long end) { String stringKey = RjcUtils.decode(key); @@ -1071,7 +1081,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long lRem(byte[] key, long count, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1088,7 +1098,7 @@ public class RjcConnection implements RedisConnection { } } - + public void lSet(byte[] key, long index, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1104,7 +1114,7 @@ public class RjcConnection implements RedisConnection { } } - + public void lTrim(byte[] key, long start, long end) { String stringKey = RjcUtils.decode(key); @@ -1120,7 +1130,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] rPop(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -1136,7 +1146,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) { String stringKey = RjcUtils.decode(srcKey); String stringDest = RjcUtils.decode(dstKey); @@ -1153,7 +1163,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) { String stringKey = RjcUtils.decode(srcKey); String stringDest = RjcUtils.decode(dstKey); @@ -1169,7 +1179,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long lPushX(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1184,7 +1194,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long rPushX(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1204,7 +1214,7 @@ public class RjcConnection implements RedisConnection { // Set commands // - + public Boolean sAdd(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1221,7 +1231,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long sCard(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -1237,7 +1247,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set sDiff(byte[]... keys) { String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -1253,7 +1263,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long sDiffStore(byte[] destKey, byte[]... keys) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -1270,7 +1280,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set sInter(byte[]... keys) { String[] stringKeys = RjcUtils.decodeMultiple(keys); try { @@ -1285,7 +1295,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long sInterStore(byte[] destKey, byte[]... keys) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -1301,7 +1311,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean sIsMember(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1318,7 +1328,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set sMembers(byte[] key) { String stringKey = RjcUtils.decode(key); try { @@ -1333,7 +1343,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value) { String stringSrc = RjcUtils.decode(srcKey); String stringDest = RjcUtils.decode(destKey); @@ -1351,7 +1361,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] sPop(byte[] key) { String stringKey = RjcUtils.decode(key); try { @@ -1366,7 +1376,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] sRandMember(byte[] key) { String stringKey = RjcUtils.decode(key); try { @@ -1381,7 +1391,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean sRem(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1398,7 +1408,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set sUnion(byte[]... keys) { String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -1414,7 +1424,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long sUnionStore(byte[] destKey, byte[]... keys) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(keys); @@ -1435,7 +1445,7 @@ public class RjcConnection implements RedisConnection { // ZSet commands // - + public Boolean zAdd(byte[] key, double score, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1451,7 +1461,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zCard(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -1466,7 +1476,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zCount(byte[] key, double min, double max) { String stringKey = RjcUtils.decode(key); try { @@ -1481,7 +1491,7 @@ public class RjcConnection implements RedisConnection { } } - + public Double zIncrBy(byte[] key, double increment, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1497,7 +1507,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(sets); @@ -1515,7 +1525,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zInterStore(byte[] destKey, byte[]... sets) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(sets); @@ -1531,7 +1541,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRange(byte[] key, long start, long end) { String stringKey = RjcUtils.decode(key); try { @@ -1546,7 +1556,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRangeWithScores(byte[] key, long start, long end) { String stringKey = RjcUtils.decode(key); try { @@ -1561,7 +1571,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRangeByScore(byte[] key, double min, double max) { String stringKey = RjcUtils.decode(key); String minString = Double.toString(min); @@ -1578,7 +1588,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRangeByScore(byte[] key, double min, double max, long offset, long count) { String stringKey = RjcUtils.decode(key); String minString = Double.toString(min); @@ -1597,7 +1607,7 @@ public class RjcConnection implements RedisConnection { } - + public Set zRevRangeByScore(byte[] key, double min, double max, long offset, long count) { String stringKey = RjcUtils.decode(key); String minString = Double.toString(min); @@ -1615,7 +1625,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRevRangeByScore(byte[] key, double min, double max) { String stringKey = RjcUtils.decode(key); String minString = Double.toString(min); @@ -1632,7 +1642,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRangeByScoreWithScores(byte[] key, double min, double max) { String stringKey = RjcUtils.decode(key); String minString = Double.toString(min); @@ -1649,7 +1659,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRevRangeWithScores(byte[] key, long start, long end) { String stringKey = RjcUtils.decode(key); String minString = Long.toString(start); @@ -1667,7 +1677,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count) { String stringKey = RjcUtils.decode(key); String minString = Double.toString(min); @@ -1686,7 +1696,7 @@ public class RjcConnection implements RedisConnection { } - + public Set zRevRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count) { String stringKey = RjcUtils.decode(key); String minString = Double.toString(min); @@ -1705,7 +1715,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRevRangeByScoreWithScores(byte[] key, double min, double max) { String stringKey = RjcUtils.decode(key); String minString = Double.toString(min); @@ -1723,7 +1733,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zRank(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1739,7 +1749,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean zRem(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1755,7 +1765,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zRemRange(byte[] key, long start, long end) { String stringKey = RjcUtils.decode(key); try { @@ -1769,7 +1779,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zRemRangeByScore(byte[] key, double min, double max) { String stringKey = RjcUtils.decode(key); String minString = Double.toString(min); @@ -1786,7 +1796,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set zRevRange(byte[] key, long start, long end) { String stringKey = RjcUtils.decode(key); try { @@ -1801,7 +1811,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zRevRank(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1817,7 +1827,7 @@ public class RjcConnection implements RedisConnection { } } - + public Double zScore(byte[] key, byte[] value) { String stringKey = RjcUtils.decode(key); String stringValue = RjcUtils.decode(value); @@ -1833,7 +1843,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(destKey); @@ -1851,7 +1861,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long zUnionStore(byte[] destKey, byte[]... sets) { String stringKey = RjcUtils.decode(destKey); String[] stringKeys = RjcUtils.decodeMultiple(sets); @@ -1871,7 +1881,7 @@ public class RjcConnection implements RedisConnection { // Hash commands // - + public Boolean hSet(byte[] key, byte[] field, byte[] value) { String stringKey = RjcUtils.decode(key); String stringField = RjcUtils.decode(field); @@ -1888,7 +1898,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean hSetNX(byte[] key, byte[] field, byte[] value) { String stringKey = RjcUtils.decode(key); String stringField = RjcUtils.decode(field); @@ -1905,7 +1915,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean hDel(byte[] key, byte[] field) { String stringKey = RjcUtils.decode(key); String stringField = RjcUtils.decode(field); @@ -1921,7 +1931,7 @@ public class RjcConnection implements RedisConnection { } } - + public Boolean hExists(byte[] key, byte[] field) { String stringKey = RjcUtils.decode(key); String stringField = RjcUtils.decode(field); @@ -1937,7 +1947,7 @@ public class RjcConnection implements RedisConnection { } } - + public byte[] hGet(byte[] key, byte[] field) { String stringKey = RjcUtils.decode(key); String stringField = RjcUtils.decode(field); @@ -1953,7 +1963,7 @@ public class RjcConnection implements RedisConnection { } } - + public Map hGetAll(byte[] key) { String stringKey = RjcUtils.decode(key); @@ -1968,7 +1978,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long hIncrBy(byte[] key, byte[] field, long delta) { String stringKey = RjcUtils.decode(key); String stringField = RjcUtils.decode(field); @@ -1984,7 +1994,7 @@ public class RjcConnection implements RedisConnection { } } - + public Set hKeys(byte[] key) { String stringKey = RjcUtils.decode(key); try { @@ -1998,7 +2008,7 @@ public class RjcConnection implements RedisConnection { } } - + public Long hLen(byte[] key) { String stringKey = RjcUtils.decode(key); try { @@ -2012,7 +2022,7 @@ public class RjcConnection implements RedisConnection { } } - + public List hMGet(byte[] key, byte[]... fields) { String stringKey = RjcUtils.decode(key); String[] stringKeys = RjcUtils.decodeMultiple(fields); @@ -2028,7 +2038,7 @@ public class RjcConnection implements RedisConnection { } } - + public void hMSet(byte[] key, Map tuple) { String stringKey = RjcUtils.decode(key); Map stringTuple = RjcUtils.decodeMap(tuple); @@ -2044,7 +2054,7 @@ public class RjcConnection implements RedisConnection { } } - + public List hVals(byte[] key) { String stringKey = RjcUtils.decode(key); try { @@ -2063,7 +2073,7 @@ public class RjcConnection implements RedisConnection { // // Pub/Sub functionality // - + public Long publish(byte[] channel, byte[] message) { try { if (isQueueing()) { @@ -2078,17 +2088,17 @@ public class RjcConnection implements RedisConnection { } } - + public Subscription getSubscription() { return subscription; } - + public boolean isSubscribed() { return (subscription != null && subscription.isAlive()); } - + public void pSubscribe(MessageListener listener, byte[]... patterns) { if (isSubscribed()) { throw new RedisSubscribedConnectionException( @@ -2112,7 +2122,7 @@ public class RjcConnection implements RedisConnection { } } - + public void subscribe(MessageListener listener, byte[]... channels) { if (isSubscribed()) { throw new RedisSubscribedConnectionException(