ConcurrentHashMap#computeIfAbsent but not its
performance.
See HHH-13527.
| Modifier and Type | Field and Description |
|---|---|
| private final ConcurrentMap | |
| private static final Object |
| Access | Constructor and Description |
|---|---|
| public | StatsNamedContainer(int capacity, int concurrencyLevel)
Creates a bounded container - based on BoundedConcurrentHashMap |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public @Nullable V | |
| public @Nullable V | getOrCompute(final String key, final Function<String, V> function)
Similar semantics as you'd get by invoking |
| public String[] |
| map | back to summary |
|---|---|
| private final ConcurrentMap<String, Object> map | |
| NULL_TOKEN | back to summary |
|---|---|
| private static final Object NULL_TOKEN | |
| StatsNamedContainer | back to summary |
|---|---|
| public StatsNamedContainer(int capacity, int concurrencyLevel) Creates a bounded container - based on BoundedConcurrentHashMap | |
| StatsNamedContainer | back to summary |
|---|---|
| public StatsNamedContainer() Creates an unbounded container - based on ConcurrentHashMap | |
| clear | back to summary |
|---|---|
| public void clear() | |
| get | back to summary |
|---|---|
| public @Nullable V get(final String key) | |
| getOrCompute | back to summary |
|---|---|
| public @Nullable V getOrCompute(final String key, final Function<String, V> function) Similar semantics as you'd get by invoking
| |
| keysAsArray | back to summary |
|---|---|
| public String[] keysAsArray() This method is inherently racy and expensive. Only use on non-hot paths, and only to get a recent snapshot.
| |