PostlistChunkWriter Class Reference

PostlistChunkWriter 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

 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


Detailed Description

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 72 of file flint_postlist.cc.


Constructor & Destructor Documentation

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

Definition at line 317 of file flint_postlist.cc.

References DEBUGCALL.


Member Function Documentation

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


Member Data Documentation

string PostlistChunkWriter::orig_key [private]

Definition at line 102 of file flint_postlist.cc.

Referenced by append(), and flush().

string PostlistChunkWriter::tname [private]

Definition at line 103 of file flint_postlist.cc.

Referenced by append(), and flush().

bool PostlistChunkWriter::is_first_chunk [private]

Definition at line 104 of file flint_postlist.cc.

Referenced by append(), and flush().

bool PostlistChunkWriter::is_last_chunk [private]

Definition at line 105 of file flint_postlist.cc.

Referenced by append(), and flush().

bool PostlistChunkWriter::started [private]

Definition at line 106 of file flint_postlist.cc.

Referenced by append(), and flush().

Xapian::docid PostlistChunkWriter::first_did [private]

Definition at line 108 of file flint_postlist.cc.

Referenced by append(), and flush().

Xapian::docid PostlistChunkWriter::current_did [private]

Definition at line 109 of file flint_postlist.cc.

Referenced by append(), and flush().

string PostlistChunkWriter::chunk [private]

Definition at line 111 of file flint_postlist.cc.

Referenced by append(), and flush().


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.