From user-return-17912-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Wed Feb 21 09:03:55 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id CF33B18061A for ; Wed, 21 Feb 2018 09:03:54 +0100 (CET) Received: (qmail 99005 invoked by uid 500); 21 Feb 2018 08:03:53 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 98994 invoked by uid 99); 21 Feb 2018 08:03:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Feb 2018 08:03:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id CF188180256 for ; Wed, 21 Feb 2018 08:03:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 5HWbt-zfSH-Z for ; Wed, 21 Feb 2018 08:03:50 +0000 (UTC) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id E82955F4DC for ; Wed, 21 Feb 2018 08:03:49 +0000 (UTC) Received: by mail-lf0-f45.google.com with SMTP id m69so1064946lfe.8 for ; Wed, 21 Feb 2018 00:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:from:subject:date:importance:in-reply-to :references; bh=joaGOeVQ6I40+c/2DgJsMGB6po6ecwDTKE5Ab/DgDz4=; b=ZG4vjTRsw2IYeEZs29hTevBfmvSWFJp0LO57opjBA67Viw+D5Z0ncKMo+xXZLm411V mGU3Af0cLNuxS5MSM5D8rpDHQ46illMCk2/mJ5WtQqWSbiNnbHxykNcD3oOMCeuSO/UZ jCYXh6T5aXyH9xUKAXazasD7/OhKtWyuvG/7N1DVrCwnEGCmgO6acghVoAyKxw7kWAfn vAU0038JqZKQ4hx5WqXaV9eu9UJe97+1aafSLpkAUj/b7xb8Du8eN6KVxlyWt3nHndvI i8/nK0x7T0J6S2/kALxhz/XHqUN7RS3gAhz+Nb/YgCZz9PnIvGL+Nto2unDZMVQkgA3x nutA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version:to:from:subject:date :importance:in-reply-to:references; bh=joaGOeVQ6I40+c/2DgJsMGB6po6ecwDTKE5Ab/DgDz4=; b=cWcgbMFjvvuYnDGHfPp/wIB1+Rh2BCsVvzlEcckr66ez+mmvi9obeSHgTMT1I73fpH fPxzyWjU9hqLMMoIeyWRc9WoUPCUpghbGKVUdgscfUlufSAB5QI6CqfuaiGiwLFzOcCr mwVZb7WZ67E+EdrhFcVMeOY6vE0OQsYR6kE40kRl+ejI5Zccc+Fly20+Loi1sHVrinH+ 966eDH0kUNyv1Q1bO7l4V0uv0YR0NmAKxQSlJeMVHGYGu/8m7FIArROOcMzBvREh6cuE UMofrWICWNI7lPGUh+ziDyS/v081qfZWQlbBfxWLh6IvonMyIUz3Njx3xoMsCdCEUqdS WpeA== X-Gm-Message-State: APf1xPCA+eTIxgXVUiPrqIrBaaDsi4ejJwUPAtHWM0plmgxJ3LjZVGxv ZYdrw/gFZL4jqtrV085agNXqGUCe X-Google-Smtp-Source: AH8x227MFsiY1MG7QdrYGlzXfRplv56vXpFZW7Uov4FppWqsOa9DqzJm+37hIukthT1s/tmoqpY3OQ== X-Received: by 10.46.92.7 with SMTP id q7mr1663375ljb.21.1519200228733; Wed, 21 Feb 2018 00:03:48 -0800 (PST) Received: from ?IPv6:::ffff:172.25.4.96? ([195.239.208.174]) by smtp.gmail.com with ESMTPSA id w14sm2578087ljd.25.2018.02.21.00.03.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 00:03:48 -0800 (PST) Message-ID: <5a8d27e4.0e162e0a.884f3.f7b7@mx.google.com> MIME-Version: 1.0 To: "user@ignite.apache.org" From: Stanislav Lukyanov Subject: Using 3rd party DB together with native persistence (WAS: Getting Invalid state exception when Persistance is enabled.) Date: Wed, 21 Feb 2018 11:03:49 +0300 Importance: normal X-Priority: 3 In-Reply-To: References: Content-Type: multipart/alternative; boundary="_BDD9B392-247B-428B-A043-7CF6E61F21FB_" --_BDD9B392-247B-428B-A043-7CF6E61F21FB_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi Prasad, // Please send different questions separately =E2=80=93 this way it=E2=80= =99s easier to answer and to search for existing answers > Also, I am loading the cache from oracle table using loadCache method. If= the persistence is enabled and if the data is already persisted, I want to= make sure that the cache is loaded from persisted data instead of loading = it from oracle table using loadCache. Can someone please advise how this ca= n be achieved? Ignite doesn=E2=80=99t support using 3rd party DBs and native persistence w= ith the same cache. If you need to use both, I=E2=80=99d suggest to create two caches, one back= ed by Oracle and one with enabled Ignite persistence, and alternate between= them in your application code. Thanks, Stan From: Prasad Bhalerao Sent: 20 =D1=84=D0=B5=D0=B2=D1=80=D0=B0=D0=BB=D1=8F 2018 =D0=B3. 15:24 To: user@ignite.apache.org Subject: Getting Invalid state exception when Persistance is enabled. Hi, I am starting ignite node in server mode in intellij. I am starting only on= e instance of it. I am using IgniteSpringBean to set configuration and star= t the node as shown below. But when I enable persistence, I get following e= xception. Caused by: java.lang.IllegalStateException: Ignite is in invalid state to p= erform this operation. It either not started yet or has already being or ha= ve stopped [ignite=3Dnull, cfg=3Dnull] As per the doc, IgniteSpringBean is responsible for starting the ignite. So= how to set node to active state in case this case? Also, I am loading the cache from oracle table using loadCache method. If t= he persistence is enabled and if the data is already persisted, I want to m= ake sure that the cache is loaded from persisted data instead of loading it= from oracle table using loadCache. Can someone please advise how this can = be achieved? Code to config ignite and cache: @Bean public IgniteSpringBean igniteInstance() { IgniteSpringBean ignite =3D new IgniteSpringBean(); ignite.active(true); ignite.setConfiguration(getIgniteConfiguration()); return ignite; } private IgniteConfiguration getIgniteConfiguration() { String HOST =3D "127.0.0.1:47500..47509"; TcpDiscoveryVmIpFinder ipFinder =3D new TcpDiscoveryVmIpFinder(); ipFinder.setAddresses(Collections.singletonList(HOST)); TcpDiscoverySpi discoSpi =3D new TcpDiscoverySpi(); discoSpi.setIpFinder(ipFinder); IgniteConfiguration cfg =3D new IgniteConfiguration(); cfg.setDiscoverySpi(discoSpi); cfg.setIgniteInstanceName("springDataNode"); cfg.setPeerClassLoadingEnabled(false); cfg.setRebalanceThreadPoolSize(4); DataStorageConfiguration storageCfg =3D new DataStorageConfiguration(); storageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(tr= ue); cfg.setDataStorageConfiguration(storageCfg); CacheConfiguration ipv4RangeCacheCfg =3D= new CacheConfiguration<>("IPV4RangeCache"); ipv4RangeCacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); ipv4RangeCacheCfg.setWriteThrough(false); ipv4RangeCacheCfg.setReadThrough(false); ipv4RangeCacheCfg.setRebalanceMode(CacheRebalanceMode.ASYNC); ipv4RangeCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronization= Mode.FULL_SYNC); ipv4RangeCacheCfg.setBackups(1); Factory storeFactory =3D FactoryBuilder.facto= ryOf(IPV4RangeCacheDataLoader.class); ipv4RangeCacheCfg.setCacheStoreFactory(storeFactory); cfg.setCacheConfiguration(ipv4RangeCacheCfg); return cfg; } Thanks, Prasad --_BDD9B392-247B-428B-A043-7CF6E61F21FB_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

