The interface implemented by applications to provide custom ordering of records. More...
Public Attributes | |
int(* | compare )(WT_COLLATOR *collator, WT_SESSION *session, const WT_ITEM *key1, const WT_ITEM *key2, int *cmp) |
Callback to compare keys. More... | |
int(* | customize )(WT_COLLATOR *collator, WT_SESSION *session, const char *uri, WT_CONFIG_ITEM *passcfg, WT_COLLATOR **customp) |
If non-NULL, this callback is called to customize the collator for each data source. More... | |
int(* | terminate )(WT_COLLATOR *collator, WT_SESSION *session) |
If non-NULL a callback performed when the data source is closed for customized extractors otherwise when the database is closed. More... | |
The interface implemented by applications to provide custom ordering of records.
Applications register their implementation with WiredTiger by calling WT_CONNECTION::add_collator. See Custom Collators for more information.
int(* WT_COLLATOR::compare) (WT_COLLATOR *collator, WT_SESSION *session, const WT_ITEM *key1, const WT_ITEM *key2, int *cmp) |
Callback to compare keys.
[out] | cmp | set to -1 if key1 < key2 , 0 if key1 == key2 , 1 if key1 > key2 . |
int(* WT_COLLATOR::customize) (WT_COLLATOR *collator, WT_SESSION *session, const char *uri, WT_CONFIG_ITEM *passcfg, WT_COLLATOR **customp) |
If non-NULL, this callback is called to customize the collator for each data source.
If the callback returns a non-NULL collator, that instance is used instead of this one for all comparisons.
int(* WT_COLLATOR::terminate) (WT_COLLATOR *collator, WT_SESSION *session) |
If non-NULL a callback performed when the data source is closed for customized extractors otherwise when the database is closed.
The WT_COLLATOR::terminate callback is intended to allow cleanup; the handle will not be subsequently accessed by WiredTiger.