Пример #1
0
 private Set<Tuple> getTupledSet() {
   checkIsInMulti();
   List<String> membersWithScores = client.getMultiBulkReply();
   Set<Tuple> set = new LinkedHashSet<Tuple>();
   Iterator<String> iterator = membersWithScores.iterator();
   while (iterator.hasNext()) {
     set.add(new Tuple(iterator.next(), Double.valueOf(iterator.next())));
   }
   return set;
 }
Пример #2
0
  public Map<String, String> hgetAll(String key) {
    checkIsInMulti();
    client.hgetAll(key);
    List<String> flatHash = client.getMultiBulkReply();
    Map<String, String> hash = new HashMap<String, String>();
    Iterator<String> iterator = flatHash.iterator();
    while (iterator.hasNext()) {
      hash.put(iterator.next(), iterator.next());
    }

    return hash;
  }
Пример #3
0
  public List<String> blpop(int timeout, String... keys) {
    checkIsInMulti();
    List<String> args = new ArrayList<String>();
    for (String arg : keys) {
      args.add(arg);
    }
    args.add(String.valueOf(timeout));

    client.blpop(args.toArray(new String[args.size()]));
    client.setTimeoutInfinite();
    List<String> multiBulkReply = client.getMultiBulkReply();
    client.rollbackTimeout();
    return multiBulkReply;
  }
Пример #4
0
 public List<String> keys(String pattern) {
   checkIsInMulti();
   client.keys(pattern);
   return client.getMultiBulkReply();
 }
Пример #5
0
 public List<String> configGet(String pattern) {
   client.configGet(pattern);
   return client.getMultiBulkReply();
 }
Пример #6
0
 public Set<String> zrangeByScore(String key, double min, double max, int offset, int count) {
   checkIsInMulti();
   client.zrangeByScore(key, min, max, offset, count);
   return new LinkedHashSet<String>(client.getMultiBulkReply());
 }
Пример #7
0
 public List<String> sort(String key, SortingParams sortingParameters) {
   checkIsInMulti();
   client.sort(key, sortingParameters);
   return client.getMultiBulkReply();
 }
Пример #8
0
 public List<String> sort(String key) {
   checkIsInMulti();
   client.sort(key);
   return client.getMultiBulkReply();
 }
Пример #9
0
 public Set<String> zrevrange(String key, int start, int end) {
   checkIsInMulti();
   client.zrevrange(key, start, end);
   List<String> members = client.getMultiBulkReply();
   return new LinkedHashSet<String>(members);
 }
Пример #10
0
 public Set<String> sdiff(String... keys) {
   checkIsInMulti();
   client.sdiff(keys);
   List<String> members = client.getMultiBulkReply();
   return new LinkedHashSet<String>(members);
 }
Пример #11
0
 public Set<String> smembers(String key) {
   checkIsInMulti();
   client.smembers(key);
   List<String> members = client.getMultiBulkReply();
   return new LinkedHashSet<String>(members);
 }
Пример #12
0
 public List<String> lrange(String key, int start, int end) {
   checkIsInMulti();
   client.lrange(key, start, end);
   return client.getMultiBulkReply();
 }
Пример #13
0
 public List<String> hvals(String key) {
   checkIsInMulti();
   client.hvals(key);
   return client.getMultiBulkReply();
 }
Пример #14
0
 public List<String> hmget(String key, String... fields) {
   checkIsInMulti();
   client.hmget(key, fields);
   return client.getMultiBulkReply();
 }
Пример #15
0
 public List<String> mget(String... keys) {
   checkIsInMulti();
   client.mget(keys);
   return client.getMultiBulkReply();
 }