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);
170 void create(
unsigned blocksize);
184 bool sync(
const std::string & tmpfile,
The GlassVersion class manages the revision files.
glass_revision_number_t oldest_changeset
Oldest changeset removed when max_changesets is set.
RootInfo * root_to_set(Glass::table_type tbl)
void set_oldest_changeset(glass_revision_number_t changeset) const
Xapian::termcount spelling_wordfreq_ubound
An upper bound on the spelling wordfreq in this database.
const RootInfo & get_root(Glass::table_type tbl) const
GlassVersion(const std::string &db_dir_)
void check_wdf(Xapian::termcount wdf)
RootInfo old_root[Glass::MAX_]
Xapian::termcount doclen_ubound
An upper bound on the greatest document length in this database.
off_t offset
Offset into the file at which the version data starts.
void add_document(Xapian::termcount doclen)
const std::string write(glass_revision_number_t new_rev, int flags)
Xapian::docid get_last_docid() const
std::string db_dir
The database directory.
glass_revision_number_t get_revision() const
void delete_document(Xapian::termcount doclen)
Xapian::termcount get_doclength_lower_bound() const
std::string get_uuid_string() const
Return UUID in the standard 36 character string format.
void set_spelling_wordfreq_upper_bound(Xapian::termcount ub)
void set_last_docid(Xapian::docid did)
glass_revision_number_t get_oldest_changeset() const
Xapian::docid last_docid
Greatest document id ever used in this database.
Xapian::termcount get_spelling_wordfreq_upper_bound() const
std::string serialised_stats
The serialised database stats.
Uuid uuid
The UUID of this database.
glass_revision_number_t rev
Xapian::totallength total_doclen
The total of the lengths of all documents in the database.
const char * get_uuid() const
Return pointer to 16 byte UUID.
bool sync(const std::string &tmpfile, glass_revision_number_t new_rev, int flags)
Xapian::doccount get_doccount() const
void set_changes(GlassChanges *changes_)
void merge_stats(const GlassVersion &o)
Merge the database stats.
Xapian::termcount get_wdf_upper_bound() const
Xapian::termcount doclen_lbound
A lower bound on the smallest document length in this database.
Xapian::docid get_next_docid()
Xapian::termcount wdf_ubound
An upper bound on the greatest wdf in this database.
Xapian::doccount doccount
The number of documents in the database.
void create(unsigned blocksize)
Create the version file.
RootInfo root[Glass::MAX_]
void read()
Read the version file and check it's a version we understand.
Xapian::totallength get_total_doclen() const
Xapian::termcount get_doclength_upper_bound() const
void set_num_entries(glass_tablesize_t n)
const std::string & get_free_list() const
void init(unsigned blocksize_, uint4 compress_min_)
void serialise(std::string &s) const
bool unserialise(const char **p, const char *end)
glass_tablesize_t get_num_entries() const
void set_blocksize(unsigned b)
std::string fl_serialised
bool get_sequential() const
void set_level(int level_)
unsigned get_blocksize() const
void set_sequential(bool f)
void set_free_list(const std::string &s)
glass_tablesize_t num_entries
uint4 get_compress_min() const
void set_root_is_fake(bool f)
uint4 compress_min
Should be >= 4 or 0 for no compression.
glass_block_t get_root() const
bool get_root_is_fake() const
void set_root(glass_block_t root_)
std::string to_string() const
const char * data() const
Definitions, types, etc for use inside glass.
unsigned long long glass_tablesize_t
How many entries there are in a table.
uint4 glass_block_t
A block number in a glass Btree file.
uint4 glass_revision_number_t
The revision number of a glass database.
Return the smaller of two numbers which isn't zero.
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.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
XAPIAN_TOTALLENGTH_TYPE totallength
The total length of all documents in a database.
Various assertion macros.
#define AssertRel(A, REL, B)
Class for handling UUIDs.