22 #ifndef XAPIAN_INCLUDED_HONEY_VERSION_H
23 #define XAPIAN_INCLUDED_HONEY_VERSION_H
31 #include <string_view>
70 #define HONEY_VERSION_MAX_SIZE 1024
171 bool sync(
const std::string& tmpfile,
The HoneyVersion class manages the revision files.
void create()
Create the version file.
void set_spelling_wordfreq_upper_bound(Xapian::termcount ub)
Xapian::termcount get_spelling_wordfreq_upper_bound() const
void check_wdf(Xapian::termcount wdf)
void delete_document(Xapian::termcount doclen)
Xapian::doccount doccount
The number of documents in the database.
Xapian::termcount doclen_lbound
A lower bound on the smallest document length in this database.
honey_revision_number_t oldest_changeset
Oldest changeset removed when max_changesets is set.
honey_revision_number_t get_oldest_changeset() const
Xapian::termcount doclen_ubound
An upper bound on the greatest document length in this database.
void merge_stats(const HoneyVersion &o)
Merge the database stats.
std::string get_uuid_string() const
Return UUID in the standard 36 character string format.
off_t offset
Offset into the file at which the version data starts.
bool sync(const std::string &tmpfile, honey_revision_number_t new_rev, int flags)
Xapian::termcount get_doclength_lower_bound() const
Xapian::docid get_last_docid() const
const std::string write(honey_revision_number_t new_rev, int flags)
Xapian::totallength get_total_doclen() const
Xapian::termcount get_unique_terms_upper_bound() const
void set_unique_terms_upper_bound(Xapian::termcount ub)
honey_revision_number_t rev
std::string db_dir
The database directory.
Xapian::docid last_docid
Greatest document id ever used in this database.
Xapian::totallength total_doclen
The total of the lengths of all documents in the database.
Honey::RootInfo old_root[Honey::MAX_]
HoneyVersion(std::string_view db_dir_)
Xapian::termcount spelling_wordfreq_ubound
An upper bound on the spelling wordfreq in this database.
Xapian::termcount get_unique_terms_lower_bound() const
Honey::RootInfo * root_to_set(Honey::table_type tbl)
void set_unique_terms_lower_bound(Xapian::termcount ub)
void set_last_docid(Xapian::docid did)
honey_revision_number_t get_revision() const
void read()
Read the version file and check it's a version we understand.
Xapian::termcount get_wdf_upper_bound() const
std::string serialised_stats
The serialised database stats.
const char * get_uuid() const
Return pointer to 16 byte UUID.
void add_document(Xapian::termcount doclen)
Honey::RootInfo root[Honey::MAX_]
Xapian::doccount get_doccount() const
Xapian::termcount uniq_terms_ubound
An upper bound on the number of unique terms in a document in this database.
Xapian::docid get_next_docid()
void set_oldest_changeset(honey_revision_number_t changeset) const
Xapian::termcount uniq_terms_lbound
A lower bound on the number of unique terms in a document in this database.
Xapian::termcount get_doclength_upper_bound() const
Xapian::termcount wdf_ubound
An upper bound on the greatest wdf in this database.
const Honey::RootInfo & get_root(Honey::table_type tbl) const
Uuid uuid
The UUID of this database.
void init(uint4 compress_min_)
bool unserialise(const char **p, const char *end)
uint4 compress_min
Should be >= 4 or 0 for no compression.
const std::string & get_free_list() const
void set_free_list(const std::string &s)
void set_num_entries(honey_tablesize_t n)
std::string fl_serialised
void serialise(std::string &s) const
uint4 get_compress_min() const
honey_tablesize_t get_num_entries() const
void set_offset(off_t offset_)
void set_root(off_t root_)
honey_tablesize_t num_entries
std::string to_string() const
const char * data() const
Definitions, types, etc for use inside honey.
unsigned long long honey_tablesize_t
How many entries there are in a table.
uint4 honey_revision_number_t
The revision number of a honey database.
Return the smaller of two numbers which isn't zero.
constexpr std::enable_if_t< std::is_unsigned_v< T >, T > 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.
Class for handling UUIDs.