You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Aleksandrov (JIRA)" <ji...@apache.org> on 2018/05/28 15:07:00 UTC
[jira] [Updated] (IGNITE-8631) IgniteInstanceResource doesn't
inject the Ignite instance to IgnitePredicate during deploying cache with
nodeFilter
[ https://issues.apache.org/jira/browse/IGNITE-8631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrey Aleksandrov updated IGNITE-8631:
---------------------------------------
Summary: IgniteInstanceResource doesn't inject the Ignite instance to IgnitePredicate during deploying cache with nodeFilter (was: IgniteInstanceResource doesn't inject the Ignite instance to Ignite Predicate during deploying cache with nodeFilter)
> IgniteInstanceResource doesn't inject the Ignite instance to IgnitePredicate 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
> Priority: Major
> 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)