new - supplement transaction missing api and fix some args type definition which is inconsistent with jedis
This commit is contained in:
@@ -475,6 +475,15 @@ public class BinaryClient extends Connection {
|
||||
public void blpop(final byte[][] args) {
|
||||
sendCommand(BLPOP, args);
|
||||
}
|
||||
|
||||
public void blpop(final int timeout, final byte[]... keys) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
for (final byte[] arg : keys) {
|
||||
args.add(arg);
|
||||
}
|
||||
args.add(Protocol.toByteArray(timeout));
|
||||
blpop(args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
public void sort(final byte[] key, final SortingParams sortingParameters,
|
||||
final byte[] dstkey) {
|
||||
@@ -493,6 +502,15 @@ public class BinaryClient extends Connection {
|
||||
public void brpop(final byte[][] args) {
|
||||
sendCommand(BRPOP, args);
|
||||
}
|
||||
|
||||
public void brpop(final int timeout, final byte[]... keys) {
|
||||
final List<byte[]> args = new ArrayList<byte[]>();
|
||||
for (final byte[] arg : keys) {
|
||||
args.add(arg);
|
||||
}
|
||||
args.add(Protocol.toByteArray(timeout));
|
||||
brpop(args.toArray(new byte[args.size()][]));
|
||||
}
|
||||
|
||||
public void auth(final String password) {
|
||||
setPassword(password);
|
||||
@@ -897,7 +915,7 @@ public class BinaryClient extends Connection {
|
||||
sendCommand(Command.SET, key, value, nxxx);
|
||||
}
|
||||
|
||||
public void set(final byte[] key, final byte[] value, final byte[] nxxx, final byte[] expx, final long time) {
|
||||
public void set(final byte[] key, final byte[] value, final byte[] nxxx, final byte[] expx, final int time) {
|
||||
sendCommand(Command.SET, key, value, nxxx, expx, toByteArray(time));
|
||||
}
|
||||
|
||||
@@ -924,4 +942,12 @@ public class BinaryClient extends Connection {
|
||||
public void time() {
|
||||
sendCommand(TIME);
|
||||
}
|
||||
|
||||
public void migrate(final byte[] host, final int port, final byte[] key, final int destinationDb, final int timeout) {
|
||||
sendCommand(MIGRATE, host, toByteArray(port), key, toByteArray(destinationDb), toByteArray(timeout));
|
||||
}
|
||||
|
||||
public void hincrByFloat(final byte[] key, final byte[] field, double increment) {
|
||||
sendCommand(HINCRBYFLOAT, key, field, toByteArray(increment));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3294,7 +3294,7 @@ public class BinaryJedis implements BasicCommands, BinaryJedisCommands, MultiKey
|
||||
return client.getStatusCodeReply();
|
||||
}
|
||||
|
||||
public String set(final byte[] key, final byte[] value, final byte[] nxxx, final byte[] expx, final long time) {
|
||||
public String set(final byte[] key, final byte[] value, final byte[] nxxx, final byte[] expx, final int time) {
|
||||
checkIsInMulti();
|
||||
client.set(key, value, nxxx, expx, time);
|
||||
return client.getStatusCodeReply();
|
||||
@@ -3329,5 +3329,18 @@ public class BinaryJedis implements BasicCommands, BinaryJedisCommands, MultiKey
|
||||
client.time();
|
||||
return client.getMultiBulkReply();
|
||||
}
|
||||
|
||||
public String migrate(final byte[] host, final int port, final byte[] key, final int destinationDb, final int timeout) {
|
||||
checkIsInMulti();
|
||||
client.migrate(host, port, key, destinationDb, timeout);
|
||||
return client.getStatusCodeReply();
|
||||
}
|
||||
|
||||
public Double hincrByFloat(final byte[] key, final byte[] field, double increment) {
|
||||
checkIsInMulti();
|
||||
client.hincrByFloat(key, field, increment);
|
||||
String relpy = client.getBulkReply();
|
||||
return (relpy != null ? new Double(relpy) : null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface BinaryRedisPipeline {
|
||||
|
||||
Response<Long> getrange(byte[] key, long startOffset, long endOffset);
|
||||
|
||||
Response<Long> hdel(byte[] key, byte[] field);
|
||||
Response<Long> hdel(byte[] key, byte[]... field);
|
||||
|
||||
Response<Boolean> hexists(byte[] key, byte[] field);
|
||||
|
||||
@@ -64,7 +64,7 @@ public interface BinaryRedisPipeline {
|
||||
|
||||
Response<Long> incrBy(byte[] key, long integer);
|
||||
|
||||
Response<byte[]> lindex(byte[] key, int index);
|
||||
Response<byte[]> lindex(byte[] key, long index);
|
||||
|
||||
Response<Long> linsert(byte[] key, BinaryClient.LIST_POSITION where,
|
||||
byte[] pivot, byte[] value);
|
||||
@@ -124,7 +124,7 @@ public interface BinaryRedisPipeline {
|
||||
|
||||
Response<byte[]> srandmember(byte[] key);
|
||||
|
||||
Response<Long> srem(byte[] key, byte[] member);
|
||||
Response<Long> srem(byte[] key, byte[]... member);
|
||||
|
||||
Response<Long> strlen(byte[] key);
|
||||
|
||||
@@ -142,7 +142,7 @@ public interface BinaryRedisPipeline {
|
||||
|
||||
Response<Double> zincrby(byte[] key, double score, byte[] member);
|
||||
|
||||
Response<Set<byte[]>> zrange(byte[] key, int start, int end);
|
||||
Response<Set<byte[]>> zrange(byte[] key, long start, long end);
|
||||
|
||||
Response<Set<byte[]>> zrangeByScore(byte[] key, double min,
|
||||
double max);
|
||||
@@ -192,22 +192,22 @@ public interface BinaryRedisPipeline {
|
||||
Response<Set<Tuple>> zrevrangeByScoreWithScores(byte[] key,
|
||||
byte[] max, byte[] min, int offset, int count);
|
||||
|
||||
Response<Set<Tuple>> zrangeWithScores(byte[] key, int start, int end);
|
||||
Response<Set<Tuple>> zrangeWithScores(byte[] key, long start, long end);
|
||||
|
||||
Response<Long> zrank(byte[] key, byte[] member);
|
||||
|
||||
Response<Long> zrem(byte[] key, byte[] member);
|
||||
Response<Long> zrem(byte[] key, byte[]... member);
|
||||
|
||||
Response<Long> zremrangeByRank(byte[] key, int start, int end);
|
||||
Response<Long> zremrangeByRank(byte[] key, long start, long end);
|
||||
|
||||
Response<Long> zremrangeByScore(byte[] key, double start, double end);
|
||||
|
||||
Response<Long> zremrangeByScore(byte[] key, byte[] start, byte[] end);
|
||||
|
||||
Response<Set<byte[]>> zrevrange(byte[] key, int start, int end);
|
||||
Response<Set<byte[]>> zrevrange(byte[] key, long start, long end);
|
||||
|
||||
Response<Set<Tuple>> zrevrangeWithScores(byte[] key, int start,
|
||||
int end);
|
||||
Response<Set<Tuple>> zrevrangeWithScores(byte[] key, long start,
|
||||
long end);
|
||||
|
||||
Response<Long> zrevrank(byte[] key, byte[] member);
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ package redis.clients.jedis;
|
||||
|
||||
import static redis.clients.jedis.Protocol.toByteArray;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@@ -385,6 +387,15 @@ public class Client extends BinaryClient implements Commands {
|
||||
}
|
||||
blpop(bargs);
|
||||
}
|
||||
|
||||
public void blpop(final int timeout, final String... keys) {
|
||||
List<String> args = new ArrayList<String>();
|
||||
for (String arg : keys) {
|
||||
args.add(arg);
|
||||
}
|
||||
args.add(String.valueOf(timeout));
|
||||
blpop(args.toArray(new String[args.size()]));
|
||||
}
|
||||
|
||||
public void sort(final String key, final SortingParams sortingParameters,
|
||||
final String dstkey) {
|
||||
@@ -403,6 +414,15 @@ public class Client extends BinaryClient implements Commands {
|
||||
}
|
||||
brpop(bargs);
|
||||
}
|
||||
|
||||
public void brpop(final int timeout, final String... keys) {
|
||||
List<String> args = new ArrayList<String>();
|
||||
for (String arg : keys) {
|
||||
args.add(arg);
|
||||
}
|
||||
args.add(String.valueOf(timeout));
|
||||
brpop(args.toArray(new String[args.size()]));
|
||||
}
|
||||
|
||||
public void zcount(final String key, final double min, final double max) {
|
||||
zcount(SafeEncoder.encode(key), toByteArray(min), toByteArray(max));
|
||||
@@ -765,7 +785,7 @@ public class Client extends BinaryClient implements Commands {
|
||||
set(SafeEncoder.encode(key), SafeEncoder.encode(value), SafeEncoder.encode(nxxx));
|
||||
}
|
||||
|
||||
public void set(final String key, final String value, final String nxxx, final String expx, final long time) {
|
||||
public void set(final String key, final String value, final String nxxx, final String expx, final int time) {
|
||||
set(SafeEncoder.encode(key), SafeEncoder.encode(value), SafeEncoder.encode(nxxx), SafeEncoder.encode(expx), time);
|
||||
}
|
||||
|
||||
@@ -780,4 +800,12 @@ public class Client extends BinaryClient implements Commands {
|
||||
public void clientSetname(final String name) {
|
||||
clientSetname(SafeEncoder.encode(name));
|
||||
}
|
||||
|
||||
public void migrate(final String host, final int port, final String key, final int destinationDb, final int timeout) {
|
||||
migrate(SafeEncoder.encode(host), port, SafeEncoder.encode(key), destinationDb, timeout);
|
||||
}
|
||||
|
||||
public void hincrByFloat(final String key, final String field, double increment) {
|
||||
hincrByFloat(SafeEncoder.encode(key), SafeEncoder.encode(field), increment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3057,7 +3057,7 @@ public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommand
|
||||
return client.getStatusCodeReply();
|
||||
}
|
||||
|
||||
public String set(final String key, final String value, final String nxxx, final String expx, final long time) {
|
||||
public String set(final String key, final String value, final String nxxx, final String expx, final int time) {
|
||||
checkIsInMulti();
|
||||
client.set(key, value, nxxx, expx, time);
|
||||
return client.getStatusCodeReply();
|
||||
@@ -3074,4 +3074,17 @@ public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommand
|
||||
client.clientSetname(name);
|
||||
return client.getBulkReply();
|
||||
}
|
||||
|
||||
public String migrate(final String host, final int port, final String key, final int destinationDb, final int timeout) {
|
||||
checkIsInMulti();
|
||||
client.migrate(host, port, key, destinationDb, timeout);
|
||||
return client.getStatusCodeReply();
|
||||
}
|
||||
|
||||
public Double hincrByFloat(final String key, final String field, double increment) {
|
||||
checkIsInMulti();
|
||||
client.hincrByFloat(key, field, increment);
|
||||
String relpy = client.getBulkReply();
|
||||
return (relpy != null ? new Double(relpy) : null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package redis.clients.jedis;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
abstract class MultiKeyPipelineBase extends PipelineBase implements
|
||||
@@ -14,21 +15,51 @@ abstract class MultiKeyPipelineBase extends PipelineBase implements
|
||||
client.brpop(args);
|
||||
return getResponse(BuilderFactory.STRING_LIST);
|
||||
}
|
||||
|
||||
public Response<List<String>> brpop(int timeout, String... keys) {
|
||||
client.brpop(timeout, keys);
|
||||
return getResponse(BuilderFactory.STRING_LIST);
|
||||
}
|
||||
|
||||
public Response<List<String>> blpop(String... args) {
|
||||
client.blpop(args);
|
||||
return getResponse(BuilderFactory.STRING_LIST);
|
||||
}
|
||||
|
||||
public Response<List<String>> blpop(int timeout, String... keys) {
|
||||
client.blpop(timeout, keys);
|
||||
return getResponse(BuilderFactory.STRING_LIST);
|
||||
}
|
||||
|
||||
public Response<Map<String, String>> blpopMap(int timeout, String... keys) {
|
||||
client.blpop(timeout, keys);
|
||||
return getResponse(BuilderFactory.STRING_MAP);
|
||||
}
|
||||
|
||||
public Response<List<byte[]>> brpop(byte[]... args) {
|
||||
client.brpop(args);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY_LIST);
|
||||
}
|
||||
|
||||
public Response<List<String>> brpop(int timeout, byte[]... keys) {
|
||||
client.brpop(timeout, keys);
|
||||
return getResponse(BuilderFactory.STRING_LIST);
|
||||
}
|
||||
|
||||
public Response<Map<String, String>> brpopMap(int timeout, String... keys) {
|
||||
client.blpop(timeout, keys);
|
||||
return getResponse(BuilderFactory.STRING_MAP);
|
||||
}
|
||||
|
||||
public Response<List<byte[]>> blpop(byte[]... args) {
|
||||
client.blpop(args);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY_LIST);
|
||||
}
|
||||
|
||||
public Response<List<String>> blpop(int timeout, byte[]... keys) {
|
||||
client.blpop(timeout, keys);
|
||||
return getResponse(BuilderFactory.STRING_LIST);
|
||||
}
|
||||
|
||||
public Response<Long> del(String... keys) {
|
||||
client.del(keys);
|
||||
|
||||
@@ -165,12 +165,12 @@ abstract class PipelineBase extends Queable implements
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> hdel(String key, String field) {
|
||||
public Response<Long> hdel(String key, String... field) {
|
||||
getClient(key).hdel(key, field);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> hdel(byte[] key, byte[] field) {
|
||||
public Response<Long> hdel(byte[] key, byte[]... field) {
|
||||
getClient(key).hdel(key, field);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
@@ -305,12 +305,12 @@ abstract class PipelineBase extends Queable implements
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<String> lindex(String key, int index) {
|
||||
public Response<String> lindex(String key, long index) {
|
||||
getClient(key).lindex(key, index);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<byte[]> lindex(byte[] key, int index) {
|
||||
public Response<byte[]> lindex(byte[] key, long index) {
|
||||
getClient(key).lindex(key, index);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY);
|
||||
}
|
||||
@@ -583,18 +583,28 @@ abstract class PipelineBase extends Queable implements
|
||||
getClient(key).srandmember(key);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<List<String>> srandmember(String key, int count) {
|
||||
getClient(key).srandmember(key, count);
|
||||
return getResponse(BuilderFactory.STRING_LIST);
|
||||
}
|
||||
|
||||
public Response<byte[]> srandmember(byte[] key) {
|
||||
getClient(key).srandmember(key);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY);
|
||||
}
|
||||
|
||||
public Response<List<byte[]>> srandmember(byte[] key, int count) {
|
||||
getClient(key).srandmember(key, count);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY_LIST);
|
||||
}
|
||||
|
||||
public Response<Long> srem(String key, String member) {
|
||||
public Response<Long> srem(String key, String... member) {
|
||||
getClient(key).srem(key, member);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> srem(byte[] key, byte[] member) {
|
||||
public Response<Long> srem(byte[] key, byte[]... member) {
|
||||
getClient(key).srem(key, member);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
@@ -679,12 +689,12 @@ abstract class PipelineBase extends Queable implements
|
||||
return getResponse(BuilderFactory.DOUBLE);
|
||||
}
|
||||
|
||||
public Response<Set<String>> zrange(String key, int start, int end) {
|
||||
public Response<Set<String>> zrange(String key, long start, long end) {
|
||||
getClient(key).zrange(key, start, end);
|
||||
return getResponse(BuilderFactory.STRING_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<byte[]>> zrange(byte[] key, int start, int end) {
|
||||
public Response<Set<byte[]>> zrange(byte[] key, long start, long end) {
|
||||
getClient(key).zrange(key, start, end);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
|
||||
}
|
||||
@@ -717,6 +727,11 @@ abstract class PipelineBase extends Queable implements
|
||||
getClient(key).zrangeByScore(key, min, max, offset, count);
|
||||
return getResponse(BuilderFactory.STRING_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<String>> zrangeByScore(String key, String min, String max, int offset, int count) {
|
||||
getClient(key).zrangeByScore(key, min, max, offset, count);
|
||||
return getResponse(BuilderFactory.STRING_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<byte[]>> zrangeByScore(byte[] key, double min,
|
||||
double max, int offset, int count) {
|
||||
@@ -734,6 +749,12 @@ abstract class PipelineBase extends Queable implements
|
||||
getClient(key).zrangeByScoreWithScores(key, min, max);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrangeByScoreWithScores(String key, String min,
|
||||
String max) {
|
||||
getClient(key).zrangeByScoreWithScores(key, min, max);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrangeByScoreWithScores(byte[] key, double min,
|
||||
double max) {
|
||||
@@ -751,6 +772,12 @@ abstract class PipelineBase extends Queable implements
|
||||
getClient(key).zrangeByScoreWithScores(key, min, max, offset, count);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrangeByScoreWithScores(String key, String min,
|
||||
String max, int offset, int count) {
|
||||
getClient(key).zrangeByScoreWithScores(key, min, max, offset, count);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrangeByScoreWithScores(byte[] key, double min,
|
||||
double max, int offset, int count) {
|
||||
@@ -793,6 +820,12 @@ abstract class PipelineBase extends Queable implements
|
||||
getClient(key).zrevrangeByScore(key, max, min, offset, count);
|
||||
return getResponse(BuilderFactory.STRING_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<String>> zrevrangeByScore(String key, String max,
|
||||
String min, int offset, int count) {
|
||||
getClient(key).zrevrangeByScore(key, max, min, offset, count);
|
||||
return getResponse(BuilderFactory.STRING_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<byte[]>> zrevrangeByScore(byte[] key, double max,
|
||||
double min, int offset, int count) {
|
||||
@@ -811,6 +844,12 @@ abstract class PipelineBase extends Queable implements
|
||||
getClient(key).zrevrangeByScoreWithScores(key, max, min);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrevrangeByScoreWithScores(String key,
|
||||
String max, String min) {
|
||||
getClient(key).zrevrangeByScoreWithScores(key, max, min);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrevrangeByScoreWithScores(byte[] key,
|
||||
double max, double min) {
|
||||
@@ -829,6 +868,12 @@ abstract class PipelineBase extends Queable implements
|
||||
getClient(key).zrevrangeByScoreWithScores(key, max, min, offset, count);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrevrangeByScoreWithScores(String key,
|
||||
String max, String min, int offset, int count) {
|
||||
getClient(key).zrevrangeByScoreWithScores(key, max, min, offset, count);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrevrangeByScoreWithScores(byte[] key,
|
||||
double max, double min, int offset, int count) {
|
||||
@@ -842,12 +887,12 @@ abstract class PipelineBase extends Queable implements
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET_BINARY);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrangeWithScores(String key, int start, int end) {
|
||||
public Response<Set<Tuple>> zrangeWithScores(String key, long start, long end) {
|
||||
getClient(key).zrangeWithScores(key, start, end);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrangeWithScores(byte[] key, int start, int end) {
|
||||
public Response<Set<Tuple>> zrangeWithScores(byte[] key, long start, long end) {
|
||||
getClient(key).zrangeWithScores(key, start, end);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET_BINARY);
|
||||
}
|
||||
@@ -862,22 +907,22 @@ abstract class PipelineBase extends Queable implements
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> zrem(String key, String member) {
|
||||
public Response<Long> zrem(String key, String... member) {
|
||||
getClient(key).zrem(key, member);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> zrem(byte[] key, byte[] member) {
|
||||
public Response<Long> zrem(byte[] key, byte[]... member) {
|
||||
getClient(key).zrem(key, member);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> zremrangeByRank(String key, int start, int end) {
|
||||
public Response<Long> zremrangeByRank(String key, long start, long end) {
|
||||
getClient(key).zremrangeByRank(key, start, end);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> zremrangeByRank(byte[] key, int start, int end) {
|
||||
public Response<Long> zremrangeByRank(byte[] key, long start, long end) {
|
||||
getClient(key).zremrangeByRank(key, start, end);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
@@ -886,6 +931,11 @@ abstract class PipelineBase extends Queable implements
|
||||
getClient(key).zremrangeByScore(key, start, end);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> zremrangeByScore(String key, String start, String end) {
|
||||
getClient(key).zremrangeByScore(key, start, end);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> zremrangeByScore(byte[] key, double start, double end) {
|
||||
getClient(key).zremrangeByScore(key, toByteArray(start), toByteArray(end));
|
||||
@@ -897,24 +947,24 @@ abstract class PipelineBase extends Queable implements
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Set<String>> zrevrange(String key, int start, int end) {
|
||||
public Response<Set<String>> zrevrange(String key, long start, long end) {
|
||||
getClient(key).zrevrange(key, start, end);
|
||||
return getResponse(BuilderFactory.STRING_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<byte[]>> zrevrange(byte[] key, int start, int end) {
|
||||
public Response<Set<byte[]>> zrevrange(byte[] key, long start, long end) {
|
||||
getClient(key).zrevrange(key, start, end);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrevrangeWithScores(String key, int start,
|
||||
int end) {
|
||||
public Response<Set<Tuple>> zrevrangeWithScores(String key, long start,
|
||||
long end) {
|
||||
getClient(key).zrevrangeWithScores(key, start, end);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
|
||||
public Response<Set<Tuple>> zrevrangeWithScores(byte[] key, int start,
|
||||
int end) {
|
||||
public Response<Set<Tuple>> zrevrangeWithScores(byte[] key, long start,
|
||||
long end) {
|
||||
getClient(key).zrevrangeWithScores(key, start, end);
|
||||
return getResponse(BuilderFactory.TUPLE_ZSET);
|
||||
}
|
||||
@@ -958,5 +1008,145 @@ abstract class PipelineBase extends Queable implements
|
||||
getClient(key).bitcount(key, start, end);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<byte[]> dump(String key) {
|
||||
getClient(key).dump(key);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY);
|
||||
}
|
||||
|
||||
public Response<byte[]> dump(byte[] key) {
|
||||
getClient(key).dump(key);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY);
|
||||
}
|
||||
|
||||
public Response<String> migrate(String host, int port, String key, int destinationDb, int timeout) {
|
||||
getClient(key).migrate(host, port, key, destinationDb, timeout);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<String> migrate(byte[] host, int port, byte[] key, int destinationDb, int timeout) {
|
||||
getClient(key).migrate(host, port, key, destinationDb, timeout);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<Long> objectRefcount(String key) {
|
||||
getClient(key).objectRefcount(key);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> objectRefcount(byte[] key) {
|
||||
getClient(key).objectRefcount(key);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<String> objectEncoding(String key) {
|
||||
getClient(key).objectEncoding(key);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<byte[]> objectEncoding(byte[] key) {
|
||||
getClient(key).objectEncoding(key);
|
||||
return getResponse(BuilderFactory.BYTE_ARRAY);
|
||||
}
|
||||
|
||||
public Response<Long> objectIdletime(String key) {
|
||||
getClient(key).objectIdletime(key);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> objectIdletime(byte[] key) {
|
||||
getClient(key).objectIdletime(key);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> pexpire(String key, int milliseconds) {
|
||||
getClient(key).pexpire(key, milliseconds);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> pexpire(byte[] key, int milliseconds) {
|
||||
getClient(key).pexpire(key, milliseconds);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> pexpireAt(String key, long millisecondsTimestamp) {
|
||||
getClient(key).pexpireAt(key, millisecondsTimestamp);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> pexpireAt(byte[] key, long millisecondsTimestamp) {
|
||||
getClient(key).pexpireAt(key, millisecondsTimestamp);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> pttl(String key) {
|
||||
getClient(key).pttl(key);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<Long> pttl(byte[] key) {
|
||||
getClient(key).pttl(key);
|
||||
return getResponse(BuilderFactory.LONG);
|
||||
}
|
||||
|
||||
public Response<String> restore(String key, int ttl, byte[] serializedValue) {
|
||||
getClient(key).restore(key, ttl, serializedValue);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<String> restore(byte[] key, int ttl, byte[] serializedValue) {
|
||||
getClient(key).restore(key, ttl, serializedValue);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<Double> incrByFloat(String key, double increment) {
|
||||
getClient(key).incrByFloat(key, increment);
|
||||
return getResponse(BuilderFactory.DOUBLE);
|
||||
}
|
||||
|
||||
public Response<Double> incrByFloat(byte[] key, double increment) {
|
||||
getClient(key).incrByFloat(key, increment);
|
||||
return getResponse(BuilderFactory.DOUBLE);
|
||||
}
|
||||
|
||||
public Response<String> psetex(String key, int milliseconds, String value) {
|
||||
getClient(key).psetex(key, milliseconds, value);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<String> psetex(byte[] key, int milliseconds, byte[] value) {
|
||||
getClient(key).psetex(key, milliseconds, value);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<String> set(String key, String value, String nxxx) {
|
||||
getClient(key).set(key, value, nxxx);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<String> set(byte[] key, byte[] value, byte[] nxxx) {
|
||||
getClient(key).set(key, value, nxxx);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<String> set(String key, String value, String nxxx, String expx, int time) {
|
||||
getClient(key).set(key, value, nxxx, expx, time);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<String> set(byte[] key, byte[] value, byte[] nxxx, byte[] expx, int time) {
|
||||
getClient(key).set(key, value, nxxx, expx, time);
|
||||
return getResponse(BuilderFactory.STRING);
|
||||
}
|
||||
|
||||
public Response<Double> hincrByFloat(String key, String field, double increment) {
|
||||
getClient(key).hincrByFloat(key, field, increment);
|
||||
return getResponse(BuilderFactory.DOUBLE);
|
||||
}
|
||||
|
||||
public Response<Double> hincrByFloat(byte[] key, byte[] field, double increment) {
|
||||
getClient(key).hincrByFloat(key, field, increment);
|
||||
return getResponse(BuilderFactory.DOUBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public final class Protocol {
|
||||
|
||||
public static enum Command {
|
||||
PING, SET, GET, QUIT, EXISTS, DEL, TYPE, FLUSHDB, KEYS, RANDOMKEY, RENAME, RENAMENX, RENAMEX, DBSIZE, EXPIRE, EXPIREAT, TTL, SELECT, MOVE, FLUSHALL, GETSET, MGET, SETNX, SETEX, MSET, MSETNX, DECRBY, DECR, INCRBY, INCR, APPEND, SUBSTR, HSET, HGET, HSETNX, HMSET, HMGET, HINCRBY, HEXISTS, HDEL, HLEN, HKEYS, HVALS, HGETALL, RPUSH, LPUSH, LLEN, LRANGE, LTRIM, LINDEX, LSET, LREM, LPOP, RPOP, RPOPLPUSH, SADD, SMEMBERS, SREM, SPOP, SMOVE, SCARD, SISMEMBER, SINTER, SINTERSTORE, SUNION, SUNIONSTORE, SDIFF, SDIFFSTORE, SRANDMEMBER, ZADD, ZRANGE, ZREM, ZINCRBY, ZRANK, ZREVRANK, ZREVRANGE, ZCARD, ZSCORE, MULTI, DISCARD, EXEC, WATCH, UNWATCH, SORT, BLPOP, BRPOP, AUTH, SUBSCRIBE, PUBLISH, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, ZCOUNT, ZRANGEBYSCORE, ZREVRANGEBYSCORE, ZREMRANGEBYRANK, ZREMRANGEBYSCORE, ZUNIONSTORE, ZINTERSTORE, SAVE, BGSAVE, BGREWRITEAOF, LASTSAVE, SHUTDOWN, INFO, MONITOR, SLAVEOF, CONFIG, STRLEN, SYNC, LPUSHX, PERSIST, RPUSHX, ECHO, LINSERT, DEBUG, BRPOPLPUSH, SETBIT, GETBIT, SETRANGE, GETRANGE, EVAL, EVALSHA, SCRIPT, SLOWLOG, OBJECT, BITCOUNT, BITOP, SENTINEL,
|
||||
DUMP, RESTORE, PEXPIRE, PEXPIREAT, PTTL, INCRBYFLOAT, PSETEX, CLIENT_KILL, CLIENT_GETNAME, CLIENT_SETNAME, CLIENT_LIST, TIME;
|
||||
DUMP, RESTORE, PEXPIRE, PEXPIREAT, PTTL, INCRBYFLOAT, PSETEX, CLIENT_KILL, CLIENT_GETNAME, CLIENT_SETNAME, CLIENT_LIST, TIME, MIGRATE, HINCRBYFLOAT;
|
||||
|
||||
public final byte[] raw;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public interface RedisPipeline {
|
||||
|
||||
Response<String> getSet(String key, String value);
|
||||
|
||||
Response<Long> hdel(String key, String field);
|
||||
Response<Long> hdel(String key, String... field);
|
||||
|
||||
Response<Boolean> hexists(String key, String field);
|
||||
|
||||
@@ -67,7 +67,7 @@ public interface RedisPipeline {
|
||||
|
||||
Response<Long> incrBy(String key, long integer);
|
||||
|
||||
Response<String> lindex(String key, int index);
|
||||
Response<String> lindex(String key, long index);
|
||||
|
||||
Response<Long> linsert(String key, BinaryClient.LIST_POSITION where,
|
||||
String pivot, String value);
|
||||
@@ -125,7 +125,7 @@ public interface RedisPipeline {
|
||||
|
||||
Response<String> srandmember(String key);
|
||||
|
||||
Response<Long> srem(String key, String member);
|
||||
Response<Long> srem(String key, String... member);
|
||||
|
||||
Response<Long> strlen(String key);
|
||||
|
||||
@@ -143,7 +143,7 @@ public interface RedisPipeline {
|
||||
|
||||
Response<Double> zincrby(String key, double score, String member);
|
||||
|
||||
Response<Set<String>> zrange(String key, int start, int end);
|
||||
Response<Set<String>> zrange(String key, long start, long end);
|
||||
|
||||
Response<Set<String>> zrangeByScore(String key, double min,
|
||||
double max);
|
||||
@@ -175,20 +175,20 @@ public interface RedisPipeline {
|
||||
Response<Set<Tuple>> zrevrangeByScoreWithScores(String key,
|
||||
double max, double min, int offset, int count);
|
||||
|
||||
Response<Set<Tuple>> zrangeWithScores(String key, int start, int end);
|
||||
Response<Set<Tuple>> zrangeWithScores(String key, long start, long end);
|
||||
|
||||
Response<Long> zrank(String key, String member);
|
||||
|
||||
Response<Long> zrem(String key, String member);
|
||||
Response<Long> zrem(String key, String... member);
|
||||
|
||||
Response<Long> zremrangeByRank(String key, int start, int end);
|
||||
Response<Long> zremrangeByRank(String key, long start, long end);
|
||||
|
||||
Response<Long> zremrangeByScore(String key, double start, double end);
|
||||
|
||||
Response<Set<String>> zrevrange(String key, int start, int end);
|
||||
Response<Set<String>> zrevrange(String key, long start, long end);
|
||||
|
||||
Response<Set<Tuple>> zrevrangeWithScores(String key, int start,
|
||||
int end);
|
||||
Response<Set<Tuple>> zrevrangeWithScores(String key, long start,
|
||||
long end);
|
||||
|
||||
Response<Long> zrevrank(String key, String member);
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package redis.clients.jedis;
|
||||
|
||||
import redis.clients.jedis.exceptions.JedisDataException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import redis.clients.jedis.exceptions.JedisDataException;
|
||||
|
||||
/**
|
||||
* Transaction is nearly identical to Pipeline, only differences are the multi/discard behaviors
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user