Hi,

I am trying to retrieve collocate data with join two different caches. 

In the caches, there are 10 rows for each. If I set DistributedJoins to
false than It retrieves 5 records, If I set DistributedJoins to true, It
retrieves 10 records(correct one). But with affinity collocation it should
bring 10 records with setDistributedJoins(false). We are using binary
objects not pojos, is that the problem?

*code:*
try (Ignite ignite = Ignition.start("ignite-client.xml")) {
            ignite.cache("DATA_CACHE").withKeepBinary().query(new
SqlFieldsQuery("SELECT * FROM Profile as p, \"IDMAP_CACHE\".IdMatching as id
WHERE id.uid = p._key").setDistributedJoins(false)).getAll().forEach(list ->
System.out.println(list.get(0)));

        }


*Here is the ignite_server_config.xml*
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns="http://www.springframework.org/schema/beans";
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd";>
    <bean id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="cacheKeyConfiguration">
            <list>
                <bean class="org.apache.ignite.cache.CacheKeyConfiguration">
                    <property name="typeName" value="IdMatching"/>
                    <property name="affinityKeyFieldName" value="uid"/>
                </bean>
            </list>
        </property>
        <property name="clientMode" value="false"/>
        <property name="gridName" value="cvm.grid"/>
        <property name="peerClassLoadingEnabled" value="true"/>
        <property name="metricsLogFrequency" value="0"/>
        <property name="gridLogger">
            <bean class="org.apache.ignite.logger.slf4j.Slf4jLogger"/>
        </property>
        <property name="binaryConfiguration">
            <bean
class="org.apache.ignite.configuration.BinaryConfiguration">
                <property name="compactFooter" value="false"/>
            </bean>
        </property>
        
        <property name="cacheConfiguration">
            <list>
                
                <bean
class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="DATA_CACHE"/>
                    <property name="cacheMode" value="PARTITIONED"/>
                    <property name="affinity">
                        <bean
class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction">
                            <property name="excludeNeighbors" value="true"/>
                            <property name="partitions" value="2048"/>
                        </bean>
                    </property>
                    <property name="queryEntities">
                        <list>
                            <bean
class="org.apache.ignite.cache.QueryEntity">
                                <property name="keyType"
value="java.lang.String"/>
                                <property name="valueType" value="Profile"/>
                                <property name="fields">
                                    <map>
                                        <entry key="age"
value="java.lang.String"/>
                                        <entry key="gender"
value="java.lang.String"/>
                                        <entry key="telco_spend"
value="java.lang.String"/>
                                        <entry key="account_type"
value="java.lang.String"/>
                                        <entry
key="registered_payment_method" value="java.lang.String"/>
                                        <entry key="phone_type"
value="java.lang.String"/>
                                        <entry key="travel_abroad_ind"
value="java.lang.String"/>
                                        <entry key="car_driver_ind"
value="java.lang.String"/>
                                        <entry key="kv_customer"
value="java.lang.Boolean"/>
                                        <entry key="veon_create_date"
value="java.util.Date"/>
                                        <entry key="veon_last_daily_usage"
value="java.util.Date"/>
                                        <entry key="last_bundle_buy_ts"
value="java.util.Date"/>
                                    </map>
                                </property>
                            </bean>
                        </list>
                    </property>
                    <property name="indexedTypes">
                        <list>
                            <value>java.lang.String</value>
                           
<value>org.apache.ignite.binary.BinaryObject</value>
                        </list>
                    </property>
                </bean>
                
                <bean
class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="IDMAP_CACHE"/>
                    <property name="cacheMode" value="PARTITIONED"/>
                    <property name="statisticsEnabled" value="false"/>
                    <property name="backups" value="0"/>
                    <property name="storeKeepBinary" value="true"/>
                    <property name="affinity">
                        <bean
class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction">
                            <property name="excludeNeighbors" value="true"/>
                            <property name="partitions" value="2048"/>
                        </bean>
                    </property>
                    <property name="queryEntities">
                        <list>
                            <bean
class="org.apache.ignite.cache.QueryEntity">
                                <property name="keyType"
value="java.lang.String"/>
                                <property name="valueType"
value="IdMatching"/>
                                <property name="fields">
                                    <map>
                                        <entry key="uid"
value="java.lang.String"/>
                                        <entry key="veon_id"
value="java.lang.String"/>
                                    </map>
                                </property>
                                <property name="indexes">
                                    <list>
                                        <bean
class="org.apache.ignite.cache.QueryIndex">
                                            <constructor-arg value="uid"/>
                                        </bean>
                                        <bean
class="org.apache.ignite.cache.QueryIndex">
                                            <constructor-arg
value="veon_id"/>
                                        </bean>
                                    </list>
                                </property>
                            </bean>
                        </list>
                    </property>
                    <property name="indexedTypes">
                        <list>
                            <value>java.lang.String</value>
                           
<value>org.apache.ignite.binary.BinaryObject</value>
                        </list>
                    </property>
                </bean>
                
                <bean
class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="SEGMENT_CACHE"/>
                    <property name="cacheMode" value="PARTITIONED"/>
                    <property name="storeKeepBinary" value="true"/>
                    <property name="queryEntities">
                        <list>
                            <bean
class="org.apache.ignite.cache.QueryEntity">
                                <property name="keyType"
value="java.lang.String"/>
                                <property name="valueType" value="Segment"/>
                                <property name="fields">
                                    <map>
                                        <entry key="uid"
value="java.lang.String"/>
                                        <entry key="segment_id"
value="java.lang.String"/>
                                    </map>
                                </property>
                                <property name="indexes">
                                    <list>
                                        <bean
class="org.apache.ignite.cache.QueryIndex">
                                            <constructor-arg value="uid"/>
                                        </bean>
                                        <bean
class="org.apache.ignite.cache.QueryIndex">
                                            <constructor-arg
value="segment_id"/>
                                        </bean>
                                    </list>
                                </property>
                            </bean>
                        </list>
                    </property>
                    <property name="indexedTypes">
                        <list>
                            <value>java.lang.String</value>
                           
<value>org.apache.ignite.binary.BinaryObject</value>
                        </list>
                    </property>
                </bean>
            </list>
        </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:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to