|
xapian-core
2.0.0
|
#include <honey_table.h>
Inheritance diagram for HoneyTable:
Collaboration diagram for HoneyTable:Public Member Functions | |
| HoneyTable (const char *, const std::string &path_, bool read_only_, bool lazy_=false) | |
| HoneyTable (const char *, int fd, off_t offset_, bool read_only_, bool lazy_=false) | |
| ~HoneyTable () | |
| bool | is_writable () const |
| int | get_flags () const |
| void | create_and_open (int flags_, const Honey::RootInfo &root_info) |
| void | open (int flags_, const Honey::RootInfo &root_info, honey_revision_number_t) |
| void | close (bool permanent) |
| const std::string & | get_path () const |
| void | add (std::string_view key, const char *val, size_t val_size, bool compressed=false) |
| void | add (std::string_view key, std::string_view val, bool compressed=false) |
| void | flush_db () |
| void | cancel (const Honey::RootInfo &, honey_revision_number_t) |
| void | commit (honey_revision_number_t, Honey::RootInfo *root_info) |
| bool | sync () |
| bool | empty () const |
| bool | get_exact_entry (std::string_view key, std::string &tag) const |
| bool | key_exists (const std::string &key) const |
| bool | del (const std::string &) |
| bool | readahead_key (const std::string &) const |
| bool | is_modified () const |
| HoneyCursor * | cursor_get () const |
| bool | exists () const |
| bool | is_open () const |
| honey_tablesize_t | get_entry_count () const |
| honey_tablesize_t | get_approx_entry_count () const |
| Return an approximation of the number of entries in the table. More... | |
| off_t | get_root () const |
| off_t | get_offset () const |
Static Public Member Functions | |
| static void | throw_database_closed () |
Private Member Functions | |
| bool | single_file () const |
| bool | get_exact_entry (std::string_view key, std::string *tag) const |
| bool | read_key (std::string &key, size_t &val_size, bool &compressed) const |
| void | read_val (std::string &val, size_t val_size) const |
Private Attributes | |
| std::string | path |
| bool | read_only |
| int | flags |
| uint4 | compress_min |
| BufferedFile | store |
| std::string | last_key |
| SSTIndex | index |
| off_t | root = -1 |
| honey_tablesize_t | num_entries = 0 |
| bool | lazy |
| off_t | offset = 0 |
| Offset to add to pointers in this table. More... | |
Friends | |
| class | HoneyCursor |
| class | MutableHoneyCursor |
Definition at line 553 of file honey_table.h.
|
inline |
Definition at line 585 of file honey_table.h.
|
inline |
Definition at line 593 of file honey_table.h.
|
inline |
Definition at line 602 of file honey_table.h.
References BufferedFile::close(), index, path, single_file(), SSTIndex::size(), and store.
| void HoneyTable::add | ( | std::string_view | key, |
| const char * | val, | ||
| size_t | val_size, | ||
| bool | compressed = false |
||
| ) |
Definition at line 74 of file honey_table.cc.
References common_prefix_length(), CompressionStream::compress(), HONEY_MAX_KEY_LENGTH, p, pack_uint(), rare, Xapian::Internal::str(), and throw_database_closed().
Referenced by add(), HoneyDocDataTable::add_document_data(), HoneyCompact::merge_spellings(), HoneyDocDataTable::replace_document_data(), HoneyInverter::set_doclength(), HoneyPositionTable::set_positionlist(), and Honey::ValueUpdater::write_tag().
|
inline |
Definition at line 637 of file honey_table.h.
References add().
|
inline |
Definition at line 648 of file honey_table.h.
Referenced by HoneySpellingTable::cancel(), and HoneySynonymTable::cancel().
|
inline |
Definition at line 622 of file honey_table.h.
References BufferedFile::close(), BufferedFile::force_close(), single_file(), and store.
Referenced by HoneyDatabase::close().
| void HoneyTable::commit | ( | honey_revision_number_t | , |
| Honey::RootInfo * | root_info | ||
| ) |
Definition at line 141 of file honey_table.cc.
References Honey::RootInfo::set_num_entries(), and Honey::RootInfo::set_root().
Referenced by HoneyDatabase::compact(), and HoneyCompact::multimerge_postlists().
| void HoneyTable::create_and_open | ( | int | flags_, |
| const Honey::RootInfo & | root_info | ||
| ) |
Definition at line 43 of file honey_table.cc.
References Assert, Honey::RootInfo::get_compress_min(), Honey::RootInfo::get_num_entries(), and Honey::RootInfo::get_root().
Referenced by HoneyDatabase::compact(), and HoneyCompact::multimerge_postlists().
| HoneyCursor * HoneyTable::cursor_get | ( | ) | const |
Definition at line 454 of file honey_table.cc.
References rare, and throw_database_closed().
Referenced by HoneyDatabase::get_postlist_cursor(), HoneyDatabase::open_metadata_keylist(), HoneyDatabase::open_spelling_wordlist(), HoneyDatabase::open_synonym_keylist(), and Honey::ValueUpdater::update().
|
inline |
Definition at line 671 of file honey_table.h.
Referenced by MutableHoneyCursor::del(), HoneyDocDataTable::delete_document_data(), HoneyPositionTable::delete_positionlist(), HoneyTermListTable::delete_termlist(), and Honey::ValueUpdater::write_tag().
|
inline |
Definition at line 659 of file honey_table.h.
References num_entries.
Referenced by HoneyDatabase::has_positions(), HoneyInverter::has_positions(), and is_modified().
|
inline |
Definition at line 682 of file honey_table.h.
References path.
|
inline |
Definition at line 643 of file honey_table.h.
References BufferedFile::flush(), index, root, store, and SSTIndex::write().
Referenced by HoneyDatabase::compact(), HoneySpellingTable::flush_db(), HoneySynonymTable::flush_db(), and HoneyCompact::multimerge_postlists().
|
inline |
Return an approximation of the number of entries in the table.
Currently this is exact, but may not be in the future.
Definition at line 699 of file honey_table.h.
References num_entries.
|
inline |
Definition at line 693 of file honey_table.h.
References num_entries.
Referenced by HoneyInverter::has_positions(), and main().
|
inline |
Definition at line 663 of file honey_table.h.
References get_exact_entry().
|
private |
Definition at line 247 of file honey_table.cc.
References Assert, CompressionStream::decompress_chunk(), CompressionStream::decompress_start(), description_append(), p, rare, SSTINDEX_BINARY_CHOP_ENTRY_SIZE, SSTINDEX_BINARY_CHOP_KEY_SIZE, Xapian::Internal::str(), throw_database_closed(), and unpack_uint().
Referenced by HoneyDocDataTable::get_document_data(), get_exact_entry(), HoneyPostListTable::get_metadata(), HoneyTermList::HoneyTermList(), key_exists(), HoneyPositionTable::open_position_list(), and HoneyInverter::store_positions().
|
inline |
Definition at line 615 of file honey_table.h.
References flags.
|
inline |
Definition at line 703 of file honey_table.h.
References offset.
|
inline |
Definition at line 630 of file honey_table.h.
References path.
Referenced by HoneyDatabase::compact().
|
inline |
Definition at line 701 of file honey_table.h.
References root.
|
inline |
Definition at line 678 of file honey_table.h.
References empty(), and read_only.
Referenced by HoneySpellingTable::is_modified(), and HoneySynonymTable::is_modified().
|
inline |
Definition at line 687 of file honey_table.h.
References BufferedFile::is_open(), and store.
Referenced by HoneyDatabase::open_term_list(), and HoneyDatabase::reopen().
|
inline |
Definition at line 613 of file honey_table.h.
References read_only.
|
inline |
Definition at line 667 of file honey_table.h.
References get_exact_entry().
Referenced by HoneyPostListTable::term_exists().
| void HoneyTable::open | ( | int | flags_, |
| const Honey::RootInfo & | root_info, | ||
| honey_revision_number_t | |||
| ) |
Definition at line 58 of file honey_table.cc.
References Honey::RootInfo::get_compress_min(), Honey::RootInfo::get_num_entries(), Honey::RootInfo::get_offset(), and Honey::RootInfo::get_root().
Referenced by HoneyDatabase::compact(), HoneyDatabase::HoneyDatabase(), and main().
|
private |
Definition at line 158 of file honey_table.cc.
References Assert, AssertEq, AssertRel, description_append(), p, and unpack_uint().
|
private |
Definition at line 232 of file honey_table.cc.
References AssertRel, and description_append().
|
inline |
Definition at line 676 of file honey_table.h.
Referenced by HoneyDocDataTable::readahead_for_document().
|
inlineprivate |
Definition at line 569 of file honey_table.h.
References path.
Referenced by close(), and ~HoneyTable().
|
inline |
Definition at line 654 of file honey_table.h.
References store, and BufferedFile::sync().
Referenced by HoneyDatabase::compact().
|
inlinestatic |
Definition at line 689 of file honey_table.h.
Referenced by HoneyCursor::do_find(), HoneyValueManager::get_all_values(), HoneyCursor::next(), HoneyCursor::prev(), HoneyCursor::read_tag(), HoneyDatabase::reopen(), and HoneyDatabase::throw_termlist_table_close_exception().
|
friend |
Definition at line 555 of file honey_table.h.
|
friend |
Definition at line 556 of file honey_table.h.
|
private |
Definition at line 561 of file honey_table.h.
|
private |
Definition at line 560 of file honey_table.h.
Referenced by get_flags().
|
private |
Definition at line 564 of file honey_table.h.
Referenced by flush_db(), and ~HoneyTable().
|
mutableprivate |
Definition at line 563 of file honey_table.h.
|
private |
Definition at line 567 of file honey_table.h.
|
private |
Definition at line 566 of file honey_table.h.
Referenced by empty(), get_approx_entry_count(), and get_entry_count().
|
private |
Offset to add to pointers in this table.
This is zero when each table is a separate file, but likely non-zero when the tables are all embedded in one file.
Definition at line 576 of file honey_table.h.
Referenced by get_offset().
|
private |
Definition at line 558 of file honey_table.h.
Referenced by exists(), get_path(), single_file(), and ~HoneyTable().
|
private |
Definition at line 559 of file honey_table.h.
Referenced by is_modified(), and is_writable().
|
private |
Definition at line 565 of file honey_table.h.
Referenced by flush_db(), and get_root().
|
mutableprivate |
Definition at line 562 of file honey_table.h.
Referenced by close(), flush_db(), is_open(), sync(), and ~HoneyTable().