xapian-core  2.0.0
Namespaces | Functions | Variables
dbcheck.cc File Reference

Check the consistency of a database or table. More...

#include <config.h>
#include "xapian/database.h"
#include "xapian/constants.h"
#include "xapian/error.h"
#include "glass/glass_defs.h"
#include "glass/glass_changes.h"
#include "glass/glass_dbcheck.h"
#include "glass/glass_version.h"
#include "honey/honey_defs.h"
#include "honey/honey_dbcheck.h"
#include "honey/honey_version.h"
#include "backends.h"
#include "databasehelpers.h"
#include "filetests.h"
#include "omassert.h"
#include "stringutils.h"
#include <ostream>
#include <stdexcept>
#include <string_view>
+ Include dependency graph for dbcheck.cc:

Go to the source code of this file.

Namespaces

 Xapian
 The Xapian namespace contains public interfaces for the Xapian library.
 

Functions

static void throw_no_db_to_check ()
 
static void reserve_doclens (vector< Xapian::termcount > &doclens, Xapian::docid last_docid, ostream *out)
 
static size_t check_db_dir (string_view path, int opts, std::ostream *out)
 
static size_t check_db_table (string_view filename, int opts, std::ostream *out, int backend)
 Check a database table. More...
 
static size_t check_db_fd (int fd, int opts, std::ostream *out, int backend)
 Check a single file DB from an fd. More...
 
static size_t Xapian::check_stub (const string &stub_path, int opts, std::ostream *out)
 

Variables

struct {
   char   name [9]
 
glass_tables []
 
struct {
   char   name [9]
 
honey_tables []
 

Detailed Description

Check the consistency of a database or table.

Definition in file dbcheck.cc.

Function Documentation

◆ check_db_dir()

static size_t check_db_dir ( string_view  path,
int  opts,
std::ostream *  out 
)
static

◆ check_db_fd()

static size_t check_db_fd ( int  fd,
int  opts,
std::ostream *  out,
int  backend 
)
static

◆ check_db_table()

static size_t check_db_table ( string_view  filename,
int  opts,
std::ostream *  out,
int  backend 
)
static

Check a database table.

Parameters
filenameThe filename of the table (only used to get the directory and
optsXapian::check() options
outstd::ostream to write messages to (or NULL for no messages)
backendBackend type (a BACKEND_XXX constant)

Definition at line 276 of file dbcheck.cc.

References Assert, BACKEND_GLASS, BACKEND_HONEY, BACKEND_OLD, C_tolower(), check_glass_table(), check_honey_table(), DIR_SEPS, opts, p, GlassVersion::read(), and HoneyVersion::read().

Referenced by Xapian::Database::check_().

◆ reserve_doclens()

static void reserve_doclens ( vector< Xapian::termcount > &  doclens,
Xapian::docid  last_docid,
ostream *  out 
)
static

Definition at line 94 of file dbcheck.cc.

Referenced by check_db_dir(), and check_db_fd().

◆ throw_no_db_to_check()

static void throw_no_db_to_check ( )
static

Definition at line 82 of file dbcheck.cc.

Referenced by Xapian::Database::check_().

Variable Documentation

◆ 

const { ... } glass_tables[]
Initial value:
= {
{ "docdata" },
{ "termlist" },
{ "postlist" },
{ "position" },
{ "spelling" },
{ "synonym" }
}

Referenced by check_db_dir(), and check_db_fd().

◆ 

const { ... } honey_tables[]
Initial value:
= {
{ "docdata" },
{ "termlist" },
{ "postlist" },
{ "position" },
{ "spelling" },
{ "synonym" }
}

Referenced by check_db_dir().

◆ name

char name[9]