Affinity Key field is not identified if binary configuration is used on cache key object

classic Classic list List threaded Threaded
10 messages Options
kotamrajuyashasvi kotamrajuyashasvi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Affinity Key field is not identified if binary configuration is used on cache key object

Hi

I am running a c++ ignite client with custom object as cache key. I specialized the binarytype for the cache key object in c++  and added cache key POJO in the binary configuration to map c++ to Java POJO. I put a string field in the cache POJO as Affinitykeymapped using annotation. I ran a sample Java client first to test if different cache key objects, having same field which is mapped to  Affinitykey get allocated to same node or not. But I could see that they are getting allocated to different nodes. Also I could see that the field in cache key POJO that I put for affinitykey was not getting identified. Because when I run 'Affinity.affinityKey(cachekey object)' method its returning the whole cache key object instead of just the String field that I chose as affinitykey. But when I remove the binaryConfiguration in ignite-config xml everything works as expected.

This is the binaryConfiguration in ignite config xml that I was talking about.

 <property name="binaryConfiguration">
            <bean class="org.apache.ignite.configuration.BinaryConfiguration">
                <property name="compactFooter" value="false"/>

                <property name="idMapper">
                    <bean class="org.apache.ignite.binary.BinaryBasicIdMapper">
                        <property name="lowerCase" value="true"/>
                    </bean>
                </property>

                <property name="nameMapper">
                    <bean class="org.apache.ignite.binary.BinaryBasicNameMapper">
                        <property name="simpleName" value="true"/>
                    </bean>
                </property>

                <property name="classNames">
                    <list>
                        <value>com.ignitetest.PersonPK</value>                                               
                    </list>
                </property>
            </bean>
        </property>

Also I would like to know if there is any way to get affinity data in c++ ignite as I could not find any in c++ docs.
agura agura
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Affinity Key field is not identified if binary configuration is used on cache key object

Hi,

it is know issue [1]. Work around is adding cache key configuration to
ignite configuration:

<property name="cacheKeyConfiguration">
    <list>
        <bean class="cacheKeyConfiguration">
            <property name="typeName" value="com.ignitetest.PersonPK"/>
            <property name="AffinityKeyFieldName" value="<YOUR_FIELD_NAME>"/>
        </bean>
    </list>
</property>

[1] https://issues.apache.org/jira/browse/IGNITE-5505

On Thu, Aug 3, 2017 at 7:50 PM, kotamrajuyashasvi
<[hidden email]> wrote:

> Hi
>
> I am running a c++ ignite client with custom object as cache key. I
> specialized the binarytype for the cache key object in c++  and added cache
> key POJO in the binary configuration to map c++ to Java POJO. I put a string
> field in the cache POJO as Affinitykeymapped using annotation. I ran a
> sample Java client first to test if different cache key objects, having same
> field which is mapped to  Affinitykey get allocated to same node or not. But
> I could see that they are getting allocated to different nodes. Also I could
> see that the field in cache key POJO that I put for affinitykey was not
> getting identified. Because when I run 'Affinity.affinityKey(cachekey
> object)' method its returning the whole cache key object instead of just the
> String field that I chose as affinitykey. But when I remove the
> binaryConfiguration in ignite-config xml everything works as expected.
>
> This is the binaryConfiguration in ignite config xml that I was talking
> about.
>
>  <property name="binaryConfiguration">
>             <bean
> class="org.apache.ignite.configuration.BinaryConfiguration">
>                 <property name="compactFooter" value="false"/>
>
>                 <property name="idMapper">
>                     <bean
> class="org.apache.ignite.binary.BinaryBasicIdMapper">
>                         <property name="lowerCase" value="true"/>
>                     </bean>
>                 </property>
>
>                 <property name="nameMapper">
>                     <bean
> class="org.apache.ignite.binary.BinaryBasicNameMapper">
>                         <property name="simpleName" value="true"/>
>                     </bean>
>                 </property>
>
>                 <property name="classNames">
>                     <list>
>                         <value>com.ignitetest.PersonPK</value>
>                     </list>
>                 </property>
>             </bean>
>         </property>
>
> Also I would like to know if there is any way to get affinity data in c++
> ignite as I could not find any in c++ docs.
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-Key-field-is-not-identified-if-binary-configuration-is-used-on-cache-key-object-tp15959.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
kotamrajuyashasvi kotamrajuyashasvi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Affinity Key field is not identified if binary configuration is used on cache key object

