xapian-core
1.4.26
|
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 (GlassTable *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 (GlassTable *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 234 of file glass_postlist.cc.
PostlistChunkWriter::PostlistChunkWriter | ( | const string & | orig_key_, |
bool | is_first_chunk_, | ||
const string & | tname_, | ||
bool | is_last_chunk_ | ||
) |
Definition at line 334 of file glass_postlist.cc.
References LOGCALL_CTOR.
void PostlistChunkWriter::append | ( | GlassTable * | table, |
Xapian::docid | did, | ||
Xapian::termcount | wdf | ||
) |
Append an entry to this chunk.
Definition at line 347 of file glass_postlist.cc.
References Assert, chunk, CHUNKSIZE, current_did, first_did, flush(), is_first_chunk, is_last_chunk, GlassPostListTable::make_key(), orig_key, pack_uint(), started, and tname.
Referenced by GlassPostListTable::merge_changes(), and GlassPostListTable::merge_doclen_changes().
void PostlistChunkWriter::flush | ( | GlassTable * | 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 418 of file glass_postlist.cc.
References GlassTable::add(), Assert, check_tname_in_key(), chunk, current_did, GlassTable::cursor_get(), GlassTable::del(), first_did, GlassTable::get_exact_entry(), is_first_chunk, is_last_chunk, LOGCALL_VOID, LOGLINE, GlassPostListTable::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(), GlassPostListTable::merge_changes(), and GlassPostListTable::merge_doclen_changes().
|
inline |
Append a block of raw entries to this chunk.
Definition at line 246 of file glass_postlist.cc.
References Assert.
|
private |
Definition at line 273 of file glass_postlist.cc.
Referenced by append(), flush(), make_start_of_chunk(), and make_start_of_first_chunk().
|
private |
Definition at line 271 of file glass_postlist.cc.
|
private |
Definition at line 270 of file glass_postlist.cc.
|
private |
Definition at line 266 of file glass_postlist.cc.
|
private |
Definition at line 267 of file glass_postlist.cc.
|
private |
Definition at line 264 of file glass_postlist.cc.
|
private |
Definition at line 268 of file glass_postlist.cc.
|
private |
Definition at line 265 of file glass_postlist.cc.