Class Striped.SmallLazyStriped<L>
- java.lang.Object
-
- com.google.common.util.concurrent.Striped<L>
-
- com.google.common.util.concurrent.Striped.PowerOfTwoStriped<L>
-
- com.google.common.util.concurrent.Striped.SmallLazyStriped<L>
-
static class Striped.SmallLazyStriped<L> extends Striped.PowerOfTwoStriped<L>
Implementation of Striped where up to 2^k stripes can be represented, using an AtomicReferenceArray of size 2^k. To map a user key into a stripe, we take a k-bit slice of the user key's (smeared) hashCode(). The stripes are lazily initialized and are weakly referenced.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Striped.SmallLazyStriped.ArrayReference<L>
-
Nested classes/interfaces inherited from class com.google.common.util.concurrent.Striped
Striped.LargeLazyStriped<L>, Striped.SmallLazyStriped<L>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.concurrent.atomic.AtomicReferenceArray<Striped.SmallLazyStriped.ArrayReference<? extends L>>
locks
(package private) java.lang.ref.ReferenceQueue<L>
queue
(package private) int
size
(package private) Supplier<L>
supplier
-
Fields inherited from class com.google.common.util.concurrent.Striped.PowerOfTwoStriped
mask
-
-
Constructor Summary
Constructors Constructor Description SmallLazyStriped(int stripes, Supplier<L> supplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
drainQueue()
L
getAt(int index)
Returns the stripe at the specified index.int
size()
Returns the total number of stripes in this instance.-
Methods inherited from class com.google.common.util.concurrent.Striped.PowerOfTwoStriped
get, indexFor
-
Methods inherited from class com.google.common.util.concurrent.Striped
bulkGet, lazyWeakLock, lazyWeakReadWriteLock, lazyWeakSemaphore, lock, readWriteLock, semaphore
-
-
-
-
Field Detail
-
locks
final java.util.concurrent.atomic.AtomicReferenceArray<Striped.SmallLazyStriped.ArrayReference<? extends L>> locks
-
size
final int size
-
queue
final java.lang.ref.ReferenceQueue<L> queue
-
-