This post was updated on .
Hi

Thanks for the response. When I put cacheKeyConfiguration in ignite configuration, the affinity was working. But when I call Cache.Get() in c++ client program I'm getting the following error.

"Java exception occurred [cls=org.apache.ignite.binary.BinaryObjectException, msg=Binary type has different affinity key fields [typeName=PersonPK, affKeyFieldName1=col5, affKeyFieldName2=null]]"

I already did LoadCache before running the c++ client program.

In java client program cache.get() is working fine.
agura agura
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Affinity Key field is not identified if binary configuration is used on cache key object

Hi

It seems that you have different configuration on nodes (e.g. one node
has cacheKeyConfiguration while other doesn't). Isn't it?

On Fri, Aug 4, 2017 at 12:54 PM, kotamrajuyashasvi
<[hidden email]> wrote:

> Hi
>
> Thanks for the response. When I put cacheKeyConfiguration in ignite
> configuration, the affinity was working. But when I call Cache.Get() in
> client program I'm getting the following error.
>
> "Java exception occurred
> [cls=org.apache.ignite.binary.BinaryObjectException, msg=Binary type has
> different affinity key fields [typeName=PersonPK,
> affKeyFieldName1=customer_ref, affKeyFieldName2=null]]"
>
> I already did LoadCache before running the program.
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-Key-field-is-not-identified-if-binary-configuration-is-used-on-cache-key-object-tp15959p15990.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
kotamrajuyashasvi kotamrajuyashasvi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Affinity Key field is not identified if binary configuration is used on cache key object

Hi
All nodes use same config xml and pojos. 

On Aug 4, 2017 7:22 PM, "agura [via Apache Ignite Users]" <[hidden email]> wrote:
Hi

It seems that you have different configuration on nodes (e.g. one node
has cacheKeyConfiguration while other doesn't). Isn't it?

On Fri, Aug 4, 2017 at 12:54 PM, kotamrajuyashasvi
<[hidden email]> wrote:

> Hi
>
> Thanks for the response. When I put cacheKeyConfiguration in ignite
> configuration, the affinity was working. But when I call Cache.Get() in
> client program I'm getting the following error.
>
> "Java exception occurred
> [cls=org.apache.ignite.binary.BinaryObjectException, msg=Binary type has
> different affinity key fields [typeName=PersonPK,
> affKeyFieldName1=customer_ref, affKeyFieldName2=null]]"
>
> I already did LoadCache before running the program.
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Affinity-Key-field-is-not-identified-if-binary-configuration-is-used-on-cache-key-object-tp15959p15990.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.



To unsubscribe from Affinity Key field is not identified if binary configuration is used on cache key object, click here.
NAML
agura agura
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Affinity Key field is not identified if binary configuration is used on cache key object

Could you please clarify what does it mean "I already did LoadCache
before running the program."?

Also it would be good if you can share some minimal reproducer.

On Fri, Aug 4, 2017 at 4:55 PM, kotamrajuyashasvi
<[hidden email]> wrote:

> Hi
> All nodes use same config xml and pojos.
>
> On Aug 4, 2017 7:22 PM, "agura [via Apache Ignite Users]" <[hidden email]>
> wrote:
>>
>> Hi
>>
>> It seems that you have different configuration on nodes (e.g. one node
>> has cacheKeyConfiguration while other doesn't). Isn't it?
>>
>> On Fri, Aug 4, 2017 at 12:54 PM, kotamrajuyashasvi
>> <[hidden email]> wrote:
>>
>> > Hi
>> >
>> > Thanks for the response. When I put cacheKeyConfiguration in ignite
>> > configuration, the affinity was working. But when I call Cache.Get() in
>> > client program I'm getting the following error.
>> >
>> > "Java exception occurred
>> > [cls=org.apache.ignite.binary.BinaryObjectException, msg=Binary type has
>> > different affinity key fields [typeName=PersonPK,
>> > affKeyFieldName1=customer_ref, affKeyFieldName2=null]]"
>> >
>> > I already did LoadCache before running the program.
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> > http://apache-ignite-users.70518.x6.nabble.com/Affinity-Key-field-is-not-identified-if-binary-configuration-is-used-on-cache-key-object-tp15959p15990.html
>> > Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://apache-ignite-users.70518.x6.nabble.com/Affinity-Key-field-is-not-identified-if-binary-configuration-is-used-on-cache-key-object-tp15959p15995.html
>> To unsubscribe from Affinity Key field is not identified if binary
>> configuration is used on cache key object, click here.
>> NAML
>
>
> ________________________________
> View this message in context: Re: Affinity Key field is not identified if
> binary configuration is used on cache key object
>
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
dsetrakyan dsetrakyan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Affinity Key field is not identified if binary configuration is used on cache key object

In reply to this post by kotamrajuyashasvi


On Fri, Aug 4, 2017 at 11:54 AM, kotamrajuyashasvi <[hidden email]> wrote:
Hi

Thanks for the response. When I put cacheKeyConfiguration in ignite
configuration, the affinity was working. But when I call Cache.Get() in
client program I'm getting the following error.

"Java exception occurred
[cls=org.apache.ignite.binary.BinaryObjectException, msg=Binary type has
different affinity key fields [typeName=PersonPK,
affKeyFieldName1=customer_ref, affKeyFieldName2=null]]"

I already did LoadCache before running the program.

Did you load the cache before you updated the configuration? If yes, it won't work. You have to fix the config and then start everything from scratch.

kotamrajuyashasvi kotamrajuyashasvi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Affinity Key field is not identified if binary configuration is used on cache key object

In reply to this post by agura
Hi

"I already did LoadCache before running the client program ".. I meant that LoadCache was successful but not Cache.Get(). LoadCache works similar to Get() right but does bulk operations? Even if I don't loadcache and try to call Get()[the key called by Get is initially not loaded/present in cache] I get the same error.

Here is my code.

--------------------------------- ignite config xml  ---------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">


        <import resource="file:connection-settings.xml" />
       
    <bean id="persistence_settings" class="org.apache.ignite.cache.store.cassandra.persistence.KeyValuePersistenceSettings">
                <constructor-arg type="org.springframework.core.io.Resource" value="file:persistence-settings-1.xml" />
        </bean>

    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
       
         <property name="clientMode" value="true"/> 
 
                 <property name="binaryConfiguration">
            <bean class="org.apache.ignite.configuration.BinaryConfiguration">
                <property name="compactFooter" value="false"/>

                <property name="idMapper">
                    <bean class="org.apache.ignite.binary.BinaryBasicIdMapper">
                        <property name="lowerCase" value="true"/>
                    </bean>
                </property>

                <property name="nameMapper">
                    <bean class="org.apache.ignite.binary.BinaryBasicNameMapper">
                        <property name="simpleName" value="true"/>
                    </bean>
                </property>

                <property name="classNames">
                    <list>
                        <value>com.ignitetest.PersonPK</value>
                    </list>
                </property>
            </bean>
        </property>
 
         <property name="cacheKeyConfiguration">
                <list>
                   <bean class="org.apache.ignite.cache.CacheKeyConfiguration">
                        <property name="typeName" value="com.ignitetest.PersonPK"/>
                        <property name="AffinityKeyFieldName" value="col5"/>
                    </bean>
              </list>
          </property>


                <property name="cacheConfiguration">
            <list>               
                <bean class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="indexedTypes">
                        <list>
                            <value>com.ignitetest.PersonPK</value>
                            <value>com.ignitetest.Person</value>
                        </list>
                    </property>
                    <property name="name" value="cache1"/>
                    <property name="readThrough" value="true"/>
                    <property name="writeThrough" value="true"/>
                    <property name="cacheStoreFactory">
                        <bean class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">
                            <property name="dataSourceBean" value="cassandraAdminDataSource"/>
                            <property name="persistenceSettingsBean" value="persistence_settings"/>
                        </bean>
                    </property>
                </bean>
           </list>
        </property>
  <property name="peerClassLoadingEnabled" value="true"></property>
        <property name="discoverySpi">
            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">                   
                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                        <property name="addresses">
                            <list>
                                <value>127.0.0.1</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>


<persistence keyspace="testkeyspace" table="person">
        <keyPersistence class="com.ignitetest.PersonPK" strategy="POJO" />
    <valuePersistence class="com.ignitetest.Person" strategy="POJO" />
</persistence>

---------------------------------Person Pojo  ---------------------------------------------------------
package com.ignitetest;

public class Person {
        int col1;
        int col2;
        int col3;
        String col4;
        String col5;
        public int getCol1() {
                return col1;
        }
        public void setCol1(int col1) {
                this.col1 = col1;
        }
        public int getCol2() {
                return col2;
        }
        public void setCol2(int col2) {
                this.col2 = col2;
        }
        public int getCol3() {
                return col3;
        }
        public void setCol3(int col3) {
                this.col3 = col3;
        }
        public String getCol4() {
                return col4;
        }
        public void setCol4(String col4) {
                this.col4 = col4;
        }

        public String getCol5() {
                return col5;
        }
        public void setCol5(String col5) {
                this.col5 = col5;
        }
}


---------------------------------PersonPK Pojo  ---------------------------------------------------------
package com.ignitetest;

import org.apache.ignite.binary.BinaryObjectException;
import org.apache.ignite.binary.BinaryReader;
import org.apache.ignite.binary.BinaryWriter;
import org.apache.ignite.binary.Binarylizable;

public class PersonPK implements Binarylizable{
        int col1;
        String col5;
        public int getCol1() {
                return col1;
        }
        public void setCol1(int col1) {
                this.col1 = col1;
        }
        public String getCol5() {
                return col5;
        }
        public void setCol5(String col5) {
                this.col5 = col5;
        }
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + col1;
                result = prime * result + ((col5 == null) ? 0 : col5.hashCode());
                return result;
        }
        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                PersonPK other = (PersonPK) obj;
                if (col1 != other.col1)
                        return false;
                if (col5 == null) {
                        if (other.col5 != null)
                                return false;
                } else if (!col5.equals(other.col5))
                        return false;
                return true;
        }
        @Override
        public void readBinary(BinaryReader reader) throws BinaryObjectException {
                this.col1  = reader.readInt("col1");
                this.col5 = reader.readString("col5");
               
        }
        @Override
        public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
                writer.writeInt("col1", col1);
                writer.writeString("col5", col5);
        }
       
       
}

