MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / putDatabase

Method putDatabase

src/jrd/Monitoring.cpp:903–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

901
902
903void Monitoring::putDatabase(thread_db* tdbb, SnapshotData::DumpRecord& record)
904{
905 const auto dbb = tdbb->getDatabase();
906
907 record.reset(rel_mon_database);
908
909 // Determine the backup state
910 int backup_state = backup_state_unknown;
911
912 BackupManager* const bm = dbb->dbb_backup_manager;
913
914 if (bm && !bm->isShutDown())
915 {
916 BackupManager::StateReadGuard holder(tdbb);
917
918 switch (bm->getState())
919 {
920 case Ods::hdr_nbak_normal:
921 backup_state = backup_state_normal;
922 break;
923 case Ods::hdr_nbak_stalled:
924 backup_state = backup_state_stalled;
925 break;
926 case Ods::hdr_nbak_merge:
927 backup_state = backup_state_merge;
928 break;
929 }
930 }
931
932 PathName databaseName(dbb->dbb_database_name);
933 ISC_systemToUtf8(databaseName);
934
935 // database name or alias (MUST BE ALWAYS THE FIRST ITEM PASSED!)
936 record.storeString(f_mon_db_name, databaseName);
937 // page size
938 record.storeInteger(f_mon_db_page_size, dbb->dbb_page_size);
939 // major ODS version
940 record.storeInteger(f_mon_db_ods_major, dbb->dbb_ods_version);
941 // minor ODS version
942 record.storeInteger(f_mon_db_ods_minor, dbb->dbb_minor_version);
943 // oldest interesting transaction
944 record.storeInteger(f_mon_db_oit, dbb->dbb_oldest_transaction);
945 // oldest active transaction
946 record.storeInteger(f_mon_db_oat, dbb->dbb_oldest_active);
947 // oldest snapshot transaction
948 record.storeInteger(f_mon_db_ost, dbb->dbb_oldest_snapshot);
949 // next transaction
950 record.storeInteger(f_mon_db_nt, dbb->dbb_next_transaction);
951 // number of page buffers
952 record.storeInteger(f_mon_db_page_bufs, dbb->dbb_bcb->bcb_count);
953
954 int temp;
955
956 // SQL dialect
957 temp = (dbb->dbb_flags & DBB_DB_SQL_dialect_3) ? 3 : 1;
958 record.storeInteger(f_mon_db_dialect, temp);
959
960 // shutdown mode

Callers

nothing calls this directly

Calls 15

ISC_systemToUtf8Function · 0.85
expandDatabaseNameFunction · 0.85
GuidToStringFunction · 0.85
genUniqueIdFunction · 0.85
getDatabaseMethod · 0.80
isShutDownMethod · 0.80
storeStringMethod · 0.80
storeIntegerMethod · 0.80
readOnlyMethod · 0.80
storeTimestampTzMethod · 0.80
getCurrentPageMethod · 0.80
getCurrentStateMethod · 0.80

Tested by

no test coverage detected