Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keySet with predicate should respect map store loadAllKeys #2692

Closed
ahmetmircik opened this issue Jun 11, 2014 · 5 comments · Fixed by #2729
Closed

keySet with predicate should respect map store loadAllKeys #2692

ahmetmircik opened this issue Jun 11, 2014 · 5 comments · Fixed by #2729
Assignees
Labels
Source: Internal PR or issue was opened by an employee Type: Defect
Milestone

Comments

@ahmetmircik
Copy link
Member

This test is failing:

   @Test
    public void testKeysWithPredicateShouldLoadMapStore() throws InterruptedException {
        TestEventBasedMapStore testMapStore = new TestEventBasedMapStore();

        Map mapForStore = new HashMap();
        mapForStore.put("key1", 17);
        mapForStore.put("key2", 37);
        mapForStore.put("key3", 47);
        testMapStore.getStore().putAll(mapForStore);

        Config config = newConfig(testMapStore, 0);
        HazelcastInstance instance = createHazelcastInstance(config);
        IMap map = instance.getMap("default");

        Set expected = map.keySet(Predicates.greaterThan("value", 1));
        assertEquals(3, expected.size());
        assertTrue(expected.contains("key1"));
        assertTrue(expected.contains("key2"));
        assertTrue(expected.contains("key3"));
    }

@pveentjer
Copy link
Contributor

Does map.values(predicate) and map.entrySet(predicate) suffer from the same bug?

@ahmetmircik
Copy link
Member Author

No they should work as expected.

@pveentjer
Copy link
Contributor

Do we have tests for it?

@pveentjer
Copy link
Contributor

I was cleaning up the methods so that foo() will make use of foo(TruePredicate.INSTANCE) if there is an overloaded version available.

@ahmetmircik
Copy link
Member Author

Sorry they should be fixed too. And fix of this PR should fix them too.

pveentjer added a commit to pveentjer/hazelcast that referenced this issue Jun 11, 2014
pveentjer added a commit to pveentjer/hazelcast that referenced this issue Jun 11, 2014
pveentjer added a commit that referenced this issue Jun 17, 2014
Fixes #2692: (maintenance) IMap methods which uses predicates should check if map store loaded.
pveentjer added a commit that referenced this issue Jun 17, 2014
Fixes #2692: IMap methods which uses predicates should check if map store loaded.
pveentjer added a commit to pveentjer/hazelcast that referenced this issue Jun 18, 2014
pveentjer added a commit to pveentjer/hazelcast that referenced this issue Jun 24, 2014
pveentjer added a commit to pveentjer/hazelcast that referenced this issue Jul 1, 2014
pveentjer added a commit to pveentjer/hazelcast that referenced this issue Jul 1, 2014
@mmedenjak mmedenjak added the Source: Internal PR or issue was opened by an employee label Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Source: Internal PR or issue was opened by an employee Type: Defect
Projects
None yet
3 participants