-----------------------------------------C++ pojo map header ---------------------------------------------

#include <string>
#include <sstream>

#include "ignite/ignite.h"
#include "ignite/ignition.h"

namespace ignite
{
        struct Person
        {
           
            Person(int32_t _col1,int64_t _col2,int64_t _col3, const std::string& _col4, const std::string& _col5):
                  col1(_col1),
                  col2(_col2),
                  col3(_col3),
                  col4(_col4),
                  col5(_col5)
            {
                // No-op.
            }
                       
            int32_t col1;
            int32_t col2;
            int32_t col3;
            std::string col4;
            std::string col5;
        };

                 struct PersonPK
          {
                          PersonPK(){

                          }
 
              PersonPK(const ignite::PersonPK& copyfromPersonPK)
              {
                  col1         = copyfromPersonPK.col1;
                  col5         = copyfromPersonPK.col5;
              }
 
              PersonPK(int32_t _col1, const std::string& _col5):
                    col1(_col1),
                    col5(_col5)
              {
 
              }
 
              int32_t col1;
              std::string col5;
          };

}

namespace ignite
{
    namespace binary
    {
        IGNITE_BINARY_TYPE_START(ignite::Person)

            typedef ignite::Person Person;

            IGNITE_BINARY_GET_TYPE_ID_AS_HASH(Person)
            IGNITE_BINARY_GET_TYPE_NAME_AS_IS(Person)
            IGNITE_BINARY_GET_FIELD_ID_AS_HASH
            IGNITE_BINARY_GET_HASH_CODE_ZERO(Person)
            IGNITE_BINARY_IS_NULL_FALSE(Person)
            IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(Person)

