Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2222

Jedis pipeline execute commands before calling sync method?

$
0
0

I am using the Jedis pipeline to add multiple records in Redis at once. But when I am debugging the code I can see the records appear in Redis even before calling jedis.sync() method. Aren't all commands in the pipeline expected to be executed only after that? Or maybe it's just batching them on some chunks with a fixed size?

var pipeline = jedis.pipelined();all.forEach(value -> pipeline.sadd(allPrefix, value));grouped.forEach((key, value) -> pipeline.hset(groupedPrefix, String.valueOf(key), value));pipeline.sync();

Am I doing it the right way and what is the reason for this behavior?


Viewing all articles
Browse latest Browse all 2222

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>