trait LightDB extends Initializable with FeatureSupport[DBFeatureKey]
The database to be implemented. Collections *may* be used without a LightDB instance, but with drastically diminished functionality. It is always ideal for collections to be associated with a database.
- Alphabetic
- By Inheritance
- LightDB
- FeatureSupport
- Initializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def directory: Option[Path]
The base directory for this database.
The base directory for this database. If None, the database is expected to operate entirely in memory.
- abstract def storeManager: StoreManager
Default StoreManager to use for collections that do not specify a Store.
- abstract def upgrades: List[DatabaseUpgrade]
List of upgrades that should be applied at the start of this database.
Concrete 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
- lazy val appliedUpgrades: StoredValue[Set[String]]
- Attributes
- protected
- def apply[T](key: DBFeatureKey[T]): T
- Definition Classes
- FeatureSupport
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- lazy val backingStore: Collection[KeyValue, KeyValue.type]
Backing key/value store used for persistent internal settings, StoredValues, and general key/value storage.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def collection[Doc <: Document[Doc], Model <: DocumentModel[Doc]](model: Model, name: Option[String] = None, store: Option[Store[Doc, Model]] = None, storeManager: Option[StoreManager] = None, maxInsertBatch: Int = 1_000_000, cacheQueries: Boolean = Collection.DefaultCacheQueries): Collection[Doc, Model]
Create a new Collection and associate it with this database.
Create a new Collection and associate it with this database. It is preferable that all collections be created before the database is initialized, but collections that are added after init will automatically be initialized during this method call.
Note: If both are specified, store takes priority over storeManager.
- model
the model to use for this collection
- name
the collection's name (defaults to None meaning it will be generated based on the model name)
- store
specify the store. If this is not set, the database's storeManager will be used to create one
- storeManager
specify the StoreManager. If this is not set, the database's storeManager will be used.
- maxInsertBatch
the maximum number of inserts to include in a batch. Defaults to 1 million.
- cacheQueries
whether to cache queries in memory. This improves performance when running the same queries with different parameters fairly drastically, but consumes a lot of memory if many queries are executed in a single transaction.
- def collections: List[Collection[_, _]]
All collections registered with this database
- lazy val databaseInitialized: StoredValue[Boolean]
- Attributes
- protected
- def dispose(): Unit
- def disposed: Boolean
True if this database has been disposed.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def featureMap: Map[DBFeatureKey[Any], Any]
- Definition Classes
- FeatureSupport
- def features: Iterable[Any]
- Definition Classes
- FeatureSupport
- def get[T](key: DBFeatureKey[T]): Option[T]
- Definition Classes
- FeatureSupport
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getOrCreate[T](key: DBFeatureKey[T], create: => T): T
- Definition Classes
- FeatureSupport
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def init(): Boolean
Calls initialize() exactly one time.
Calls initialize() exactly one time. Safe to call multiple times.
- Definition Classes
- Initializable
- def initialize(): Unit
Define initialization functionality here, but never call directly.
Define initialization functionality here, but never call directly.
- Attributes
- protected
- Definition Classes
- LightDB → Initializable
- def isInitialized: Boolean
- Definition Classes
- Initializable
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def name: String
Identifiable name for this database.
Identifiable name for this database. Defaults to using the class name.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def put[T](key: DBFeatureKey[T], value: T): Unit
- Definition Classes
- FeatureSupport
- def reIndex(): Int
Offers each collection the ability to re-index data if supported.
Offers each collection the ability to re-index data if supported. Only stores that separate storage and indexing (like SplitStore) will do any work. Returns the number of stores that were re-indexed.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def truncate(): Unit
- def truncateOnInit: Boolean
Automatically truncates all collections in the database during initialization if this is set to true.
Automatically truncates all collections in the database during initialization if this is set to true. Defaults to false.
- Attributes
- protected
- 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])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- object stored
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)