trait KeyValueStore extends AnyRef
Persistent key-value store
The keys are organized into namespaces. THe same key can be used in different namespaces to represent different values. Each entry is also associated with numeric timestamp, and the store is designed to be able to find the latest timestamp within given constraints.
- Alphabetic
- By Inheritance
- KeyValueStore
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def delete(namespace: String, key: Chunk[Byte], marker: Option[Timestamp]): IO[Throwable, Unit]
Deletes all versions of a given key from a given namespace
Deletes all versions of a given key from a given namespace
- namespace
Namespace of the key
- key
Key of the entries to be deleted
- marker
If None, all values with the given key are going to be deleted. If it is set to a timestamp, only the old values are going to be deleted, such that getLatest called with the marker timestamp can still return a valid element if there was any before calling delete.
- abstract def getAllTimestamps(namespace: String, key: Chunk[Byte]): ZStream[Any, Throwable, Timestamp]
Gets all the stored timestamps for a given key
- abstract def getLatest(namespace: String, key: Chunk[Byte], before: Option[Timestamp]): IO[Throwable, Option[Chunk[Byte]]]
Get the stored value of a given key with the largest timestamp
Get the stored value of a given key with the largest timestamp
- namespace
Namespace of the keys
- key
Key of the item
- before
If specified, the returned item will be the one with the largest timestamp but not larger than the provided value. Otherwise it takes the entry with the largest timestamp.
- returns
The stored value if it was found, or None
- abstract def getLatestTimestamp(namespace: String, key: Chunk[Byte]): IO[Throwable, Option[Timestamp]]
Get the largest timestamp a given key has value stored with.
Get the largest timestamp a given key has value stored with. This is the timestamp of the element that would be returned by getLatest if its timestamp is not constrained.
- namespace
Namespace of the keys
- key
Key of the item
- returns
Largest timestamp stored in the key-value store, or None if there isn't any
- abstract def put(namespace: String, key: Chunk[Byte], value: Chunk[Byte], timestamp: Timestamp): IO[Throwable, Boolean]
Put an item to the store
Put an item to the store
- namespace
Namespace of the keys
- key
Key of the item
- value
Value of the item
- timestamp
Timestamp of the item. If a value with the same key and timestamp already exists it is going to be overridden.
- returns
True if the item was stored
- abstract def scanAll(namespace: String): ZStream[Any, Throwable, (Chunk[Byte], Chunk[Byte])]
Get all key-value pairs of the given namespace, using the latest timestamp for each
Get all key-value pairs of the given namespace, using the latest timestamp for each
- namespace
Namespace of the keys
- returns
A stream of key-value pairs
- abstract def scanAllKeys(namespace: String): ZStream[Any, Throwable, Chunk[Byte]]
Get all the keys of the given namespace
Get all the keys of the given namespace
- namespace
Namespace of the keys
- returns
A stream of keys
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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()
- 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()