IDZEBRA  2.0.59
Data Fields
key_control Struct Reference

#include <isam.h>

Data Fields

int key_size
 
int scope
 
int(* cmp )(const void *p1, const void *p2)
 
void(* key_logdump_txt )(int logmask, const void *p, const char *txt)
 
zint(* getseq )(const void *p)
 
ISAM_CODECcodec
 

Detailed Description

isam.h - a generalized interface to the isam systems

The isam system consists of a number of isam lists. Physically it is stored in a file, or a group of related files. It is typically used for storing all the occurrences of a given word, storing the document number and position for each occurrence.

An isam list is indentified by an isam_position. This is a number (zint). It can be seen as a mapping from an isam_position to an ordered list of isam_ entries.

An isam list consists of one or more isam entries. We do not know the structure of those entries, but we know the (maximum) size of such, and that they can be memcpy'ed around.

The entries can be seen to consist of a key and a value, although we have no idea of their internal structure. We know that we have a compare function that can look at a part (or whole) of the isam entry (the 'key'). The part not looked at (if any) will count as 'value' or 'payload'.

The entries are stored in increasing order (as defined by the compare function), and no duplicates are allowed.

There is an effective mass-insert routine that takes a stream of values, each accompanied by an insert/delete flag.

For reading we have cursors, that can read through an isam list in order. They have a fast-forward function to skip values we are not interested in. key_control contains all there is to know about the keys (entries) stored in an isam, (and therefore operated by the rsets). Other than this info, all we assume is that all keys are the same size, and they can be memcpy'd around.

Definition at line 69 of file isam.h.

Field Documentation

int(* key_control::cmp)(const void *p1, const void *p2)

Compare function, returning -1,0,1, if p1 is less/equal/greater than p2

Definition at line 80 of file isam.h.

ISAM_CODEC* key_control::codec

Codec to pack key values into a disk page (delta-compression etc)

Definition at line 90 of file isam.h.

zint(* key_control::getseq)(const void *p)

Return the sequence number of a key, to see if we are on the same record. FIXME - this makes less sense with higher-scope keys.

Definition at line 87 of file isam.h.

void(* key_control::key_logdump_txt)(int logmask, const void *p, const char *txt)

Debug function to write a key in the log, with a message

Definition at line 83 of file isam.h.

int key_control::key_size

(max) size of a key

Definition at line 71 of file isam.h.

int key_control::scope

Default for what level we operate on (book/chapter/verse). for typical zebra, this is always 2 (sysno/seqno). Not used in isam context, but the rsets make use of this.

Definition at line 76 of file isam.h.


The documentation for this struct was generated from the following file: