xapian-core  1.4.26
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ChertValueManager Class Reference

#include <chert_values.h>

+ Collaboration diagram for ChertValueManager:

Public Member Functions

 ChertValueManager (ChertPostListTable *postlist_table_, ChertTermListTable *termlist_table_)
 Create a new ChertValueManager object. More...
 
void merge_changes ()
 
void add_document (Xapian::docid did, const Xapian::Document &doc, std::map< Xapian::valueno, ValueStats > &value_stats)
 
void delete_document (Xapian::docid did, std::map< Xapian::valueno, ValueStats > &value_stats)
 
void replace_document (Xapian::docid did, const Xapian::Document &doc, std::map< Xapian::valueno, ValueStats > &value_stats)
 
std::string get_value (Xapian::docid did, Xapian::valueno slot) const
 
void get_all_values (std::map< Xapian::valueno, std::string > &values, Xapian::docid did) const
 
Xapian::doccount get_value_freq (Xapian::valueno slot) const
 
std::string get_value_lower_bound (Xapian::valueno slot) const
 
std::string get_value_upper_bound (Xapian::valueno slot) const
 
void set_value_stats (std::map< Xapian::valueno, ValueStats > &value_stats)
 Write the updated statistics to the table. More...
 
void reset ()
 
bool is_modified () const
 
void cancel ()
 

Private Member Functions

void add_value (Xapian::docid did, Xapian::valueno slot, const std::string &val)
 
void remove_value (Xapian::docid did, Xapian::valueno slot)
 
Xapian::docid get_chunk_containing_did (Xapian::valueno slot, Xapian::docid did, std::string &chunk) const
 
void get_value_stats (Xapian::valueno slot) const
 Get the statistics for value slot slot. More...
 
void get_value_stats (Xapian::valueno slot, ValueStats &stats) const
 

Private Attributes

Xapian::valueno mru_slot
 The value number for the most recently used value statistics. More...
 
ValueStats mru_valstats
 The most recently used value statistics. More...
 
ChertPostListTablepostlist_table
 
ChertTermListTabletermlist_table
 
std::map< Xapian::docid, std::string > slots
 
std::map< Xapian::valueno, std::map< Xapian::docid, std::string > > changes
 
AutoPtr< ChertCursorcursor
 

Detailed Description

Definition at line 73 of file chert_values.h.

Constructor & Destructor Documentation

◆ ChertValueManager()

ChertValueManager::ChertValueManager ( ChertPostListTable postlist_table_,
ChertTermListTable termlist_table_ 
)
inline

Create a new ChertValueManager object.

Definition at line 110 of file chert_values.h.

Member Function Documentation

◆ add_document()

void ChertValueManager::add_document ( Xapian::docid  did,
const Xapian::Document doc,
std::map< Xapian::valueno, ValueStats > &  value_stats 
)

◆ add_value()

void ChertValueManager::add_value ( Xapian::docid  did,
Xapian::valueno  slot,
const std::string &  val 
)
private

Definition at line 132 of file chert_values.cc.

◆ cancel()

void ChertValueManager::cancel ( )
inline

Definition at line 166 of file chert_values.h.

Referenced by ChertDatabase::cancel().

◆ delete_document()

void ChertValueManager::delete_document ( Xapian::docid  did,
std::map< Xapian::valueno, ValueStats > &  value_stats 
)

◆ get_all_values()

void ChertValueManager::get_all_values ( std::map< Xapian::valueno, std::string > &  values,
Xapian::docid  did 
) const

◆ get_chunk_containing_did()

Xapian::docid ChertValueManager::get_chunk_containing_did ( Xapian::valueno  slot,
Xapian::docid  did,
std::string &  chunk 
) const
private

◆ get_value()

string ChertValueManager::get_value ( Xapian::docid  did,
Xapian::valueno  slot 
) const

Definition at line 462 of file chert_values.cc.

References ValueChunkReader::skip_to().

Referenced by ChertDocument::do_get_value().

◆ get_value_freq()

