Package redis

Examples of redis.Command


  }

  // Varargs version to simplify commands with optional or multiple arguments
  public Promise<Reply> object_(Object... arguments) {
    if (version < OBJECT_VERSION) return new Promise<>(new RedisException("Server does not support OBJECT"));
    return execute(Reply.class, new Command(OBJECT_BYTES, arguments));
  }
View Full Code Here


   * @param key0
   * @return IntegerReply
   */
  public Promise<IntegerReply> persist(Object key0) {
    if (version < PERSIST_VERSION) return new Promise<>(new RedisException("Server does not support PERSIST"));
    return execute(IntegerReply.class, new Command(PERSIST_BYTES, key0));
  }
View Full Code Here

   * @param milliseconds1
   * @return IntegerReply
   */
  public Promise<IntegerReply> pexpire(Object key0, Object milliseconds1) {
    if (version < PEXPIRE_VERSION) return new Promise<>(new RedisException("Server does not support PEXPIRE"));
    return execute(IntegerReply.class, new Command(PEXPIRE_BYTES, key0, milliseconds1));
  }
View Full Code Here

   * @param milliseconds_timestamp1
   * @return IntegerReply
   */
  public Promise<IntegerReply> pexpireat(Object key0, Object milliseconds_timestamp1) {
    if (version < PEXPIREAT_VERSION) return new Promise<>(new RedisException("Server does not support PEXPIREAT"));
    return execute(IntegerReply.class, new Command(PEXPIREAT_BYTES, key0, milliseconds_timestamp1));
  }
View Full Code Here

   * @param key0
   * @return IntegerReply
   */
  public Promise<IntegerReply> pttl(Object key0) {
    if (version < PTTL_VERSION) return new Promise<>(new RedisException("Server does not support PTTL"));
    return execute(IntegerReply.class, new Command(PTTL_BYTES, key0));
  }
View Full Code Here

   *
   * @return BulkReply
   */
  public Promise<BulkReply> randomkey() {
    if (version < RANDOMKEY_VERSION) return new Promise<>(new RedisException("Server does not support RANDOMKEY"));
    return execute(BulkReply.class, new Command(RANDOMKEY_BYTES));
  }
View Full Code Here

   * @param newkey1
   * @return StatusReply
   */
  public Promise<StatusReply> rename(Object key0, Object newkey1) {
    if (version < RENAME_VERSION) return new Promise<>(new RedisException("Server does not support RENAME"));
    return execute(StatusReply.class, new Command(RENAME_BYTES, key0, newkey1));
  }
View Full Code Here

   * @param newkey1
   * @return IntegerReply
   */
  public Promise<IntegerReply> renamenx(Object key0, Object newkey1) {
    if (version < RENAMENX_VERSION) return new Promise<>(new RedisException("Server does not support RENAMENX"));
    return execute(IntegerReply.class, new Command(RENAMENX_BYTES, key0, newkey1));
  }
View Full Code Here

   * @param serialized_value2
   * @return StatusReply
   */
  public Promise<StatusReply> restore(Object key0, Object ttl1, Object serialized_value2) {
    if (version < RESTORE_VERSION) return new Promise<>(new RedisException("Server does not support RESTORE"));
    return execute(StatusReply.class, new Command(RESTORE_BYTES, key0, ttl1, serialized_value2));
  }
View Full Code Here

  @Test
  public void benchmarkPipeline() throws IOException, ExecutionException, InterruptedException {
    if (System.getenv().containsKey("CI") || System.getProperty("CI") != null) return;
    long start = System.currentTimeMillis();
    RedisClient redisClient = new RedisClient("localhost", 6379);
    redisClient.execute("INFO", new Command("INFO", "server"));
    RedisClient.Pipeline pipeline = redisClient.pipeline();
    int PIPELINE_CALLS = 50;
    Future<StatusReply>[] replies = new Future[PIPELINE_CALLS];
    for (int i = 0; i < CALLS * 10 / PIPELINE_CALLS; i++) {
      for (int j = 0; j < PIPELINE_CALLS; j++) {
View Full Code Here

TOP

Related Classes of redis.Command

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.