QPostlistChunkWriter Class Reference

QPostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk, taking care of the messy details. More...

List of all members.

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


Detailed Description

QPostlistChunkWriter 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 59 of file quartz_postlist.cc.


Constructor & Destructor Documentation

QPostlistChunkWriter::QPostlistChunkWriter ( const string &  orig_key_,
bool  is_first_chunk_,
const string &  tname_,
bool  is_last_chunk_ 
)

Definition at line 329 of file quartz_postlist.cc.

References DEBUGCALL.


Member Function Documentation

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().


Member Data Documentation

string QPostlistChunkWriter::orig_key [private]

Definition at line 89 of file quartz_postlist.cc.

Referenced by append(), and flush().

string QPostlistChunkWriter::tname [private]

Definition at line 90 of file quartz_postlist.cc.

Referenced by append(), and flush().

bool QPostlistChunkWriter::is_first_chunk [private]

Definition at line 91 of file quartz_postlist.cc.

Referenced by append(), and flush().

bool QPostlistChunkWriter::is_last_chunk [private]

Definition at line 92 of file quartz_postlist.cc.

Referenced by append(), and flush().

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().

Xapian::docid QPostlistChunkWriter::current_did [private]

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().


The documentation for this class was generated from the following file:
Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.