Public Member Functions | |
QPostlistChunkWriter (const string &orig_key_, bool is_first_chunk_, const string &tname_, bool is_last_chunk_) | |
void | append (Btree *table, Xapian::docid did, Xapian::termcount wdf, quartz_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 (Btree *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 59 of file quartz_postlist.cc.
QPostlistChunkWriter::QPostlistChunkWriter | ( | const string & | orig_key_, | |
bool | is_first_chunk_, | |||
const string & | tname_, | |||
bool | is_last_chunk_ | |||
) |
void QPostlistChunkWriter::append | ( | Btree * | table, | |
Xapian::docid | did, | |||
Xapian::termcount | wdf, | |||
quartz_doclen_t | doclen | |||
) |
Append an entry to this chunk.
Definition at line 344 of file quartz_postlist.cc.
References Assert, chunk, CHUNKSIZE, current_did, first_did, flush(), is_first_chunk, is_last_chunk, make_key(), make_wdf_and_length(), orig_key, pack_uint(), started, and tname.
Referenced by QuartzPostListTable::merge_changes().
void QPostlistChunkWriter::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 71 of file quartz_postlist.cc.
References Assert, chunk, current_did, first_did, and started.
void QPostlistChunkWriter::flush | ( | Btree * | 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 393 of file quartz_postlist.cc.
References Btree::add(), Assert, check_tname_in_key(), chunk, current_did, Btree::cursor_get(), DEBUGCALL, DEBUGLINE, Btree::del(), first_did, Btree::get_exact_entry(), is_first_chunk, is_last_chunk, 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 QuartzPostListTable::merge_changes().
string QPostlistChunkWriter::orig_key [private] |
string QPostlistChunkWriter::tname [private] |
bool QPostlistChunkWriter::is_first_chunk [private] |
bool QPostlistChunkWriter::is_last_chunk [private] |
bool QPostlistChunkWriter::started [private] |
Definition at line 93 of file quartz_postlist.cc.
Referenced by append(), flush(), and raw_append().
Xapian::docid QPostlistChunkWriter::first_did [private] |
Definition at line 95 of file quartz_postlist.cc.
Referenced by append(), flush(), and raw_append().
Definition at line 96 of file quartz_postlist.cc.
Referenced by append(), flush(), and raw_append().
string QPostlistChunkWriter::chunk [private] |
Definition at line 98 of file quartz_postlist.cc.
Referenced by append(), flush(), and raw_append().