Package com.hazelcast.core

Examples of com.hazelcast.core.IMap.clear()


        for (Map.Entry entry : entries) {
            SampleObjects.Employee c = (SampleObjects.Employee) entry.getValue();
            assertEquals(c.getAge(), 23);
            assertTrue(c.isActive());
        }
        imap.clear();
        imap = h1.getMap("employees2");
        imap.addIndex("name", false);
        imap.addIndex("active", false);
        imap.addIndex("age", true);
        for (int i = 0; i < 5000; i++) {
View Full Code Here


        for (Map.Entry entry : entries) {
            SampleObjects.Employee c = (SampleObjects.Employee) entry.getValue();
            assertEquals(c.getAge(), 23);
            assertTrue(c.isActive());
        }
        imap.clear();
        imap = h1.getMap("employees2");
        imap.addIndex("name", false);
        imap.addIndex("age", true);
        imap.addIndex("active", false);
        for (int i = 0; i < 5000; i++) {
View Full Code Here

        for (Map.Entry entry : entries) {
            SampleObjects.Employee c = (SampleObjects.Employee) entry.getValue();
            assertTrue(c.getAge() < 4033);
            assertTrue(c.isActive());
        }
        imap.clear();
        imap = h1.getMap("employees2");
        imap.addIndex("name", false);
        imap.addIndex("salary", false);
        imap.addIndex("active", false);
        for (int i = 0; i < 5000; i++) {
View Full Code Here

        for (Map.Entry entry : entries) {
            SampleObjects.Employee c = (SampleObjects.Employee) entry.getValue();
            assertEquals(c.getAge(), 23);
            assertTrue(c.isActive());
        }
        imap.clear();

        imap = h1.getMap("employees2");
        for (int i = 0; i < 5000; i++) {
            imap.put(String.valueOf(i), new SampleObjects.Employee("name" + i, i % 60, ((i & 1) == 1), Double.valueOf(i)));
        }
View Full Code Here

    }

    @Test
    public void testClear_whenEmpty() throws Exception {
        final IMap map = client.getMap(randomString());
        map.clear();
        assertTrue(map.isEmpty());
    }

    @Test
    public void testClear() throws Exception {
View Full Code Here

        final IMap map = client.getMap(randomString());
        final Object key = "Key";
        final Object value = "Value";

        map.put(key, value);
        map.clear();

        assertTrue(map.isEmpty());
    }

    @Test
View Full Code Here

        final String KEY = "key";
        final String VAL = "val";

        map.put(KEY, VAL);
        map.lock(KEY);
        map.clear();

        assertEquals("a locked key should not be removed by map clear", false, map.isEmpty());
        assertEquals("a key present in a map, should be locked after map clear", true, map.isLocked(KEY));
    }
View Full Code Here

        map.lock(key);

        final CountDownLatch cleared = new CountDownLatch(1);
        new Thread() {
            public void run() {
                map.clear();
                cleared.countDown();
            }
        }.start();

        assertOpenEventually(cleared);
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.