public class ConcurrentTypeCache extends ResolvedTypeCache
ResolvedTypeCache implementation that uses
ConcurrentHashMap for efficient concurrent access and limits maximum
entry count to specified maximum. But instead of trying to optimize retention
by access (as LRUTypeCache does, will simply clear (remove all entries)
if maximum size is reached. This works well as long as maximum size is large enough
to cover most commonly resolved types, and works well for higher concurrency use
cases.LRUTypeCache,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentHashMap<ResolvedTypeKey,ResolvedType> |
_map |
protected int |
_maxEntries |
| Constructor and Description |
|---|
ConcurrentTypeCache(int maxEntries) |
| Modifier and Type | Method and Description |
|---|---|
ResolvedType |
find(ResolvedTypeKey key) |
void |
put(ResolvedTypeKey key,
ResolvedType type) |
int |
size() |
_addForTest, concurrentCache, key, key, lruCacheprotected final int _maxEntries
protected final transient ConcurrentHashMap<ResolvedTypeKey,ResolvedType> _map
public ResolvedType find(ResolvedTypeKey key)
find in class ResolvedTypeCachepublic int size()
size in class ResolvedTypeCachepublic void put(ResolvedTypeKey key, ResolvedType type)
put in class ResolvedTypeCacheCopyright © 2019 fasterxml.com. All rights reserved.