class LruTreeMap extends LruMapLike[Seq[Any], TreeOrLeaf]
Class defining a tree map with limited capacity that uses an LRU (least recently used) algorithm for automatic eviction. The primary use case is for caches that need to be limited in size while still maintaining good performance. The map uses a key structure with a sequence of objects denoting the address of the value on each level in the tree from top to bottom. A prefix of the key may represent a subtree of values. The map is thread safe.
- Alphabetic
- By Inheritance
- LruTreeMap
- LruMapLike
- BoundedMapLike
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new LruTreeMap(capacity: Int, valueCleanUp: Option[(Any) => Unit] = None)
- capacity
The maximum capacity of the map.
- valueCleanUp
A method to run when a value is evicted. Used to trigger additional clean-up logic.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def attachNode(entry: Entry[Seq[Any], TreeOrLeaf]): Entry[Seq[Any], TreeOrLeaf]
- Attributes
- protected
- Definition Classes
- LruMapLike
- val cacheSize: AtomicInteger
- Attributes
- protected
- Definition Classes
- BoundedMapLike
- val capacity: Int
- Definition Classes
- LruTreeMap → BoundedMapLike
- def cleanUp(): Unit
- Attributes
- protected
- Definition Classes
- LruMapLike
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def get(keys: Seq[Any]): Option[TreeOrLeaf]
- Attributes
- protected
- Definition Classes
- LruTreeMap → LruMapLike
- def getCacheSize: Int
- Definition Classes
- BoundedMapLike
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def getLeaf(keys: Any*): Option[Any]
Gets the leaf value (i.e.
Gets the leaf value (i.e. not a subtree) for a sequence of keys, if available.
- keys
The sequence of keys
- def getMisses: Long
- Definition Classes
- BoundedMapLike
- def getOrAdd(keys: Seq[Any])(action: => TreeOrLeaf): TreeOrLeaf
- Attributes
- protected
- Definition Classes
- LruTreeMap → LruMapLike
- def getOrAddLeaf(keys: Any*)(action: => Any): Any
Get the leaf value associated with a given key sequence, if available, and compute and add it if not.
Get the leaf value associated with a given key sequence, if available, and compute and add it if not.
- keys
The sequence of keys
- action
A function to compute the value.
- def getQueueSize: Int
- Definition Classes
- BoundedMapLike
- def getRequests: Long
- Definition Classes
- BoundedMapLike
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def keySet: Set[Seq[Any]]
- Attributes
- protected
- Definition Classes
- LruTreeMap → LruMapLike
- val lock: AnyRef
- Attributes
- protected
- Definition Classes
- BoundedMapLike
- val misses: AtomicLong
- Attributes
- protected
- Definition Classes
- BoundedMapLike
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def poll(): Option[(Seq[Any], TreeOrLeaf)]
- Attributes
- protected
- Definition Classes
- LruMapLike
- def purge(): Unit
- Definition Classes
- LruMapLike → BoundedMapLike
- val queue: ConcurrentLinkedQueue[LruNode[Seq[Any], TreeOrLeaf]]
- Attributes
- protected
- Definition Classes
- LruMapLike
- val queueSize: AtomicInteger
- Attributes
- protected
- Definition Classes
- BoundedMapLike
- def registerAs(id: String, environment: String): LruTreeMap
Registers the map with the LruCacheManager
Registers the map with the LruCacheManager
- id
The id to use for registration.
- environment
The unique id of the environment where the map is used.
- def remove(keys: Seq[Any]): Int
Remove the leaf value or subtree associated with a given key sequence.
Remove the leaf value or subtree associated with a given key sequence.
- keys
The sequence of keys
- returns
The number of leaf values removed.
- Definition Classes
- LruTreeMap → LruMapLike
- val requests: AtomicLong
- Attributes
- protected
- Definition Classes
- BoundedMapLike
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)