22 #ifndef XAPIAN_INCLUDED_GLASS_VERSION_H 23 #define XAPIAN_INCLUDED_GLASS_VERSION_H 53 void init(
unsigned blocksize_,
uint4 compress_min_);
57 bool unserialise(
const char ** p,
const char * end);
71 void set_level(
int level_) { level = unsigned(level_); }
159 : rev(0), fd(-1), offset(0), db_dir(db_dir_), changes(NULL),
160 doccount(0), total_doclen(0), last_docid(0),
161 doclen_lbound(0), doclen_ubound(0),
162 wdf_ubound(0), spelling_wordfreq_ubound(0),
163 oldest_changeset(0) { }
184 bool sync(
const std::string & tmpfile,
214 return doclen_lbound;
218 return doclen_ubound;
224 return spelling_wordfreq_ubound;
228 return oldest_changeset;
234 oldest_changeset = changeset;
238 spelling_wordfreq_ubound = ub;
244 doclen_ubound = std::max(doclen_ubound, doclen);
245 total_doclen += doclen;
250 total_doclen -= doclen;
253 if (total_doclen == 0) {
261 if (wdf > wdf_ubound) wdf_ubound = wdf;
277 #endif // XAPIAN_INCLUDED_GLASS_VERSION_H const RootInfo & get_root(Glass::table_type tbl) const
uint4 get_compress_min() const
Xapian::termcount get_doclength_upper_bound() const
Xapian::docid get_next_docid()
bool get_sequential() const
glass_revision_number_t oldest_changeset
Oldest changeset removed when max_changesets is set.
XAPIAN_REVISION_TYPE rev
Revision number of a database.
Xapian::termcount wdf_ubound
An upper bound on the greatest wdf in this database.
off_t offset
Offset into the file at which the version data starts.
#define AssertRel(A, REL, B)
Uuid uuid
The UUID of this database.
uint4 glass_revision_number_t
The revision number of a glass database.
XAPIAN_TOTALLENGTH_TYPE totallength
The total length of all documents in a database.
glass_tablesize_t num_entries
void set_blocksize(unsigned b)
The GlassVersion class manages the revision files.
GlassVersion(const std::string &db_dir_)
glass_revision_number_t rev
Definitions, types, etc for use inside glass.
void check_wdf(Xapian::termcount wdf)
void set_level(int level_)
unsigned long long glass_tablesize_t
How many entries there are in a table.
Xapian::docid get_last_docid() const
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
void set_num_entries(glass_tablesize_t n)
Xapian::termcount get_wdf_upper_bound() const
Xapian::totallength total_doclen
The total of the lengths of all documents in the database.
RootInfo * root_to_set(Glass::table_type tbl)
uint4 compress_min
Should be >= 4 or 0 for no compression.
bool unserialise(const char **p, const char *end)
void set_changes(GlassChanges *changes_)
void add_document(Xapian::termcount doclen)
Xapian::termcount get_doclength_lower_bound() const
std::string to_string() const
glass_tablesize_t get_num_entries() const
bool get_root_is_fake() const
void set_oldest_changeset(glass_revision_number_t changeset) const
std::string serialised_stats
The serialised database stats.
void delete_document(Xapian::termcount doclen)
const char * get_uuid() const
Return pointer to 16 byte UUID.
string serialise_stats(const Xapian::Weight::Internal &stats)
Serialise a stats object.
void set_spelling_wordfreq_upper_bound(Xapian::termcount ub)
void init(unsigned blocksize_, uint4 compress_min_)
void unserialise_stats(const char *p, const char *p_end, Xapian::Weight::Internal &stat)
Unserialise a serialised stats object.
unsigned get_blocksize() const
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
glass_revision_number_t get_oldest_changeset() const
glass_block_t get_root() const
Xapian::termcount spelling_wordfreq_ubound
An upper bound on the spelling wordfreq in this database.
Xapian::totallength get_total_doclen() const
Xapian::termcount get_spelling_wordfreq_upper_bound() const
void set_root_is_fake(bool f)
Class for handling UUIDs.
Xapian::termcount doclen_ubound
An upper bound on the greatest document length in this database.
Xapian::docid last_docid
Greatest document id ever used in this database.
Various assertion macros.
constexpr std::enable_if< std::is_unsigned< T >::value, T >::type min_non_zero(const T &a, const T &b)
Return the smaller of two unsigned integers which isn't zero.
const char * data() const
Xapian::termcount doclen_lbound
A lower bound on the smallest document length in this database.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
glass_revision_number_t get_revision() const
void set_root(glass_block_t root_)
void set_sequential(bool f)
void serialise(std::string &s) const
std::string fl_serialised
std::string db_dir
The database directory.
std::string get_uuid_string() const
Return UUID in the standard 36 character string format.
const std::string & get_free_list() const
void set_last_docid(Xapian::docid did)
void set_free_list(const std::string &s)
uint4 glass_block_t
A block number in a glass Btree file.
Xapian::doccount doccount
The number of documents in the database.
Return the smaller of two numbers which isn't zero.
Xapian::doccount get_doccount() const