xapian-core  1.4.27
Classes | Functions | Variables
chert_postlist.cc File Reference
#include <config.h>
#include "chert_postlist.h"
#include "chert_cursor.h"
#include "chert_database.h"
#include "debuglog.h"
#include "noreturn.h"
#include "pack.h"
#include "str.h"
+ Include dependency graph for chert_postlist.cc:

Go to the source code of this file.

Classes

class  Chert::PostlistChunkWriter
 PostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk, taking care of the messy details. More...
 
class  Chert::PostlistChunkReader
 PostlistChunkReader is essentially an iterator wrapper around a postlist chunk. More...
 

Functions

static void report_read_error (const char *position)
 Report an error when reading the posting list. More...
 
static bool get_tname_from_key (const char **src, const char *end, string &tname)
 
static bool check_tname_in_key_lite (const char **keypos, const char *keyend, const string &tname)
 
static bool check_tname_in_key (const char **keypos, const char *keyend, const string &tname)
 
static Xapian::docid read_start_of_first_chunk (const char **posptr, const char *end, Xapian::doccount *number_of_entries_ptr, Xapian::termcount *collection_freq_ptr)
 Read the start of the first chunk in the posting list. More...
 
static void read_did_increase (const char **posptr, const char *end, Xapian::docid *did_ptr)
 
static void read_wdf (const char **posptr, const char *end, Xapian::termcount *wdf_ptr)
 Read the wdf for an entry. More...
 
static Xapian::docid read_start_of_chunk (const char **posptr, const char *end, Xapian::docid first_did_in_chunk, bool *is_last_chunk_ptr)
 Read the start of a chunk. More...
 
static string make_start_of_first_chunk (Xapian::doccount entries, Xapian::termcount collectionfreq, Xapian::docid new_did)
 Make the data to go at the start of the very first chunk. More...
 
static string make_start_of_chunk (bool new_is_last_chunk, Xapian::docid new_first_did, Xapian::docid new_final_did)
 Make the data to go at the start of a standard chunk. More...
 
static void write_start_of_chunk (string &chunk, unsigned int start_of_chunk_header, unsigned int end_of_chunk_header, bool is_last_chunk, Xapian::docid first_did_in_chunk, Xapian::docid last_did_in_chunk)
 

Variables

const unsigned int CHUNKSIZE = 2000
 

Function Documentation

◆ check_tname_in_key()

static bool check_tname_in_key ( const char **  keypos,
const char *  keyend,
const string &  tname 
)
inlinestatic

◆ check_tname_in_key_lite()

static bool check_tname_in_key_lite ( const char **  keypos,
const char *  keyend,
const string &  tname 
)
inlinestatic

◆ get_tname_from_key()

static bool get_tname_from_key ( const char **  src,
const char *  end,
string &  tname 
)
inlinestatic

Definition at line 153 of file chert_postlist.cc.

References unpack_string_preserving_sort().

Referenced by check_tname_in_key_lite().

◆ make_start_of_chunk()

static string make_start_of_chunk ( bool  new_is_last_chunk,
Xapian::docid  new_first_did,
Xapian::docid  new_final_did 
)
inlinestatic

Make the data to go at the start of a standard chunk.

Definition at line 361 of file chert_postlist.cc.

References Assert, Chert::PostlistChunkWriter::chunk, pack_bool(), and pack_uint().

Referenced by Chert::PostlistChunkWriter::flush(), ChertPostListTable::merge_changes(), and write_start_of_chunk().

◆ make_start_of_first_chunk()

static string make_start_of_first_chunk ( Xapian::doccount  entries,
Xapian::termcount  collectionfreq,
Xapian::docid  new_did 
)
inlinestatic

Make the data to go at the start of the very first chunk.

Definition at line 347 of file chert_postlist.cc.

References Chert::PostlistChunkWriter::chunk, and pack_uint().

Referenced by Chert::PostlistChunkWriter::flush(), and ChertPostListTable::merge_changes().

◆ read_did_increase()

static void read_did_increase ( const char **  posptr,
const char *  end,
Xapian::docid did_ptr 
)
inlinestatic

◆ read_start_of_chunk()

static Xapian::docid read_start_of_chunk ( const char **  posptr,
const char *  end,
Xapian::docid  first_did_in_chunk,
bool *  is_last_chunk_ptr 
)
static

◆ read_start_of_first_chunk()

static Xapian::docid read_start_of_first_chunk ( const char **  posptr,
const char *  end,
Xapian::doccount number_of_entries_ptr,
Xapian::termcount collection_freq_ptr 
)
static

◆ read_wdf()

static void read_wdf ( const char **  posptr,
const char *  end,
Xapian::termcount wdf_ptr 
)
inlinestatic

◆ report_read_error()

static void report_read_error ( const char *  position)
static

◆ write_start_of_chunk()

static void write_start_of_chunk ( string &  chunk,
unsigned int  start_of_chunk_header,
unsigned int  end_of_chunk_header,
bool  is_last_chunk,
Xapian::docid  first_did_in_chunk,
Xapian::docid  last_did_in_chunk 
)
static

Definition at line 373 of file chert_postlist.cc.

References Assert, and make_start_of_chunk().

Referenced by Chert::PostlistChunkWriter::flush().

Variable Documentation

◆ CHUNKSIZE

const unsigned int CHUNKSIZE = 2000

Definition at line 85 of file chert_postlist.cc.

Referenced by Chert::PostlistChunkWriter::append().