IgniteAtomicLong

The IgniteAtomicLong interface provides a long variable that can be read and written atomically, and that also supports advanced atomic operations.

We can create a long value as follows:

IgniteAtomicLong atomicLong = ignite.atomicLong("myLong", // Atomic long name.
0, // Initial value.
true // Create if it does not exist.
);

All operations are atomic in nature. You can change a value as follows:

System.out.println("The new value is - "+atomicLong.addAndGet(2));

The output will look like this: 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.93.0