本文整理了Java中redis.clients.jedis.Pipeline.zadd()
方法的一些代码示例,展示了Pipeline.zadd()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Pipeline.zadd()
方法的具体详情如下:
包路径:redis.clients.jedis.Pipeline
类名称:Pipeline
方法名:zadd
暂无
代码示例来源:origin: sohutv/cachecloud
@Override
public void pipelineCommand(Pipeline pipeline, List<String> pipelineKeys) {
for (String key : pipelineKeys) {
Map<String, Double> scoreMemberMap = map.get(key);
pipeline.zadd(key, scoreMemberMap);
}
}
代码示例来源:origin: sohutv/cachecloud
@Override
public void pipelineCommand(Pipeline pipeline, List<String> pipelineKeys) {
for (String key : pipelineKeys) {
SortedSetVO vo = map.get(key);
if (vo.getMemberStr() != null) {
pipeline.zadd(key, vo.getScore(), vo.getMemberStr());
} else {
pipeline.zadd(SafeEncoder.encode(key), vo.getScore(), vo.getBytesBytes());
}
}
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public Boolean zAdd(byte[] key, double score, byte[] value) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(value, "Value must not be null!");
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().zadd(key, score, value),
JedisConverters.longToBoolean()));
return null;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().zadd(key, score, value),
JedisConverters.longToBoolean()));
return null;
}
return JedisConverters.toBoolean(connection.getJedis().zadd(key, score, value));
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public Long zAdd(byte[] key, Set<Tuple> tuples) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(tuples, "Tuples must not be null!");
try {
if (isPipelined()) {
pipeline(
connection.newJedisResult(connection.getRequiredPipeline().zadd(key, JedisConverters.toTupleMap(tuples))));
return null;
}
if (isQueueing()) {
transaction(connection
.newJedisResult(connection.getRequiredTransaction().zadd(key, JedisConverters.toTupleMap(tuples))));
return null;
}
return connection.getJedis().zadd(key, JedisConverters.toTupleMap(tuples));
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: Impetus/Kundera
pipeLine.zadd(idx_Name, value, parentId.toString());
代码示例来源:origin: com.netflix.dyno/dyno-jedis
@Override
Response<Long> execute(Pipeline jedisPipeline) throws DynoException {
return jedisPipeline.zadd(key, scoreMembers);
}
代码示例来源:origin: Netflix/dyno-queues
@Override
public Response<Long> zadd(String key, double score, String member) {
return pipe.zadd(key, score, member);
}
代码示例来源:origin: com.netflix.dyno/dyno-jedis
@Override
Response<Long> execute(Pipeline jedisPipeline) throws DynoException {
return jedisPipeline.zadd(key, score, member);
}
代码示例来源:origin: com.netflix.dyno/dyno-jedis
@Override
Response<Long> execute(Pipeline jedisPipeline) throws DynoException {
return jedisPipeline.zadd(key, score, member, params);
}
代码示例来源:origin: Netflix/dyno-queues
@Override
public Response<Long> zadd(String key, double score, String member, ZAddParams zParams) {
return pipe.zadd(key, score, member, zParams);
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Response<Long> zadd(byte[] key, Map<byte[], Double> scoreMembers) {
String command = "zadd";
return instrumented(command, () -> delegated.zadd(key, scoreMembers));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Response<Long> zadd(String key, Map<String, Double> scoreMembers, ZAddParams params) {
String command = "zadd";
return instrumented(command, () -> delegated.zadd(key, scoreMembers, params));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Response<Long> zadd(String key, Map<String, Double> scoreMembers) {
String command = "zadd";
return instrumented(command, () -> delegated.zadd(key, scoreMembers));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Response<Long> zadd(byte[] key, Map<byte[], Double> scoreMembers, ZAddParams params) {
String command = "zadd";
return instrumented(command, () -> delegated.zadd(key, scoreMembers, params));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Response<Long> zadd(String key, double score, String member, ZAddParams params) {
String command = "zadd";
return instrumented(command, payloadSize(member), () -> delegated.zadd(key, score, member, params));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Response<Long> zadd(byte[] key, double score, byte[] member) {
String command = "zadd";
return instrumented(command, payloadSize(member), () -> delegated.zadd(key, score, member));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Response<Long> zadd(String key, double score, String member) {
String command = "zadd";
return instrumented(command, payloadSize(member), () -> delegated.zadd(key, score, member));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Response<Long> zadd(byte[] key, double score, byte[] member, ZAddParams params) {
String command = "zadd";
return instrumented(command, payloadSize(member), () -> delegated.zadd(key, score, member, params));
}
代码示例来源:origin: Baqend/Orestes-Bloomfilter
@Override
public void setTimeToLiveMap(TimeMap<T> map) {
try (Jedis jedis = pool.getResource()) {
Pipeline pipeline = jedis.pipelined();
AtomicInteger ctr = new AtomicInteger(0);
map.forEach((item, ttl) -> {
pipeline.zadd(keys.TTL_KEY, ttl, item.toString());
// Sync every thousandth item
if (ctr.incrementAndGet() >= 1000) {
ctr.set(0);
pipeline.sync();
}
});
pipeline.sync();
}
}
代码示例来源:origin: Baqend/Orestes-Bloomfilter
@Override
public void setExpirationMap(TimeMap<String> map) {
try (Jedis jedis = pool.getResource()) {
Pipeline pipeline = jedis.pipelined();
AtomicInteger ctr = new AtomicInteger(0);
map.forEach((item, expiration) -> {
int[] positions = hash(item);
pipeline.zadd(keys.EXPIRATION_QUEUE_KEY.getBytes(), expiration, msgPack.encodeItem(item, positions));
if (ctr.incrementAndGet() >= 1000) {
ctr.set(0);
pipeline.sync();
}
});
pipeline.sync();
}
}
内容来源于网络,如有侵权,请联系作者删除!