Hi Michael,

As I see from your configuration you are going to have cluster with two
ignite servers and PARTITIONED cache.

You can't choose directly on what node will be stored your cache entities
because ignite will use its own affinity function that will maps keys to
partitions (not nodes).

In this case data from your cache could be stored on both nodes.

What you can to do:

1)Create two caches and setup the node filters for them:


2)Ignite can try to give you guarantee that entities calculated on Node A
will be stored on one node and entities calculated on node B will be stored
on another. But there is no guarantee that it will be the same nodes where
it was calculated. setup your own AffinityKey. For example something like

    public static class EntityKey {
        public EntityKey(String id, long nodeId) {
            this.id = id;
            this.nodeId = nodeId;

        private String id;

        // Subscriber ID which will be used for affinity.
        private long nodeId;

        public long getNodeId() {
            return nodeId;

        public String getId() {
            return id;


After that use it as follow:

        IgniteCache<EntityKey, HosCache > cache =

        cache.putIfAbsent( new EntityKey(hid, 0), monthValues ) //from node
        cache.putIfAbsent( new EntityKey(hid, 1), monthValues ) //from node


Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to