(LocalCache<K, V> map, int initialCapacity, long maxSegmentWeight, StatsCounter statsCounter)
| 2171 | final StatsCounter statsCounter; |
| 2172 | |
| 2173 | Segment(LocalCache<K, V> map, int initialCapacity, long maxSegmentWeight, StatsCounter statsCounter) { |
| 2174 | this.map = map; |
| 2175 | this.maxSegmentWeight = maxSegmentWeight; |
| 2176 | this.statsCounter = checkNotNull(statsCounter); |
| 2177 | initTable(newEntryArray(initialCapacity)); |
| 2178 | keyReferenceQueue = map.usesKeyReferences() ? new ReferenceQueue<K>() : null; |
| 2179 | valueReferenceQueue = map.usesValueReferences() ? new ReferenceQueue<V>() : null; |
| 2180 | recencyQueue = |
| 2181 | map.usesAccessQueue() |
| 2182 | ? new ConcurrentLinkedQueue<ReferenceEntry<K, V>>() |
| 2183 | : LocalCache.<ReferenceEntry<K, V>>discardingQueue(); |
| 2184 | writeQueue = |
| 2185 | map.usesWriteQueue() |
| 2186 | ? new WriteQueue<K, V>() |
| 2187 | : LocalCache.<ReferenceEntry<K, V>>discardingQueue(); |
| 2188 | accessQueue = |
| 2189 | map.usesAccessQueue() |
| 2190 | ? new AccessQueue<K, V>() |
| 2191 | : LocalCache.<ReferenceEntry<K, V>>discardingQueue(); |
| 2192 | } |
| 2193 | |
| 2194 | AtomicReferenceArray<ReferenceEntry<K, V>> newEntryArray(int size) { |
| 2195 | return new AtomicReferenceArray<ReferenceEntry<K, V>>(size); |
nothing calls this directly
no test coverage detected