ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Aleksandrov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-8631) IgniteInstanceResource doesn't inject the Ignite instance to Ignite Predicate during deploying cache with nodeFilter
Date Mon, 28 May 2018 15:04:00 GMT
Andrey Aleksandrov created IGNITE-8631:
------------------------------------------

             Summary: IgniteInstanceResource doesn't inject the Ignite instance to Ignite
Predicate during deploying cache with nodeFilter
                 Key: IGNITE-8631
                 URL: https://issues.apache.org/jira/browse/IGNITE-8631
             Project: Ignite
          Issue Type: Bug
          Components: cache
    Affects Versions: 2.4
            Reporter: Andrey Aleksandrov
             Fix For: 2.6


Next code:
{code:java}
Ignite ignite = IgnitionEx.start("examples/config/example-ignite.xml", "ignite-1");
Ignite ignite2 = IgnitionEx.start("examples/config/example-ignite.xml", "ignite-2");


ignite2.createCache(new CacheConfiguration<Integer, Integer>()
    .setName("my-cache")
    .setNodeFilter(new IgnitePredicate<ClusterNode>() {
        @IgniteInstanceResource Ignite filterIgnite;

        @Override public boolean apply(ClusterNode node) {
            System.out.println("Is local node: " + node.isLocal());
            System.out.println("ignite: " + (isNull(filterIgnite) ? null : filterIgnite.name()));
            return true;
        }
    })
);

{code}
Produces next output:
{code:java}
Is local node: true
ignite: null
Is local node: true
ignite: null
Is local node: false
ignite: null
Is local node: false
ignite: null
Is local node: false
ignite: null
Is local node: false
ignite: null
Is local node: true
ignite: null
Is local node: true
ignite: null
Is local node: true
ignite: null
Is local node: true
ignite: null
Is local node: true
ignite: null
{code}
Looks like @IgniteInstanceResource doesn't work in this case.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message