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_FILESET(3) 														   MTBL_FILESET(3)

NAME
mtbl_fileset - automatic multiple MTBL data file merger SYNOPSIS
#include <mtbl.h> Fileset objects: struct mtbl_fileset * mtbl_fileset_init(const char *fname, const struct mtbl_fileset_options *fopt); void mtbl_fileset_destroy(struct mtbl_fileset **f); void mtbl_fileset_reload(struct mtbl_fileset *f); const struct mtbl_source * mtbl_fileset_source(struct mtbl_fileset *f); Fileset options: struct mtbl_fileset_options * mtbl_fileset_options_init(void); void mtbl_fileset_options_destroy(struct mtbl_fileset_options **fopt); void mtbl_fileset_options_set_merge_func( struct mtbl_fileset_options *fopt, mtbl_merge_func fp, void *clos); void mtbl_fileset_options_set_reload_frequency( struct mtbl_fileset_options *fopt, uint32_t reload_frequency); DESCRIPTION
The mtbl_fileset is a convenience interface for automatically maintaining a merged view of a set of MTBL data files. The merged entries may be consumed via the mtbl_source(3) and mtbl_iter(3) interfaces. mtbl_fileset objects are initialized from a "setfile", which specifies a list of filenames of MTBL data files, one per line. Internally, an mtbl_reader object is initialized from each filename and added to an mtbl_merger object. The setfile is watched for changes and the addition or removal of filenames from the setfile will result in the corresponding addition or removal of mtbl_reader objects. Because the MTBL format does not allow duplicate keys, the caller must provide a function which will accept a key and two conflicting values for that key and return a replacement value. This function may be called multiple times for the same key if the same key is inserted more than twice. See mtbl_merger(3) for further details about the merge function. mtbl_fileset objects are created with the mtbl_fileset_init() function, which requires the path to a "setfile", fname, and a non-NULL fopt argument which has been configured with a merge function fp. mtbl_fileset_source() should then be called in order to consume output via the mtbl_source(3) interface. Accesses via the mtbl_source(3) interface will implicitly check for updates to the setfile. However, it may be necessary to explicitly call the mtbl_fileset_reload() function in order to check for updates, especially if files are being removed from the setfile. Fileset options merge_func See mtbl_merger(3). An mtbl_merger object is used internally for the external sort. reload_interval Specifies the interval between checks for updates to the setfile, in seconds. Defaults to 60 seconds. 05/29/2012 MTBL_FILESET(3)
Man Page