Hi Prasad,

 

// Please send different ques= tions separately =E2=80=93 this way it=E2=80=99s easier to answer and to se= arch for existing answers

 

> Also, I am loading the cache from oracle table using loadC= ache method. If the persistence is enabled and if the data is already persi= sted, I want to make sure that the cache is loaded from persisted data inst= ead of loading it from oracle table using loadCache. Can someone please adv= ise how this can be achieved?

 

&nbs= p;

Ignite doesn=E2= =80=99t support using 3rd party DBs and native persistence with the same ca= che.

If you ne= ed to use both, I=E2=80=99d suggest to create two caches, one backed by Ora= cle and one with enabled Ignite persistence, and alternate between them in = your application code.

 

Thanks,

Stan=

 

From: Prasad = Bhalerao
Sent: 20 =D1=84=D0=B5=D0=B2=D1=80=D0=B0=D0=BB=D1=8F = 2018 =D0=B3. 15:24
To: = user@ignite.apache.org
Subject: Getting Invalid state excepti= on when Persistance is enabled.

 

Hi,

 

I am starting ignit= e node in server mode in intellij. I am starting only one instance of it. I= am using IgniteSpringBean to set configuration and start the node as shown= below. But when I enable persistence, I get following exception.

=

 

Caused by: java.lang.IllegalStateException: Ignite is in invalid state = to perform this operation. It either not started yet or has already being o= r have stopped [ignite=3Dnull, cfg=3Dnull]

 

