November 2018
Beginner to intermediate
260 pages
6h 12m
English
An ID generator should sequentially generate unique IDs across the cluster. In all our examples, we created hardcoded IDs for cache keys or used a database to generate a unique ID. Sequential ID generation is an important task in distributed computing. Ignite provides the IgniteCacheAtomicSequence interface to generate an atomic sequence.
The following code snippet creates an IgniteCacheAtomicSequence interface:
IgniteAtomicSequence seq = ignite.atomicSequence( "name", // name of sequence generate 0, // Initial value for sequence. true // Create if it does not exist. );
In the real world, the initial value can be read from a persistent store and set in IgniteCacheAtomicSequence.
In this section, we'll create a sequence generator ...
Read now
Unlock full access