ream/storage/kv

Types

pub type KV {
  KV(
    base_path: String,
    name: String,
    memtable_ranges: Map(Int, MemTableRange),
    active_value_file: Option(Int),
    values: Map(Int, ValueFile),
    memtables_loaded: Int,
    max_memtables_loaded: Int,
    max_memtable_size: Int,
    max_value_size: Int,
  )
}

Constructors

  • KV(
      base_path: String,
      name: String,
      memtable_ranges: Map(Int, MemTableRange),
      active_value_file: Option(Int),
      values: Map(Int, ValueFile),
      memtables_loaded: Int,
      max_memtables_loaded: Int,
      max_memtable_size: Int,
      max_value_size: Int,
    )
pub type KVInfo {
  KVInfo(
    base_path: String,
    name: String,
    values: Int,
    values_size_bytes: Int,
    memtables_total: Int,
    memtables_loaded: Int,
    memtables_loaded_size_bytes: Int,
    max_memtables_loaded: Int,
    max_memtable_size: Int,
    max_value_size: Int,
  )
}

Constructors

  • KVInfo(
      base_path: String,
      name: String,
      values: Int,
      values_size_bytes: Int,
      memtables_total: Int,
      memtables_loaded: Int,
      memtables_loaded_size_bytes: Int,
      max_memtables_loaded: Int,
      max_memtable_size: Int,
      max_value_size: Int,
    )
pub type MemTableRange {
  MemTableRange(
    lower: Int,
    upper: Int,
    memtable: Option(MemTable),
  )
}

Constructors

  • MemTableRange(lower: Int, upper: Int, memtable: Option(MemTable))

Functions

pub fn close(kv: KV) -> Result(Nil, Nil)
pub fn flush(kv: KV) -> Result(Nil, Nil)
pub fn get(kv: KV, key: String) -> #(Result(BitString, Nil), KV)
pub fn info(kv: KV) -> KVInfo
pub fn open(path: String, name: String, max_memtables_loaded: Int, max_memtable_size: Int, max_value_size: Int) -> KV
pub fn set(kv: KV, key: String, value: BitString) -> KV
Search Document