Hi Team,
Below are my java templates whose object I want to store in the Ignite
Caches
Class A
{
field1
field2
field3
}
Class B
{
field1
field4
field5
}
Class C
{
field5
field6
field7
}
I wanted to colocate data in such a way that all instances of class A and
Class B should stay together in the partition node where ClassAObj.field1 =
ClassBObj.field1
Silimarly I want to make sure that all instances of class B and Class C
should stay together in the node where ClassBObj.field5 = ClassCObj.field5.
How Can we achive using cache Key configuration?
I tried like this
Defined Key classes
Class AKey
{
field1
}
Class BKey
{
field1
field5
}
Class CKey
{
field5
}
used below property in the IgniteConfiguration.
<property name="cacheKeyConfiguration">
<list>
<bean class="org.apache.ignite.cache.CacheKeyConfiguration">
<property name="typeName"
value="com.report.model.AKey"/>
<property name="affinityKeyFieldName" value="field1" />
</bean>
<bean class="org.apache.ignite.cache.CacheKeyConfiguration">
<property name="typeName"
value="com.report.model.BKey"/>
<property name="affinityKeyFieldName" value="field1" />
</bean>
<bean class="org.apache.ignite.cache.CacheKeyConfiguration">
<property name="typeName"
value="com.report.model.BKey"/>
<property name="affinityKeyFieldName" value="field5" />
</bean>
<bean class="org.apache.ignite.cache.CacheKeyConfiguration">
<property name="typeName"
value="com.report.model.CKey"/>
<property name="affinityKeyFieldName" value="field5" />
</bean>
</list>
</property>
Is this the way I should map or there is some other way to do it. Any help
to this will be appreciated.
Thanks
Saji
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/