Class CachedAtomicLong
- java.lang.Object
-
- org.apache.curator.framework.recipes.atomic.CachedAtomicLong
-
public class CachedAtomicLong extends java.lang.ObjectUses anDistributedAtomicNumberand allocates values in chunks for better performance
-
-
Constructor Summary
Constructors Constructor Description CachedAtomicLong(DistributedAtomicLong number, int cacheFactor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AtomicValue<java.lang.Long>next()Returns the next value (incrementing by 1).
-
-
-
Constructor Detail
-
CachedAtomicLong
public CachedAtomicLong(DistributedAtomicLong number, int cacheFactor)
- Parameters:
number- the number to usecacheFactor- the number of values to allocate at a time
-
-
Method Detail
-
next
public AtomicValue<java.lang.Long> next() throws java.lang.Exception
Returns the next value (incrementing by 1). If a new chunk of numbers is needed, it is requested from the number- Returns:
- next increment
- Throws:
java.lang.Exception- errors
-
-