3
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
10
.TH "MTBL" "7" "01/31/2014" "\ \&" "\ \&"
11
.\" -----------------------------------------------------------------
12
.\" * Define some portability stuff
13
.\" -----------------------------------------------------------------
14
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
.\" http://bugs.debian.org/507673
16
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
.\" -----------------------------------------------------------------
21
.\" * set default formatting
22
.\" -----------------------------------------------------------------
23
.\" disable hyphenation
25
.\" disable justification (adjust text to left margin only)
27
.\" -----------------------------------------------------------------
28
.\" * MAIN CONTENT STARTS HERE *
29
.\" -----------------------------------------------------------------
31
mtbl \- immutable sorted string library
34
\fB#include <mtbl\&.h>\fR
36
\fBgcc [\fR\fB\fIflags\fR\fR\fB] \fR\fB\fIfiles\fR\fR\fB \-lmtbl [\fR\fB\fIlibraries\fR\fR\fB]\fR
39
The mtbl library provides interfaces for creating, searching, and merging Sorted String Table (SSTable) files in the \fIMTBL\fR format, which provide an immutable mapping of keys to values\&. Sorted String Tables are compact and provide fast random access to keys and key ranges\&. Keys and values are arbitrary byte arrays, and MTBL SSTables may not contain duplicate keys\&.
41
The six main interfaces provided by the mtbl library are:
45
Iterator objects provide a consistent interface for iterating over the key\-value entries returned by other interfaces\&.
50
Source objects provide functions for obtaining iterators from an underlying data source\&. The
54
interfaces provide functions for obtaining references to a source object\&. The source methods return an
61
Reader objects provide read\-only access to
68
Writer objects initialize a new
70
file from a sequence of key\-value entries provided by the caller\&. Keys must be in sorted order based on lexicographical byte value, and keys may not be duplicated\&.
75
Merger objects receive multiple sequences of key\-value entries from one or more
77
objects and combine them into a single, sorted sequence\&. The combined, merged output sequence is provided via the
84
Sorter objects receive a sequence of key\-value entries provided by the caller and return them in sorted order\&. The caller must provide a callback function to merge values in the case of entries with duplicate keys\&. The sorted output sequence may be retrieved via the
86
interface or be dumped to an
93
Fileset objects automatically maintain an
99
interfaces\&. The set of underlying
101
objects is kept synchronized with a "setfile" on disk listing
106
Additionally, several utility interfaces are provided:
110
Calculates the CRC32C checksum of a byte array\&.
115
Functions for fixed\-width encoding and decoding of 32 and 64 bit integers\&.
120
Functions for varint encoding and decoding of 32 and 64 bit integers\&.