Skip to content

Commit

Permalink
use cmsIncrBy simple variant
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 authored Jan 2, 2024
1 parent 5432dcf commit e9e774d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/test/java/io/redis/examples/CMSExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class CMSExample {

@Test
public void run(){
public void run() {

//HIDE_START
UnifiedJedis jedis = new UnifiedJedis("redis://localhost:6379");
Expand All @@ -29,10 +29,8 @@ public void run(){
String res1 = jedis.cmsInitByProb("bikes:profit", 0.001d, 0.002d);
System.out.println(res1); // >>> OK

List<Long> res2 = jedis.cmsIncrBy("bikes:profit", new HashMap<String, Long>() {{
put("Smoky Mountain Striker", 100L);
}});
System.out.println(res2); // >>> [100]
long res2 = jedis.cmsIncrBy("bikes:profit", "Smoky Mountain Striker", 100L);
System.out.println(res2); // >>> 100

List<Long> res3 = jedis.cmsIncrBy("bikes:profit", new HashMap<String, Long>() {{
put("Rocky Mountain Racer", 200L);
Expand Down

0 comments on commit e9e774d

Please sign in to comment.