org.apache.curator.framework.recipes.atomic
Class CachedAtomicInteger
java.lang.Object
org.apache.curator.framework.recipes.atomic.CachedAtomicInteger
public class CachedAtomicInteger
- extends Object
Uses an DistributedAtomicNumber and allocates values in chunks for better performance
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachedAtomicInteger
public CachedAtomicInteger(DistributedAtomicInteger number,
int cacheFactor)
- Parameters:
number - the number to usecacheFactor - the number of values to allocate at a time
next
public AtomicValue<Integer> next()
throws 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:
Exception - errors
Copyright © 2011–2014 The Apache Software Foundation. All rights reserved.