Xapian::doccount ChertValueManager::get_value_freq ( Xapian::valueno  slot) const
inline

Definition at line 133 of file chert_values.h.

References ValueStats::freq.

Referenced by ChertDatabase::get_value_freq().

◆ get_value_lower_bound()

std::string ChertValueManager::get_value_lower_bound ( Xapian::valueno  slot) const
inline

Definition at line 138 of file chert_values.h.

References ValueStats::lower_bound.

Referenced by ChertDatabase::get_value_lower_bound().

◆ get_value_stats() [1/2]

void ChertValueManager::get_value_stats ( Xapian::valueno  slot) const
private

Get the statistics for value slot slot.

Definition at line 519 of file chert_values.cc.

References Xapian::BAD_VALUENO, and LOGCALL_VOID.

◆ get_value_stats() [2/2]

void ChertValueManager::get_value_stats ( Xapian::valueno  slot,
ValueStats stats 
) const
private

◆ get_value_upper_bound()

std::string ChertValueManager::get_value_upper_bound ( Xapian::valueno  slot) const
inline

Definition at line 143 of file chert_values.h.

References ValueStats::upper_bound.

Referenced by ChertDatabase::get_value_upper_bound().

◆ is_modified()

bool ChertValueManager::is_modified ( ) const
inline

◆ merge_changes()

void ChertValueManager::merge_changes ( )

◆ remove_value()

void ChertValueManager::remove_value ( Xapian::docid  did,
Xapian::valueno  slot 
)
private

Definition at line 144 of file chert_values.cc.

◆ replace_document()

void ChertValueManager::replace_document ( Xapian::docid  did,
const Xapian::Document doc,
std::map< Xapian::valueno, ValueStats > &  value_stats 
)

Definition at line 449 of file chert_values.cc.

References Xapian::Document::internal.

Referenced by ChertWritableDatabase::replace_document().

◆ reset()

void ChertValueManager::reset ( )
inline

Ignore any old cached valuestats.

Definition at line 157 of file chert_values.h.

References Xapian::BAD_VALUENO.

Referenced by ChertDatabase::open_tables(), and ChertDatabase::open_tables_consistent().

◆ set_value_stats()

void ChertValueManager::set_value_stats ( std::map< Xapian::valueno, ValueStats > &  value_stats)

Write the updated statistics to the table.

If the freq member of the statistics for a particular slot is 0, the statistics for that slot will be cleared.

Parameters
value_statsThe statistics to set.

Definition at line 570 of file chert_values.cc.

References Xapian::BAD_VALUENO, ValueStats::freq, LOGCALL_VOID, ValueStats::lower_bound, make_valuestats_key(), pack_string(), pack_uint(), and ValueStats::upper_bound.

Referenced by ChertWritableDatabase::apply().

Member Data Documentation

◆ changes

std::map<Xapian::valueno, std::map<Xapian::docid, std::string> > ChertValueManager::changes
private

Definition at line 90 of file chert_values.h.

◆ cursor

AutoPtr<ChertCursor> ChertValueManager::cursor
mutableprivate

Definition at line 92 of file chert_values.h.

◆ mru_slot

Xapian::valueno ChertValueManager::mru_slot
mutableprivate

The value number for the most recently used value statistics.

Set to Xapian::BAD_VALUENO if no value statistics are currently cached.

Definition at line 79 of file chert_values.h.

◆ mru_valstats

ValueStats ChertValueManager::mru_valstats
mutableprivate

The most recently used value statistics.

Definition at line 82 of file chert_values.h.

◆ postlist_table

ChertPostListTable* ChertValueManager::postlist_table
private

Definition at line 84 of file chert_values.h.

◆ slots

std::map<Xapian::docid, std::string> ChertValueManager::slots
private

Definition at line 88 of file chert_values.h.

◆ termlist_table

ChertTermListTable* ChertValueManager::termlist_table
private

Definition at line 86 of file chert_values.h.


The documentation for this class was generated from the following files: