|
xapian-core
2.0.0
|
A writable glass database. More...
#include <glass_database.h>
Inheritance diagram for GlassWritableDatabase:
Collaboration diagram for GlassWritableDatabase:Public Member Functions | |
| GlassWritableDatabase (std::string_view dir, int flags, int block_size) | |
| Create and open a writable glass database. More... | |
| ~GlassWritableDatabase () | |
| Xapian::termcount | get_doclength (Xapian::docid did) const |
| Virtual methods of Database::Internal. More... | |
| Xapian::termcount | get_unique_terms (Xapian::docid did) const |
| Get the number of unique terms in document. More... | |
| void | get_freqs (std::string_view term, Xapian::doccount *termfreq_ptr, Xapian::termcount *collfreq_ptr) const |
| Returns frequencies for a term. More... | |
| Xapian::doccount | get_value_freq (Xapian::valueno slot) const |
| Return the frequency of a given value slot. More... | |
| std::string | get_value_lower_bound (Xapian::valueno slot) const |
| Get a lower bound on the values stored in the given value slot. More... | |
| std::string | get_value_upper_bound (Xapian::valueno slot) const |
| Get an upper bound on the values stored in the given value slot. More... | |
| bool | term_exists (std::string_view term) const |
| bool | has_positions () const |
| Check whether this database contains any positional information. More... | |
| PostList * | open_post_list (std::string_view term) const |
| Return a PostList suitable for use in a PostingIterator. More... | |
| LeafPostList * | open_leaf_post_list (std::string_view term, bool need_read_pos) const |
| Create a LeafPostList for use during a match. More... | |
| ValueList * | open_value_list (Xapian::valueno slot) const |
| Open a value stream. More... | |
| void | read_position_list (GlassRePositionList *pos_list, Xapian::docid did, std::string_view term) const |
| Xapian::termcount | positionlist_count (Xapian::docid did, std::string_view term) const |
| PositionList * | open_position_list (Xapian::docid did, std::string_view term) const |
| TermList * | open_allterms (std::string_view prefix) const |
| void | add_spelling (std::string_view word, Xapian::termcount freqinc) const |
| Add a word to the spelling dictionary. More... | |
| Xapian::termcount | remove_spelling (std::string_view word, Xapian::termcount freqdec) const |
| Remove a word from the spelling dictionary. More... | |
| TermList * | open_spelling_wordlist () const |
| Return a termlist which returns the words which are spelling correction targets. More... | |
| TermList * | open_synonym_keylist (std::string_view prefix) const |
| Open a termlist returning each term which has synonyms. More... | |
| void | add_synonym (std::string_view word, std::string_view synonym) const |
| Add a synonym for a term. More... | |
| void | remove_synonym (std::string_view word, std::string_view synonym) const |
| Remove a synonym for a term. More... | |
| void | clear_synonyms (std::string_view word) const |
| Clear all synonyms for a term. More... | |
| void | set_metadata (std::string_view key, std::string_view value) |
| Set the metadata associated with a given key. More... | |
| void | invalidate_doc_object (Xapian::Document::Internal *obj) const |
| Notify the database that document is no longer valid. More... | |
| bool | has_uncommitted_changes () const |
| Return true if there are uncommitted changes. More... | |
| Xapian::Database::Internal * | update_lock (int flags) |
| Lock a read-only database for writing or unlock a writable database. More... | |
Public Member Functions inherited from GlassDatabase | |
| GlassDatabase (std::string_view db_dir_, int flags=Xapian::DB_READONLY_, unsigned int block_size=0u) | |
| Create and open a glass database. More... | |
| GlassDatabase (int fd) | |
| ~GlassDatabase () | |
| GlassCursor * | get_postlist_cursor () const |
| Get a postlist table cursor (used by GlassValueList). More... | |
| Xapian::doccount | get_doccount () const |
| Virtual methods of Database::Internal. More... | |
| Xapian::docid | get_lastdocid () const |
| Return the last used document id of this (sub) database. More... | |
| Xapian::totallength | get_total_length () const |
| Return the total length of all documents in this database. More... | |
| Xapian::termcount | get_wdfdocmax (Xapian::docid did) const |
| Get the max wdf in document. More... | |
| Xapian::termcount | get_doclength_lower_bound () const |
| Get a lower bound on the length of a document in this DB. More... | |
| Xapian::termcount | get_doclength_upper_bound () const |
| Get an upper bound on the length of a document in this DB. More... | |
| Xapian::termcount | get_wdf_upper_bound (std::string_view term) const |
| Get an upper bound on the wdf of term term. More... | |
| Xapian::termcount | get_unique_terms_lower_bound () const |
| Get a lower bound on the unique terms size of a document in this DB. More... | |
| TermList * | open_term_list (Xapian::docid did) const |
| TermList * | open_term_list_direct (Xapian::docid did) const |
| Like open_term_list() but without MultiTermList wrapper. More... | |
| TermList * | open_spelling_termlist (std::string_view word) const |
| Create a termlist tree from trigrams of word. More... | |
| Xapian::doccount | get_spelling_frequency (std::string_view word) const |
| Return the number of times word was added as a spelling. More... | |
| TermList * | open_synonym_termlist (std::string_view term) const |
| Open a termlist returning synonyms for a term. More... | |
| string | get_metadata (std::string_view key) const |
| Get the metadata associated with a given key. More... | |
| TermList * | open_metadata_keylist (std::string_view prefix) const |
| Open a termlist returning each metadata key. More... | |
| void | write_changesets_to_fd (int fd, std::string_view start_revision, bool need_whole_db, Xapian::ReplicationInfo *info) |
| Write a set of changesets to a file descriptor. More... | |
| Xapian::rev | get_revision () const |
| Get the revision number which the tables are opened at. More... | |
| string | get_uuid () const |
| Get a UUID for the database. More... | |
| void | request_document (Xapian::docid) const |
| Request a document. More... | |
| void | readahead_for_query (const Xapian::Query &query) const |
| void | throw_termlist_table_close_exception () const |
| int | get_backend_info (string *path) const |
| Get backend information about this database. More... | |
| bool | single_file () const |
| void | get_used_docid_range (Xapian::docid &first, Xapian::docid &last) const |
| Find lowest and highest docids actually in use. More... | |
| bool | locked () const |
| Return true if the database is open for writing. More... | |
| std::string | get_description () const |
| Return a string describing this object. More... | |
Public Member Functions inherited from Xapian::Database::Internal | |
| virtual | ~Internal () |
| We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor. More... | |
| virtual size_type | size () const |
| virtual void | keep_alive () |
| virtual termcount | get_unique_terms_upper_bound () const |
| Get an upper bound on the unique terms size of a document in this DB. More... | |
| virtual void | begin_transaction (bool flushed) |
| Begin transaction. More... | |
| virtual void | end_transaction (bool do_commit) |
| End transaction. More... | |
| virtual void | delete_document (std::string_view unique_term) |
| Delete any documents indexed by a term from the database. More... | |
| virtual docid | replace_document (std::string_view unique_term, const Document &document) |
| Replace any documents matching a term. More... | |
| virtual std::string | reconstruct_text (Xapian::docid did, size_t length, std::string_view prefix, Xapian::termpos start_pos, Xapian::termpos end_pos) const |
Public Member Functions inherited from Xapian::Internal::intrusive_base | |
| intrusive_base () | |
| Construct with no references. More... | |
Private Member Functions | |
| void | check_flush_threshold () |
| Check if we should autoflush. More... | |
| void | flush_postlist_changes () |
| Flush any unflushed postlist changes, but don't commit them. More... | |
| void | close () |
| Close all the tables permanently. More... | |
| void | apply () |
| Apply changes. More... | |
| void | commit () |
| Implementation of virtual methods: see Database::Internal for details. More... | |
| void | cancel () |
| Cancel pending modifications to the database. More... | |
| Xapian::docid | add_document (const Xapian::Document &document) |
| Xapian::docid | add_document_ (Xapian::docid did, const Xapian::Document &document) |
| void | delete_document (Xapian::docid did) |
| void | replace_document (Xapian::docid did, const Xapian::Document &document) |
| Xapian::Document::Internal * | open_document (Xapian::docid did, bool lazy) const |
| Open a handle on a document. More... | |
Private Attributes | |
| Inverter | inverter |
| std::map< Xapian::valueno, ValueStats > | value_stats |
| Xapian::doccount | change_count |
| The number of documents added, deleted, or replaced since the last flush. More... | |
| Xapian::doccount | flush_threshold |
| If change_count reaches this threshold we automatically flush. More... | |
| Xapian::Document::Internal * | modify_shortcut_document |
| A pointer to the last document which was returned by open_document(), or NULL if there is no such valid document. More... | |
| Xapian::docid | modify_shortcut_docid |
| The document ID for the last document returned by open_document(). More... | |
Additional Inherited Members | |
Public Types inherited from Xapian::Database::Internal | |
| typedef Xapian::doccount | size_type |
Static Public Member Functions inherited from GlassDatabase | |
| static void | compact (Xapian::Compactor *compactor, const char *destdir, int fd, const std::vector< const Xapian::Database::Internal * > &sources, const std::vector< Xapian::docid > &offset, unsigned block_size, Xapian::Compactor::compaction_level compaction, unsigned flags, Xapian::docid last_docid) |
Public Attributes inherited from Xapian::Internal::intrusive_base | |
| unsigned | _refs |
| Reference count. More... | |
Protected Types inherited from Xapian::Database::Internal | |
| enum | transaction_state { TRANSACTION_READONLY = -2 , TRANSACTION_UNIMPLEMENTED = -1 , TRANSACTION_NONE = 0 , TRANSACTION_UNFLUSHED = 1 , TRANSACTION_FLUSHED = 2 } |
| Transaction state enum. More... | |
Protected Member Functions inherited from Xapian::Database::Internal | |
| Internal (transaction_state transaction_support) | |
| Only constructable as a base class for derived classes. More... | |
| bool | is_read_only () const |
| Test if this shard is read-only. More... | |
| bool | transaction_active () const |
| Test if a transaction is currently active. More... | |
| void | dtor_called () |
| Helper to process uncommitted changes when a writable db is destroyed. More... | |
Protected Attributes inherited from Xapian::Database::Internal | |
| transaction_state | state |
| Current transaction state. More... | |
A writable glass database.
Definition at line 341 of file glass_database.h.
| GlassWritableDatabase::GlassWritableDatabase | ( | std::string_view | dir, |
| int | flags, | ||
| int | block_size | ||
| ) |
Create and open a writable glass database.
| Xapian::DatabaseOpeningError | thrown if database can't be opened. |
| Xapian::DatabaseVersionError | thrown if database is in an unsupported format. This implies that the database was created by an older or newer version of Xapian. |
| dir | directory holding glass tables |
Definition at line 1068 of file glass_database.cc.
References flush_threshold, LOGCALL_CTOR, p, and parse_unsigned().
| GlassWritableDatabase::~GlassWritableDatabase | ( | ) |
Definition at line 1089 of file glass_database.cc.
References Xapian::Database::Internal::dtor_called(), and LOGCALL_DTOR.
|
privatevirtual |
Reimplemented from Xapian::Database::Internal.
Definition at line 1153 of file glass_database.cc.
References add_document_(), GlassVersion::get_last_docid(), GlassVersion::get_next_docid(), GLASS_MAX_DOCID, LOGCALL, RETURN, and GlassDatabase::version_file.
|
private |
Definition at line 1164 of file glass_database.cc.
References GlassValueManager::add_document(), GlassVersion::add_document(), Inverter::add_posting(), Assert, cancel(), check_flush_threshold(), GlassVersion::check_wdf(), GlassDatabase::docdata_table, Xapian::Document::get_data(), inverter, GlassTable::is_open(), LOGCALL, LOGLINE, MAX_SAFE_TERM_LENGTH, GlassDatabase::position_table, GlassDocDataTable::replace_document_data(), RETURN, Inverter::set_doclength(), Inverter::set_positionlist(), GlassTermListTable::set_termlist(), STRINGIZE, term, Xapian::Document::termlist_begin(), Xapian::Document::termlist_end(), GlassDatabase::termlist_table, GlassDatabase::value_manager, value_stats, and GlassDatabase::version_file.
Referenced by add_document(), and replace_document().
|
virtual |
Add a word to the spelling dictionary.
If the word is already present, its frequency is increased.
| word | The word to add. |
| freqinc | How much to increase its frequency by. |
Reimplemented from Xapian::Database::Internal.
Definition at line 1666 of file glass_database.cc.
References GlassSpellingTable::add_word(), and GlassDatabase::spelling_table.
|
virtual |
Add a synonym for a term.
If synonym is already a synonym for term, then no action is taken.
Reimplemented from Xapian::Database::Internal.
Definition at line 1694 of file glass_database.cc.
References GlassSynonymTable::add_synonym(), GlassDatabase::synonym_table, and term.
|
private |
Apply changes.
Definition at line 1146 of file glass_database.cc.
References GlassDatabase::apply(), GlassValueManager::set_value_stats(), GlassDatabase::value_manager, and value_stats.
Referenced by check_flush_threshold(), and commit().
|
privatevirtual |
Cancel pending modifications to the database.
Reimplemented from GlassDatabase.
Definition at line 1657 of file glass_database.cc.
References GlassDatabase::cancel(), change_count, Inverter::clear(), inverter, and value_stats.
Referenced by add_document_(), delete_document(), flush_postlist_changes(), and replace_document().
|
private |
Check if we should autoflush.
Called at the end of each document changing operation.
Definition at line 1105 of file glass_database.cc.
References apply(), change_count, flush_postlist_changes(), flush_threshold, and Xapian::Database::Internal::transaction_active().
Referenced by add_document_(), delete_document(), and replace_document().
|
virtual |
Clear all synonyms for a term.
If term has no synonyms, no action is taken.
Reimplemented from Xapian::Database::Internal.
Definition at line 1708 of file glass_database.cc.
References GlassSynonymTable::clear_synonyms(), GlassDatabase::synonym_table, and term.
|
privatevirtual |
Close all the tables permanently.
Reimplemented from GlassDatabase.
Definition at line 1135 of file glass_database.cc.
References GlassDatabase::close(), commit(), LOGCALL_VOID, and Xapian::Database::Internal::transaction_active().
Referenced by update_lock().
|
privatevirtual |
Implementation of virtual methods: see Database::Internal for details.
Reimplemented from Xapian::Database::Internal.
Definition at line 1096 of file glass_database.cc.
References apply(), change_count, flush_postlist_changes(), and Xapian::Database::Internal::transaction_active().
Referenced by close().
|
privatevirtual |
Reimplemented from Xapian::Database::Internal.
Definition at line 1217 of file glass_database.cc.
References Assert, cancel(), check_flush_threshold(), Inverter::delete_doclength(), GlassValueManager::delete_document(), GlassVersion::delete_document(), GlassDocDataTable::delete_document_data(), Inverter::delete_positionlist(), GlassTermListTable::delete_termlist(), GlassDatabase::docdata_table, GlassTermList::get_doclength(), get_doclength(), Xapian::TermIterator::Internal::get_termname(), GlassTermList::get_wdf(), inverter, GlassTable::is_open(), LOGCALL_VOID, modify_shortcut_docid, modify_shortcut_document, GlassTermList::next(), rare, Inverter::remove_posting(), GlassDatabase::termlist_table, GlassDatabase::throw_termlist_table_close_exception(), GlassDatabase::value_manager, value_stats, and GlassDatabase::version_file.
|
private |
Flush any unflushed postlist changes, but don't commit them.
Definition at line 1117 of file glass_database.cc.
References cancel(), change_count, GlassDatabase::changes, Inverter::flush(), Inverter::flush_pos_lists(), GlassChanges::get_oldest_changeset(), inverter, GlassDatabase::position_table, GlassDatabase::postlist_table, GlassVersion::set_oldest_changeset(), and GlassDatabase::version_file.
Referenced by check_flush_threshold(), and commit().
|
virtual |
Virtual methods of Database::Internal.
Reimplemented from GlassDatabase.
Definition at line 1451 of file glass_database.cc.
References GlassDatabase::get_doclength(), Inverter::get_doclength(), inverter, LOGCALL, and RETURN.
Referenced by delete_document().
|
virtual |
Returns frequencies for a term.
| term | The term to get frequencies for |
| termfreq_ptr | Point to return number of docs indexed by term (or NULL not to return) |
| collfreq_ptr | Point to return number of occurrences of term in the database (or NULL not to return) |
Reimplemented from GlassDatabase.
Definition at line 1480 of file glass_database.cc.
References Assert, Inverter::get_deltas(), GlassDatabase::get_freqs(), inverter, LOGCALL_VOID, term, and UNSIGNED_OVERFLOW_OK.
Referenced by term_exists().
|
virtual |
Get the number of unique terms in document.
| did | The document id of the document to return this value for. |
Reimplemented from GlassDatabase.
Definition at line 1461 of file glass_database.cc.
References Assert, GlassTermList::get_approx_size(), Inverter::get_doclength(), GlassDatabase::get_unique_terms(), inverter, LOGCALL, and RETURN.
|
virtual |
Return the frequency of a given value slot.
This is the number of documents which have a (non-empty) value stored in the slot.
| slot | The value slot to examine. |
Reimplemented from GlassDatabase.
Definition at line 1497 of file glass_database.cc.
References GlassDatabase::get_value_freq(), LOGCALL, RETURN, and value_stats.
|
virtual |
Get a lower bound on the values stored in the given value slot.
If there are no values stored in the given value slot, this will return an empty string.
| slot | The value slot to examine. |
Reimplemented from GlassDatabase.
Definition at line 1507 of file glass_database.cc.
References GlassDatabase::get_value_lower_bound(), LOGCALL, RETURN, and value_stats.
|
virtual |
Get an upper bound on the values stored in the given value slot.
If there are no values stored in the given value slot, this will return an empty string.
| slot | The value slot to examine. |
Reimplemented from GlassDatabase.
Definition at line 1517 of file glass_database.cc.
References GlassDatabase::get_value_upper_bound(), LOGCALL, RETURN, and value_stats.
|
virtual |
Check whether this database contains any positional information.
Reimplemented from GlassDatabase.
Definition at line 1539 of file glass_database.cc.
References Inverter::has_positions(), inverter, and GlassDatabase::position_table.
|
virtual |
Return true if there are uncommitted changes.
Reimplemented from GlassDatabase.
Definition at line 1736 of file glass_database.cc.
References change_count, GlassDatabase::docdata_table, GlassSpellingTable::is_modified(), GlassSynonymTable::is_modified(), GlassTable::is_modified(), GlassValueManager::is_modified(), GlassDatabase::position_table, GlassDatabase::postlist_table, GlassDatabase::spelling_table, GlassDatabase::synonym_table, GlassDatabase::termlist_table, and GlassDatabase::value_manager.
|
virtual |
Notify the database that document is no longer valid.
This is used to invalidate references to a document kept by a database for doing lazy updates. If we moved to using a weak_ptr instead we wouldn't need a special method for this, but it would involve a fair bit of reorganising of other parts of the code.
Reimplemented from Xapian::Database::Internal.
Definition at line 1727 of file glass_database.cc.
References modify_shortcut_docid, and modify_shortcut_document.
|
virtual |
Reimplemented from GlassDatabase.
Definition at line 1637 of file glass_database.cc.
References change_count, Inverter::flush_post_lists(), inverter, LOGCALL, GlassDatabase::open_allterms(), GlassDatabase::postlist_table, and RETURN.
|
privatevirtual |
Open a handle on a document.
The returned handle provides access to document data and document values.
| did | The document id to open. |
| lazy | If true, there's no need to check that this document actually exists (only a hint - the backend may still check). Used to avoid unnecessary work when we already know that the requested document exists. |
Reimplemented from GlassDatabase.
Definition at line 1440 of file glass_database.cc.
References LOGCALL, modify_shortcut_docid, modify_shortcut_document, GlassDatabase::open_document(), and RETURN.
|
virtual |
Create a LeafPostList for use during a match.
| term | The term to open a postlist for, or the empty string to create an all-docs postlist. |
| need_read_pos | Does the postlist need to support read_position_list()? Note that open_position_list() may still be called even if need_read_pos is false. |
Reimplemented from GlassDatabase.
Definition at line 1552 of file glass_database.cc.
References Assert, Inverter::flush_doclengths(), Inverter::flush_post_list(), GlassDatabase::get_doccount(), GlassVersion::get_last_docid(), GlassDatabase::GlassAllDocsPostList, GlassDatabase::GlassPostList, inverter, LOGCALL, GlassDatabase::postlist_table, rare, RETURN, term, and GlassDatabase::version_file.
Referenced by open_post_list().
|
virtual |
Reimplemented from GlassDatabase.
Definition at line 1624 of file glass_database.cc.
References Assert, Inverter::get_positionlist(), inverter, GlassDatabase::open_position_list(), and term.
|
virtual |
Return a PostList suitable for use in a PostingIterator.
Reimplemented from GlassDatabase.
Definition at line 1545 of file glass_database.cc.
References LOGCALL, open_leaf_post_list(), RETURN, and term.
|
virtual |
Return a termlist which returns the words which are spelling correction targets.
If there are no spelling correction targets, returns NULL.
Reimplemented from GlassDatabase.
Definition at line 1680 of file glass_database.cc.
References GlassSpellingTable::merge_changes(), GlassDatabase::open_spelling_wordlist(), and GlassDatabase::spelling_table.
|
virtual |
Open a termlist returning each term which has synonyms.
| prefix | If non-empty, only terms with this prefix are returned. |
Reimplemented from GlassDatabase.
Definition at line 1687 of file glass_database.cc.
References GlassSynonymTable::merge_changes(), GlassDatabase::open_synonym_keylist(), and GlassDatabase::synonym_table.
|
virtual |
Open a value stream.
This returns the value in a particular slot for each document.
| slot | The value slot. |
Reimplemented from GlassDatabase.
Definition at line 1585 of file glass_database.cc.
References change_count, LOGCALL, GlassValueManager::merge_changes(), GlassDatabase::open_value_list(), RETURN, and GlassDatabase::value_manager.
|
virtual |
Reimplemented from GlassDatabase.
Definition at line 1610 of file glass_database.cc.
References Assert, Inverter::get_positionlist(), inverter, GlassDatabase::position_table, GlassPositionListTable::positionlist_count(), GlassDatabase::positionlist_count(), and term.
|
virtual |
Reimplemented from GlassDatabase.
Definition at line 1596 of file glass_database.cc.
References Assert, GlassRePositionList::assign_data(), Inverter::get_positionlist(), inverter, GlassDatabase::read_position_list(), and term.
|
virtual |
Remove a word from the spelling dictionary.
The word's frequency is decreased, and if would become zero or less then the word is removed completely.
| word | The word to remove. |
| freqdec | How much to decrease its frequency by. |
Reimplemented from Xapian::Database::Internal.
Definition at line 1673 of file glass_database.cc.
References GlassSpellingTable::remove_word(), and GlassDatabase::spelling_table.
|
virtual |
Remove a synonym for a term.
If synonym isn't a synonym for term, then no action is taken.
Reimplemented from Xapian::Database::Internal.
Definition at line 1701 of file glass_database.cc.
References GlassSynonymTable::remove_synonym(), GlassDatabase::synonym_table, and term.
|
privatevirtual |
Reimplemented from Xapian::Database::Internal.
Definition at line 1278 of file glass_database.cc.
References GlassVersion::add_document(), add_document_(), Inverter::add_posting(), Assert, cancel(), check_flush_threshold(), GlassVersion::check_wdf(), GlassVersion::delete_document(), Inverter::delete_positionlist(), GlassDatabase::docdata_table, GlassPostListTable::document_exists(), Xapian::Internal::intrusive_ptr_nonnull< T >::get(), Xapian::Document::get_data(), GlassTermList::get_doclength(), GlassVersion::get_last_docid(), Xapian::TermIterator::Internal::get_termname(), GlassTermList::get_wdf(), Xapian::Document::internal, inverter, GlassTable::is_open(), LOGCALL_VOID, LOGLINE, MAX_SAFE_TERM_LENGTH, modify_shortcut_docid, modify_shortcut_document, GlassTermList::next(), GlassTermList::not_present(), GlassDatabase::position_table, GlassDatabase::postlist_table, Inverter::remove_posting(), GlassValueManager::replace_document(), GlassDocDataTable::replace_document_data(), Inverter::set_doclength(), GlassVersion::set_last_docid(), Inverter::set_positionlist(), GlassTermListTable::set_termlist(), STRINGIZE, term, Xapian::Document::termlist_begin(), Xapian::Document::termlist_end(), GlassDatabase::termlist_table, GlassDatabase::throw_termlist_table_close_exception(), Inverter::update_posting(), GlassDatabase::value_manager, value_stats, and GlassDatabase::version_file.
|
virtual |
Set the metadata associated with a given key.
See WritableDatabase::set_metadata() for more information.
Reimplemented from Xapian::Database::Internal.
Definition at line 1714 of file glass_database.cc.
References GlassTable::add(), GlassTable::del(), LOGCALL_VOID, and GlassDatabase::postlist_table.
|
virtual |
Reimplemented from GlassDatabase.
Definition at line 1527 of file glass_database.cc.
References GlassDatabase::get_doccount(), get_freqs(), LOGCALL, RETURN, and term.
|
virtual |
Lock a read-only database for writing or unlock a writable database.
This is the internal method behind Database::lock() and Database::unlock().
In the unlocking case, the writable database is closed. In the locking case, the read-only database is left open.
| flags | Xapian::DB_READONLY_ to unlock, otherwise the flags to use when opening from writing. |
Reimplemented from GlassDatabase.
Definition at line 1749 of file glass_database.cc.
References close(), GlassDatabase::db_dir, GlassDatabase::docdata_table, GlassDatabase::GlassDatabase(), GlassTable::is_open(), GlassDatabase::position_table, GlassDatabase::postlist_table, GlassTable::set_flags(), GlassDatabase::spelling_table, GlassDatabase::synonym_table, GlassDatabase::termlist_table, and GlassTable::throw_database_closed().
|
mutableprivate |
The number of documents added, deleted, or replaced since the last flush.
Definition at line 349 of file glass_database.h.
Referenced by cancel(), check_flush_threshold(), commit(), flush_postlist_changes(), has_uncommitted_changes(), open_allterms(), and open_value_list().
|
private |
If change_count reaches this threshold we automatically flush.
Definition at line 352 of file glass_database.h.
Referenced by check_flush_threshold(), and GlassWritableDatabase().
|
mutableprivate |
Definition at line 342 of file glass_database.h.
Referenced by add_document_(), cancel(), delete_document(), flush_postlist_changes(), get_doclength(), get_freqs(), get_unique_terms(), has_positions(), open_allterms(), open_leaf_post_list(), open_position_list(), positionlist_count(), read_position_list(), and replace_document().
|
mutableprivate |
The document ID for the last document returned by open_document().
Definition at line 364 of file glass_database.h.
Referenced by delete_document(), invalidate_doc_object(), open_document(), and replace_document().
|
mutableprivate |
A pointer to the last document which was returned by open_document(), or NULL if there is no such valid document.
This is used purely for comparing with a supplied document to help with optimising replace_document. When the document internals are deleted, this pointer gets set to NULL.
Definition at line 360 of file glass_database.h.
Referenced by delete_document(), invalidate_doc_object(), open_document(), and replace_document().
|
mutableprivate |
Definition at line 344 of file glass_database.h.
Referenced by add_document_(), apply(), cancel(), delete_document(), get_value_freq(), get_value_lower_bound(), get_value_upper_bound(), and replace_document().