Examples of SortingParams


Examples of redis.clients.jedis.SortingParams

  }

  @Override
  public Long sort(byte[] key, SortParameters params, byte[] sortKey) {

    SortingParams sortParams = JedisUtils.convertSortParams(params);

    try {
      if (isQueueing()) {
        if (sortParams != null) {
          transaction.sort(key, sortParams, sortKey);
View Full Code Here

Examples of redis.clients.jedis.SortingParams

    }
    return result;
  }

  static SortingParams convertSortParams(SortParameters params) {
    SortingParams jedisParams = null;

    if (params != null) {
      jedisParams = new SortingParams();

      byte[] byPattern = params.getByPattern();
      if (byPattern != null) {
        jedisParams.by(params.getByPattern());
      }

      byte[][] getPattern = params.getGetPattern();
      if (getPattern != null) {
        jedisParams.get(getPattern);
      }

      Range limit = params.getLimit();
      if (limit != null) {
        jedisParams.limit((int) limit.getStart(), (int) limit.getCount());
      }
      Order order = params.getOrder();
      if (order != null && order.equals(Order.DESC)) {
        jedisParams.desc();
      }
      Boolean isAlpha = params.isAlphabetic();
      if (isAlpha != null && isAlpha) {
        jedisParams.alpha();
      }
    }

    return jedisParams;
  }
View Full Code Here

Examples of redis.clients.jedis.SortingParams

        String id = parseAndSearch(conn, queryString, 300);

        Transaction trans = conn.multi();
        trans.scard("idx:" + id);
        SortingParams params = new SortingParams();
        if (desc) {
            params.desc();
        }
        if (alpha){
            params.alpha();
        }
        params.by(by);
        params.limit(0, 20);
        trans.sort("idx:" + id, params);
        List<Object> results = trans.exec();

        return new SearchResult(
            id,
View Full Code Here

Examples of redis.clients.jedis.SortingParams

    txResults.add(result);
  }

  public List<byte[]> sort(byte[] key, SortParameters params) {

    SortingParams sortParams = JedisConverters.toSortingParams(params);

    try {
      if (isPipelined()) {
        if (sortParams != null) {
          pipeline(new JedisResult(pipeline.sort(key, sortParams)));
View Full Code Here

Examples of redis.clients.jedis.SortingParams

    }
  }

  public Long sort(byte[] key, SortParameters params, byte[] storeKey) {

    SortingParams sortParams = JedisConverters.toSortingParams(params);

    try {
      if (isPipelined()) {
        if (sortParams != null) {
          pipeline(new JedisResult(pipeline.sort(key, sortParams, storeKey)));
View Full Code Here

Examples of redis.clients.jedis.SortingParams

    }
    return result;
  }

  static SortingParams convertSortParams(SortParameters params) {
    SortingParams jedisParams = null;

    if (params != null) {
      jedisParams = new SortingParams();

      byte[] byPattern = params.getByPattern();
      if (byPattern != null) {
        jedisParams.by(params.getByPattern());
      }

      byte[][] getPattern = params.getGetPattern();
      if (getPattern != null) {
        jedisParams.get(getPattern);
      }

      Range limit = params.getLimit();
      if (limit != null) {
        jedisParams.limit((int) limit.getStart(), (int) limit.getCount());
      }
      Order order = params.getOrder();
      if (order != null && order.equals(Order.DESC)) {
        jedisParams.desc();
      }
      Boolean isAlpha = params.isAlphabetic();
      if (isAlpha != null && isAlpha) {
        jedisParams.alpha();
      }
    }

    return jedisParams;
  }
View Full Code Here

Examples of redis.clients.jedis.SortingParams

    }
    return result;
  }

  public static SortingParams toSortingParams(SortParameters params) {
    SortingParams jedisParams = null;
    if (params != null) {
      jedisParams = new SortingParams();
      byte[] byPattern = params.getByPattern();
      if (byPattern != null) {
        jedisParams.by(params.getByPattern());
      }
      byte[][] getPattern = params.getGetPattern();
      if (getPattern != null) {
        jedisParams.get(getPattern);
      }
      Range limit = params.getLimit();
      if (limit != null) {
        jedisParams.limit((int) limit.getStart(), (int) limit.getCount());
      }
      Order order = params.getOrder();
      if (order != null && order.equals(Order.DESC)) {
        jedisParams.desc();
      }
      Boolean isAlpha = params.isAlphabetic();
      if (isAlpha != null && isAlpha) {
        jedisParams.alpha();
      }
    }
    return jedisParams;
  }
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.