Database.h (Firebird-3.0.2.32703-0.tar.bz2) | : | Database.h (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 55 | skipping to change at line 55 | |||
#include "../common/classes/fb_atomic.h" | #include "../common/classes/fb_atomic.h" | |||
#include "../common/classes/fb_string.h" | #include "../common/classes/fb_string.h" | |||
#include "../common/classes/MetaName.h" | #include "../common/classes/MetaName.h" | |||
#include "../common/classes/array.h" | #include "../common/classes/array.h" | |||
#include "../common/classes/objects_array.h" | #include "../common/classes/objects_array.h" | |||
#include "../common/classes/stack.h" | #include "../common/classes/stack.h" | |||
#include "../common/classes/timestamp.h" | #include "../common/classes/timestamp.h" | |||
#include "../common/classes/GenericMap.h" | #include "../common/classes/GenericMap.h" | |||
#include "../common/classes/RefCounted.h" | #include "../common/classes/RefCounted.h" | |||
#include "../common/classes/semaphore.h" | #include "../common/classes/semaphore.h" | |||
#include "../common/classes/DbImplementation.h" | ||||
#include "../common/utils_proto.h" | #include "../common/utils_proto.h" | |||
#include "../jrd/RandomGenerator.h" | #include "../jrd/RandomGenerator.h" | |||
#include "../common/os/guid.h" | #include "../common/os/guid.h" | |||
#include "../common/os/os_utils.h" | #include "../common/os/os_utils.h" | |||
#include "../jrd/sbm.h" | #include "../jrd/sbm.h" | |||
#include "../jrd/flu.h" | #include "../jrd/flu.h" | |||
#include "../jrd/RuntimeStatistics.h" | #include "../jrd/RuntimeStatistics.h" | |||
#include "../jrd/event_proto.h" | #include "../jrd/event_proto.h" | |||
#include "../jrd/ExtEngineManager.h" | #include "../jrd/ExtEngineManager.h" | |||
#include "../lock/lock_proto.h" | #include "../lock/lock_proto.h" | |||
skipping to change at line 82 | skipping to change at line 83 | |||
template <typename T> class vec; | template <typename T> class vec; | |||
class jrd_rel; | class jrd_rel; | |||
class Shadow; | class Shadow; | |||
class BlobFilter; | class BlobFilter; | |||
class TipCache; | class TipCache; | |||
class BackupManager; | class BackupManager; | |||
class ExternalFileDirectoryList; | class ExternalFileDirectoryList; | |||
class MonitoringData; | class MonitoringData; | |||
class GarbageCollector; | class GarbageCollector; | |||
class CryptoManager; | class CryptoManager; | |||
class JProvider; | ||||
// general purpose vector | // general purpose vector | |||
template <class T, BlockType TYPE = type_vec> | template <class T, BlockType TYPE = type_vec> | |||
class vec_base : protected pool_alloc<TYPE> | class vec_base : protected pool_alloc<TYPE> | |||
{ | { | |||
public: | public: | |||
typedef typename Firebird::Array<T>::iterator iterator; | typedef typename Firebird::Array<T>::iterator iterator; | |||
typedef typename Firebird::Array<T>::const_iterator const_iterator; | typedef typename Firebird::Array<T>::const_iterator const_iterator; | |||
/* | /* | |||
skipping to change at line 333 | skipping to change at line 333 | |||
// ITimer implementation | // ITimer implementation | |||
void handler(); | void handler(); | |||
int release(); | int release(); | |||
private: | private: | |||
Database* dbb; | Database* dbb; | |||
bool active; | bool active; | |||
}; | }; | |||
static Database* create(Firebird::IPluginConfig* pConf, JProvider* provid er, bool shared) | static Database* create(Firebird::IPluginConfig* pConf, bool shared) | |||
{ | { | |||
Firebird::MemoryStats temp_stats; | Firebird::MemoryStats temp_stats; | |||
MemoryPool* const pool = MemoryPool::createPool(NULL, temp_stats) ; | MemoryPool* const pool = MemoryPool::createPool(NULL, temp_stats) ; | |||
Database* const dbb = FB_NEW_POOL(*pool) Database(pool, pConf, sh ared); | Database* const dbb = FB_NEW_POOL(*pool) Database(pool, pConf, sh ared); | |||
pool->setStatsGroup(dbb->dbb_memory_stats); | pool->setStatsGroup(dbb->dbb_memory_stats); | |||
dbb->dbb_provider = provider; | ||||
return dbb; | return dbb; | |||
} | } | |||
// The destroy() function MUST be used to delete a Database object. | // The destroy() function MUST be used to delete a Database object. | |||
// The function hides some tricky order of operations. Since the | // The function hides some tricky order of operations. Since the | |||
// memory for the vectors in the Database is allocated out of the Databas e's | // memory for the vectors in the Database is allocated out of the Databas e's | |||
// permanent memory pool, the entire delete() operation needs | // permanent memory pool, the entire delete() operation needs | |||
// to complete _before_ the permanent pool is deleted, or else | // to complete _before_ the permanent pool is deleted, or else | |||
// risk an aborted engine. | // risk an aborted engine. | |||
static void destroy(Database* const toDelete) | static void destroy(Database* const toDelete) | |||
skipping to change at line 378 | skipping to change at line 377 | |||
} | } | |||
Firebird::SyncObject dbb_sync; | Firebird::SyncObject dbb_sync; | |||
Firebird::SyncObject dbb_sys_attach; // synchronize operations with dbb_sys_attachments | Firebird::SyncObject dbb_sys_attach; // synchronize operations with dbb_sys_attachments | |||
MemoryPool* dbb_permanent; | MemoryPool* dbb_permanent; | |||
LockManager* dbb_lock_mgr; | LockManager* dbb_lock_mgr; | |||
EventManager* dbb_event_mgr; | EventManager* dbb_event_mgr; | |||
JProvider* dbb_provider; // Provider that owns thi s database block | Firebird::ICryptKeyCallback* dbb_callback; // Parent's crypt callbac k | |||
Database* dbb_next; // Next database block in system | Database* dbb_next; // Next database block in system | |||
Attachment* dbb_attachments; // Active attachments | Attachment* dbb_attachments; // Active attachments | |||
Attachment* dbb_sys_attachments; // System attachments | Attachment* dbb_sys_attachments; // System attachments | |||
BufferControl* dbb_bcb; // Buffer control block | BufferControl* dbb_bcb; // Buffer control block | |||
Lock* dbb_lock; // database lock | Lock* dbb_lock; // database lock | |||
Lock* dbb_sweep_lock; // sweep lock | Lock* dbb_sweep_lock; // sweep lock | |||
Firebird::SyncObject dbb_sh_counter_sync; | Firebird::SyncObject dbb_sh_counter_sync; | |||
Firebird::SyncObject dbb_shadow_sync; | Firebird::SyncObject dbb_shadow_sync; | |||
skipping to change at line 400 | skipping to change at line 399 | |||
Lock* dbb_shadow_lock; // lock for synchronizing addition of shadows | Lock* dbb_shadow_lock; // lock for synchronizing addition of shadows | |||
Lock* dbb_retaining_lock; // lock for preserving co mmit retaining snapshot | Lock* dbb_retaining_lock; // lock for preserving co mmit retaining snapshot | |||
PageManager dbb_page_manager; | PageManager dbb_page_manager; | |||
vcl* dbb_t_pages; // pages number for trans actions | vcl* dbb_t_pages; // pages number for trans actions | |||
vcl* dbb_gen_id_pages; // known pages for gen_id | vcl* dbb_gen_id_pages; // known pages for gen_id | |||
BlobFilter* dbb_blob_filters; // known blob filters | BlobFilter* dbb_blob_filters; // known blob filters | |||
MonitoringData* dbb_monitoring_data; // monitoring dat a | MonitoringData* dbb_monitoring_data; // monitoring dat a | |||
Firebird::SyncObject dbb_modules_sync; | ||||
DatabaseModules dbb_modules; // external function/filter modul es | DatabaseModules dbb_modules; // external function/filter modul es | |||
ExtEngineManager dbb_extManager; // external engine manager | ExtEngineManager dbb_extManager; // external engine manager | |||
Firebird::SyncObject dbb_flush_count_mutex; | Firebird::SyncObject dbb_flush_count_mutex; | |||
Firebird::RWLock dbb_ast_lock; // avoids deliver ing AST to going away database | Firebird::RWLock dbb_ast_lock; // avoids deliver ing AST to going away database | |||
Firebird::AtomicCounter dbb_ast_flags; // flags modified at AST level | Firebird::AtomicCounter dbb_ast_flags; // flags modified at AST level | |||
Firebird::AtomicCounter dbb_flags; | Firebird::AtomicCounter dbb_flags; | |||
USHORT dbb_ods_version; // major ODS version numb er | USHORT dbb_ods_version; // major ODS version numb er | |||
USHORT dbb_minor_version; // minor ODS version numb er | USHORT dbb_minor_version; // minor ODS version numb er | |||
USHORT dbb_page_size; // page size | USHORT dbb_page_size; // page size | |||
USHORT dbb_dp_per_pp; // data pages per pointer page | USHORT dbb_dp_per_pp; // data pages per pointer page | |||
USHORT dbb_max_records; // max record per data pa ge | USHORT dbb_max_records; // max record per data pa ge | |||
USHORT dbb_max_idx; // max number of indexes on a root page | USHORT dbb_max_idx; // max number of indexes on a root page | |||
Firebird::DbImplementation dbb_implementation; // implementation | ||||
#ifdef SUPERSERVER_V2 | #ifdef SUPERSERVER_V2 | |||
USHORT dbb_prefetch_sequence; // sequence to pace frequency of prefetch requests | USHORT dbb_prefetch_sequence; // sequence to pace frequency of prefetch requests | |||
USHORT dbb_prefetch_pages; // prefetch pages per req uest | USHORT dbb_prefetch_pages; // prefetch pages per req uest | |||
#endif | #endif | |||
Firebird::PathName dbb_filename; // filename string | Firebird::PathName dbb_filename; // filename string | |||
Firebird::PathName dbb_database_name; // database visible name (file na me or alias) | Firebird::PathName dbb_database_name; // database visible name (file na me or alias) | |||
#ifdef HAVE_ID_BY_NAME | #ifdef HAVE_ID_BY_NAME | |||
Firebird::UCharBuffer dbb_id; | Firebird::UCharBuffer dbb_id; | |||
skipping to change at line 498 | skipping to change at line 499 | |||
{ | { | |||
MemoryPool* const pool = MemoryPool::createPool(dbb_permanent, db b_memory_stats); | MemoryPool* const pool = MemoryPool::createPool(dbb_permanent, db b_memory_stats); | |||
Firebird::SyncLockGuard guard(&dbb_pools_sync, Firebird::SYNC_EXC LUSIVE, "Database::createPool"); | Firebird::SyncLockGuard guard(&dbb_pools_sync, Firebird::SYNC_EXC LUSIVE, "Database::createPool"); | |||
dbb_pools.add(pool); | dbb_pools.add(pool); | |||
return pool; | return pool; | |||
} | } | |||
void deletePool(MemoryPool* pool); | void deletePool(MemoryPool* pool); | |||
void registerModule(Module&); | ||||
private: | private: | |||
Database(MemoryPool* p, Firebird::IPluginConfig* pConf, bool shared) | Database(MemoryPool* p, Firebird::IPluginConfig* pConf, bool shared) | |||
: dbb_permanent(p), | : dbb_permanent(p), | |||
dbb_page_manager(this, *p), | dbb_page_manager(this, *p), | |||
dbb_modules(*p), | dbb_modules(*p), | |||
dbb_extManager(*p), | dbb_extManager(*p), | |||
dbb_flags(shared ? DBB_shared : 0), | dbb_flags(shared ? DBB_shared : 0), | |||
dbb_filename(*p), | dbb_filename(*p), | |||
dbb_database_name(*p), | dbb_database_name(*p), | |||
#ifdef HAVE_ID_BY_NAME | #ifdef HAVE_ID_BY_NAME | |||
End of changes. 8 change blocks. | ||||
4 lines changed or deleted | 7 lines changed or added |