IDZEBRA
2.2.7
|
Go to the source code of this file.
Macros | |
#define | SORT_IDX_ENTRYSIZE 64 |
#define | ZEBRA_SORT_TYPE_FLAT 1 |
#define | ZEBRA_SORT_TYPE_ISAMB 2 |
#define | ZEBRA_SORT_TYPE_MULTI 3 |
Typedefs | |
typedef struct zebra_sort_index * | zebra_sort_index_t |
sort index handle More... | |
Functions | |
zebra_sort_index_t | zebra_sort_open (BFiles bfs, int write_flag, int sort_type) |
creates sort handle More... | |
void | zebra_sort_close (zebra_sort_index_t si) |
frees sort handle More... | |
int | zebra_sort_type (zebra_sort_index_t si, int type) |
sets type for sort usage More... | |
void | zebra_sort_sysno (zebra_sort_index_t si, zint sysno) |
sets sort system number for read / add / delete More... | |
void | zebra_sort_add (zebra_sort_index_t si, zint section_id, WRBUF w) |
adds multi-map content to sort file More... | |
void | zebra_sort_delete (zebra_sort_index_t si, zint section_id) |
delete sort entry More... | |
int | zebra_sort_read (zebra_sort_index_t si, zint *section_id, WRBUF w) |
reads sort entry More... | |
void zebra_sort_add | ( | zebra_sort_index_t | si, |
zint | section_id, | ||
WRBUF | w | ||
) |
adds multi-map content to sort file
si | sort index handle |
section_id | section of key |
w | one or more 0-terminted strings (thus an array) |
zebra_sort_type and zebra_sort_sysno must be called prior to this
Definition at line 393 of file sortidx.c.
References sortFile::bf, bf_write(), zebra_sort_index::current_file, zebra_sort_index::entry_buf, sort_term_stream::insert_flag, sortFile::isam_p, sortFile::isamb, isamb_merge(), sort_term::length, sort_term_stream::no, sortFile::no_inserted, sort_term::section_id, SORT_IDX_ENTRYSIZE, SORT_MAX_MULTI, SORT_MAX_TERM, sort_term_code_read(), sort_term_stream::st, sort_term::sysno, zebra_sort_index::sysno, sort_term::term, zebra_sort_index::type, sortFile::u, ZEBRA_SORT_TYPE_FLAT, ZEBRA_SORT_TYPE_ISAMB, and ZEBRA_SORT_TYPE_MULTI.
Referenced by extract_flush_sort_keys().
void zebra_sort_close | ( | zebra_sort_index_t | si | ) |
frees sort handle
Definition at line 209 of file sortidx.c.
References sortFile::bf, bf_close(), zebra_sort_index::entry_buf, zebra_sort_index::files, sortFile::isam_p, sortFile::isam_pp, sortFile::isamb, isamb_close(), isamb_pp_close(), isamb_set_root_ptr(), sortFile::next, zebra_sort_index::type, sortFile::u, ZEBRA_SORT_TYPE_FLAT, ZEBRA_SORT_TYPE_ISAMB, and ZEBRA_SORT_TYPE_MULTI.
Referenced by zebra_register_close().
void zebra_sort_delete | ( | zebra_sort_index_t | si, |
zint | section_id | ||
) |
delete sort entry
si | sort index handle |
section_id | section of sort key to be deleted |
zebra_sort_type and zebra_sort_sysno must be called prior to this
Definition at line 356 of file sortidx.c.
References sortFile::bf, bf_write(), zebra_sort_index::current_file, zebra_sort_index::entry_buf, sort_term_stream::insert_flag, sortFile::isam_p, sortFile::isamb, isamb_merge(), sort_term::length, sort_term_stream::no, sortFile::no_deleted, sort_term::section_id, SORT_IDX_ENTRYSIZE, sort_term_code_read(), sort_term_stream::st, sort_term::sysno, zebra_sort_index::sysno, sort_term::term, zebra_sort_index::type, sortFile::u, ZEBRA_SORT_TYPE_FLAT, ZEBRA_SORT_TYPE_ISAMB, and ZEBRA_SORT_TYPE_MULTI.
Referenced by extract_flush_sort_keys().
zebra_sort_index_t zebra_sort_open | ( | BFiles | bfs, |
int | write_flag, | ||
int | sort_type | ||
) |
creates sort handle
bfs | block files handle |
write_flag | (0=read-only, 1=write and read) |
sort_type | one of ZEBRA_SORT_TYPE_.. |
Definition at line 197 of file sortidx.c.
References zebra_sort_index::bfs, zebra_sort_index::current_file, zebra_sort_index::entry_buf, zebra_sort_index::files, SORT_IDX_ENTRYSIZE, zebra_sort_index::type, and zebra_sort_index::write_flag.
Referenced by zebra_register_open().
int zebra_sort_read | ( | zebra_sort_index_t | si, |
zint * | section_id, | ||
WRBUF | w | ||
) |
reads sort entry
si | sort index handle |
section_id | output section ID (may be NULL and it will not be set) |
w | resulting buffer |
0 | could not be read |
1 | could be read (found) |
Definition at line 470 of file sortidx.c.
References sortFile::bf, bf_read(), zebra_sort_index::current_file, sortFile::isam_p, sortFile::isam_pp, sortFile::isamb, isamb_pp_forward(), isamb_pp_open(), sort_term::length, sort_term::section_id, SORT_IDX_ENTRYSIZE, sort_term::sysno, zebra_sort_index::sysno, sort_term::term, zebra_sort_index::type, sortFile::u, ZEBRA_SORT_TYPE_FLAT, ZEBRA_SORT_TYPE_ISAMB, and ZEBRA_SORT_TYPE_MULTI.
Referenced by perform_facet_sort(), resultSetInsertSort(), and sort_fetch().
void zebra_sort_sysno | ( | zebra_sort_index_t | si, |
zint | sysno | ||
) |
sets sort system number for read / add / delete
si | sort index handle |
sysno | system number |
Definition at line 340 of file sortidx.c.
References zebra_sort_index::files, sortFile::isam_pp, sortFile::next, sortFile::no_deleted, sortFile::no_inserted, rec_sysno_to_int(), zebra_sort_index::sysno, and zebra_sortf_rewind().
Referenced by extract_flush_sort_keys(), perform_facet_sort(), resultSetInsertSort(), and sort_fetch().
int zebra_sort_type | ( | zebra_sort_index_t | si, |
int | type | ||
) |
sets type for sort usage
si | sort index handle |
type | opaque type .. A sort file for each type is created |
Definition at line 235 of file sortidx.c.
References sortFile::bf, bf_close(), bf_open(), bf_read(), zebra_sort_index::bfs, ISAMC_M_s::codec, ISAMC_M_s::compare_item, zebra_sort_index::current_file, ISAM_CODEC::decode, ISAM_CODEC::encode, zebra_sort_index::files, sortFile::head, sortFile::id, sortFile::isam_p, sortFile::isam_pp, sortFile::isamb, isamb_get_root_ptr(), isamb_open2(), ISAMC_M_s::log_item, sortFile::next, sortFile::no_deleted, sortFile::no_inserted, ISAM_CODEC::reset, SORT_IDX_BLOCKSIZE, sort_term_code_reset(), sort_term_code_start(), sort_term_code_stop(), sort_term_compare(), sort_term_decode1(), sort_term_decode2(), sort_term_encode1(), sort_term_encode2(), sort_term_log_item(), ISAM_CODEC::start, ISAM_CODEC::stop, sortFileHead::sysno_max, zebra_sort_index::type, sortFile::u, zebra_sort_index::write_flag, ZEBRA_SORT_TYPE_FLAT, ZEBRA_SORT_TYPE_ISAMB, and ZEBRA_SORT_TYPE_MULTI.
Referenced by extract_flush_sort_keys(), perform_facet_sort(), resultSetInsertSort(), and sort_fetch().