ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From monstereo <mehmetozangu...@gmail.com>
Subject Waiting too long, to load 7k datas to cache.... And Client gets null value
Date Mon, 23 Jul 2018 08:22:45 GMT
Here is the config file:
 <property name="dataStorageConfiguration">
                <bean
class="org.apache.ignite.configuration.DataStorageConfiguration">
                    <property name="dataRegionConfigurations">
                        <list>
                            <bean
class="org.apache.ignite.configuration.DataRegionConfiguration">
                                <property name="name" value="10MB_Region"/>
                                <property name="initialSize"
value="#{10L*1024*1024}"/>
                                <property name="maxSize"
value="#{10L*1024*1024}"/>
                                <property name="pageEvictionMode"
value="RANDOM_2_LRU"/>
                                <property name="evictionThreshold"
value="0.5"/>
                            </bean>
                        </list>
                    </property>
                </bean>
            </property>

            <property name="cacheConfiguration">
                <bean
class="org.apache.ignite.configuration.CacheConfiguration">
                    
                    <property name="name" value="testCache"/>
                    
                    <property name="cacheMode" value="REPLICATED"/>
                    
                    <property name="dataRegionName" value="10MB_Region"/>
                </bean>
            </property>


Here is the main app
public static void populateCache(IgniteCache igniteCache){
        for (int i = 0; i < 10; i++){
            igniteCache.put(i, String.valueOf(i));
        }
    }

public static void main(String[] args) {
        Ignite igniteNode =
IgniteFactory.createIgniteNodeWithSpecificConfiguration("s", configPath);
        IgniteConfiguration igniteConfiguration =
igniteNode.configuration();
        IgniteCache igniteCache = igniteNode.getOrCreateCache("testCache");
        populateCache(igniteCache);
        System.out.println(igniteCache.size());

}

when i changed to i<7000 (in  populateCache method),  server node appears(I
mean, i can see "[11:13:09] Topology snapshot [ver=1, servers=1, clients=0,
CPUs=4, offheap=1.2GB, heap=1.3GB]") but too wait to write 
System.out.println(igniteCache.size());

Now at the same time I have created client node :

  Ignite client =
IgniteFactory.createIgniteNodeWithSpecificConfiguration("c", cluster_1);
        IgniteCache igniteCache = client.getOrCreateCache("testCache");
        System.out.println(igniteCache.get(6999));

this returns null,

it should not return null -> it should return::
* cache is not ready
* or wait until cache is ready and get the result which is 6999



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

Mime
View raw message