Examples of ZStoreArgs


Examples of com.lambdaworks.redis.ZStoreArgs

    }
    return args;
  }

  static ZStoreArgs zArgs(Aggregate aggregate, int[] weights) {
    ZStoreArgs args = new ZStoreArgs();

    if (aggregate != null) {
      switch (aggregate) {
        case MIN:
          args.min();
          break;
        case MAX:
          args.max();
          break;
        default:
          args.sum();
          break;
      }
    }

    long[] lg = new long[weights.length];
    for (int i = 0; i < lg.length; i++) {
      lg[i] = (long) weights[i];
    }
    args.weights(lg);
    return args;
  }
View Full Code Here

Examples of com.lambdaworks.redis.ZStoreArgs

      throw convertLettuceAccessException(ex);
    }
  }

  public Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
    ZStoreArgs storeArgs = zStoreArgs(aggregate, weights);

    try {
      if (isPipelined()) {
        pipeline(new LettuceResult(getAsyncConnection().zinterstore(destKey, storeArgs, sets)));
        return null;
View Full Code Here

Examples of com.lambdaworks.redis.ZStoreArgs

      throw convertLettuceAccessException(ex);
    }
  }

  public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
    ZStoreArgs storeArgs = zStoreArgs(aggregate, weights);

    try {
      if (isPipelined()) {
        pipeline(new LettuceResult(getAsyncConnection().zunionstore(destKey, storeArgs, sets)));
        return null;
View Full Code Here

Examples of com.lambdaworks.redis.ZStoreArgs

    }
    return new byte[0][0];
  }

  private ZStoreArgs zStoreArgs(Aggregate aggregate, int[] weights) {
    ZStoreArgs args = new ZStoreArgs();
    if (aggregate != null) {
      switch (aggregate) {
        case MIN:
          args.min();
          break;
        case MAX:
          args.max();
          break;
        default:
          args.sum();
          break;
      }
    }
    long[] lg = new long[weights.length];
    for (int i = 0; i < lg.length; i++) {
      lg[i] = (long) weights[i];
    }
    args.weights(lg);
    return args;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.