Public Member Functions | |
PostlistChunkWriter (const string &orig_key_, bool is_first_chunk_, const string &tname_, bool is_last_chunk_) | |
void | append (FlintTable *table, Xapian::docid did, Xapian::termcount wdf, flint_doclen_t doclen) |
Append an entry to this chunk. | |
void | raw_append (Xapian::docid first_did_, Xapian::docid current_did_, const string &s) |
Append a block of raw entries to this chunk. | |
void | flush (FlintTable *table) |
Flush the chunk to the buffered table. | |
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 |
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 72 of file flint_postlist.cc.
PostlistChunkWriter::PostlistChunkWriter | ( | const string & | orig_key_, | |
bool | is_first_chunk_, | |||
const string & | tname_, | |||
bool | is_last_chunk_ | |||
) |
void PostlistChunkWriter::append | ( | FlintTable * | table, | |
Xapian::docid | did, | |||
Xapian::termcount | wdf, | |||
flint_doclen_t | doclen | |||
) |
Append an entry to this chunk.
Definition at line 332 of file flint_postlist.cc.
References Assert, chunk, current_did, first_did, flush(), is_first_chunk, is_last_chunk, FlintPostListTable::make_key(), make_wdf_and_length(), orig_key, pack_uint(), started, and tname.
Referenced by FlintPostListTable::merge_changes().
void PostlistChunkWriter::raw_append | ( | Xapian::docid | first_did_, | |
Xapian::docid | current_did_, | |||
const string & | s | |||
) | [inline] |
Append a block of raw entries to this chunk.
Definition at line 84 of file flint_postlist.cc.
References Assert.
void PostlistChunkWriter::flush | ( | FlintTable * | 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 381 of file flint_postlist.cc.
References FlintTable::add(), Assert, check_tname_in_key(), chunk, current_did, FlintTable::cursor_get(), DEBUGCALL, DEBUGLINE, FlintTable::del(), first_did, FlintTable::get_exact_entry(), is_first_chunk, is_last_chunk, FlintPostListTable::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, unpack_uint_preserving_sort(), and write_start_of_chunk().
Referenced by append(), and FlintPostListTable::merge_changes().
string PostlistChunkWriter::orig_key [private] |
string PostlistChunkWriter::tname [private] |
bool PostlistChunkWriter::is_first_chunk [private] |
bool PostlistChunkWriter::is_last_chunk [private] |
bool PostlistChunkWriter::started [private] |
Xapian::docid PostlistChunkWriter::first_did [private] |
string PostlistChunkWriter::chunk [private] |