xapian-core  1.4.27
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GlassValueManager Class Reference

#include <glass_values.h>

+ Collaboration diagram for GlassValueManager:

Public Member Functions

 GlassValueManager (GlassPostListTable *postlist_table_, GlassTermListTable *termlist_table_)
 Create a new GlassValueManager 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...
 
GlassPostListTablepostlist_table
 
GlassTermListTabletermlist_table
 
std::map< Xapian::docid, std::string > slots
 
std::map< Xapian::valueno, std::map< Xapian::docid, std::string > > changes
 
AutoPtr< GlassCursorcursor
 

Detailed Description

Definition at line 77 of file glass_values.h.

Constructor & Destructor Documentation

◆ GlassValueManager()

GlassValueManager::GlassValueManager ( GlassPostListTable postlist_table_,
GlassTermListTable termlist_table_ 
)
inline

Create a new GlassValueManager object.

Definition at line 114 of file glass_values.h.

Member Function Documentation

◆ add_document()

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

◆ add_value()

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

Definition at line 133 of file glass_values.cc.

◆ cancel()

void GlassValueManager::cancel ( )
inline

Definition at line 170 of file glass_values.h.

Referenced by GlassDatabase::cancel().

◆ delete_document()

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

◆ get_all_values()

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

◆ get_chunk_containing_did()

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

◆ get_value()

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

Definition at line 472 of file glass_values.cc.

References Glass::ValueChunkReader::skip_to().

Referenced by GlassDocument::do_get_value().

◆ get_value_freq()

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

Definition at line 137 of file glass_values.h.

References ValueStats::freq.

Referenced by GlassDatabase::get_value_freq().

◆ get_value_lower_bound()

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

Definition at line 142 of file glass_values.h.

References ValueStats::lower_bound.

Referenced by GlassDatabase::get_value_lower_bound().

◆ get_value_stats() [1/2]

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

Get the statistics for value slot slot.

Definition at line 528 of file glass_values.cc.

References Xapian::BAD_VALUENO, and LOGCALL_VOID.

◆ get_value_stats() [2/2]

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

◆ get_value_upper_bound()

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

Definition at line 147 of file glass_values.h.

References ValueStats::upper_bound.

Referenced by GlassDatabase::get_value_upper_bound().

◆ is_modified()

bool GlassValueManager::is_modified ( ) const
inline

◆ merge_changes()

void GlassValueManager::merge_changes ( )

◆ remove_value()

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

Definition at line 144 of file glass_values.cc.

◆ replace_document()

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

◆ reset()

void GlassValueManager::reset ( )
inline

Ignore any old cached valuestats.

Definition at line 161 of file glass_values.h.

References Xapian::BAD_VALUENO.

Referenced by GlassDatabase::modifications_failed(), and GlassDatabase::open_tables().

◆ set_value_stats()

void GlassValueManager::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 574 of file glass_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 GlassWritableDatabase::apply().

Member Data Documentation

◆ changes

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

Definition at line 94 of file glass_values.h.

◆ cursor

AutoPtr<GlassCursor> GlassValueManager::cursor
mutableprivate

Definition at line 96 of file glass_values.h.

◆ mru_slot

Xapian::valueno GlassValueManager::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 83 of file glass_values.h.

◆ mru_valstats

ValueStats GlassValueManager::mru_valstats
mutableprivate

The most recently used value statistics.

Definition at line 86 of file glass_values.h.

◆ postlist_table

GlassPostListTable* GlassValueManager::postlist_table
private

Definition at line 88 of file glass_values.h.

◆ slots

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

Definition at line 92 of file glass_values.h.

◆ termlist_table

GlassTermListTable* GlassValueManager::termlist_table
private

Definition at line 90 of file glass_values.h.


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