As per the doc, Ign= iteSpringBean is responsible for starting the ignite. So how to set node to= active state in case this case?

&n= bsp;

Also, I am loading the cache = from oracle table using loadCache method. If the persistence is enabled and= if the data is already persisted, I want to make sure that the cache is lo= aded from persisted data instead of loading it from oracle table using load= Cache. Can someone please advise how this can be achieved?

 

Cod= e to config ignite and cache:

 = ;

@Bean
public Ign= iteSpringBean igniteInstance() {
=C2=A0=C2=A0=C2=A0 IgniteSpringBean ign= ite =3D
new IgniteSpringBean();
=C2=A0= =C2=A0=C2=A0 ignite.active(
true)= ;
=C2=A0=C2=A0=C2= =A0 ignite.setConfiguration(getIgniteConfiguration());

=C2=A0=C2=A0= =C2=A0
return <= /b>ignite;
}

<= b>private
IgniteConfiguration getIgniteConfiguration= () {

=C2=A0=C2=A0=C2=A0 String HOST =3D
"127.0.0.1:47500..47509";
=C2=A0=C2=A0=C2=A0 TcpDiscover= yVmIpFinder ipFinder =3D new TcpDiscoveryV= mIpFinder();
=C2=A0=C2=A0=C2=A0 ipFinder.setAddresses(Collections.sin= gletonList(HOST));

=C2=A0=C2=A0=C2=A0 TcpDiscoverySpi discoSpi = =3D
new TcpDiscoverySpi();
=C2=A0=C2=A0= =C2=A0 discoSpi.setIpFinder(ipFinder);

=C2=A0=C2=A0=C2=A0 IgniteConf= iguration cfg =3D new = IgniteConfiguration(= );
=C2=A0=C2=A0=C2=A0 cfg.setDiscoverySpi(discoSpi);
=C2=A0=C2=A0=C2= =A0 cfg.setIgniteInstanceName(
"springDataNode");
=C2=A0=C2=A0=C2=A0 cfg.setPeerClassLoadingEnabled(
false);
=C2=A0=C2=A0=C2=A0 cfg.setRebalance= ThreadPoolSize(
4);

=C2=A0=C2=A0=C2=A0D= ataStorageConfiguration storageCfg =3D new DataStorageConfiguration();
=C2=A0 =C2=A0=C2=A0storageCfg.getDef= aultDataRegionConfiguration().setPersistenceEnabled(
true);
=C2=A0=C2=A0=C2=A0 cfg.setDataStorageConfigurati= on(storageCfg);

<= br>=C2=A0=C2=A0=C2=A0 CacheConfiguration<IPRangeDataKey, IPV4RangeData&g= t; ipv4RangeCacheCfg =3D
new CacheConfigur= ation<>("I= PV4RangeCache")= ;
=C2=A0=C2=A0=C2=A0 ipv4RangeCacheCfg.setAtomicityMode(CacheAtomicityMo= de.
TRANSACTIONAL= );
=C2=A0=C2= =A0=C2=A0 ipv4RangeCacheCfg.setWriteThrough(
false);
=C2=A0=C2=A0=C2=A0 ipv4RangeCacheCfg.setReadThrough(
= false);
=C2=A0=C2=A0=C2=A0 ipv4RangeCacheCfg.setR= ebalanceMode(CacheRebalanceMode.
ASYNC);
=C2=A0=C2=A0=C2=A0 ipv4RangeCacheCfg.setWriteSynchronizationMode= (CacheWriteSynchronizationMode.
FULL_SYNC);
=C2=A0=C2=A0=C2=A0 ipv4RangeCacheCfg.setBackups(
1);
=C2=A0=C2=A0=C2=A0 Factory<IPV4RangeCacheDataLoader&= gt; storeFactory =3D FactoryBuilder.factoryOf(IPV4RangeCacheDataLoad= er.
class);
=C2=A0=C2=A0=C2=A0 ipv4Range= CacheCfg.setCacheStoreFactory(storeFactory);

=C2=A0=C2=A0=C2=A0 cfg.= setCacheConfiguration(ipv4RangeCacheCfg);
=C2=A0=C2=A0=C2=A0 <= span style=3D'font-size:8.0pt;color:navy'>return cfg;
}
 

Tha= nks,

Prasad

 

 

 

= --_BDD9B392-247B-428B-A043-7CF6E61F21FB_--