Package com.hazelcast.core

Examples of com.hazelcast.core.ICountDownLatch.countDown()


                        sleep(100);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    final ICountDownLatch l = instances[i].getCountDownLatch("test");
                    l.countDown();
                    assertEquals(k - 1 - i, l.getCount());
                }
            }
        }.start();
View Full Code Here


        latch1.trySetCount(10);
        Thread.sleep(500);

        ICountDownLatch latch2 = hz2.getCountDownLatch("test");
        assertEquals(10, latch2.getCount());
        latch2.countDown();
        assertEquals(9, latch1.getCount());
        hz1.shutdown();
        assertEquals(9, latch2.getCount());

        HazelcastInstance hz3 = factory.newHazelcastInstance();
View Full Code Here

        assertEquals(9, latch2.getCount());

        HazelcastInstance hz3 = factory.newHazelcastInstance();
        warmUpPartitions(hz3);
        ICountDownLatch latch3 = hz3.getCountDownLatch("test");
        latch3.countDown();
        assertEquals(8, latch3.getCount());

        hz2.shutdown();
        latch3.countDown();
        assertEquals(7, latch3.getCount());
View Full Code Here

        ICountDownLatch latch3 = hz3.getCountDownLatch("test");
        latch3.countDown();
        assertEquals(8, latch3.getCount());

        hz2.shutdown();
        latch3.countDown();
        assertEquals(7, latch3.getCount());

        HazelcastInstance hz4 = factory.newHazelcastInstance();
        HazelcastInstance hz5 = factory.newHazelcastInstance();
        warmUpPartitions(hz5, hz4);
View Full Code Here

        hz3.shutdown();
        ICountDownLatch latch4 = hz4.getCountDownLatch("test");
        assertEquals(7, latch4.getCount());

        ICountDownLatch latch5 = hz5.getCountDownLatch("test");
        latch5.countDown();
        assertEquals(6, latch5.getCount());
        latch5.countDown();
        assertEquals(5, latch4.getCount());
        assertEquals(5, latch5.getCount());
    }
View Full Code Here

        assertEquals(7, latch4.getCount());

        ICountDownLatch latch5 = hz5.getCountDownLatch("test");
        latch5.countDown();
        assertEquals(6, latch5.getCount());
        latch5.countDown();
        assertEquals(5, latch4.getCount());
        assertEquals(5, latch5.getCount());
    }
}
View Full Code Here

        TestMemberShipListener memberShipListener = new TestMemberShipListener(2);
        h3.getCluster().addMembershipListener(memberShipListener);
        TestLifeCycleListener lifeCycleListener = new TestLifeCycleListener(1);
        h3.getLifecycleService().addLifecycleListener(lifeCycleListener);

        countDownLatch.countDown();

        closeConnectionBetween(h1, h3);
        closeConnectionBetween(h2, h3);

        assertOpenEventually(memberShipListener.latch);
View Full Code Here

        assertClusterSizeEventually(2, h1);
        assertClusterSizeEventually(2, h2);
        assertClusterSizeEventually(1, h3);

        ICountDownLatch countDownLatch1 = h1.getCountDownLatch(name);
        countDownLatch1.countDown();

        countDownLatch.countDown();
        countDownLatch.countDown();

        assertOpenEventually(lifeCycleListener.latch);
View Full Code Here

        HazelcastInstance instance = createHazelcastInstance();
        ICountDownLatch latch = instance.getCountDownLatch(randomString());

        latch.trySetCount(20);
        for (int i = 19; i >= 0; i--) {
            latch.countDown();
            assertEquals(i, latch.getCount());
        }
    }

    @Test
View Full Code Here

        ICountDownLatch latch = instance.getCountDownLatch(randomString());
        CountDownLatchService service = getNode(instance).getNodeEngine().getService(CountDownLatchService.SERVICE_NAME);

        latch.trySetCount(1);
        assertTrue(service.containsLatch(latch.getName()));
        latch.countDown();
        assertFalse(service.containsLatch(latch.getName()));
    }

    // ================= getCount =================================================
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.