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

Feature Request: Consistent interface for IMap and TransactionalMap #8729

ebrandsberg opened this issue Aug 16, 2016 · 1 comment


None yet
2 participants
Copy link

commented Aug 16, 2016

In creating code that will conditionally need to operate on data in Hazelcast, I noticed that the two classes IMap and TransactionalMap have different methods, and don't have a consistent interface for the more advanced functions. For example, I have to use code such as the following:

        if (map instanceof IMap)
            keys = ((IMap)map).keySet(new SqlPredicate(predicate));
        else if (map instanceof TransactionalMap)
            keys = ((TransactionalMap)map).keySet(new SqlPredicate(predicate));


                if (map instanceof IMap)
                    ((IMap)map).set(key, rowData, ttl, TimeUnit.MILLISECONDS);
                else if (map instanceof TransactionalMap)
                    // transactionalMap's set doesn't have the ttl options, but the put does.
                    ((TransactionalMap)map).put(key, rowData, ttl, TimeUnit.MILLISECONDS);

If these various calls had a single interface, it would make mixed transactional/non-transactional code much easier to deal with.


This comment has been minimized.

Copy link

commented Aug 16, 2016

@ebrandsberg: this is a good idea, many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.