            void Write(BinaryWriter& writer, ignite::Person obj)
            {
                writer.WriteInt32("col1", obj.col1);
                writer.WriteInt32("col2", obj.col2);
                writer.WriteInt32("col3", obj.col3);
                writer.WriteString("col4", obj.col4);
                writer.WriteString("col5", obj.col5);
            }

            ignite::Person Read(BinaryReader& reader)
            {
                int32_t _col1 = reader.ReadInt32("col1");
                int32_t _col2 = reader.ReadInt32("col2");
                int32_t _col3 = reader.ReadInt32("col3");
                std::string _col4 = reader.ReadString("col4");
                std::string _col5 = reader.ReadString("col5");

                return ignite::Person(_col1, _col2, _col3, _col4, _col5);
            }

        IGNITE_BINARY_TYPE_END


          template<>
      struct BinaryType<PersonPK>
      {
        static int32_t GetTypeId()
        {
          return GetBinaryStringHashCode("PersonPK");
        }
 
        std::string GetTypeName()
        {
          return "PersonPK";
        }
 
        static int32_t GetFieldId(const char* name)
        {
          return GetBinaryStringHashCode(name);
        }
 
        static bool IsNull(const PersonPK& obj)
        {
          return false;
        }
 
        static void GetNull(PersonPK& dst)
        {
          dst = PersonPK();
        }
 
