k2hash - Man Page
NoSQL Key Value Store(KVS) library
Synopsis
library
libk2hash.so
tool for library
k2hlinetool [options]
k2hreplace [options]
k2hcompress [options]
k2htouch [options]
k2hedit [options]
Description
- K2HASH is NoSQL(key value store) library and tools for this library by Yahoo! JAPAN. K2HASH is following specifications.
- Supports multi-threading and multi-processing program.
- Expands data area.
- Switches accessing only memory and data file directly.
- Puts transaction.
- Archiving.
- Replaces hash function like plugin.
- Replaces transaction.
K2HASH tools can create/store(write)/read a file or memory which is made(allocated) by K2HASH library for testing.
- K2HASH library has following three way for KVS storage.
- Use storage on memory only, this type of storage can be used by only multi-thread process. And on this type, the data on storage is not permanent.
- Use fully mapping file, this type can be used by multi-thread and multi-process. All of data in the file is mmapping fully, then the limit of the file and data size depends on the memory.
- Use a part of mapping file and directly accessing a file, this type can be used by multi-thread and multi-process.
K2HASH maps only hash table and etc from the file, and reads/writes the file for datas directly. This way is expanding upper limit, but less performance because directly accessing.
- In cases of using mapping file, you can use the data(file) as permanently or temporary.
- K2HASH uses FNV-1a hashing function in it. If you replace this hash function, you can do by two way.
- One way is that your process defines same prototype of hash function.
- The other is that you can load your original DSO library which includes same prototype of hash function.
You can know how to implement replacing hash function, please see k2hashfunc.h file.
- K2HASH can put transaction and archive all of data in file. If you need to make your original formatted transaction outputs, you can do by two way like replacing hash function.
- One way is that your process defines same prototype of hash function.
- The other is that you can load your original DSO library which includes same prototype of hash function.
You can know how to implement replacing transaction function, please see k2htransfunc.h file.
Functions
You can develop programs using the interface for C/C++ language provided by the K2HASH library. You can see following C language function prototypes in k2hash.h.
K2HASH C++ Language interface is implemented almost in k2shm.h. You can use public K2HShm class methods like C Language interface.
- K2HASH C Language interface function:
void k2h_bump_debug_level(...)
void k2h_set_debug_level_silent(...)
void k2h_set_debug_level_error(...)
void k2h_set_debug_level_warning(...)
void k2h_set_debug_level_message(...)
bool k2h_set_debug_file(...)
bool k2h_unset_debug_file(...)
bool k2h_load_debug_env(...)
bool k2h_set_bumpup_debug_signal_user1(...)- bool k2h_load_hash_library(...)
bool k2h_unload_hash_library(...)
bool k2h_load_transaction_library(...)
bool k2h_unload_transaction_library(...)- bool k2h_create(...)
k2h_h k2h_open(...)
k2h_h k2h_open_rw(...)- k2h_h k2h_open_ro(...)
k2h_h k2h_open_tempfile(...)
k2h_h k2h_open_mem(...)
bool k2h_close(...)
bool k2h_close_wait(...)- bool k2h_transaction(...)
bool k2h_transaction_prefix(...)
bool k2h_transaction_param(...)
bool k2h_transaction_param_we(...)
bool k2h_enable_transaction(...)
bool k2h_enable_transaction_prefix(...)
bool k2h_enable_transaction_param(...)
bool k2h_enable_transaction_param_we(...)
bool k2h_disable_transaction(...)
int k2h_get_transaction_archive_fd(...)
bool k2h_load_archive(...)
bool k2h_put_archive(...)
int k2h_get_transaction_thread_pool(...)
bool k2h_set_transaction_thread_pool(...)
bool k2h_unset_transaction_thread_pool(...)- bool k2h_set_common_attr(...)
bool k2h_clean_common_attr(...)
bool k2h_add_attr_plugin_library(...)
bool k2h_add_attr_crypt_pass(...)
bool k2h_print_attr_version(...)
bool k2h_print_attr_information(...)- bool k2h_get_value(...)
unsigned char* k2h_get_direct_value(...)
bool k2h_get_str_value(...)
char* k2h_get_str_direct_value(...)
bool k2h_get_value_wp(...)
unsigned char* k2h_get_direct_value_wp(...)
bool k2h_get_str_value_wp(...)
char* k2h_get_str_direct_value_wp(...)
bool k2h_get_value_np(...)
unsigned char* k2h_get_direct_value_np(...)
bool k2h_get_str_value_np(...)
char* k2h_get_str_direct_value_np(...)
bool k2h_get_value_ext(...)
unsigned char* k2h_get_direct_value_ext(...)
bool k2h_get_str_value_ext(...)
char* k2h_get_str_direct_value_ext(...)
bool k2h_get_value_wp_ext(...)
unsigned char* k2h_get_direct_value_wp_ext(...)
bool k2h_get_str_value_wp_ext(...)
char* k2h_get_str_direct_value_wp_ext(...)
bool k2h_get_value_np_ext(...)
unsigned char* k2h_get_direct_value_np_ext(...)
bool k2h_get_str_value_np_ext(...)
char* k2h_get_str_direct_value_np_ext(...)- bool k2h_get_subkeys(...)
PK2HKEYPCK k2h_get_direct_subkeys(...)
int k2h_get_str_subkeys(...)
char** k2h_get_str_direct_subkeys(...)
bool k2h_get_subkeys_np(...)
PK2HKEYPCK k2h_get_direct_subkeys_np(...)
int k2h_get_str_subkeys_np(...)
char** k2h_get_str_direct_subkeys_np(...)- bool k2h_free_keypack(...)
bool k2h_free_keyarray(...)
- bool k2h_get_attrs(...)
PK2HATTRPCK k2h_get_direct_attrs(...)
PK2HATTRPCK k2h_get_str_direct_attrs(...)
bool k2h_free_attrpack(...)- bool k2h_set_all(...)
bool k2h_set_str_all(...)
bool k2h_set_value(...)
bool k2h_set_str_value(...)
bool k2h_set_all_wa(...)
bool k2h_set_str_all_wa(...)
bool k2h_set_value_wa(...)
bool k2h_set_str_value_wa(...)
bool k2h_set_subkeys(...)
bool k2h_set_str_subkeys(...)
bool k2h_add_subkey(...)
bool k2h_add_str_subkey(...)
k2h_add_subkey_wa(...)
k2h_add_str_subkey_wa(...)
k2h_add_attr(...)
k2h_add_str_attr(...)- bool k2h_remove_all(...)
bool k2h_remove_str_all(...)
bool k2h_remove(...)
bool k2h_remove_str(...)
bool k2h_remove_subkey(...)
bool k2h_remove_str_subkey(...)- bool k2h_rename(...)
bool k2h_rename_str(...)
- k2h_find_h k2h_find_first(...)
k2h_find_h k2h_find_first_subkey(...)
k2h_find_h k2h_find_first_str_subkey(...)
k2h_find_h k2h_find_next(...)
bool k2h_find_free(...)- bool k2h_find_get_key(...)
char* k2h_find_get_str_key(...)
bool k2h_find_get_value(...)
char* k2h_find_get_direct_value(...)
bool k2h_find_get_subkeys(...)
PK2HKEYPCK k2h_find_get_direct_subkeys(...)
int k2h_find_get_str_subkeys(...)
char** k2h_find_get_str_direct_subkeys(...)- k2h_da_h k2h_da_handle(...)
k2h_da_h k2h_da_handle_read(...)
k2h_da_h k2h_da_handle_write(...)
k2h_da_h k2h_da_handle_rw(...)
k2h_da_h k2h_da_str_handle(...)
k2h_da_h k2h_da_str_handle_read(...)
k2h_da_h k2h_da_str_handle_write(...)
k2h_da_h k2h_da_str_handle_rw(...)
bool k2h_da_free(...)
ssize_t k2h_da_get_length(...)
ssize_t k2h_da_get_buf_size(...)
bool k2h_da_set_buf_size(...)
off_t k2h_da_get_offset(...)
off_t k2h_da_get_read_offset(...)
off_t k2h_da_get_write_offset(...)
bool k2h_da_set_offset(...)
bool k2h_da_set_read_offset(...)
bool k2h_da_set_write_offset(...)
bool k2h_da_get_value(...)
bool k2h_da_get_value_offset(...)
bool k2h_da_get_value_to_file(...)
unsigned char* k2h_da_read(...)
unsigned char* k2h_da_read_offset(...)
char* k2h_da_read_str(...)
bool k2h_da_set_value(...)
bool k2h_da_set_value_offset(...)
bool k2h_da_set_value_from_file(...)
bool k2h_da_set_value_str(...)- k2h_q_h k2h_q_handle(...)
k2h_q_h k2h_q_handle_prefix(...)
k2h_q_h k2h_q_handle_str_prefix(...)
bool k2h_q_free(...)
bool k2h_q_empty(...)
int k2h_q_count(...)
bool k2h_q_read(...)
bool k2h_q_str_read(...)
bool k2h_q_push(...)
bool k2h_q_str_push(...)
bool k2h_q_pop(...)
bool k2h_q_str_pop(...)
bool k2h_q_remove(...)
int k2h_q_remove_ext(...)
bool k2h_q_dump(...)
k2h_q_read_wp(...)
k2h_q_str_read_wp(...)
k2h_q_push_wa(...)
k2h_q_str_push_wa(...)
k2h_q_pop_wa(...)
k2h_q_str_pop_wa(...)
k2h_q_pop_wp(...)
k2h_q_str_pop_wp(...)
k2h_q_remove_wp(...)
k2h_q_remove_wp_ext(...)
k2h_keyq_h k2h_keyq_handle(...)
k2h_keyq_h k2h_keyq_handle_prefix(...)
k2h_keyq_h k2h_keyq_handle_str_prefix(...)
bool k2h_keyq_free(...)
bool k2h_keyq_empty(...)
int k2h_keyq_count(...)
bool k2h_keyq_read(...)
bool k2h_keyq_read_keyval(...)
bool k2h_keyq_str_read(...)
bool k2h_keyq_str_read_keyval(...)
bool k2h_keyq_push(...)
bool k2h_keyq_str_push(...)
bool k2h_keyq_push_keyval(...)
bool k2h_keyq_str_push_keyval(...)
bool k2h_keyq_pop(...)
bool k2h_keyq_pop_keyval(...)
bool k2h_keyq_str_pop(...)
bool k2h_keyq_str_pop_keyval(...)
bool k2h_keyq_remove(...)
int k2h_keyq_remove_ext(...)
bool k2h_keyq_dump(...)
k2h_keyq_read_wp(...)
k2h_keyq_read_keyval_wp(...)
k2h_keyq_str_read_wp(...)
k2h_keyq_str_read_keyval_wp(...)
k2h_keyq_push_wa(...)
k2h_keyq_push_keyval_wa(...)
k2h_keyq_str_push_wa(...)
k2h_keyq_str_push_keyval_wa(...)
k2h_keyq_pop_wp(...)
k2h_keyq_pop_keyval_wp(...)
k2h_keyq_str_pop_wp(...)
k2h_keyq_str_pop_keyval_wp(...)
k2h_keyq_remove_wp(...)
k2h_keyq_remove_wp_ext(...)- bool k2h_dump_head(...)
bool k2h_dump_keytable(...)
bool k2h_dump_full_keytable(...)
bool k2h_dump_elementtable(...)
bool k2h_dump_full(...)
bool k2h_print_state(...)
void k2h_print_version(...)
Environment
- K2HASH use some environments automatically, please take care these environments.
K2HDBGMODE - specifies debugging level: INFO/WAN/ERR/SILENT
K2HDBGFILE - output file path for message(default: stderr)
K2HATTR_MTIME - set ON for builtin attribute last modify time
K2HATTR_HISTORY - set ON for builtin attribute history
K2HATTR_EXPIRE_SEC - set seconds for builtin attribute expire time
K2HATTR_DEFENC - set ON for enabling builtin attribute encrypt
K2HATTR_ENCFILE - set pass phrase file path for builtin attribute en(de)crypt
Notes
k2hlinetool, k2hreplace, k2hcompress, k2htouch, k2hedit is tool for k2hash file/memory.
See Also
k2hlinetool(1), k2hreplace(1), k2hcompress(1), k2htouch(1), k2hedit(1)
Bugs
Please report owner and committers.
Author
k2hash has been written by Takeshi Nakatani <nakatani@yahoo-corp.jp>.
Referenced By
k2hbench(1), k2hcompress(1), k2hedit(1), k2himport(1), k2hlinetool(1), k2hreplace(1), k2htouch(1).