class ReferenceManager extends AutoCloseable with HeapNotificationListener
can clear references to disk and apply backpressure when creating new nodes, both to avoid an OutOfMemoryError
can save all references to disk to persist the graph on shutdown n.b. we could also persist the graph without a ReferenceManager, by serializing all nodes to disk. But if that instance has been started from a storage location, the ReferenceManager ensures that we don't re-serialize all unchanged nodes.
- Alphabetic
- By Inheritance
- ReferenceManager
- HeapNotificationListener
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ReferenceManager(storage: OdbStorage, nodesWriter: NodesWriter, executorService: ExecutorService)
Create a reference manager with the given storage and node writer set; the given executor will be used to spawn a background thread for clearing references.
Create a reference manager with the given storage and node writer set; the given executor will be used to spawn a background thread for clearing references. Note that the executor will not be shut down once
#close()
is called, it's the callers responsibility to manage it. - new ReferenceManager(storage: OdbStorage, nodesWriter: NodesWriter)
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
- def applyBackpressureMaybe(): Unit
When we're running low on heap memory we'll serialize some elements to disk.
When we're running low on heap memory we'll serialize some elements to disk. To ensure we're not creating new ones faster than old ones are serialized away, we're applying some backpressure to those newly created ones.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clearAllReferences(): Unit
writes all references to disk overflow, blocks until complete.
writes all references to disk overflow, blocks until complete. useful when saving the graph
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(): Unit
- Definition Classes
- ReferenceManager → AutoCloseable
- Annotations
- @Override()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def notifyHeapAboveThreshold(): Unit
- Definition Classes
- ReferenceManager → HeapNotificationListener
- Annotations
- @Override()
- def registerRef(ref: NodeRef): Unit
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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()