mtblr : Tools to work with mtbl files in R

mtbl is a C library implementation of the Sorted String Table (SSTable) data structure, based on the SSTable implementation in the open source Google LevelDB library. An SSTable is a file containing an immutable mapping of keys to values. Keys are stored in sorted order, with an index at the end of the file allowing keys to be located quickly.

mtbl is not a database library. It does not provide an updateable key-value data store, but rather exposes primitives for creating, searching and merging SSTable files. Unlike databases which use the SSTable data structure internally as part of their data store, management of SSTable files -- creation, merging, deletion, combining of search results from multiple SSTables -- is left to the discretion of the mtbl library user.

The following functions are implemented:

The following data sets are included:

News


Installation

devtools::install_github("brudis-r7/mtblr")
options(width=120)

Usage

library(mtblr)

# current verison
packageVersion("mtblr")

mtbl <- read_mtbl(system.file("extdata/sample.mtbl", package="mtblr"))

mtbl_length(mtbl)

head(mtbl_keys(mtbl))

head(mtbl_values(mtbl))

mtbl_next(mtbl_map(mtbl))[99][[1]]$value

mtbl_next(mtbl_get(mtbl, "aa"))[[1]]$value

mtbl_next(mtbl_get_prefix(mtbl, "a"))[[10]]$value

Test Results

library(mtblr)
library(testthat)

date()

test_dir("tests/")


brudis-r7/mtblr documentation built on May 13, 2019, 7:55 a.m.