IDZEBRA
2.2.7
|
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <yaz/snprintf.h>
#include "index.h"
Go to the source code of this file.
Data Structures | |
struct | key_file |
struct | heap_info |
struct | heap_cread_info |
struct | progressInfo |
Macros | |
#define | KEY_SIZE (1+sizeof(struct it_key)) |
#define | INP_NAME_MAX 768 |
#define | PR_KEY_LOW 0 |
#define | PR_KEY_TOP 0 |
#define | R_OK 4 |
Functions | |
void | extract_get_fname_tmp (ZebraHandle zh, char *fname, size_t fname_size, int no) |
void | key_file_chunk_read (struct key_file *f) |
void | key_file_destroy (struct key_file *f) |
struct key_file * | key_file_init (int no, int chunk, Res res) |
int | key_file_getc (struct key_file *f) |
int | key_file_read (struct key_file *f, char *key) |
static struct heap_info * | key_heap_malloc (void) |
struct heap_info * | key_heap_init_file (ZebraHandle zh, int nkeys, int(*cmp)(const void *p1, const void *p2)) |
void | key_heap_destroy (struct heap_info *hi, int nkeys) |
static void | key_heap_swap (struct heap_info *hi, int i1, int i2) |
static void | key_heap_delete (struct heap_info *hi) |
static void | key_heap_insert (struct heap_info *hi, const char *buf, int nbytes, struct key_file *kf) |
static int | heap_read_one (struct heap_info *hi, char *name, char *key) |
void | zebra_log_dict_entry (ZebraHandle zh, const char *s) |
static int | heap_cread_item (void *vp, char **dst, int *insertMode) |
int | heap_cread_item2 (void *vp, char **dst, int *insertMode) |
int | heap_inpc (struct heap_cread_info *hci, struct heap_info *hi) |
int | heap_inpb (struct heap_cread_info *hci, struct heap_info *hi) |
int | heap_inps (struct heap_cread_info *hci, struct heap_info *hi) |
void | progressFunc (struct key_file *keyp, void *info) |
void | zebra_index_merge (ZebraHandle zh) |
void extract_get_fname_tmp | ( | ZebraHandle | zh, |
char * | fname, | ||
size_t | fname_size, | ||
int | no | ||
) |
Definition at line 69 of file kinput.c.
References key_file::no, zebra_session::res, and res_get_def().
Referenced by zebra_index_merge().
|
static |
Definition at line 504 of file kinput.c.
References heap_cread_info::cur_name, heap_cread_info::first_in_list, heap_read_one(), heap_cread_info::hi, heap_cread_info::key, heap_cread_info::more, heap_cread_info::prev_name, zebra_log_dict_entry(), and heap_info::zh.
Referenced by heap_cread_item2(), and heap_inps().
int heap_cread_item2 | ( | void * | vp, |
char ** | dst, | ||
int * | insertMode | ||
) |
Definition at line 403 of file kinput.c.
References heap_cread_item(), heap_cread_info::key_1, heap_cread_info::key_2, key_compare(), heap_cread_info::look_level, heap_cread_info::mode_1, heap_cread_info::mode_2, heap_cread_info::ret, heap_cread_info::sz_1, and heap_cread_info::sz_2.
Referenced by heap_inpb(), and heap_inpc().
int heap_inpb | ( | struct heap_cread_info * | hci, |
struct heap_info * | hi | ||
) |
Definition at line 588 of file kinput.c.
References ISAMC_I_s::clientData, heap_cread_info::cur_name, zebra_register::dict, dict_delete(), dict_insert(), dict_lookup(), heap_cread_item2(), INP_NAME_MAX, zebra_register::isamb, isamb_merge(), heap_cread_info::more, heap_info::no_deletions, heap_info::no_diffs, heap_info::no_insertions, heap_info::no_updates, ISAMC_I_s::read_item, heap_info::reg, zebra_log_dict_entry(), and heap_info::zh.
Referenced by zebra_index_merge().
int heap_inpc | ( | struct heap_cread_info * | hci, |
struct heap_info * | hi | ||
) |
Definition at line 539 of file kinput.c.
References ISAMC_I_s::clientData, heap_cread_info::cur_name, zebra_register::dict, dict_delete(), dict_insert(), dict_lookup(), heap_cread_item2(), INP_NAME_MAX, zebra_register::isamc, isamc_merge(), heap_cread_info::more, heap_info::no_deletions, heap_info::no_diffs, heap_info::no_insertions, heap_info::no_updates, ISAMC_I_s::read_item, and heap_info::reg.
Referenced by zebra_index_merge().
int heap_inps | ( | struct heap_cread_info * | hci, |
struct heap_info * | hi | ||
) |
Definition at line 642 of file kinput.c.
References ISAMS_I_s::clientData, heap_cread_info::cur_name, zebra_register::dict, dict_insert(), dict_lookup(), heap_cread_item(), INP_NAME_MAX, zebra_register::isams, isams_merge(), heap_cread_info::more, heap_info::no_diffs, heap_info::no_insertions, ISAMS_I_s::read_item, and heap_info::reg.
Referenced by zebra_index_merge().
|
static |
Definition at line 342 of file kinput.c.
References heap_info::buf, heap_info::file, heap_info::heapnum, heap_info::info, INP_NAME_MAX, key_file_read(), key_heap_delete(), key_heap_insert(), KEY_SIZE, heap_info::no_iterations, and heap_info::ptr.
Referenced by heap_cread_item(), and zebra_index_merge().
void key_file_chunk_read | ( | struct key_file * | f | ) |
Definition at line 77 of file kinput.c.
References key_file::buf, key_file::buf_ptr, key_file::buf_size, key_file::chunk, fd, key_file::length, key_file::no, O_BINARY, key_file::offset, key_file::readHandler, key_file::readInfo, key_file::res, and res_get_def().
Referenced by key_file_getc(), and key_file_init().
void key_file_destroy | ( | struct key_file * | f | ) |
Definition at line 128 of file kinput.c.
References key_file::buf, key_file::decode_handle, iscz1_stop(), and key_file::prev_name.
Referenced by zebra_index_merge().
int key_file_getc | ( | struct key_file * | f | ) |
Definition at line 155 of file kinput.c.
References key_file::buf, key_file::buf_ptr, key_file::buf_size, key_file::chunk, key_file_chunk_read(), and key_file::offset.
Referenced by key_file_read().
Definition at line 136 of file kinput.c.
References key_file::buf, key_file::chunk, key_file::decode_handle, INP_NAME_MAX, iscz1_start(), key_file_chunk_read(), key_file::length, key_file::no, key_file::offset, key_file::prev_name, key_file::readHandler, and key_file::res.
Referenced by zebra_index_merge().
int key_file_read | ( | struct key_file * | f, |
char * | key | ||
) |
Definition at line 169 of file kinput.c.
References key_file::decode_handle, INP_NAME_MAX, iscz1_decode(), iscz1_reset(), key_file_getc(), it_key::mem, and key_file::prev_name.
Referenced by heap_read_one(), and zebra_index_merge().
|
static |
Definition at line 296 of file kinput.c.
References heap_info::buf, heap_info::cmp, heap_info::heapnum, heap_info::info, key_heap_swap(), and heap_info::ptr.
Referenced by heap_read_one().
void key_heap_destroy | ( | struct heap_info * | hi, |
int | nkeys | ||
) |
Definition at line 275 of file kinput.c.
References heap_info::buf, heap_info::file, heap_info::info, and heap_info::ptr.
Referenced by zebra_index_merge().
struct heap_info* key_heap_init_file | ( | ZebraHandle | zh, |
int | nkeys, | ||
int(*)(const void *p1, const void *p2) | cmp | ||
) |
Definition at line 253 of file kinput.c.
References heap_info::buf, heap_info::cmp, heap_info::file, heap_info::info, INP_NAME_MAX, key_heap_malloc(), heap_info::ptr, and heap_info::zh.
Referenced by zebra_index_merge().
|
static |
Definition at line 321 of file kinput.c.
References key_file::buf, heap_info::buf, heap_info::cmp, heap_info::file, heap_info::heapnum, heap_info::info, INP_NAME_MAX, key_heap_swap(), and heap_info::ptr.
Referenced by heap_read_one(), and zebra_index_merge().
|
static |
Definition at line 236 of file kinput.c.
References heap_info::buf, heap_info::file, heap_info::heapnum, heap_info::info, heap_info::no_deletions, heap_info::no_diffs, heap_info::no_insertions, heap_info::no_iterations, heap_info::no_updates, and heap_info::ptr.
Referenced by key_heap_init_file().
|
static |
Definition at line 286 of file kinput.c.
References heap_info::ptr.
Referenced by key_heap_delete(), and key_heap_insert().
void progressFunc | ( | struct key_file * | keyp, |
void * | info | ||
) |
Definition at line 681 of file kinput.c.
References key_file::buf_size, progressInfo::lastTime, progressInfo::startTime, progressInfo::totalBytes, and progressInfo::totalOffset.
Referenced by zebra_index_merge().
void zebra_index_merge | ( | ZebraHandle | zh | ) |
Definition at line 709 of file kinput.c.
References key_file::buf_size, heap_cread_info::cur_name, extract_get_fname_tmp(), heap_cread_info::first_in_list, heap_inpb(), heap_inpc(), heap_inps(), heap_read_one(), heap_cread_info::hi, zebra_register::isamb, zebra_register::isamc, zebra_register::isams, heap_cread_info::key, heap_cread_info::key_1, heap_cread_info::key_2, zebra_register::key_block, key_block_destroy(), key_block_get_no_files(), key_file_destroy(), key_file_init(), key_file_read(), key_heap_destroy(), key_heap_init_file(), key_heap_insert(), key_qsort_compare(), KEY_SIZE, progressInfo::lastTime, key_file::length, heap_cread_info::look_level, heap_cread_info::more, heap_info::no_deletions, heap_info::no_diffs, heap_info::no_insertions, heap_info::no_iterations, heap_info::no_updates, progressFunc(), R_OK, key_file::readHandler, key_file::readInfo, zebra_session::reg, heap_info::reg, zebra_session::res, heap_cread_info::ret, progressInfo::startTime, progressInfo::totalBytes, progressInfo::totalOffset, and ZINT_FORMAT.
Referenced by zebra_flush_reg().
void zebra_log_dict_entry | ( | ZebraHandle | zh, |
const char * | s | ||
) |
Definition at line 364 of file kinput.c.
References INP_NAME_MAX, key_SU_decode(), zebra_session::reg, zebra_term_untrans(), zebraExplain_lookup_ord(), and zebra_register::zei.
Referenced by heap_cread_item(), and heap_inpb().