Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Can we create multiple instances of Ignite?

How Can we create multiple instances of Ignite when multiple threads are trying to access same Ignite instance.

Ignite ignite = Ignition.start("conf/example-ignite-config.xml");

Here I have started/created one Ignite instance. But using same xml I have to create multiple instances of same without other thread to wait for it to get free.

like image 605
iamLalit Avatar asked Oct 03 '26 07:10

iamLalit


2 Answers

Ignite instances are thread safe. You should call Ignition.start once and share it between all threads.

Alternatively, once Ignite has been started, you can obtain Ignite instance with Ignition.ignite() methods.

like image 157
Pavel Tupitsyn Avatar answered Oct 05 '26 20:10

Pavel Tupitsyn


For this, I created a ClientGroup, from one Ignite started in Client mode, i.e.(Cluster group of nodes started in client mode.) and when I need a Ignite node (grid) in client mode I just called a ignite() method of ClientGroup which gets instance of grid.

like image 38
iamLalit Avatar answered Oct 05 '26 22:10

iamLalit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!