This will do it. I have found out ClusterNode::attribute also includes
environment variables so I can even further identify my nodes.

I also want to make sure if I get *setAffinityBackupFilter* right. Let's
say I have two nodes and I return *false* for one of them and *true* for
the other. I assume the one with *false* return will be assigned as
*PRIMARY* and the one I return *true* will be assigned as *BACKUP*. Is it
correct or the false one is not eligible to hold data at all and a primary
is chosen among backups?

On Thu, Apr 13, 2017 at 4:23 PM Igor Sapego <isap...@gridgain.com> wrote:

> Well, there is a way to get C++ nodes. You can use the following code for
> this:
>
> IgniteCluster#forAttribute("org.apache.ignite.platform", "cpp");
>
> That returns you a cluster group of C++ nodes if that's what you need.
>
> Best Regards,
> Igor
>
> On Thu, Apr 13, 2017 at 4:05 PM, Tolga HOŞGÖR <fasdfas...@gmail.com>
> wrote:
>
>> I have managed to put a AffinityFunction implementation in ./libs and
>> load/use it. But I still could not figure out how to detect my C++ node.
>>
>> I see C++ API allows you to name my node via *Ignition::Start(const
>> IgniteConfiguration &cfg, const char *name)* but ClusterNode
>> <https://www.gridgain.com/sdk/pe/latest/javadoc/org/apache/ignite/cluster/ClusterNode.html>
>>  does
>> not have a method to get the node's name. It allows you to get the
>> attributes but C++ does not provide anything to set the attribute on the
>> node. What would you recommend to distinguish my C++ node?
>>
>> On Thu, Apr 13, 2017 at 4:04 PM tolga <fasdfas...@gmail.com> wrote:
>>
>>> I have managed to put a AffinityFunction implementation in ./libs and
>>> load/use it. But I still could not figure out how to detect my C++ node.
>>>
>>> I see C++ API allows you to name my node via /Ignition::Start(const
>>> IgniteConfiguration &cfg, const char *name)/ but  ClusterNode
>>> <
>>> https://www.gridgain.com/sdk/pe/latest/javadoc/org/apache/ignite/cluster/ClusterNode.html
>>> >
>>> does not have a method to get the node's name. It allows you to get the
>>> attributes but C++ does not provide anything to set the attribute on the
>>> node. What would you recommend to distinguish my C++ node?
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://apache-ignite-users.70518.x6.nabble.com/How-do-I-provide-AffinityFunction-BackupFilter-when-mainly-using-C-bindings-tp11930p11945.html
>>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>>
>>
>

Reply via email to