        static void Read(BinaryReader& reader, PersonPK& dst)
        {
          dst.col1 = reader.ReadInt32("col1");
          dst.col5 = reader.ReadString("col5");
        }
 
        static void Write(BinaryWriter& writer, const PersonPK& obj)
        {
          writer.WriteInt32("col1", obj.col1);
          writer.WriteString("col5", obj.col5);
       }
     
       int32_t GetHashCode(const PersonPK& obj){
               int32_t prime = 31;
               int32_t result = 1;

              int32_t strhash = 0;
              int32_t i,len;
              std::string custstr;

              custstr = obj.col5;
              len = custstr.length();
              for(i=0;i<len;++i){
                strhash = (prime*strhash) + custstr[i];
              }
              result = (prime*result)+strhash;

              result = (prime*result)+ obj.col1;
     
             return result;
         }
 
     };

    }
};

------------------------------------------------- ignite c++ client ---------------------------------------
#include <stdint.h>
#include <iostream>
#include "ignite/ignite.h"
#include "ignite/ignition.h"
#include "pojomap.h"

using namespace std;
using namespace ignite;
using namespace cache;
using namespace query;

void callIgnite();

int main()
{
        callIgnite();
        return 0;
}

void callIgnite()
{
        IgniteConfiguration cfg;
        cfg.springCfgPath = "default-config.xml";

        try
        {
                Ignite ignite = Ignition::Start(cfg);

                Person myPerson;
                PersonPK pk ;
               
                std::cout << std::endl;
                std::cout << ">>> Cassandra Cache query example started." << std::endl;
                std::cout << std::endl;

                Cache<PersonPK, Person> PersonCache = ignite.GetOrCreateCache<PersonPK, Person>("cache1");

                std::cout << "CACHE SIZE before loadCache(): " << PersonCache.Size()<<std::endl;
                PersonCache.LoadCache();
                std::cout << "CACHE SIZE after loadCache :"<<PersonCache.Size()<<std::endl;  

                pk = PersonPK(1,"cust1");
                myPerson = PersonCache.Get(pk); //error
                std::cout<<myPerson.col4<<endl;
               
                Ignition::StopAll(false);
        }
        catch (IgniteError& err)
        {
                std::cout << "An error occurred: " << err.GetText() << std::endl;
        }
}

