Version 2.0.1
WT_EXTRACTOR Struct Reference

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

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. More...
 

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_extract};
ret = conn->add_extractor(conn, "my_extractor", &my_extractor, NULL);

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);
}