Version 1.1.5
WT_EXTRACTOR Struct Reference

The interface implemented by applications to provide custom extraction of index keys or column group values. More...

List of all members.

Public Attributes

int(* extract )(WT_EXTRACTOR *extractor, WT_SESSION *session, const WT_ITEM *key, const WT_ITEM *value, WT_ITEM *result)
 Callback to extract a value for an index or column group.

Detailed Description

The interface implemented by applications to provide custom extraction of index keys or column group values.

Applications register implementations with WiredTiger by calling WT_CONNECTION::add_extractor.

        static WT_EXTRACTOR my_extractor;
        my_extractor.extract = my_extract;
        ret = conn->add_extractor(conn, "my_extractor", &my_extractor, NULL);
Examples:
ex_all.c.

Member Data Documentation

int(* WT_EXTRACTOR::extract)(WT_EXTRACTOR *extractor, WT_SESSION *session, const WT_ITEM *key, const WT_ITEM *value, WT_ITEM *result)

Callback to extract a value for an index or column group.

Returns:
zero on success and a non-zero error code on failure. See Error Returns for details.
static int
my_extract(WT_EXTRACTOR *extractor, WT_SESSION *session,
    const WT_ITEM *key, const WT_ITEM *value,
    WT_ITEM *result)
{
        /* Unused parameters */
        (void)extractor;
        (void)session;
        (void)key;

        *result = *value;
        return (0);
}
Examples:
ex_all.c.