Lines Matching defs:db

23  *	db.cc
41 #include "db.h"
44 extern int add_to_standby_list(db*);
45 extern int remove_from_standby_list(db*);
63 db::db(char* dbname)
68 FATAL("db::db: cannot allocate space", DB_MEMORY_LIMIT);
72 FATAL("db::db: cannot allocate space", DB_MEMORY_LIMIT);
78 FATAL("db::db: cannot allocate space", DB_MEMORY_LIMIT);
86 INITRW(db);
87 READLOCKOK(db);
94 db::~db()
114 FATAL("db::assign_next_desc: cannot allocate space",
131 FATAL("db::assign_next_desc: cannot allocate space (2)",
170 db::exec_action(db_action action, db_query *query,
183 FATAL3("db::exec_action: cannot allocate space for result",
222 "db::exec_action: cannot allocate space for DB_FIRST result",
256 WARNING("db::exec_action: invalid previous indicator");
271 "db::exec_action: cannot allocate space for DB_NEXT result",
298 WARNING("db::exec_action: invalid previous indicator");
325 db::log_action(db_action action, db_query *query, entry_object *content)
332 WRITELOCK(this, empty_result(DB_LOCK_ERROR), "w db::log_action");
347 "wu db::log_action DB_STORAGE_LIMIT");
353 WARNING_M("db::log_action: could not add log entry: ");
356 "wu db::log_action DB_STORAGE_LIMIT");
370 WARNING_M("db::log_action: could not add log entry: ");
373 "wu db::log_action DB_STORAGE_LIMIT");
382 WRITEUNLOCK(this, empty_result(DB_LOCK_ERROR), "wu db::log_action");
394 db::execute(db_action action, db_query *query,
405 READLOCK(this, empty_result(DB_LOCK_ERROR), "r db::execute");
408 "ru db::execute");
412 WRITELOCK(this, empty_result(DB_LOCK_ERROR), "w db::execute");
416 "wu db::execute");
427 WARNING("db::execute: unknown request");
434 db::reset_log()
436 WRITELOCK(this, -1, "w db::reset_log");
443 WARNING_M("db::reset_log: could not close log file: ");
451 WRITEUNLOCK(this, -1, "wu db::reset_log");
457 db::close_log(int bypass_standby)
459 WRITELOCK(this, -1, "w db::close_log");
467 WRITEUNLOCK(this, -1, "wu db::close_log");
473 db::open_log(bool_t copylog)
475 WRITELOCK(this, -1, "w db::open_log");
479 FATAL3("db::reset_log: cannot allocate space",
484 WRITEUNLOCK(this, -1, "wu db::open_log");
491 WARNING_M("db::open_log: could not open log file: ");
494 WRITEUNLOCK(this, -1, "wu db::open_log");
499 WRITEUNLOCK(this, -1, "wu db::open_log");
512 db_mindex * db = (db_mindex *) dbchar;
515 WRITELOCK(db, FALSE, "db::apply_log_entry");
517 if (db->get_version()->earlier_than(j->get_version())) {
525 db->add(j->get_query(), j->get_object());
530 db->remove(j->get_query());
534 WARNING("db::apply_log_entry: unknown action_type");
535 WRITEUNLOCK(db, FALSE, "db::apply_log_entry");
538 db->change_version(j->get_version());
541 WRITEUNLOCK(db, FALSE, "db::apply_log_entry");
547 * Execute log entry 'j' on this db. 'j' is executed if its version is
554 db::execute_log_entry(db_log_entry *j)
577 WRITELOCK(this, FALSE, "w db::execute_log_entry");
580 WRITEUNLOCK(this, FALSE, "wu db::execute_log_entry");
587 "db::execute_log_entry: could not add log entry: ");
588 WRITEUNLOCK(this, FALSE, "wu db::execute_log_entry");
593 WRITEUNLOCK(this, FALSE, "wu db::execute_log_entry");
601 db::incorporate_log(char* filename)
606 WRITELOCK(this, -1, "w db::incorporate_log");
607 WRITELOCK2((&internal_db), -1, "w internal_db db::incorporate_log",
613 "wu db::incorporate_log",
614 "wu mindex db::incorporate_log");
621 db::load()
626 WRITELOCK(this, FALSE, "w db::load");
629 "WARNING: the current db '%s' has been changed but not checkpointed",
636 syslog(LOG_ERR, "Load of db '%s' failed", dbfilename);
638 WRITEUNLOCK(this, FALSE, "wu db::load");
644 WRITELOCK2((&internal_db), FALSE, "w internal_db db::load", this);
647 syslog(LOG_ERR, "incorporation of db logfile '%s' load failed",
653 "wu db::load", "wu internal_db db::load");
664 db::init(db_scheme * s)
668 WRITELOCK(this, FALSE, "w db::init");
677 WRITEUNLOCK(this, FALSE, "wu db::init");
691 db::checkpoint()
693 WRITELOCK(this, FALSE, "w db::checkpoint");
695 WRITEUNLOCK(this, FALSE, "wu db::checkpoint");
704 WARNING_M("db::checkpoint: could not dump database: ");
708 WRITEUNLOCK(this, FALSE, "wu db::checkpoint");
713 "db::checkpoint: could not rename temp file to db file: ");
717 WRITEUNLOCK(this, FALSE, "wu db::checkpoint");
725 WRITEUNLOCK(this, FALSE, "wu db::checkpoint");
744 * db::get_log_entries_since(), no locking is necessary.
767 db::get_log_entries_since(vers * v)
781 FATAL3("db::get_log_entries_since: cannot allocate space",
795 "db::get_log_entries_since: cannot allocate space for entries",
815 db::remove_files()
817 WRITELOCK(this, -1, "w db::remove_files");
822 WRITEUNLOCK(this, -1, "wu db::remove_files");
827 db::sync_log() {
831 WRITELOCK(this, DB_LOCK_ERROR, "w db::sync_log");
840 WRITEUNLOCK(this, DB_LOCK_ERROR, "wu db::sync_log");
846 db::configure(char *objName) {
851 db::mindex(void) {