Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mtbl_merge(1) [debian man page]

MTBL_MERGE(1)															     MTBL_MERGE(1)

NAME
mtbl_merge - merge MTBL data from multiple input files into a single output file SYNOPSIS
User-provided functions: typedef void * (*mtbl_merge_init_func)(void); typedef void (*mtbl_merge_free_func)(void *clos); typedef void (*mtbl_merge_func)(void *clos, const uint8_t *key, size_t len_key, const uint8_t *val0, size_t len_val0, const uint8_t *val1, size_t len_val1, uint8_t **merged_val, size_t *len_merged_val); Command line tool: export MTBL_MERGE_DSO="libexample.so.0" export MTBL_MERGE_FUNC_PREFIX="example_merge" mtbl_merge INPUT [INPUT]... OUTPUT DESCRIPTION
mtbl_merge(1) is a command-line driver for the mtbl_merger(3) interface. The mtbl_merger(3) interface requires a user-provided merge function, which is loaded from a shared object whose filename is specified in the environment variable MTBL_MERGE_DSO. The user-provided merge function must have the same type as the mtbl_merge_func function type given above in the synopsis. The symbol name of the merge function to be loaded from the user-provided DSO will be constructed by appending "_func" to the string provided in the MTBL_MERGE_FUNC_PREFIX environment variable, which must be non-empty. Additionally, two optional functions may be provided: an "init" function whose symbol name is "_init" appended to the function prefix, and a "free" function whose symbol name is "_free" appended to the function prefix. If the "init" function exists, it will be called at the beginning, before any calls to the merge function, and the return value from the init function will be passed as the first argument to the merge function. If the "free" function exists, it will be called at the end, after any calls to the merge function, and its argument will be the return value of the "init" function. The environment variable MTBL_MERGE_BLOCK_SIZE may optionally be set in order to configure the MTBL block size (in bytes) of the output file. SEE ALSO
mtbl_merger(3) 05/29/2012 MTBL_MERGE(1)

Check Out this Related Man Page

MTBL_SOURCE(3)															    MTBL_SOURCE(3)

NAME
mtbl_source - obtain key-value entries from a data source SYNOPSIS
#include <mtbl.h> struct mtbl_iter * mtbl_source_iter(const struct mtbl_source *s); struct mtbl_iter * mtbl_source_get(const struct mtbl_source *s, const uint8_t *key, size_t len_key); struct mtbl_iter * mtbl_source_get_prefix( const struct mtbl_source *s, const uint8_t *prefix, size_t len_prefix); struct mtbl_iter * mtbl_source_get_range( const struct mtbl_source *s, const uint8_t *key0, size_t len_key0, const uint8_t *key1, size_t len_key1); mtbl_res mtbl_source_write(const struct mtbl_source *s, struct mtbl_writer *w); void mtbl_source_destroy(struct mtbl_source **s); DESCRIPTION
The mtbl_source iterface provides an abstraction for reading key-value entries from mtbl data sources. mtbl_source_iter() provides an iterator over all of the entries in the data source. mtbl_source_get() provides an exact match iterator which returns all entries whose key matches the key provided in the arguments key and len_key. mtbl_source_get_prefix() provides a prefix iterator which returns all entries whose keys start with prefix and are at least len_prefix bytes long. mtbl_source_get_range() provides a range iterator which returns all entries whose keys are between key0 and key1 inclusive. mtbl_source_write() is a convenience function for reading all of the entries from a source and writing them to an mtbl_writer object. It is equivalent to calling mtbl_writer_add() on all of the entries returned from mtbl_source_iter(). RETURN VALUE
mtbl_source_iter(), mtbl_source_get(), mtbl_source_get_prefix(), and mtbl_source_get_range() return mtbl_iter objects. mtbl_source_write() returns mtbl_res_success if all of the entries in the data source were successfully written to the mtbl_writer argument, and mtbl_res_failure otherwise. SEE ALSO
mtbl_iter(3) 05/29/2012 MTBL_SOURCE(3)
Man Page