Package redis.reply

Examples of redis.reply.MultiBulkReply


    }
    {
      os = new ByteArrayOutputStream();
      String message = "OK";
      long integer = 999;
      new MultiBulkReply(new Reply[] {
              new StatusReply(message),
              new ErrorReply(message),
              new MultiBulkReply(new Reply[] { new StatusReply(message)}),
              new BulkReply(message.getBytes()),
              new IntegerReply(integer)}).write(os);
      receive = RedisProtocol.receive(new ByteArrayInputStream(os.toByteArray()));
      assertTrue(receive instanceof MultiBulkReply);
      Reply[] data = (Reply[]) receive.data();
View Full Code Here


      }
      case BulkReply.MARKER: {
        return new BulkReply(readBytes(is));
      }
      case MultiBulkReply.MARKER: {
        return new MultiBulkReply(is);
      }
      default: {
        throw new IOException("Unexpected character in stream: " + code);
      }
    }
View Full Code Here

    redisClient.del(new Object[] { "hash" });
    redisClient.hset("hash", "field1", "value1");
    redisClient.hset("hash", "field2", "value2");
    redisClient.hset("hash", "field3", "value1");
    MultiBulkReply hash = redisClient.hgetall("hash");
    assertEquals("value2", hash.asStringMap(Charsets.UTF_8).get("field2"));
    assertEquals(6, hash.asStringList(Charsets.UTF_8).size());
    assertEquals(5, hash.asStringSet(Charsets.UTF_8).size());

    Object[] keys = {"test1", "test2", "test3"};
    redisClient.del(keys);
    redisClient.set("test1", "value1");
    redisClient.set("test2", "value2");
    redisClient.set("test3", "value3");
    MultiBulkReply values = redisClient.mget(keys);
    List<String> strings = values.asStringList(Charsets.UTF_8);
    assertEquals(3, strings.size());
    assertEquals("value2", strings.get(1));
  }
View Full Code Here

  private RedisClient client;

  public List scriptExists(String... scripts) {
    Reply reply = client.script_exists(scripts);
    if (reply instanceof MultiBulkReply) {
      MultiBulkReply mbr = (MultiBulkReply) reply;
      return mbr.asStringList(Charsets.UTF_8);
    }
    return new ArrayList();
  }
View Full Code Here

    if (isPipelined()) {
      pipeline(new SrpGenericResult(pipeline.time(), SrpConverters.repliesToTimeAsLong()));
      return null;
    }

    MultiBulkReply reply = this.client.time();
    Assert.notNull(reply, "Received invalid result from server. MultiBulkReply must not be empty.");

    return SrpConverters.toTimeAsLong(reply.data());
  }
View Full Code Here

TOP

Related Classes of redis.reply.MultiBulkReply

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.