Package com.hazelcast.map.TempData

Examples of com.hazelcast.map.TempData.LoggingEntryProcessor


        HazelcastInstance instance = createHazelcastInstance(cfg);
        IMap<String, TempData> map = instance.getMap("test");
        map.put("a", new TempData("foo", "bar"));
        map.put("b", new TempData("abc", "123"));
        TestPredicate predicate = new TestPredicate("foo");
        Map<String, Object> entries = map.executeOnEntries(new LoggingEntryProcessor(), predicate);
        assertEquals("The predicate should be applied to only one entry if indexing works!", entries.size(), 1);
    }
View Full Code Here


            instance2.shutdown();
            newPrimary = instance1;
        }
        //Make sure there are no entries left
        IMap<String, TempData> map2 = newPrimary.getMap("test");
        Map<String, Object> executedEntries = map2.executeOnEntries(new LoggingEntryProcessor());
        assertEquals(0, executedEntries.size());
    }
View Full Code Here

            instance2.shutdown();
            newPrimary = instance1;
        }
        IMap<String, TempData> map2 = newPrimary.getMap("test");
        //Make sure there are no entries left
        Map<String, Object> executedEntries = map2.executeOnEntries(new LoggingEntryProcessor());
        assertEquals(0, executedEntries.size());
    }
View Full Code Here

        HazelcastInstance instance1 = nodeFactory.newHazelcastInstance(cfg);
        HazelcastInstance instance2 = nodeFactory.newHazelcastInstance(cfg);
        IMap<String, TempData> map = instance1.getMap("test");
        try {
            map.put("a", new TempData("foo", "bar"));
            map.executeOnEntries(new LoggingEntryProcessor(), Predicates.equal("attr1", "foo"));
            map.executeOnEntries(new DeleteEntryProcessor(), Predicates.equal("attr1", "foo"));
            // Now the entry has been removed from the primary store but not the backup.
            // Let's kill the primary and execute the logging processor again...
            String a_member_uiid = instance1.getPartitionService().getPartition("a").getOwner().getUuid();
            HazelcastInstance newPrimary;
            if (a_member_uiid.equals(instance1.getCluster().getLocalMember().getUuid())) {
                instance1.shutdown();
                newPrimary = instance2;
            } else {
                instance2.shutdown();
                newPrimary = instance1;
            }
            IMap<String, TempData> map2 = newPrimary.getMap("test");
            map2.executeOnEntries(new LoggingEntryProcessor(), Predicates.equal("attr1", "foo"));
        } finally {
            instance1.shutdown();
            instance2.shutdown();
        }
    }
View Full Code Here

        HazelcastInstance instance1 = nodeFactory.newHazelcastInstance(cfg);
        HazelcastInstance instance2 = nodeFactory.newHazelcastInstance(cfg);
        IMap<String, TempData> map = instance1.getMap("test");
        try {
            map.put("a", new TempData("foo", "bar"));
            map.executeOnKey("a", new LoggingEntryProcessor());
            map.executeOnKey("a", new DeleteEntryProcessor());
            // Now the entry has been removed from the primary store but not the backup.
            // Let's kill the primary and execute the logging processor again...
            String a_member_uiid = instance1.getPartitionService().getPartition("a").getOwner().getUuid();
            HazelcastInstance newPrimary;
View Full Code Here

TOP

Related Classes of com.hazelcast.map.TempData.LoggingEntryProcessor

Copyright © 2018 www.massapicom. 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.