If I remove cacheKeyConfiguration (where affinity field is added) in config xml, Get() is successful but affinity is not working.
kotamrajuyashasvi kotamrajuyashasvi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Affinity Key field is not identified if binary configuration is used on cache key object

This post was updated on .
In reply to this post by dsetrakyan
Hi

I have loaded the cache after updating the config. Even if the cache is not
loaded initially(cache initial size 0) and I call cache.Get() I get the
same error.

After a bit of research I could see that this exception is raised by method org.apache.ignite.internal.binary.BinaryUtils.mergeMetadata() where it will do this check.

if (!F.eq(oldMeta.affinityKeyFieldName(), newMeta.affinityKeyFieldName())) {
                throw new BinaryObjectException(
                    "Binary type has different affinity key fields [" + "typeName=" + newMeta.typeName() +
                        ", affKeyFieldName1=" + oldMeta.affinityKeyFieldName() +
                        ", affKeyFieldName2=" + newMeta.affinityKeyFieldName() + ']'
                );
}


so from the exception that I encountered it means that newMeta.affinityKeyFieldName() is returning null, but oldMeta.affinityKeyFieldName() is returning the affinitykeyfield that I set in config xml.

On Sun, Aug 6, 2017 at 4:08 AM, dsetrakyan [via Apache Ignite Users] <
ml+s70518n16014h99@n6.nabble.com> wrote:

>
>
> On Fri, Aug 4, 2017 at 11:54 AM, kotamrajuyashasvi <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=16014&i=0>> wrote:
>
>> Hi
>>
>> Thanks for the response. When I put cacheKeyConfiguration in ignite
>> configuration, the affinity was working. But when I call Cache.Get() in
>> client program I'm getting the following error.
>>
>> "Java exception occurred
>> [cls=org.apache.ignite.binary.BinaryObjectException, msg=Binary type has
>> different affinity key fields [typeName=PersonPK,
>> affKeyFieldName1=customer_ref, affKeyFieldName2=null]]"
>>
>> I already did LoadCache before running the program.
>>
>
> Did you load the cache before you updated the configuration? If yes, it
> won't work. You have to fix the config and then start everything from
> scratch.
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Affinity-
> Key-field-is-not-identified-if-binary-configuration-is-
> used-on-cache-key-object-tp15959p16014.html
> To unsubscribe from Affinity Key field is not identified if binary
> configuration is used on cache key object, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=15959&code=a290YW1yYWp1eWFzaGFzdmlAZ21haWwuY29tfDE1OTU5fC05MTMwMDYyODU=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
agura agura
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Affinity Key field is not identified if binary configuration is used on cache key object

In reply to this post by kotamrajuyashasvi
Hi,

this configuration shouldn't work because there is typo in property name in this code snippet (AffinityKeyFieldName should start with lower case, my fault from previous posts):

 <property name="cacheKeyConfiguration">
                <list>
                   <bean class="org.apache.ignite.cache.CacheKeyConfiguration">
                        <property name="typeName" value="com.ignitetest.PersonPK"/>
                        <property name="AffinityKeyFieldName" value="col5"/>
                    </bean>
              </list>
</property>

I expect that exception should be throwed up on ignite instance start up because there is no such property "AffinityKeyFieldName".
Loading...