#include <config.h>
#include "omdebug.h"
#include "quartz_postlist.h"
#include "quartz_utils.h"
#include "bcursor.h"
#include "database.h"
#include "noreturn.h"
#include "utils.h"
Include dependency graph for quartz_postlist.cc:
Go to the source code of this file.
Classes | |
class | QPostlistChunkWriter |
QPostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk, taking care of the messy details. More... | |
class | QPostlistChunkReader |
QPostlistChunkReader is essentially an iterator wrapper around a postlist chunk. More... | |
Functions | |
static void | make_key (const string &tname, Xapian::docid did, string &key) |
Make a key for accessing the postlist. | |
static void | make_key (const string &tname, string &key) |
XAPIAN_NORETURN (static void report_read_error(const char *position)) | |
Report an error when reading the posting list. | |
static void | report_read_error (const char *position) |
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. | |
static void | read_did_increase (const char **posptr, const char *end, Xapian::docid *did_ptr) |
static void | read_wdf_and_length (const char **posptr, const char *end, Xapian::termcount *wdf_ptr, quartz_doclen_t *doclength_ptr) |
Read the wdf and the document length of an item. | |
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. | |
static string | make_wdf_and_length (Xapian::termcount wdf, quartz_doclen_t doclength) |
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 string | make_start_of_first_chunk (Xapian::termcount entries, Xapian::termcount collectionfreq, Xapian::docid new_did) |
Make the data to go at the start of the very first chunk. | |
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. | |
Variables | |
const unsigned int | CHUNKSIZE = 2000 |
static void make_key | ( | const string & | tname, | |
Xapian::docid | did, | |||
string & | key | |||
) | [static] |
Make a key for accessing the postlist.
Definition at line 34 of file quartz_postlist.cc.
References pack_string_preserving_sort(), and pack_uint_preserving_sort().
static void make_key | ( | const string & | tname, | |
string & | key | |||
) | [static] |
XAPIAN_NORETURN | ( | static void | report_read_error(const char *position) | ) |
Report an error when reading the posting list.
static void report_read_error | ( | const char * | position | ) | [static] |
Definition at line 105 of file quartz_postlist.cc.
static bool get_tname_from_key | ( | const char ** | src, | |
const char * | end, | |||
string & | tname | |||
) | [inline, static] |
static bool check_tname_in_key_lite | ( | const char ** | keypos, | |
const char * | keyend, | |||
const string & | tname | |||
) | [inline, static] |
Definition at line 122 of file quartz_postlist.cc.
References get_tname_from_key(), and report_read_error().
static bool check_tname_in_key | ( | const char ** | keypos, | |
const char * | keyend, | |||
const string & | tname | |||
) | [inline, static] |
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 the start of the first chunk in the posting list.
Definition at line 145 of file quartz_postlist.cc.
References DEBUGCALL_STATIC, DEBUGLINE, QuartzPostList::read_number_of_entries(), report_read_error(), RETURN, and unpack_uint().
static void read_did_increase | ( | const char ** | posptr, | |
const char * | end, | |||
Xapian::docid * | did_ptr | |||
) | [inline, static] |
Definition at line 198 of file quartz_postlist.cc.
References report_read_error(), and unpack_uint().
static void read_wdf_and_length | ( | const char ** | posptr, | |
const char * | end, | |||
Xapian::termcount * | wdf_ptr, | |||
quartz_doclen_t * | doclength_ptr | |||
) | [inline, static] |
Read the wdf and the document length of an item.
Definition at line 208 of file quartz_postlist.cc.
References report_read_error(), and unpack_uint().
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 the start of a chunk.
Definition at line 219 of file quartz_postlist.cc.
References DEBUGCALL_STATIC, DEBUGLINE, report_read_error(), RETURN, unpack_bool(), and unpack_uint().
static string make_wdf_and_length | ( | Xapian::termcount | wdf, | |
quartz_doclen_t | doclength | |||
) | [static] |
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] |
static string make_start_of_first_chunk | ( | Xapian::termcount | entries, | |
Xapian::termcount | collectionfreq, | |||
Xapian::docid | new_did | |||
) | [inline, static] |
Make the data to go at the start of the very first chunk.
Definition at line 373 of file quartz_postlist.cc.
References pack_uint().
static string make_start_of_chunk | ( | bool | new_is_last_chunk, | |
Xapian::docid | new_first_did, | |||
Xapian::docid | new_final_did | |||
) | [inline, static] |
Make the data to go at the start of a standard chunk.
Definition at line 383 of file quartz_postlist.cc.
References Assert, pack_bool(), and pack_uint().
const unsigned int CHUNKSIZE = 2000 |
Definition at line 51 of file quartz_postlist.cc.