Package com.lambdaworks.redis

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


      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

      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

    }
    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

Related Classes of com.lambdaworks.redis.ZStoreArgs

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.