ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piubelli, Manuel " <manuel.piube...@citi.com>
Subject RE: Local mode recommended setup
Date Tue, 16 Aug 2016 10:56:43 GMT
Perfect, that answers my question, thank you Vladislav.

From: Vladislav Pyatkov [mailto:vldpyatkov@gmail.com]
Sent: 16 August 2016 11:49
To: user@ignite.apache.org
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 <manuel.piubelli@citi.com<mailto:manuel.piubelli@citi.com>>
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
Mime
View raw message