#include <config.h>#include "flint_postlist.h"#include "flint_cursor.h"#include "flint_database.h"#include "flint_utils.h"#include "debuglog.h"#include "noreturn.h"#include "str.h"

Go to the source code of this file.
Classes | |
| class | FlintPostlistChunkWriter |
| FlintPostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk, taking care of the messy details. More... | |
| class | FlintPostlistChunkReader |
| FlintPostlistChunkReader 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::doccount 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 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 FlintPostlistChunkWriter::flush(), and FlintPostListTable::get_chunk().
| 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(), FlintPostListTable::merge_changes(), FlintPostList::move_to_chunk_containing(), and FlintPostList::next_chunk().
| 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 F_unpack_string_preserving_sort().
Referenced by check_tname_in_key_lite().
| 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 361 of file flint_postlist.cc.
References Assert, F_pack_bool(), and F_pack_uint().
Referenced by FlintPostlistChunkWriter::flush(), and FlintPostListTable::merge_changes().
| static string make_start_of_first_chunk | ( | Xapian::doccount | 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 351 of file flint_postlist.cc.
References F_pack_uint().
Referenced by FlintPostlistChunkWriter::flush(), and FlintPostListTable::merge_changes().
| static string make_wdf_and_length | ( | Xapian::termcount | wdf, | |
| flint_doclen_t | doclength | |||
| ) | [static] |
Definition at line 225 of file flint_postlist.cc.
References F_pack_uint().
Referenced by FlintPostlistChunkWriter::append().
| static void read_did_increase | ( | const char ** | posptr, | |
| const char * | end, | |||
| Xapian::docid * | did_ptr | |||
| ) | [inline, static] |
Definition at line 181 of file flint_postlist.cc.
References F_unpack_uint(), and report_read_error().
Referenced by FlintPostlistChunkReader::next(), and FlintPostList::next_in_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 the start of a chunk.
Definition at line 202 of file flint_postlist.cc.
References F_unpack_bool(), F_unpack_uint(), LOGCALL_STATIC, LOGVALUE, report_read_error(), and RETURN.
Referenced by FlintPostList::FlintPostList(), FlintPostlistChunkWriter::flush(), FlintPostListTable::get_chunk(), FlintPostListTable::merge_changes(), FlintPostList::move_to_chunk_containing(), and FlintPostList::next_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 F_unpack_uint(), LOGCALL_STATIC, LOGVALUE, FlintPostList::read_number_of_entries(), report_read_error(), and RETURN.
Referenced by FlintPostList::FlintPostList(), FlintPostlistChunkWriter::flush(), FlintPostListTable::get_chunk(), FlintPostListTable::merge_changes(), and FlintPostList::move_to_chunk_containing().
| 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 191 of file flint_postlist.cc.
References F_unpack_uint(), and report_read_error().
Referenced by FlintPostList::FlintPostList(), FlintPostlistChunkReader::FlintPostlistChunkReader(), FlintPostList::move_to_chunk_containing(), FlintPostlistChunkReader::next(), FlintPostList::next_chunk(), and FlintPostList::next_in_chunk().
| 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(), FlintPostlistChunkWriter::flush(), FlintPostListTable::get_chunk(), FlintPostList::move_to_chunk_containing(), FlintPostList::next_chunk(), read_did_increase(), FlintPostList::read_number_of_entries(), read_start_of_chunk(), read_start_of_first_chunk(), and read_wdf_and_length().
| 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 230 of file flint_postlist.cc.
References Assert, F_pack_bool(), and F_pack_uint().
Referenced by FlintPostlistChunkWriter::flush().
| XAPIAN_NORETURN | ( | static void | report_read_errorconst char *position | ) |
Report an error when reading the posting list.
| const unsigned int CHUNKSIZE = 2000 |
Definition at line 64 of file flint_postlist.cc.