/*jadclipse*/// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
package redis.clients.jedis;
import java.net.URI;
import java.util.*;
import redis.clients.util.SafeEncoder;
import redis.clients.util.Slowlog;
// Referenced classes of package redis.clients.jedis:
// BinaryJedis, Tuple, ScanParams, ScanResult,
// JedisCommands, MultiKeyCommands, AdvancedJedisCommands, ScriptingCommands,
// BasicCommands, ClusterCommands, Client, BuilderFactory,
// Builder, JedisPubSub, BinaryClient, Protocol,
// JedisShardInfo, SortingParams, ZParams, BitOP
public class Jedis extends BinaryJedis
implements JedisCommands, MultiKeyCommands, AdvancedJedisCommands, ScriptingCommands, BasicCommands, ClusterCommands
{
public Jedis(String host)
{
super(host);
}
public Jedis(String host, int port)
{
super(host, port);
}
public Jedis(String host, int port, int timeout)
{
super(host, port, timeout);
}
public Jedis(JedisShardInfo shardInfo)
{
super(shardInfo);
}
public Jedis(URI uri)
{
super(uri);
}
public String set(String key, String value)
{
checkIsInMulti();
client.set(key, value);
return client.getStatusCodeReply();
}
public String set(String key, String value, String nxxx, String expx, long time)
{
checkIsInMulti();
client.set(key, value, nxxx, expx, time);
return client.getStatusCodeReply();
}
public String get(String key)
{
checkIsInMulti();
client.sendCommand(Protocol.Command.GET, new String[] {
key
});
return client.getBulkReply();
}
public Boolean exists(String key)
{
checkIsInMulti();
client.exists(key);
return Boolean.valueOf(client.getIntegerReply().longValue() == 1L);
}
public transient Long del(String keys[])
{
checkIsInMulti();
client.del(keys);
return client.getIntegerReply();
}
public Long del(String key)
{
client.del(new String[] {
key
});
return client.getIntegerReply();
}
public String type(String key)
{
checkIsInMulti();
client.type(key);
return client.getStatusCodeReply();
}
public Set keys(String pattern)
{
checkIsInMulti();
client.keys(pattern);
return (Set)BuilderFactory.STRING_SET.build(client.getBinaryMultiBulkReply());
}
public String randomKey()
{
checkIsInMulti();
client.randomKey();
return client.getBulkReply();
}
public String rename(String oldkey, String newkey)
{
checkIsInMulti();
client.rename(oldkey, newkey);
return client.getStatusCodeReply();
}
public Long renamenx(String oldkey, String newkey)
{
checkIsInMulti();
client.renamenx(oldkey, newkey);
return client.getIntegerReply();
}
public Long expire(String key, int seconds)
{
checkIsInMulti();
client.expire(key, seconds);
return client.getIntegerReply();
}
public Long expireAt(String key, long unixTime)
{
checkIsInMulti();
client.expireAt(key, unixTime);
return client.getIntegerReply();
}
public Long ttl(String key)
{
checkIsInMulti();
client.ttl(key);
return client.getIntegerReply();
}
public Long move(String key, int dbIndex)
{
checkIsInMulti();
client.move(key, dbIndex);
return client.getIntegerReply();
}
public String getSet(String key, String value)
{
checkIsInMulti();
client.getSet(key, value);
return client.getBulkReply();
}
public transient List mget(String keys[])
{
checkIsInMulti();
client.mget(keys);
return client.getMultiBulkReply();
}
public Long setnx(String key, String value)
{
checkIsInMulti();
client.setnx(key, value);
return client.getIntegerReply();
}
public String setex(String key, int seconds, String value)
{
checkIsInMulti();
client.setex(key, seconds, value);
return client.getStatusCodeReply();
}
public transient String mset(String keysvalues[])
{
checkIsInMulti();
client.mset(keysvalues);
return client.getStatusCodeReply();
}
public transient Long msetnx(String keysvalues[])
{
checkIsInMulti();
client.msetnx(keysvalues);
return client.getIntegerReply();
}
public Long decrBy(String key, long integer)
{
checkIsInMulti();
client.decrBy(key, integer);
return client.getIntegerReply();
}
public Long decr(String key)
{
checkIsInMulti();
client.decr(key);
return client.getIntegerReply();
}
public Long incrBy(String key, long integer)
{
checkIsInMulti();
client.incrBy(key, integer);
return client.getIntegerReply();
}
public Long incr(String key)
{
checkIsInMulti();
client.incr(key);
return client.getIntegerReply();
}
public Long append(String key, String value)
{
checkIsInMulti();
client.append(key, value);
return client.getIntegerReply();
}
public String substr(String key, int start, int end)
{
checkIsInMulti();
client.substr(key, start, end);
return client.getBulkReply();
}
public Long hset(String key, String field, String value)
{
checkIsInMulti();
client.hset(key, field, value);
return client.getIntegerReply();
}
public String hget(String key, String field)
{
checkIsInMulti();
client.hget(key, field);
return client.getBulkReply();
}
public Long hsetnx(String key, String field, String value)
{
checkIsInMulti();
client.hsetnx(key, field, value);
return client.getIntegerReply();
}
public String hmset(String key, Map hash)
{
checkIsInMulti();
client.hmset(key, hash);
return client.getStatusCodeReply();
}
public transient List hmget(String key, String fields[])
{
checkIsInMulti();
client.hmget(key, fields);
return client.getMultiBulkReply();
}
public Long hincrBy(String key, String field, long value)
{
checkIsInMulti();
client.hincrBy(key, field, value);
return client.getIntegerReply();
}
public Boolean hexists(String key, String field)
{
checkIsInMulti();
client.hexists(key, field);
return Boolean.valueOf(client.getIntegerReply().longValue() == 1L);
}
public transient Long hdel(String key, String fields[])
{
checkIsInMulti();
client.hdel(key, fields);
return client.getIntegerReply();
}
public Long hlen(String key)
{
checkIsInMulti();
client.hlen(key);
return client.getIntegerReply();
}
public Set hkeys(String key)
{
checkIsInMulti();
client.hkeys(key);
return (Set)BuilderFactory.STRING_SET.build(client.getBinaryMultiBulkReply());
}
public List hvals(String key)
{
checkIsInMulti();
client.hvals(key);
List lresult = client.getMultiBulkReply();
return lresult;
}
public Map hgetAll(String key)
{
checkIsInMulti();
client.hgetAll(key);
return (Map)BuilderFactory.STRING_MAP.build(client.getBinaryMultiBulkReply());
}
public transient Long rpush(String key, String strings[])
{
checkIsInMulti();
client.rpush(key, strings);
return client.getIntegerReply();
}
public transient Long lpush(String key, String strings[])
{
checkIsInMulti();
client.lpush(key, strings);
return client.getIntegerReply();
}
public Long llen(String key)
{
checkIsInMulti();
client.llen(key);
return client.getIntegerReply();
}
public List lrange(String key, long start, long end)
{
checkIsInMulti();
client.lrange(key, start, end);
return client.getMultiBulkReply();
}
public String ltrim(String key, long start, long end)
{
checkIsInMulti();
client.ltrim(key, start, end);
return client.getStatusCodeReply();
}
public String lindex(String key, long index)
{
checkIsInMulti();
client.lindex(key, index);
return client.getBulkReply();
}
public String lset(String key, long index, String value)
{
checkIsInMulti();
client.lset(key, index, value);
return client.getStatusCodeReply();
}
public Long lrem(String key, long count, String value)
{
checkIsInMulti();
client.lrem(key, count, value);
return client.getIntegerReply();
}
public String lpop(String key)
{
checkIsInMulti();
client.lpop(key);
return client.getBulkReply();
}
public String rpop(String key)
{
checkIsInMulti();
client.rpop(key);
return client.getBulkReply();
}
public String rpoplpush(String srckey, String dstkey)
{
checkIsInMulti();
client.rpoplpush(srckey, dstkey);
return client.getBulkReply();
}
public transient Long sadd(String key, String members[])
{
checkIsInMulti();
client.sadd(key, members);
return client.getIntegerReply();
}
public Set smembers(String key)
{
checkIsInMulti();
client.smembers(key);
List members = client.getMultiBulkReply();
return new HashSet(members);
}
public transient Long srem(String key, String members[])
{
checkIsInMulti();
client.srem(key, members);
return client.getIntegerReply();
}
public String spop(String key)
{
checkIsInMulti();
client.spop(key);
return client.getBulkReply();
}
public Long smove(String srckey, String dstkey, String member)
{
checkIsInMulti();
client.smove(srckey, dstkey, member);
return client.getIntegerReply();
}
public Long scard(String key)
{
checkIsInMulti();
client.scard(key);
return client.getIntegerReply();
}
public Boolean sismember(String key, String member)
{
checkIsInMulti();
client.sismember(key, member);
return Boolean.valueOf(client.getIntegerReply().longValue() == 1L);
}
public transient Set sinter(String keys[])
{
checkIsInMulti();
client.sinter(keys);
List members = client.getMultiBulkReply();
return new HashSet(members);
}
public transient Long sinterstore(String dstkey, String keys[])
{
checkIsInMulti();
client.sinterstore(dstkey, keys);
return client.getIntegerReply();
}
public transient Set sunion(String keys[])
{
checkIsInMulti();
client.sunion(keys);
List members = client.getMultiBulkReply();
return new HashSet(members);
}
public transient Long sunionstore(String dstkey, String keys[])
{
checkIsInMulti();
client.sunionstore(dstkey, keys);
return client.getIntegerReply();
}
public transient Set sdiff(String keys[])
{
checkIsInMulti();
client.sdiff(keys);
return (Set)BuilderFactory.STRING_SET.build(client.getBinaryMultiBulkReply());
}
public transient Long sdiffstore(String dstkey, String keys[])
{
checkIsInMulti();
client.sdiffstore(dstkey, keys);
return client.getIntegerReply();
}
public String srandmember(String key)
{
checkIsInMulti();
client.srandmember(key);
return client.getBulkReply();
}
public List srandmember(String key, int count)
{
checkIsInMulti();
client.srandmember(key, count);
return client.getMultiBulkReply();
}
public Long zadd(String key, double score, String member)
{
checkIsInMulti();
client.zadd(key, score, member);
return client.getIntegerReply();
}
public Long zadd(String key, Map scoreMembers)
{
checkIsInMulti();
client.zadd(key, scoreMembers);
return client.getIntegerReply();
}
public Set zrange(String key, long start, long end)
{
checkIsInMulti();
client.zrange(key, start, end);
List members = client.getMultiBulkReply();
return new LinkedHashSet(members);
}
public transient Long zrem(String key, String members[])
{
checkIsInMulti();
client.zrem(key, members);
return client.getIntegerReply();
}
public Double zincrby(String key, double score, String member)
{
checkIsInMulti();
client.zincrby(key, score, member);
String newscore = client.getBulkReply();
return Double.valueOf(newscore);
}
public Long zrank(String key, String member)
{
checkIsInMulti();
client.zrank(key, member);
return client.getIntegerReply();
}
public Long zrevrank(String key, String member)
{
checkIsInMulti();
client.zrevrank(key, member);
return client.getIntegerReply();
}
public Set zrevrange(String key, long start, long end)
{
checkIsInMulti();
client.zrevrange(key, start, end);
List members = client.getMultiBulkReply();
return new LinkedHashSet(members);
}
public Set zrangeWithScores(String key, long start, long end)
{
checkIsInMulti();
client.zrangeWithScores(key, start, end);
Set set = getTupledSet();
return set;
}
public Set zrevrangeWithScores(String key, long start, long end)
{
checkIsInMulti();
client.zrevrangeWithScores(key, start, end);
Set set = getTupledSet();
return set;
}
public Long zcard(String key)
{
checkIsInMulti();
client.zcard(key);
return client.getIntegerReply();
}
public Double zscore(String key, String member)
{
checkIsInMulti();
client.zscore(key, member);
String score = client.getBulkReply();
return score == null ? null : new Double(score);
}
public transient String watch(String keys[])
{
client.watch(keys);
return client.getStatusCodeReply();
}
public List sort(String key)
{
checkIsInMulti();
client.sort(key);
return client.getMultiBulkReply();
}
public List sort(String key, SortingParams sortingParameters)
{
checkIsInMulti();
client.sort(key, sortingParameters);
return client.getMultiBulkReply();
}
public transient List blpop(int timeout, String keys[])
{
checkIsInMulti();
List args = new ArrayList();
String arr$[] = keys;
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
String arg = arr$[i$];
args.add(arg);
}
args.add(String.valueOf(timeout));
client.blpop((String[])args.toArray(new String[args.size()]));
client.setTimeoutInfinite();
List multiBulkReply = client.getMultiBulkReply();
client.rollbackTimeout();
return multiBulkReply;
}
public transient List blpop(String args[])
{
client.blpop(args);
client.setTimeoutInfinite();
List multiBulkReply = client.getMultiBulkReply();
client.rollbackTimeout();
return multiBulkReply;
}
public transient List brpop(String args[])
{
client.brpop(args);
client.setTimeoutInfinite();
List multiBulkReply = client.getMultiBulkReply();
client.rollbackTimeout();
return multiBulkReply;
}
public List blpop(String arg)
{
String args[] = new String[1];
args[0] = arg;
client.blpop(args);
client.setTimeoutInfinite();
List multiBulkReply = client.getMultiBulkReply();
client.rollbackTimeout();
return multiBulkReply;
}
public List brpop(String arg)
{
String args[] = new String[1];
args[0] = arg;
client.brpop(args);
client.setTimeoutInfinite();
List multiBulkReply = client.getMultiBulkReply();
client.rollbackTimeout();
return multiBulkReply;
}
public Long sort(String key, SortingParams sortingParameters, String dstkey)
{
checkIsInMulti();
client.sort(key, sortingParameters, dstkey);
return client.getIntegerReply();
}
public Long sort(String key, String dstkey)
{
checkIsInMulti();
client.sort(key, dstkey);
return client.getIntegerReply();
}
public transient List brpop(int timeout, String keys[])
{
checkIsInMulti();
List args = new ArrayList();
String arr$[] = keys;
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
String arg = arr$[i$];
args.add(arg);
}
args.add(String.valueOf(timeout));
client.brpop((String[])args.toArray(new String[args.size()]));
client.setTimeoutInfinite();
List multiBulkReply = client.getMultiBulkReply();
client.rollbackTimeout();
return multiBulkReply;
}
public Long zcount(String key, double min, double max)
{
checkIsInMulti();
client.zcount(key, min, max);
return client.getIntegerReply();
}
public Long zcount(String key, String min, String max)
{
checkIsInMulti();
client.zcount(key, min, max);
return client.getIntegerReply();
}
public Set zrangeByScore(String key, double min, double max)
{
checkIsInMulti();
client.zrangeByScore(key, min, max);
return new LinkedHashSet(client.getMultiBulkReply());
}
public Set zrangeByScore(String key, String min, String max)
{
checkIsInMulti();
client.zrangeByScore(key, min, max);
return new LinkedHashSet(client.getMultiBulkReply());
}
public Set zrangeByScore(String key, double min, double max, int offset, int count)
{
checkIsInMulti();
client.zrangeByScore(key, min, max, offset, count);
return new LinkedHashSet(client.getMultiBulkReply());
}
public Set zrangeByScore(String key, String min, String max, int offset, int count)
{
checkIsInMulti();
client.zrangeByScore(key, min, max, offset, count);
return new LinkedHashSet(client.getMultiBulkReply());
}
public Set zrangeByScoreWithScores(String key, double min, double max)
{
checkIsInMulti();
client.zrangeByScoreWithScores(key, min, max);
Set set = getTupledSet();
return set;
}
public Set zrangeByScoreWithScores(String key, String min, String max)
{
checkIsInMulti();
client.zrangeByScoreWithScores(key, min, max);
Set set = getTupledSet();
return set;
}
public Set zrangeByScoreWithScores(String key, double min, double max, int offset, int count)
{
checkIsInMulti();
client.zrangeByScoreWithScores(key, min, max, offset, count);
Set set = getTupledSet();
return set;
}
public Set zrangeByScoreWithScores(String key, String min, String max, int offset, int count)
{
checkIsInMulti();
client.zrangeByScoreWithScores(key, min, max, offset, count);
Set set = getTupledSet();
return set;
}
private Set getTupledSet()
{
checkIsInMulti();
List membersWithScores = client.getMultiBulkReply();
Set set = new LinkedHashSet();
for(Iterator iterator = membersWithScores.iterator(); iterator.hasNext(); set.add(new Tuple((String)iterator.next(), Double.valueOf((String)iterator.next()))));
return set;
}
public Set zrevrangeByScore(String key, double max, double min)
{
checkIsInMulti();
client.zrevrangeByScore(key, max, min);
return new LinkedHashSet(client.getMultiBulkReply());
}
public Set zrevrangeByScore(String key, String max, String min)
{
checkIsInMulti();
client.zrevrangeByScore(key, max, min);
return new LinkedHashSet(client.getMultiBulkReply());
}
public Set zrevrangeByScore(String key, double max, double min, int offset, int count)
{
checkIsInMulti();
client.zrevrangeByScore(key, max, min, offset, count);
return new LinkedHashSet(client.getMultiBulkReply());
}
public Set zrevrangeByScoreWithScores(String key, double max, double min)
{
checkIsInMulti();
client.zrevrangeByScoreWithScores(key, max, min);
Set set = getTupledSet();
return set;
}
public Set zrevrangeByScoreWithScores(String key, double max, double min, int offset, int count)
{
checkIsInMulti();
client.zrevrangeByScoreWithScores(key, max, min, offset, count);
Set set = getTupledSet();
return set;
}
public Set zrevrangeByScoreWithScores(String key, String max, String min, int offset, int count)
{
checkIsInMulti();
client.zrevrangeByScoreWithScores(key, max, min, offset, count);
Set set = getTupledSet();
return set;
}
public Set zrevrangeByScore(String key, String max, String min, int offset, int count)
{
checkIsInMulti();
client.zrevrangeByScore(key, max, min, offset, count);
return new LinkedHashSet(client.getMultiBulkReply());
}
public Set zrevrangeByScoreWithScores(String key, String max, String min)
{
checkIsInMulti();
client.zrevrangeByScoreWithScores(key, max, min);
Set set = getTupledSet();
return set;
}
public Long zremrangeByRank(String key, long start, long end)
{
checkIsInMulti();
client.zremrangeByRank(key, start, end);
return client.getIntegerReply();
}
public Long zremrangeByScore(String key, double start, double end)
{
checkIsInMulti();
client.zremrangeByScore(key, start, end);
return client.getIntegerReply();
}
public Long zremrangeByScore(String key, String start, String end)
{
checkIsInMulti();
client.zremrangeByScore(key, start, end);
return client.getIntegerReply();
}
public transient Long zunionstore(String dstkey, String sets[])
{
checkIsInMulti();
client.zunionstore(dstkey, sets);
return client.getIntegerReply();
}
public transient Long zunionstore(String dstkey, ZParams params, String sets[])
{
checkIsInMulti();
client.zunionstore(dstkey, params, sets);
return client.getIntegerReply();
}
public transient Long zinterstore(String dstkey, String sets[])
{
checkIsInMulti();
client.zinterstore(dstkey, sets);
return client.getIntegerReply();
}
public transient Long zinterstore(String dstkey, ZParams params, String sets[])
{
checkIsInMulti();
client.zinterstore(dstkey, params, sets);
return client.getIntegerReply();
}
public Long strlen(String key)
{
client.strlen(key);
return client.getIntegerReply();
}
public transient Long lpushx(String key, String string[])
{
client.lpushx(key, string);
return client.getIntegerReply();
}
public Long persist(String key)
{
client.persist(key);
return client.getIntegerReply();
}
public transient Long rpushx(String key, String string[])
{
client.rpushx(key, string);
return client.getIntegerReply();
}
public String echo(String string)
{
client.echo(string);
return client.getBulkReply();
}
public Long linsert(String key, BinaryClient.LIST_POSITION where, String pivot, String value)
{
client.linsert(key, where, pivot, value);
return client.getIntegerReply();
}
public String brpoplpush(String source, String destination, int timeout)
{
client.brpoplpush(source, destination, timeout);
client.setTimeoutInfinite();
String reply = client.getBulkReply();
client.rollbackTimeout();
return reply;
}
public Boolean setbit(String key, long offset, boolean value)
{
client.setbit(key, offset, value);
return Boolean.valueOf(client.getIntegerReply().longValue() == 1L);
}
public Boolean setbit(String key, long offset, String value)
{
client.setbit(key, offset, value);
return Boolean.valueOf(client.getIntegerReply().longValue() == 1L);
}
public Boolean getbit(String key, long offset)
{
client.getbit(key, offset);
return Boolean.valueOf(client.getIntegerReply().longValue() == 1L);
}
public Long setrange(String key, long offset, String value)
{
client.setrange(key, offset, value);
return client.getIntegerReply();
}
public String getrange(String key, long startOffset, long endOffset)
{
client.getrange(key, startOffset, endOffset);
return client.getBulkReply();
}
public List configGet(String pattern)
{
client.configGet(pattern);
return client.getMultiBulkReply();
}
public String configSet(String parameter, String value)
{
client.configSet(parameter, value);
return client.getStatusCodeReply();
}
public transient Object eval(String script, int keyCount, String params[])
{
client.setTimeoutInfinite();
client.eval(script, keyCount, params);
return getEvalResult();
}
public transient void subscribe(JedisPubSub jedisPubSub, String channels[])
{
client.setTimeoutInfinite();
jedisPubSub.proceed(client, channels);
client.rollbackTimeout();
}
public Long publish(String channel, String message)
{
checkIsInMulti();
connect();
client.publish(channel, message);
return client.getIntegerReply();
}
public transient void psubscribe(JedisPubSub jedisPubSub, String patterns[])
{
checkIsInMulti();
connect();
client.setTimeoutInfinite();
jedisPubSub.proceedWithPatterns(client, patterns);
client.rollbackTimeout();
}
protected static String[] getParams(List keys, List args)
{
int keyCount = keys.size();
int argCount = args.size();
String params[] = new String[keyCount + args.size()];
for(int i = 0; i < keyCount; i++)
params[i] = (String)keys.get(i);
for(int i = 0; i < argCount; i++)
params[keyCount + i] = (String)args.get(i);
return params;
}
public Object eval(String script, List keys, List args)
{
return eval(script, keys.size(), getParams(keys, args));
}
public Object eval(String script)
{
return eval(script, 0, new String[0]);
}
public Object evalsha(String script)
{
return evalsha(script, 0, new String[0]);
}
private Object getEvalResult()
{
return evalResult(client.getOne());
}
private Object evalResult(Object result)
{
if(result instanceof byte[])
return SafeEncoder.encode((byte[])(byte[])result);
if(result instanceof List)
{
List list = (List)result;
List listResult = new ArrayList(list.size());
Object bin;
for(Iterator i$ = list.iterator(); i$.hasNext(); listResult.add(evalResult(bin)))
bin = i$.next();
return listResult;
} else
{
return result;
}
}
public Object evalsha(String sha1, List keys, List args)
{
return evalsha(sha1, keys.size(), getParams(keys, args));
}
public transient Object evalsha(String sha1, int keyCount, String params[])
{
checkIsInMulti();
client.evalsha(sha1, keyCount, params);
return getEvalResult();
}
public Boolean scriptExists(String sha1)
{
String a[] = new String[1];
a[0] = sha1;
return (Boolean)scriptExists(a).get(0);
}
public transient List scriptExists(String sha1[])
{
client.scriptExists(sha1);
List result = client.getIntegerMultiBulkReply();
List exists = new ArrayList();
Long value;
for(Iterator i$ = result.iterator(); i$.hasNext(); exists.add(Boolean.valueOf(value.longValue() == 1L)))
value = (Long)i$.next();
return exists;
}
public String scriptLoad(String script)
{
client.scriptLoad(script);
return client.getBulkReply();
}
public List slowlogGet()
{
client.slowlogGet();
return Slowlog.from(client.getObjectMultiBulkReply());
}
public List slowlogGet(long entries)
{
client.slowlogGet(entries);
return Slowlog.from(client.getObjectMultiBulkReply());
}
public Long objectRefcount(String string)
{
client.objectRefcount(string);
return client.getIntegerReply();
}
public String objectEncoding(String string)
{
client.objectEncoding(string);
return client.getBulkReply();
}
public Long objectIdletime(String string)
{
client.objectIdletime(string);
return client.getIntegerReply();
}
public Long bitcount(String key)
{
client.bitcount(key);
return client.getIntegerReply();
}
public Long bitcount(String key, long start, long end)
{
client.bitcount(key, start, end);
return client.getIntegerReply();
}
public transient Long bitop(BitOP op, String destKey, String srcKeys[])
{
client.bitop(op, destKey, srcKeys);
return client.getIntegerReply();
}
public List sentinelMasters()
{
client.sentinel(new String[] {
"masters"
});
List reply = client.getObjectMultiBulkReply();
List masters = new ArrayList();
Object obj;
for(Iterator i$ = reply.iterator(); i$.hasNext(); masters.add(BuilderFactory.STRING_MAP.build((List)obj)))
obj = i$.next();
return masters;
}
public List sentinelGetMasterAddrByName(String masterName)
{
client.sentinel(new String[] {
"get-master-addr-by-name", masterName
});
List reply = client.getObjectMultiBulkReply();
return (List)BuilderFactory.STRING_LIST.build(reply);
}
public Long sentinelReset(String pattern)
{
client.sentinel(new String[] {
"reset", pattern
});
return client.getIntegerReply();
}
public List sentinelSlaves(String masterName)
{
client.sentinel(new String[] {
"slaves", masterName
});
List reply = client.getObjectMultiBulkReply();
List slaves = new ArrayList();
Object obj;
for(Iterator i$ = reply.iterator(); i$.hasNext(); slaves.add(BuilderFactory.STRING_MAP.build((List)obj)))
obj = i$.next();
return slaves;
}
public String sentinelFailover(String masterName)
{
client.sentinel(new String[] {
"failover", masterName
});
return client.getStatusCodeReply();
}
public String sentinelMonitor(String masterName, String ip, int port, int quorum)
{
client.sentinel(new String[] {
"monitor", masterName, ip, String.valueOf(port), String.valueOf(quorum)
});
return client.getStatusCodeReply();
}
public String sentinelRemove(String masterName)
{
client.sentinel(new String[] {
"remove", masterName
});
return client.getStatusCodeReply();
}
public String sentinelSet(String masterName, Map parameterMap)
{
int index = 0;
int paramsLength = parameterMap.size() * 2 + 2;
String params[] = new String[paramsLength];
params[index++] = "set";
params[index++] = masterName;
for(Iterator i$ = parameterMap.entrySet().iterator(); i$.hasNext();)
{
java.util.Map.Entry entry = (java.util.Map.Entry)i$.next();
params[index++] = (String)entry.getKey();
params[index++] = (String)entry.getValue();
}
client.sentinel(params);
return client.getStatusCodeReply();
}
public byte[] dump(String key)
{
checkIsInMulti();
client.dump(key);
return client.getBinaryBulkReply();
}
public String restore(String key, int ttl, byte serializedValue[])
{
checkIsInMulti();
client.restore(key, ttl, serializedValue);
return client.getStatusCodeReply();
}
public Long pexpire(String key, int milliseconds)
{
checkIsInMulti();
client.pexpire(key, milliseconds);
return client.getIntegerReply();
}
public Long pexpireAt(String key, long millisecondsTimestamp)
{
checkIsInMulti();
client.pexpireAt(key, millisecondsTimestamp);
return client.getIntegerReply();
}
public Long pttl(String key)
{
checkIsInMulti();
client.pttl(key);
return client.getIntegerReply();
}
public Double incrByFloat(String key, double increment)
{
checkIsInMulti();
client.incrByFloat(key, increment);
String relpy = client.getBulkReply();
return relpy == null ? null : new Double(relpy);
}
public String psetex(String key, int milliseconds, String value)
{
checkIsInMulti();
client.psetex(key, milliseconds, value);
return client.getStatusCodeReply();
}
public String set(String key, String value, String nxxx)
{
checkIsInMulti();
client.set(key, value, nxxx);
return client.getStatusCodeReply();
}
public String set(String key, String value, String nxxx, String expx, int time)
{
checkIsInMulti();
client.set(key, value, nxxx, expx, time);
return client.getStatusCodeReply();
}
public String clientKill(String client)
{
checkIsInMulti();
this.client.clientKill(client);
return this.client.getStatusCodeReply();
}
public String clientSetname(String name)
{
checkIsInMulti();
client.clientSetname(name);
return client.getStatusCodeReply();
}
public String migrate(String host, int port, String key, int destinationDb, int timeout)
{
checkIsInMulti();
client.migrate(host, port, key, destinationDb, timeout);
return client.getStatusCodeReply();
}
public Double hincrByFloat(String key, String field, double increment)
{
checkIsInMulti();
client.hincrByFloat(key, field, increment);
String relpy = client.getBulkReply();
return relpy == null ? null : new Double(relpy);
}
/**
* @deprecated Method scan is deprecated
*/
public ScanResult scan(int cursor)
{
return scan(cursor, new ScanParams());
}
/**
* @deprecated Method scan is deprecated
*/
public ScanResult scan(int cursor, ScanParams params)
{
checkIsInMulti();
client.scan(cursor, params);
List result = client.getObjectMultiBulkReply();
int newcursor = Integer.parseInt(new String((byte[])(byte[])result.get(0)));
List results = new ArrayList();
List rawResults = (List)result.get(1);
byte bs[];
for(Iterator i$ = rawResults.iterator(); i$.hasNext(); results.add(SafeEncoder.encode(bs)))
bs = (byte[])i$.next();
return new ScanResult(newcursor, results);
}
/**
* @deprecated Method hscan is deprecated
*/
public ScanResult hscan(String key, int cursor)
{
return hscan(key, cursor, new ScanParams());
}
/**
* @deprecated Method hscan is deprecated
*/
public ScanResult hscan(String key, int cursor, ScanParams params)
{
checkIsInMulti();
client.hscan(key, cursor, params);
List result = client.getObjectMultiBulkReply();
int newcursor = Integer.parseInt(new String((byte[])(byte[])result.get(0)));
List results = new ArrayList();
List rawResults = (List)result.get(1);
for(Iterator iterator = rawResults.iterator(); iterator.hasNext(); results.add(new java.util.AbstractMap.SimpleEntry(SafeEncoder.encode((byte[])iterator.next()), SafeEncoder.encode((byte[])iterator.next()))));
return new ScanResult(newcursor, results);
}
/**
* @deprecated Method sscan is deprecated
*/
public ScanResult sscan(String key, int cursor)
{
return sscan(key, cursor, new ScanParams());
}
/**
* @deprecated Method sscan is deprecated
*/
public ScanResult sscan(String key, int cursor, ScanParams params)
{
checkIsInMulti();
client.sscan(key, cursor, params);
List result = client.getObjectMultiBulkReply();
int newcursor = Integer.parseInt(new String((byte[])(byte[])result.get(0)));
List results = new ArrayList();
List rawResults = (List)result.get(1);
byte bs[];
for(Iterator i$ = rawResults.iterator(); i$.hasNext(); results.add(SafeEncoder.encode(bs)))
bs = (byte[])i$.next();
return new ScanResult(newcursor, results);
}
/**
* @deprecated Method zscan is deprecated
*/
public ScanResult zscan(String key, int cursor)
{
return zscan(key, cursor, new ScanParams());
}
/**
* @deprecated Method zscan is deprecated
*/
public ScanResult zscan(String key, int cursor, ScanParams params)
{
checkIsInMulti();
client.zscan(key, cursor, params);
List result = client.getObjectMultiBulkReply();
int newcursor = Integer.parseInt(new String((byte[])(byte[])result.get(0)));
List results = new ArrayList();
List rawResults = (List)result.get(1);
for(Iterator iterator = rawResults.iterator(); iterator.hasNext(); results.add(new Tuple(SafeEncoder.encode((byte[])iterator.next()), Double.valueOf(SafeEncoder.encode((byte[])iterator.next())))));
return new ScanResult(newcursor, results);
}
public ScanResult scan(String cursor)
{
return scan(cursor, new ScanParams());
}
public ScanResult scan(String cursor, ScanParams params)
{
checkIsInMulti();
client.scan(cursor, params);
List result = client.getObjectMultiBulkReply();
String newcursor = new String((byte[])(byte[])result.get(0));
List results = new ArrayList();
List rawResults = (List)result.get(1);
byte bs[];
for(Iterator i$ = rawResults.iterator(); i$.hasNext(); results.add(SafeEncoder.encode(bs)))
bs = (byte[])i$.next();
return new ScanResult(newcursor, results);
}
public ScanResult hscan(String key, String cursor)
{
return hscan(key, cursor, new ScanParams());
}
public ScanResult hscan(String key, String cursor, ScanParams params)
{
checkIsInMulti();
client.hscan(key, cursor, params);
List result = client.getObjectMultiBulkReply();
String newcursor = new String((byte[])(byte[])result.get(0));
List results = new ArrayList();
List rawResults = (List)result.get(1);
for(Iterator iterator = rawResults.iterator(); iterator.hasNext(); results.add(new java.util.AbstractMap.SimpleEntry(SafeEncoder.encode((byte[])iterator.next()), SafeEncoder.encode((byte[])iterator.next()))));
return new ScanResult(newcursor, results);
}
public ScanResult sscan(String key, String cursor)
{
return sscan(key, cursor, new ScanParams());
}
public ScanResult sscan(String key, String cursor, ScanParams params)
{
checkIsInMulti();
client.sscan(key, cursor, params);
List result = client.getObjectMultiBulkReply();
String newcursor = new String((byte[])(byte[])result.get(0));
List results = new ArrayList();
List rawResults = (List)result.get(1);
byte bs[];
for(Iterator i$ = rawResults.iterator(); i$.hasNext(); results.add(SafeEncoder.encode(bs)))
bs = (byte[])i$.next();
return new ScanResult(newcursor, results);
}
public ScanResult zscan(String key, String cursor)
{
return zscan(key, cursor, new ScanParams());
}
public ScanResult zscan(String key, String cursor, ScanParams params)
{
checkIsInMulti();
client.zscan(key, cursor, params);
List result = client.getObjectMultiBulkReply();
String newcursor = new String((byte[])(byte[])result.get(0));
List results = new ArrayList();
List rawResults = (List)result.get(1);
for(Iterator iterator = rawResults.iterator(); iterator.hasNext(); results.add(new Tuple(SafeEncoder.encode((byte[])iterator.next()), Double.valueOf(SafeEncoder.encode((byte[])iterator.next())))));
return new ScanResult(newcursor, results);
}
public String clusterNodes()
{
checkIsInMulti();
client.clusterNodes();
return client.getBulkReply();
}
public String clusterMeet(String ip, int port)
{
checkIsInMulti();
client.clusterMeet(ip, port);
return client.getStatusCodeReply();
}
public transient String clusterAddSlots(int slots[])
{
checkIsInMulti();
client.clusterAddSlots(slots);
return client.getStatusCodeReply();
}
public transient String clusterDelSlots(int slots[])
{
checkIsInMulti();
client.clusterDelSlots(slots);
return client.getStatusCodeReply();
}
public String clusterInfo()
{
checkIsInMulti();
client.clusterInfo();
return client.getStatusCodeReply();
}
public List clusterGetKeysInSlot(int slot, int count)
{
checkIsInMulti();
client.clusterGetKeysInSlot(slot, count);
return client.getMultiBulkReply();
}
public String clusterSetSlotNode(int slot, String nodeId)
{
checkIsInMulti();
client.clusterSetSlotNode(slot, nodeId);
return client.getStatusCodeReply();
}
public String clusterSetSlotMigrating(int slot, String nodeId)
{
checkIsInMulti();
client.clusterSetSlotMigrating(slot, nodeId);
return client.getStatusCodeReply();
}
public String clusterSetSlotImporting(int slot, String nodeId)
{
checkIsInMulti();
client.clusterSetSlotImporting(slot, nodeId);
return client.getStatusCodeReply();
}
public String asking()
{
checkIsInMulti();
client.asking();
return client.getStatusCodeReply();
}
public List pubsubChannels(String pattern)
{
checkIsInMulti();
client.pubsubChannels(pattern);
return client.getMultiBulkReply();
}
public Long pubsubNumPat()
{
checkIsInMulti();
client.pubsubNumPat();
return client.getIntegerReply();
}
public transient Map pubsubNumSub(String channels[])
{
checkIsInMulti();
client.pubsubNumSub(channels);
return (Map)BuilderFactory.STRING_MAP.build(client.getBinaryMultiBulkReply());
}
}
/*
DECOMPILATION REPORT
Decompiled from: F:\workspace\redis\WebContent\WEB-INF\lib\jedis-2.4.2.jar
Total time: 147 ms
Jad reported messages/errors:
The class file version is 50.0 (only 45.3, 46.0 and 47.0 are supported)
Exit status: 0
Caught exceptions:
*/
jedis调用redis之源码
最新推荐文章于 2024-08-20 10:30:59 发布