GLnexus
Scalable datastore for population genome sequencing, with on-demand joint genotyping
 All Classes Functions Variables
Public Member Functions | List of all members
GLnexus::KeyValue::DB Class Referenceabstract

#include <KeyValue.h>

Inheritance diagram for GLnexus::KeyValue::DB:
GLnexus::KeyValue::Reader GLnexus::RocksKeyValue::DB

Public Member Functions

virtual Status collection (const std::string &name, CollectionHandle &coll) const =0
 Get the handle to a collection, or return NotFound.
 
virtual Status create_collection (const std::string &name)=0
 Create a new collection, or return Exists.
 
virtual Status current (std::unique_ptr< Reader > &snapshot) const =0
 Get an up-to-date snapshot.
 
virtual Status begin_writes (std::unique_ptr< WriteBatch > &writes)=0
 Begin preparing a batch of writes.
 
Status get (CollectionHandle coll, const std::string &key, std::string &value) const override
 
Status iterator (CollectionHandle coll, const std::string &key, std::unique_ptr< Iterator > &it) const override
 
virtual Status put (CollectionHandle coll, const std::string &key, const std::string &value)
 

Detailed Description

Main database interface for retrieving collection handles, generating snapshopts to read from, and creating and applying write batches. The DB object itself implements the Reader interface (with no consistency guarantees between multiple calls) and the WriteBatch interface (which applies one write immediately, no atomicity guarantees between multiple calls). Caller must ensure that the parent DB object still exists when any Reader or WriteBatch object is used. Thread-safe.

Member Function Documentation

Status GLnexus::KeyValue::DB::get ( CollectionHandle  coll,
const std::string &  key,
std::string &  value 
) const
overridevirtual

Get the value corresponding to the key and return OK. Return NotFound if no corresponding record exists in the collection, or any error code

Implements GLnexus::KeyValue::Reader.

Status GLnexus::KeyValue::DB::iterator ( CollectionHandle  coll,
const std::string &  key,
std::unique_ptr< Iterator > &  it 
) const
overridevirtual

Create an iterator positioned at the first key equal to or greater than the given one. If key is empty then position at the beginning of the collection.

If there are no extant keys equal to or greater than the given one, the return status will be OK but it->valid() will be false.

Implements GLnexus::KeyValue::Reader.


The documentation for this class was generated from the following files: