Hello!

1) Affinity key will be automatically used so that SQL query is routed to
affinity node (as opposed to being broadcast) if affinity key condition is
present in WHERE.
2) However, if you're using QueryEntites you may also need to declare
CacheKeyConfiguration with your affinity key field. It is recommended to do
that.

This is due to https://issues.apache.org/jira/browse/IGNITE-5795

Regards,
-- 
Ilya Kasnacheev


пт, 22 февр. 2019 г. в 12:09, Ajay Babu Maguluri <[email protected]>:

> Hi,
>
>
>
> I want to know scenarios,
>
>
>
> 1)I want to use ignite affinity key logic to keep homogeneous data in one
> place, for this i created bean like
>
>
>
>      public class RowID {
>
>             private int id;
>
>             @AffinityKeyMapped
>
>             private int regid;
>
>             ...
>
>
>
> }
>
>
>
> configured  in xml like,
>
> .....
>
> <property name="queryEntities">
>
> <list>
>
> <bean class="org.apache.ignite.cache.QueryEntity">
>
> <property name="keyType" value="com.sixdee.ignite.RowID"></property>
>
> <property name="valueType" value="persons"></property> <property
> name="fields"> <map> <entry key="subscriber"
> value="java.lang.String"></entry> <entry key="orgId"
> value="java.lang.String"></entry> <entry key="birthday"
> value="java.lang.String"></entry> <entry key="name"
> value="java.lang.String"></entry> <entry key="salary"
> value="java.lang.String"></entry> <entry key="gender"
> value="java.lang.String"></entry> <entry key="key"
> value="com.sixdee.ignite.RowID"></entry>
>
> </map>
>
> </property>
>
> <property name="keyFields">
>
> <set>
>
> <value>key</value>
>
> </set>
>
> </property>
>
> </bean>
>
> </list>
>
> </property>
>
> ......
>
>
>
> And Schema was automatically created by Ignite,
>
>
>
> Now, how i can query the cache with an affinity key in SQL to get the data
> directly from the node where it resides.
>
>
>
> Note: Actually i want to use affinity key like row key in HBase.
>
>
>
>
>
> 2)Do we need to maintain key also as an entry in map tag?
>
>
>
> 3)How I can query(through Ignite web console) the cache with the fields in
> RowID(Above
>
> example) in ignite.
>
>
>
> Thanks,
>
> Ajay.
>
>
>
>
> <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=default3&tag=ffe5f5d6-7bf3-42a0-9529-c043a52d8ad7>
>  I’m
> protected online with Avast Free Antivirus. Get it here — it’s free
> forever.
> <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=default3&tag=ffe5f5d6-7bf3-42a0-9529-c043a52d8ad7>
> <#m_7505633473825407265_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>

Reply via email to