If you can send me the working code I can try to compare what’s missing.
On Thu, Mar 15, 2018 at 10:14 AM Subash Chaturanga <[email protected]>
wrote:
> Here’s my code.
>
> *public static void *main(String[] args) *throws*InterruptedException {
>
> String region = *"4GRegion"*;
> String cacheName = *"bar2"*;
> String path = *"C:**\\**dev**\\**dpsrc**\\**simple-java**\\*
> *work"*;
>
> DataStorageConfiguration storageCfg = *new*
> DataStorageConfiguration();
>
> DataRegionConfiguration regionCfg = *new*
> DataRegionConfiguration();
> regionCfg.setName(region);
> regionCfg.setInitialSize(10L * 1024 *1024);
> regionCfg.setMaxSize(100L * 1024 * 1024);
> regionCfg.setPageEvictionMode(DataPageEvictionMode.*RANDOM_LRU*);
> regionCfg.setPersistenceEnabled(*true*);
>
> storageCfg.setDataRegionConfigurations(regionCfg);
>
> IgniteConfiguration cfg = *new*IgniteConfiguration();
> cfg.setWorkDirectory(path);
> cfg.setDataStorageConfiguration(storageCfg);
> TcpDiscoverySpi spi = *new*TcpDiscoverySpi();
> TcpDiscoveryVmIpFinder ipFinder = *new*TcpDiscoveryVmIpFinder();
> ipFinder.setAddresses(Arrays.*asList*(*"127.0.0.1:47500..47509"*
> ));
> spi.setIpFinder(ipFinder);
> cfg.setDiscoverySpi(spi);
>
> Ignite ignite = Ignition.*start*(cfg);
>
> ignite.active(*true*);
>
> CacheConfiguration<String,String> cc = *new *
> CacheConfiguration<>();
> cc.setDataRegionName(region);
> cc.setPartitionLossPolicy(PartitionLossPolicy.*READ_WRITE_ALL*);
> cc.setName(cacheName);
> cc.setCacheMode(CacheMode.*PARTITIONED*);
> cc.setGroupName(cacheName);
> cc.setExpiryPolicyFactory(CreatedExpiryPolicy.*factoryOf*(*new*
> Duration(TimeUnit.*SECONDS*, 15)));
> cc.setStatisticsEnabled(*true*);
> ignite.resetLostPartitions(Arrays.*asList*(*new *
> String[]{cacheName}));
>
>
>
>
> *// ignite.getOrCreateCache(cc).put("A1","V1");//
> ignite.getOrCreateCache(cc).put("A2","V2"); *System.*out*.println(
> *new *Date().toString() + *"---->>>" *+ ignite.getOrCreateCache(cc).get(
> *"A1"*));
> System.*out*.println(*new *Date().toString() + *"---->>>" *+
> ignite.getOrCreateCache(cc).get(*"A2"*));
>
> Thread.*sleep*(20*1000);
>
> System.*out*.println(*new *Date().toString() + *"---->>>" *+
> ignite.getOrCreateCache(cc).get(*"A1"*));
> System.*out*.println(*new *Date().toString() + *"---->>>" *+
> ignite.getOrCreateCache(cc).get(*"A2"*));
> }
>
>
>
> On Wed, Mar 14, 2018 at 5:07 PM vkulichenko <[email protected]>
> wrote:
>
>> Subash,
>>
>> This is weird, I'm doing exactly the same and not able to reproduce the
>> issue. Can you share your whole test so that I can run it as-is?
>>
>> -Val
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
> --
> /subash
>
--
/subash