Package com.hazelcast.core

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


            }
        }, 1);
        addOperation(operations, new Runnable() {
            public void run() {
                IMap map = hazelcast.getMap("myMap");
                map.containsKey(random.nextInt(SIZE));
            }
        }, 2);
        addOperation(operations, new Runnable() {
            public void run() {
                IMap map = hazelcast.getMap("myMap");
View Full Code Here


                            stats.increment("get");
                        } else if (operation < 3) {
                            map.remove(key);
                            stats.increment("remove");
                        } else if (operation < 4) {
                            map.containsKey(key);
                            stats.increment("containsKey");
                        } else if (operation < 5) {
                            Object value = String.valueOf(key);
                            map.containsValue(value);
                            stats.increment("containsValue");
View Full Code Here

            }
        }, 1);
        addOperation(operations, new Runnable() {
            public void run() {
                IMap map = hazelcast.getMap("myMap");
                map.containsKey(random.nextInt(SIZE));
            }
        }, 2);
        addOperation(operations, new Runnable() {
            public void run() {
                IMap map = hazelcast.getMap("myMap");
View Full Code Here

    private boolean checkKeysIn(HazelcastInstance[] cluster, String mapName, int start, int end) {
        HazelcastInstance node = getNode(cluster);
        IMap m = node.getMap(mapName);
        for (; start < end; start++) {
            if (!m.containsKey(start)) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

    private boolean checkKeysNotIn(HazelcastInstance[] cluster, String mapName, int start, int end) {
        HazelcastInstance node = getNode(cluster);
        IMap m = node.getMap(mapName);
        for (; start < end; start++) {
            if (m.containsKey(start)) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

    @Test
    public void testContains() throws Exception {
        final IMap map = createMap();
        fillMap(map);

        assertFalse(map.containsKey("key10"));
        assertTrue(map.containsKey("key1"));

        assertFalse(map.containsValue("value10"));
        assertTrue(map.containsValue("value1"));
View Full Code Here

    public void testContains() throws Exception {
        final IMap map = createMap();
        fillMap(map);

        assertFalse(map.containsKey("key10"));
        assertTrue(map.containsKey("key1"));

        assertFalse(map.containsValue("value10"));
        assertTrue(map.containsValue("value1"));

    }
View Full Code Here

    }

    @Test(expected = NullPointerException.class)
    public void testNearCacheContainsNullKey() {
        final IMap map = client.getMap(randomMapName(NEAR_CACHE_WITH_INVALIDATION));
        map.containsKey(null);
    }

    @Test
    public void testNearCacheContainsKey() {
        final IMap map = client.getMap(randomMapName(NEAR_CACHE_WITH_INVALIDATION));
View Full Code Here

        final Object key = "key";

        map.put(key, "value");
        map.get(key);

        assertTrue(map.containsKey(key));
    }

    @Test
    public void testNearCacheContainsKey_whenKeyAbsent() {
        final IMap map = client.getMap(randomMapName(NEAR_CACHE_WITH_INVALIDATION));
View Full Code Here

    @Test
    public void testNearCacheContainsKey_whenKeyAbsent() {
        final IMap map = client.getMap(randomMapName(NEAR_CACHE_WITH_INVALIDATION));

        assertFalse(map.containsKey("NOT_THERE"));
    }

    @Test
    public void testNearCacheContainsKey_afterRemove() {
        final IMap map = client.getMap(randomMapName(NEAR_CACHE_WITH_INVALIDATION));
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.