xapian-core  1.4.21
Classes | Functions | Variables
glass_postlist.cc File Reference

Postlists in a glass database. More...

#include <config.h>
#include "glass_postlist.h"
#include "glass_cursor.h"
#include "glass_database.h"
#include "debuglog.h"
#include "noreturn.h"
#include "pack.h"
#include "str.h"
#include "unicode/description_append.h"
+ Include dependency graph for glass_postlist.cc:

Go to the source code of this file.

Classes

class  Glass::PostlistChunkWriter
 PostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk, taking care of the messy details. More...
 
class  Glass::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
 

Detailed Description

Postlists in a glass database.

Definition in file glass_postlist.cc.

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 56 of file glass_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_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 376 of file glass_postlist.cc.

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

Referenced by Glass::PostlistChunkWriter::flush(), GlassPostListTable::merge_changes(), and GlassPostListTable::merge_doclen_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 402 of file glass_postlist.cc.

References Assert, and make_start_of_chunk().

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

Variable Documentation

◆ CHUNKSIZE

const unsigned int CHUNKSIZE = 2000

Definition at line 226 of file glass_postlist.cc.

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