redis.clients.jedis.Transaction.sort()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中redis.clients.jedis.Transaction.sort()方法的一些代码示例,展示了Transaction.sort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transaction.sort()方法的具体详情如下:
包路径:redis.clients.jedis.Transaction
类名称:Transaction
方法名:sort

Transaction.sort介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Long sort(byte[] key, @Nullable SortParameters params, byte[] storeKey) {
  Assert.notNull(key, "Key must not be null!");
  SortingParams sortParams = JedisConverters.toSortingParams(params);
  try {
    if (isPipelined()) {
      if (sortParams != null) {
        pipeline(connection.newJedisResult(connection.getRequiredPipeline().sort(key, sortParams, storeKey)));
      } else {
        pipeline(connection.newJedisResult(connection.getRequiredPipeline().sort(key, storeKey)));
      }
      return null;
    }
    if (isQueueing()) {
      if (sortParams != null) {
        transaction(connection.newJedisResult(connection.getRequiredTransaction().sort(key, sortParams, storeKey)));
      } else {
        transaction(connection.newJedisResult(connection.getRequiredTransaction().sort(key, storeKey)));
      }
      return null;
    }
    return (sortParams != null ? connection.getJedis().sort(key, sortParams, storeKey)
        : connection.getJedis().sort(key, storeKey));
  } catch (Exception ex) {
    throw connection.convertJedisAccessException(ex);
  }
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public List<byte[]> sort(byte[] key, SortParameters params) {
  Assert.notNull(key, "Key must not be null!");
  SortingParams sortParams = JedisConverters.toSortingParams(params);
  try {
    if (isPipelined()) {
      if (sortParams != null) {
        pipeline(connection.newJedisResult(connection.getRequiredPipeline().sort(key, sortParams)));
      } else {
        pipeline(connection.newJedisResult(connection.getRequiredPipeline().sort(key)));
      }
      return null;
    }
    if (isQueueing()) {
      if (sortParams != null) {
        transaction(connection.newJedisResult(connection.getRequiredTransaction().sort(key, sortParams)));
      } else {
        transaction(connection.newJedisResult(connection.getRequiredTransaction().sort(key)));
      }
      return null;
    }
    return (sortParams != null ? connection.getJedis().sort(key, sortParams) : connection.getJedis().sort(key));
  } catch (Exception ex) {
    throw connection.convertJedisAccessException(ex);
  }
}

代码示例来源:origin: mindwind/craft-atom

private void sort_destination(String key, String destination) {
  t.sort(key, destination);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_desc(String key, boolean desc) {
  SortingParams sp = new SortingParams();
  if (desc) {
    sp.desc();
  }
  
  t.sort(key, sp);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_desc_destination(String key, boolean desc, String destination) {
  SortingParams sp = new SortingParams();
  if (desc) {
    sp.desc();
  }
  t.sort(key, sp, destination);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_offset_count_destination(String key, int offset, int count, String destination) {
  SortingParams sp = new SortingParams();
  sp.limit(offset, count);
  t.sort(key, sp, destination);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_destination_get(String key, String bypattern, String destination, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  
  t.sort(key, sp, destination);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_alpha_desc(String key, boolean alpha, boolean desc) {
  SortingParams sp = new SortingParams();
  if (desc) {
    sp.desc();
  }
  if (alpha) { 
    sp.alpha() ;
  }
  t.sort(key, sp);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_get(String key, String bypattern, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  
  t.sort(key, sp);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_alpha_desc_destination(String key, boolean alpha, boolean desc, String destination) {
  SortingParams sp = new SortingParams();
  if (desc) {
    sp.desc();
  }
  if (alpha) {
    sp.alpha();
  }
  
  t.sort(key, sp, destination);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_desc_destination_get(String key, String bypattern, boolean desc, String destination, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  if (desc) {
    sp.desc();
  }
  
  t.sort(key, sp, destination);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_desc_get(String key, String bypattern, boolean desc, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  if (desc) {
    sp.desc();
  }
  
  t.sort(key, sp);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_offset_count_get(String key, String bypattern, int offset, int count, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  sp.limit(offset, count);
  t.sort(key, sp);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_offset_count_destination_get(String key, String bypattern, int offset, int count, String destination, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  sp.limit(offset, count);
  
  t.sort(key, sp, destination);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_offset_count_alpha_desc(String key, int offset, int count, boolean alpha, boolean desc) {
  SortingParams sp = new SortingParams();
  if (desc) {
    sp.desc();
  }
  if (alpha) { 
    sp.alpha() ;
  }
  sp.limit(offset, count);
  
  t.sort(key, sp);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_offset_count_alpha_desc_destination(String key, int offset, int count, boolean alpha, boolean desc, String destination) {
  SortingParams sp = new SortingParams();
  sp.limit(offset, count);
  if (desc) {
    sp.desc();
  }
  if (alpha) {
    sp.alpha();
  }
  t.sort(key, sp, destination);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_alpha_desc_destination_get(String key, String bypattern, boolean alpha, boolean desc, String destination, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  if (alpha) {
    sp.alpha();
  }
  if (desc) {
    sp.desc();
  }
  
  t.sort(key, sp, destination);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_alpha_desc_get(String key, String bypattern, boolean alpha, boolean desc, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  if (alpha) {
    sp.alpha();
  }
  if (desc) {
    sp.desc();
  }
  
  t.sort(key, sp);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_offset_count_alpha_desc_get(String key, String bypattern, int offset, int count, boolean alpha, boolean desc, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  sp.limit(offset, count);
  if (alpha) {
    sp.alpha();
  }
  if (desc) {
    sp.desc();
  }
  
  t.sort(key, sp);
}

代码示例来源:origin: mindwind/craft-atom

private void sort_by_offset_count_alpha_desc_destination_get(String key, String bypattern, int offset, int count, boolean alpha, boolean desc, String destination, String... getpatterns) {
  SortingParams sp = new SortingParams();
  sp.by(bypattern);
  sp.get(getpatterns);
  sp.limit(offset, count);
  if (alpha) {
    sp.alpha();
  }
  if (desc) {
    sp.desc();
  }
  
  t.sort(key, sp, destination);
}

相关文章

微信公众号

最新文章

更多

Transaction类方法