Perfect, that answers my question, thank you Vladislav.
From: Vladislav Pyatkov [mailto:[email protected]]
Sent: 16 August 2016 11:49
To: [email protected]
Subject: Re: Local mode recommended setup
Hello,
If I understand correctly, you want to create node which works until it will by
cancelation by system (for eample by kill comand).
If yes, you need do not invoke ignite.close() (explisitly or in try{} block):
public static void main(String[] args) throws URISyntaxException, IOException {
Ignition.setClientMode(false);
Ignite ignite =
Ignition.start("examples/config/example-ignite.xml");
IgniteCache<String, FullOrd> cache =
FullOrdCacheLoader.getCacherLoader().loadAndGetCache();
}
On Tue, Aug 16, 2016 at 1:14 PM, Piubelli, Manuel
<[email protected]<mailto:[email protected]>> wrote:
Hi All,
I am trying to setup a cluster in Local Mode: all my data fits in RAM and
operations are read only , data is loaded from a cache or disk at startup. I
have a very simple question:
How can I configure some code to be run at startup of every node? When defining
an own start class the ignite node expectedly stops after loading the cache? Is
there any stayAlive() method or similar I can execute on the ignite or cluster
object?
Sample Code:
public static void main(String[] args) throws URISyntaxException, IOException {
Ignition.setClientMode(false);
try (Ignite ignite =
Ignition.start("examples/config/example-ignite.xml")) {
IgniteCache<String, FullOrd> cache =
FullOrdCacheLoader.getCacherLoader().loadAndGetCache();
// load complete, now stay alive to receive client requests
}
}
Much appreciated,
Manuel
--
Vladislav Pyatkov