IDZEBRA
2.2.7
|
Go to the source code of this file.
Data Structures | |
struct | record_info |
Macros | |
#define | REC_NO_INFO 8 |
#define | REC_COMPRESS_NONE 0 |
No compression ("none") More... | |
#define | REC_COMPRESS_BZIP2 1 |
BZIP2 compression (slow and requires big chunks) More... | |
#define | REC_COMPRESS_ZLIB 2 |
zlib compression (faster and works off small chunks) More... | |
Typedefs | |
typedef struct record_info * | Record |
typedef struct records_info * | Records |
typedef struct recindex * | recindex_t |
Enumerations | |
enum | { recInfo_fileType , recInfo_filename , recInfo_delKeys , recInfo_databaseName , recInfo_storeData , recInfo_attr , recInfo_sortKeys } |
Functions | |
ZEBRA_RES | rec_del (Records p, Record *recpp) |
marks record for deletion (on file storage) More... | |
void | rec_free (Record *recpp) |
frees record (from memory) More... | |
ZEBRA_RES | rec_put (Records p, Record *recpp) |
puts record (writes into file storage) More... | |
Record | rec_new (Records p) |
creates new record (to be written to file storage) More... | |
Record | rec_get (Records p, zint sysno) |
gets record - with given system number More... | |
Record | rec_get_root (Records p) |
gets root record More... | |
Record | rec_get_next (Records p, Record rec) |
gets next record - with given records More... | |
ZEBRA_RES | rec_close (Records *p) |
Records | rec_open (BFiles bfs, int rw, int compression_method) |
opens records system More... | |
int | rec_check_compression_method (int compression_method) |
check whether a compression method is supported More... | |
char * | rec_strdup (const char *s, size_t *len) |
void | rec_prstat (Records p, int verbose) |
zint | rec_sysno_to_int (zint sysno) |
recindex_t | recindex_open (BFiles bfs, int rw, int use_isamb) |
opens record index handle More... | |
void | recindex_close (recindex_t p) |
closes record index handle More... | |
int | recindex_read_head (recindex_t p, void *buf) |
const char * | recindex_get_fname (recindex_t p) |
ZEBRA_RES | recindex_write_head (recindex_t p, const void *buf, size_t len) |
int | recindex_read_indx (recindex_t p, zint sysno, void *buf, int itemsize, int ignoreError) |
void | recindex_write_indx (recindex_t p, zint sysno, void *buf, int itemsize) |
#define REC_COMPRESS_BZIP2 1 |
BZIP2 compression (slow and requires big chunks)
Definition at line 113 of file recindex.h.
#define REC_COMPRESS_NONE 0 |
No compression ("none")
Definition at line 111 of file recindex.h.
#define REC_COMPRESS_ZLIB 2 |
zlib compression (faster and works off small chunks)
Definition at line 115 of file recindex.h.
#define REC_NO_INFO 8 |
Definition at line 29 of file recindex.h.
typedef struct recindex* recindex_t |
Definition at line 128 of file recindex.h.
typedef struct record_info * Record |
typedef struct records_info* Records |
Definition at line 41 of file recindex.h.
anonymous enum |
Enumerator | |
---|---|
recInfo_fileType | |
recInfo_filename | |
recInfo_delKeys | |
recInfo_databaseName | |
recInfo_storeData | |
recInfo_attr | |
recInfo_sortKeys |
Definition at line 118 of file recindex.h.
int rec_check_compression_method | ( | int | compression_method | ) |
check whether a compression method is supported
compression_method | (REC_COMPRESS_..) |
0 | if method is unsupported |
1 | if method is supported |
Definition at line 287 of file records.c.
References REC_COMPRESS_BZIP2, REC_COMPRESS_NONE, and REC_COMPRESS_ZLIB.
Referenced by zebra_register_open().
Definition at line 721 of file records.c.
References bf_close(), records_info::data_BFile, records_info::data_fname, records_info::head, records_info::mutex, REC_BLOCK_TYPES, rec_cache_flush(), records_info::recindex, recindex_close(), recindex_write_head(), records_info::record_cache, records_info::rw, records_info::tmp_buf, ZEBRA_FAIL, zebra_mutex_destroy(), and ZEBRA_OK.
Referenced by rec_open(), and zebra_register_close().
marks record for deletion (on file storage)
p | records handle |
recpp | record pointer |
Definition at line 1001 of file records.c.
References records_info::head, records_info::mutex, records_info::records_head::no_records, rec_cache_insert(), rec_cache_lookup(), rec_free(), recordFlagDelete, zebra_mutex_lock(), zebra_mutex_unlock(), and ZEBRA_OK.
Referenced by delete_w_all_handle(), zebra_extract_record_stream(), and zebraExplain_removeDatabase().
void rec_free | ( | Record * | recpp | ) |
frees record (from memory)
recpp | record pointer |
Definition at line 1044 of file records.c.
References REC_NO_INFO.
Referenced by perform_facet_index(), rec_cache_flush(), rec_del(), rec_put(), rpn_search_APT_local(), zebra_create_record_stream(), zebra_extract_record_stream(), zebra_get_rec_snippets(), zebra_record_fetch(), zebra_register_check(), zebra_special_fetch(), zebraExplain_open(), zebraExplain_readAttributeDetails(), and zebraExplain_readDatabase().
gets record - with given system number
p | records handle |
sysno | system ID (external number) |
Definition at line 928 of file records.c.
References records_info::mutex, rec_get_int(), zebra_mutex_lock(), and zebra_mutex_unlock().
Referenced by createRecord(), delete_w_all_handle(), perform_facet_index(), rec_get_next(), rec_get_root(), rpn_search_APT_local(), zebra_extract_record_stream(), zebra_get_rec_snippets(), zebra_record_fetch(), zebra_special_fetch(), zebraExplain_readAttributeDetails(), zebraExplain_readDatabase(), and zebraExplain_removeDatabase().
gets next record - with given records
p | records handle |
rec | record |
Definition at line 943 of file records.c.
References records_info::head, records_info::records_head::index_last, record_index_entry::next, rec_get(), rec_sysno_to_ext(), rec_sysno_to_int(), and record_info::sysno.
Referenced by zebra_register_check().
gets root record
p | records handle |
Definition at line 938 of file records.c.
References rec_get(), and rec_sysno_to_ext().
Referenced by zebra_register_check(), zebraExplain_open(), and zebraExplain_writeTarget().
creates new record (to be written to file storage)
p | records handle |
Definition at line 991 of file records.c.
References records_info::mutex, rec_new_int(), zebra_mutex_lock(), and zebra_mutex_unlock().
Referenced by createRecord(), zebra_extract_record_stream(), and zebraExplain_open().
opens records system
bfs | block file storage |
rw | read-write flag(0=read only, 1=write) |
compression_method | REC_COMPRESS_ type |
Definition at line 309 of file records.c.
References bf_open(), records_info::records_head::block_free, records_info::records_head::block_last, records_info::records_head::block_move, records_info::records_head::block_size, records_info::records_head::block_used, records_info::cache_cur, records_info::cache_max, CAST_ZINT_TO_INT, records_info::compression_chunk_size, records_info::compression_method, records_info::data_BFile, records_info::data_fname, records_info::head, records_info::records_head::index_free, records_info::records_head::index_last, records_info::records_head::magic, records_info::mutex, records_info::records_head::no_records, REC_BLOCK_TYPES, rec_close(), REC_COMPRESS_BZIP2, REC_HEAD_MAGIC, REC_VERSION, records_info::recindex, recindex_get_fname(), recindex_open(), recindex_read_head(), recindex_write_head(), records_info::record_cache, records_info::rw, records_info::tmp_buf, records_info::tmp_size, records_info::records_head::total_bytes, records_info::records_head::version, ZEBRA_FAIL, zebra_mutex_init(), and ZEBRA_OK.
Referenced by zebra_register_open().
void rec_prstat | ( | Records | p, |
int | verbose | ||
) |
Definition at line 1095 of file records.c.
References bf_read(), records_info::records_head::block_free, records_info::records_head::block_last, records_info::records_head::block_size, records_info::records_head::block_used, records_info::data_BFile, records_info::data_fname, records_info::head, records_info::records_head::no_records, REC_BLOCK_TYPES, records_info::records_head::total_bytes, ZINT_FORMAT, and ZINT_FORMAT0.
Referenced by zebra_register_statistics().
puts record (writes into file storage)
p | records handle |
recpp | record pointer |
Definition at line 1023 of file records.c.
References records_info::mutex, rec_cache_insert(), rec_cache_lookup(), rec_free(), recordFlagWrite, zebra_mutex_lock(), zebra_mutex_unlock(), and ZEBRA_OK.
Referenced by zebra_extract_record_stream(), zebraExplain_open(), zebraExplain_writeAttributeDetails(), zebraExplain_writeAttributeSet(), zebraExplain_writeCategoryList(), zebraExplain_writeDatabase(), and zebraExplain_writeTarget().
char* rec_strdup | ( | const char * | s, |
size_t * | len | ||
) |
Definition at line 1080 of file records.c.
Referenced by createRecord(), zebra_extract_record_stream(), and zebraExplain_open().
Definition at line 130 of file records.c.
References FAKE_OFFSET, and USUAL_RANGE.
Referenced by rec_cache_flush_block1(), rec_delete_single(), rec_get_int(), rec_get_next(), rec_write_multiple(), and zebra_sort_sysno().
void recindex_close | ( | recindex_t | p | ) |
closes record index handle
p | records handle |
Definition at line 182 of file recindex.c.
References bf_close(), recindex::index_BFile, recindex::isam_p, recindex::isamb, isamb_close(), isamb_dump(), isamb_set_root_ptr(), and log_pr().
Referenced by rec_close().
const char* recindex_get_fname | ( | recindex_t | p | ) |
Definition at line 203 of file recindex.c.
References recindex::index_fname.
Referenced by rec_open().
recindex_t recindex_open | ( | BFiles | bfs, |
int | rw, | ||
int | use_isamb | ||
) |
opens record index handle
bfs | Block files handle |
rw | 1 for read and write; 0 for read-only |
use_isamb | 1 if ISAMB is to used for record index; 0 for flat (old) |
Definition at line 134 of file recindex.c.
References bf_open(), ISAMC_M_s::codec, ISAMC_M_s::compare_item, ISAM_CODEC::decode, ISAM_CODEC::encode, recindex::index_BFile, recindex::index_fname, recindex::isam_p, recindex::isamb, isamb_get_root_ptr(), isamb_open2(), ISAMC_M_s::log_item, rect_code_reset(), rect_code_start(), rect_code_stop(), rect_compare(), rect_decode(), rect_encode(), rect_log_item(), ISAM_CODEC::reset, RIDX_CHUNK, ISAM_CODEC::start, and ISAM_CODEC::stop.
Referenced by rec_open().
int recindex_read_head | ( | recindex_t | p, |
void * | buf | ||
) |
Definition at line 198 of file recindex.c.
References bf_read(), and recindex::index_BFile.
Referenced by rec_open().
int recindex_read_indx | ( | recindex_t | p, |
zint | sysno, | ||
void * | buf, | ||
int | itemsize, | ||
int | ignoreError | ||
) |
Definition at line 225 of file recindex.c.
References bf_read(), CAST_ZINT_TO_INT, recindex::index_BFile, recindex::index_fname, recindex::isam_p, recindex::isamb, isamb_pp_close(), isamb_pp_forward(), isamb_pp_open(), record_index_entry::next, RIDX_CHUNK, record_index_entry::size, and ZINT_FORMAT.
Referenced by rec_get_int(), rec_new_int(), and rec_release_blocks().
ZEBRA_RES recindex_write_head | ( | recindex_t | p, |
const void * | buf, | ||
size_t | len | ||
) |
Definition at line 208 of file recindex.c.
References bf_write(), recindex::index_BFile, recindex::index_fname, ZEBRA_FAIL, and ZEBRA_OK.
Referenced by rec_close(), and rec_open().
void recindex_write_indx | ( | recindex_t | p, |
zint | sysno, | ||
void * | buf, | ||
int | itemsize | ||
) |
Definition at line 312 of file recindex.c.
References bf_write(), bt_code_read(), code_read_data::buf, CAST_ZINT_TO_INT, recindex::index_BFile, code_read_data::insert_flag, recindex::isam_p, recindex::isamb, isamb_merge(), code_read_data::itemsize, code_read_data::no, RIDX_CHUNK, code_read_data::sysno, and ZINT_FORMAT.
Referenced by rec_delete_single(), and rec_write_tmp_buf().