本文整理了Java中redis.clients.jedis.ZParams.getParams()
方法的一些代码示例,展示了ZParams.getParams()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZParams.getParams()
方法的具体详情如下:
包路径:redis.clients.jedis.ZParams
类名称:ZParams
方法名:getParams
暂无
代码示例来源:origin: sohutv/cachecloud
public void zinterstore(final byte[] dstkey, final ZParams params, final byte[]... sets) {
final List<byte[]> args = new ArrayList<byte[]>();
args.add(dstkey);
args.add(Protocol.toByteArray(sets.length));
for (final byte[] set : sets) {
args.add(set);
}
args.addAll(params.getParams());
sendCommand(ZINTERSTORE, args.toArray(new byte[args.size()][]));
}
代码示例来源:origin: sohutv/cachecloud
public void zunionstore(final byte[] dstkey, final ZParams params, final byte[]... sets) {
final List<byte[]> args = new ArrayList<byte[]>();
args.add(dstkey);
args.add(Protocol.toByteArray(sets.length));
for (final byte[] set : sets) {
args.add(set);
}
args.addAll(params.getParams());
sendCommand(ZUNIONSTORE, args.toArray(new byte[args.size()][]));
}
代码示例来源:origin: apache/servicemix-bundles
public void zunionstore(final byte[] dstkey, final ZParams params, final byte[]... sets) {
final List<byte[]> args = new ArrayList<byte[]>();
args.add(dstkey);
args.add(Protocol.toByteArray(sets.length));
for (final byte[] set : sets) {
args.add(set);
}
args.addAll(params.getParams());
sendCommand(ZUNIONSTORE, args.toArray(new byte[args.size()][]));
}
代码示例来源:origin: io.leopard/leopard-redis
/**
* 返回AGGREGATE参数选项.
*
* @param params 参数
* @return
*/
public static ZParams.Aggregate getAggregate(ZParams params) {
Collection<byte[]> collect = params.getParams();
Iterator<byte[]> iterator = collect.iterator();
String key = new String(iterator.next());
if (!"aggregate".equals(key)) {
return ZParams.Aggregate.SUM;
}
String type = new String(iterator.next());
return ZParams.Aggregate.valueOf(type);
}
代码示例来源:origin: apache/servicemix-bundles
public void zinterstore(final byte[] dstkey, final ZParams params, final byte[]... sets) {
final List<byte[]> args = new ArrayList<byte[]>();
args.add(dstkey);
args.add(Protocol.toByteArray(sets.length));
for (final byte[] set : sets) {
args.add(set);
}
args.addAll(params.getParams());
sendCommand(ZINTERSTORE, args.toArray(new byte[args.size()][]));
}
代码示例来源:origin: io.leopard/leopard-redis
/**
* 返回WEIGHTS参数列表.
*
* @param params 参数
* @return
*/
public static List<Double> getWeights(ZParams params) {
Collection<byte[]> collect = params.getParams();
Iterator<byte[]> iterator = collect.iterator();
boolean hasWeights = false;
while (iterator.hasNext()) {
String value = new String(iterator.next());
// System.out.println("value:" + value);
if ("weights".equals(value)) {
hasWeights = true;
break;
}
}
if (!hasWeights) {
return null;
}
List<Double> result = new ArrayList<Double>();
while (iterator.hasNext()) {
String weight = new String(iterator.next());
result.add(Double.parseDouble(weight));
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!