예제 #1
0
 @Test
 public void testFastPut() throws Exception {
   RMap<Integer, Integer> map = redisson.getMap("simple");
   Assert.assertTrue(map.fastPut(1, 2));
   Assert.assertFalse(map.fastPut(1, 3));
   Assert.assertEquals(1, map.size());
 }
예제 #2
0
 @Test
 public void testFastRemoveEmpty() throws Exception {
   RMap<Integer, Integer> map = redisson.getMap("simple");
   map.put(1, 3);
   Assert.assertEquals(0, map.fastRemove());
   Assert.assertEquals(1, map.size());
 }
예제 #3
0
  @Test
  public void testFastRemoveAsync() throws InterruptedException, ExecutionException {
    RMap<Integer, Integer> map = redisson.getMap("simple");
    map.put(1, 3);
    map.put(3, 5);
    map.put(4, 6);
    map.put(7, 8);

    Assert.assertEquals((Long) 3L, map.fastRemoveAsync(1, 3, 7).get());
    Thread.sleep(1);
    Assert.assertEquals(1, map.size());
  }