Class CounterResolver.AtomicBigInteger
- java.lang.Object
-
- org.apache.logging.log4j.layout.template.json.resolver.CounterResolver.AtomicBigInteger
-
- Enclosing class:
- CounterResolver
private static final class CounterResolver.AtomicBigInteger extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicReference<java.math.BigInteger>
lastNumber
-
Constructor Summary
Constructors Modifier Constructor Description private
AtomicBigInteger(java.math.BigInteger start)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
compareAndSetWithBackOff(java.math.BigInteger prevNumber, java.math.BigInteger nextNumber)
AtomicReference.compareAndSet(Object, Object)
shortcut with a constant back off.private java.math.BigInteger
getAndIncrement()
-
-
-
Method Detail
-
getAndIncrement
private java.math.BigInteger getAndIncrement()
-
compareAndSetWithBackOff
private boolean compareAndSetWithBackOff(java.math.BigInteger prevNumber, java.math.BigInteger nextNumber)
AtomicReference.compareAndSet(Object, Object)
shortcut with a constant back off. This technique was originally described in Lightweight Contention Management for Efficient Compare-and-Swap Operations and showed great results in benchmarks.
-
-