ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "aaron@tophold.com" <aa...@tophold.com>
Subject Re: Re: Exception use affinity key when put #invoke from Client.
Date Wed, 20 Sep 2017 04:22:21 GMT
Thanks Denis. 

We customized own BinaryConfiguration, which include this AssetKey, when I removed this seem
can work now. 


From: Denis Mekhanikov
Date: 2017-09-20 00:36
To: user
Subject: Re: Exception use affinity key when put #invoke from Client.
Hi Aaron!

Is it possible that you wrote a value to cache before configuring an affinity key?
This exception occurs when configuration of affinity key for a sought key doesn't match configuration
that is stored in cache.
Maybe you have persistence enabled and you wrote the value before adding @AffinityKeyMapped
to field of AssetKey class?


вт, 19 сент. 2017 г. в 13:10, aaron@tophold.com <aaron@tophold.com>:
hi all, 

We using the affinity key map to affinity cache connected,  the key is a very simple class:

class AssetKey

private String accountId;
private String transId;

But every time when run this command from client:

ignite.<AssetKey, AssetEntry>cache(AssetEntry.IG_CACHE_NAME).invoke(new AssetKey(..),
(entry, arguments)....)

A exception always thrown:

Caused by: class org.apache.ignite.binary.BinaryObjectException: Binary type has different
affinity key fields [typeName=AssetKey, affKeyFieldName1=null, affKeyFieldName2=accountId]
at org.apache.ignite.internal.binary.BinaryUtils.mergeMetadata(BinaryUtils.java:950)
at org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl.addMeta(CacheObjectBinaryProcessorImpl.java:430)
at org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$2.addMeta(CacheObjectBinaryProcessorImpl.java:173)

For Ignite configuration we put this:

<property name="cacheKeyConfiguration">
                <bean class="org.apache.ignite.cache.CacheKeyConfiguration">
                    <constructor-arg value="AssetKey"/>

Any configuration we missed?  Thanks for your time!


View raw message