本文整理了Java中redis.clients.jedis.Pipeline.multi()
方法的一些代码示例,展示了Pipeline.multi()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Pipeline.multi()
方法的具体详情如下:
包路径:redis.clients.jedis.Pipeline
类名称:Pipeline
方法名:multi
暂无
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public void multi() {
if (isQueueing()) {
return;
}
try {
if (isPipelined()) {
getRequiredPipeline().multi();
return;
}
this.transaction = jedis.multi();
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Response<String> multi() {
String command = "multi";
return instrumented(command, () -> delegated.multi());
}
代码示例来源:origin: gojektech/feast
@StartBundle
public void startBundle() {
pipeline = jedis.pipelined();
pipeline.multi();
batchCount = 0;
}
代码示例来源:origin: gojektech/feast
private void exec() {
// LOGGER.info("Flushing pipeline");
if (!pipeline.isInMulti()) {
pipeline.multi();
}
pipeline.exec();
pipeline.multi();
batchCount = 0;
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-redis
@StartBundle
public void startBundle() {
pipeline = jedis.pipelined();
pipeline.multi();
batchCount = 0;
}
代码示例来源:origin: pyloque/captain
public void pipeline(Consumer<Pipeline> func) {
try (Jedis jedis = pool.getResource()) {
try (Pipeline pipe = jedis.pipelined()) {
pipe.multi();
func.accept(pipe);
pipe.exec();
} catch (IOException e) {
throw new RuntimeException("pipe close error", e);
}
}
}
代码示例来源:origin: intsmaze/intsmaze
@Test
public void testPipelineTrans() {
long start = System.currentTimeMillis();
Pipeline pipeline = jedis.pipelined();
pipeline.multi();
for (int i = 0; i < 100000; i++) {
pipeline.set("" + i, "" + i);
}
pipeline.exec();
List<Object> results = pipeline.syncAndReturnAll();
long end = System.currentTimeMillis();
System.out.println("Pipelined transaction SET: " + ((end - start)/1000.0) + " seconds");
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-redis
@ProcessElement
public void processElement(ProcessContext processContext) {
KV<String, String> record = processContext.element();
writeRecord(record);
batchCount++;
if (batchCount >= DEFAULT_BATCH_SIZE) {
pipeline.exec();
pipeline.multi();
batchCount = 0;
}
}
代码示例来源:origin: kstyrc/trident-redis
public void multiPut(List<List<Object>> keys, List<T> vals) {
if (keys.size() == 0) {
return;
}
if (Strings.isNullOrEmpty(this.options.hkey)) {
String[] keyValues = buildKeyValuesList(keys, vals);
mset(keyValues);
} else {
Jedis jedis = pool.getResource();
try {
Pipeline pl = jedis.pipelined();
pl.multi();
for (int i = 0; i < keys.size(); i++) {
String val = new String(serializer.serialize(vals.get(i)));
pl.hset(this.options.hkey,
keyFactory.build(keys.get(i)),
val);
}
pl.exec();
pl.sync();
} finally {
pool.returnResource(jedis);
}
}
}
代码示例来源:origin: com.coveo/spillway
pipeline.multi();
LimitKey limitKey = LimitKey.fromRequest(request);
String redisKey =
代码示例来源:origin: Baqend/Orestes-Bloomfilter
@SuppressWarnings("unchecked")
public <T> List<T> transactionallyDo(Consumer<Pipeline> f, String... watch) {
return (List<T>) safelyReturn(jedis -> {
Pipeline p = jedis.pipelined();
if (watch.length != 0) {
p.watch(watch);
}
p.multi();
f.accept(p);
Response<List<Object>> exec = p.exec();
p.sync();
return exec.get();
});
}
代码示例来源:origin: org.springframework.data/spring-data-redis
@Override
public void multi() {
if (isQueueing()) {
return;
}
try {
if (isPipelined()) {
getRequiredPipeline().multi();
return;
}
this.transaction = jedis.multi();
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public void multi() {
if (isQueueing()) {
return;
}
try {
if (isPipelined()) {
getRequiredPipeline().multi();
return;
}
this.transaction = jedis.multi();
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: Baqend/Orestes-Bloomfilter
p.multi();
p.set("muh", "mäh");
p.exec();
pipe.multi();
pipe.set("myKey", "myVal");
Response<List<Object>> result = pipe.exec();
代码示例来源:origin: Baqend/Orestes-Bloomfilter
@Ignore
@Test
public void testOverflow() {
Jedis jedis = new Jedis("localhost");
Pipeline p = jedis.pipelined();
p.multi();
for (int i = 0; i < 10000; i++) {
p.setbit("test", 1, true); //or any other call
}
Response<List<Object>> exec = p.exec();
p.sync();
exec.get();
}
内容来源于网络,如有侵权,请联系作者删除!