#include <config.h>
#include "flint_postlist.h"
#include "flint_cursor.h"
#include "flint_database.h"
#include "flint_utils.h"
#include "noreturn.h"
#include "omdebug.h"
#include "utils.h"
Include dependency graph for flint_postlist.cc:
Go to the source code of this file.
Classes | |
class | PostlistChunkWriter |
PostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk, taking care of the messy details. More... | |
class | PostlistChunkReader |
PostlistChunkReader is essentially an iterator wrapper around a postlist chunk. More... | |
Functions | |
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, flint_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, flint_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 |
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 118 of file flint_postlist.cc.
Referenced by check_tname_in_key_lite(), QPostlistChunkWriter::flush(), PostlistChunkWriter::flush(), QuartzPostListTable::get_chunk(), FlintPostListTable::get_chunk(), QuartzPostList::move_to_chunk_containing(), FlintPostList::move_to_chunk_containing(), QuartzPostList::next_chunk(), FlintPostList::next_chunk(), read_did_increase(), QuartzPostList::read_number_of_entries(), FlintPostList::read_number_of_entries(), read_start_of_chunk(), read_start_of_first_chunk(), and read_wdf_and_length().
static bool get_tname_from_key | ( | const char ** | src, | |
const char * | end, | |||
string & | tname | |||
) | [inline, static] |
Definition at line 128 of file flint_postlist.cc.
References unpack_string_preserving_sort().
Referenced by check_tname_in_key_lite().
static bool check_tname_in_key_lite | ( | const char ** | keypos, | |
const char * | keyend, | |||
const string & | tname | |||
) | [inline, static] |
Definition at line 135 of file flint_postlist.cc.
References get_tname_from_key(), and report_read_error().
Referenced by check_tname_in_key(), QuartzPostListTable::merge_changes(), FlintPostListTable::merge_changes(), QuartzPostList::move_to_chunk_containing(), FlintPostList::move_to_chunk_containing(), QuartzPostList::next_chunk(), and FlintPostList::next_chunk().
static bool check_tname_in_key | ( | const char ** | keypos, | |
const char * | keyend, | |||
const string & | tname | |||
) | [inline, static] |
Definition at line 149 of file flint_postlist.cc.
References check_tname_in_key_lite().
Referenced by QPostlistChunkWriter::flush(), PostlistChunkWriter::flush(), QuartzPostListTable::get_chunk(), and FlintPostListTable::get_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 the start of the first chunk in the posting list.
Definition at line 158 of file flint_postlist.cc.
References DEBUGCALL_STATIC, DEBUGLINE, FlintPostList::read_number_of_entries(), report_read_error(), RETURN, and unpack_uint().
Referenced by FlintPostList::FlintPostList(), QPostlistChunkWriter::flush(), PostlistChunkWriter::flush(), QuartzPostListTable::get_chunk(), FlintPostListTable::get_chunk(), QuartzPostListTable::merge_changes(), FlintPostListTable::merge_changes(), QuartzPostList::move_to_chunk_containing(), FlintPostList::move_to_chunk_containing(), and QuartzPostList::QuartzPostList().
static void read_did_increase | ( | const char ** | posptr, | |
const char * | end, | |||
Xapian::docid * | did_ptr | |||
) | [inline, static] |
Definition at line 185 of file flint_postlist.cc.
References report_read_error(), and unpack_uint().
Referenced by QPostlistChunkReader::next(), PostlistChunkReader::next(), QuartzPostList::next_in_chunk(), and FlintPostList::next_in_chunk().
static void read_wdf_and_length | ( | const char ** | posptr, | |
const char * | end, | |||
Xapian::termcount * | wdf_ptr, | |||
flint_doclen_t * | doclength_ptr | |||
) | [inline, static] |
Read the wdf and the document length of an item.
Definition at line 195 of file flint_postlist.cc.
References report_read_error(), and unpack_uint().
Referenced by FlintPostList::FlintPostList(), QuartzPostList::move_to_chunk_containing(), FlintPostList::move_to_chunk_containing(), QPostlistChunkReader::next(), PostlistChunkReader::next(), QuartzPostList::next_chunk(), FlintPostList::next_chunk(), QuartzPostList::next_in_chunk(), FlintPostList::next_in_chunk(), PostlistChunkReader::PostlistChunkReader(), QPostlistChunkReader::QPostlistChunkReader(), and QuartzPostList::QuartzPostList().
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 206 of file flint_postlist.cc.
References DEBUGCALL_STATIC, DEBUGLINE, report_read_error(), RETURN, unpack_bool(), and unpack_uint().
Referenced by FlintPostList::FlintPostList(), QPostlistChunkWriter::flush(), PostlistChunkWriter::flush(), QuartzPostListTable::get_chunk(), FlintPostListTable::get_chunk(), QuartzPostListTable::merge_changes(), FlintPostListTable::merge_changes(), QuartzPostList::move_to_chunk_containing(), FlintPostList::move_to_chunk_containing(), QuartzPostList::next_chunk(), FlintPostList::next_chunk(), and QuartzPostList::QuartzPostList().
static string make_wdf_and_length | ( | Xapian::termcount | wdf, | |
flint_doclen_t | doclength | |||
) | [static] |
Definition at line 233 of file flint_postlist.cc.
References pack_uint().
Referenced by QPostlistChunkWriter::append(), and PostlistChunkWriter::append().
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 238 of file flint_postlist.cc.
References Assert, pack_bool(), and pack_uint().
Referenced by QPostlistChunkWriter::flush(), and PostlistChunkWriter::flush().
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 361 of file flint_postlist.cc.
References pack_uint().
Referenced by QPostlistChunkWriter::flush(), PostlistChunkWriter::flush(), QuartzPostListTable::merge_changes(), and FlintPostListTable::merge_changes().
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 371 of file flint_postlist.cc.
References Assert, pack_bool(), and pack_uint().
Referenced by QPostlistChunkWriter::flush(), PostlistChunkWriter::flush(), QuartzPostListTable::merge_changes(), and FlintPostListTable::merge_changes().
const unsigned int CHUNKSIZE = 2000 |