xapian-core
1.4.27
|
PostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk, taking care of the messy details. More...
Public Member Functions | |
PostlistChunkWriter (const string &orig_key_, bool is_first_chunk_, const string &tname_, bool is_last_chunk_) | |
void | append (ChertTable *table, Xapian::docid did, Xapian::termcount wdf) |
Append an entry to this chunk. More... | |
void | raw_append (Xapian::docid first_did_, Xapian::docid current_did_, const string &s) |
Append a block of raw entries to this chunk. More... | |
void | flush (ChertTable *table) |
Flush the chunk to the buffered table. More... | |
Private Attributes | |
string | orig_key |
string | tname |
bool | is_first_chunk |
bool | is_last_chunk |
bool | started |
Xapian::docid | first_did |
Xapian::docid | current_did |
string | chunk |
PostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk, taking care of the messy details.
It's intended to be used with deletion and replacing of entries, not for adding to the end, when it's not really needed.
Definition at line 93 of file chert_postlist.cc.
PostlistChunkWriter::PostlistChunkWriter | ( | const string & | orig_key_, |
bool | is_first_chunk_, | ||
const string & | tname_, | ||
bool | is_last_chunk_ | ||
) |
Definition at line 305 of file chert_postlist.cc.
References LOGCALL_CTOR.
void PostlistChunkWriter::append | ( | ChertTable * | table, |
Xapian::docid | did, | ||
Xapian::termcount | wdf | ||
) |
Append an entry to this chunk.
Definition at line 318 of file chert_postlist.cc.
References Assert, chunk, CHUNKSIZE, current_did, first_did, flush(), is_first_chunk, is_last_chunk, ChertPostListTable::make_key(), orig_key, pack_uint(), started, and tname.
Referenced by ChertPostListTable::merge_changes().
void PostlistChunkWriter::flush | ( | ChertTable * | table | ) |
Flush the chunk to the buffered table.
Note: this may write it with a different key to the original one, if for example the first entry has changed.
Definition at line 389 of file chert_postlist.cc.
References ChertTable::add(), Assert, C_unpack_uint_preserving_sort(), check_tname_in_key(), chunk, current_did, ChertTable::cursor_get(), ChertTable::del(), first_did, ChertTable::get_exact_entry(), is_first_chunk, is_last_chunk, LOGCALL_VOID, LOGLINE, ChertPostListTable::make_key(), make_start_of_chunk(), make_start_of_first_chunk(), orig_key, read_start_of_chunk(), read_start_of_first_chunk(), report_read_error(), started, tname, and write_start_of_chunk().
Referenced by append(), and ChertPostListTable::merge_changes().
|
inline |
Append a block of raw entries to this chunk.
Definition at line 105 of file chert_postlist.cc.
References Assert.
|
private |
Definition at line 132 of file chert_postlist.cc.
Referenced by append(), flush(), make_start_of_chunk(), and make_start_of_first_chunk().
|
private |
Definition at line 130 of file chert_postlist.cc.
|
private |
Definition at line 129 of file chert_postlist.cc.
|
private |
Definition at line 125 of file chert_postlist.cc.
|
private |
Definition at line 126 of file chert_postlist.cc.
|
private |
Definition at line 123 of file chert_postlist.cc.
|
private |
Definition at line 127 of file chert_postlist.cc.
|
private |
Definition at line 124 of file chert_postlist.cc.