ATLAS Offline Software
Loading...
Searching...
No Matches
DBReplicaSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef DBREPLICASVC_DBREPLICASVC_H
6#define DBREPLICASVC_DBREPLICASVC_H
7// DBReplicaSvc.h - concrete implementation of service implementating
8// CORAL IReplicaSortingAlgorithm
9// Richard Hawkings, started 24/4/07
10
11#include <string>
12
14#include "CoralKernel/Context.h"
16#include "RelationalAccess/IDatabaseServiceDescription.h"
17
18class DBReplicaSvc : public extends<AthService, IDBReplicaSvc> {
19 public:
20 using base_class::base_class;
21
22 virtual StatusCode initialize() override;
23
24 void sort(std::vector<const coral::IDatabaseServiceDescription*>& replicaSet) override;
25
26 private:
27 StatusCode readConfig();
28
29 Gaudi::Property<std::string> m_configfile{this, "ConfigFile", "dbreplica.config"};
30 Gaudi::Property<std::string> m_testhost{this, "TestHost", ""};
31 Gaudi::Property<std::string> m_coolsqlitepattern{this, "COOLSQLiteVetoPattern", ""};
32 Gaudi::Property<bool> m_usecoolsqlite{this, "UseCOOLSQLite", true};
33 Gaudi::Property<bool> m_usecoolfrontier{this, "UseCOOLFrontier", true};
34 Gaudi::Property<bool> m_usegeomsqlite{this, "UseGeomSQLite", true};
35 Gaudi::Property<bool> m_nofailover{this, "DisableFailover", false};
36
38 Gaudi::Property<int> m_retrialPeriod{this, "ConnectionRetrialPeriod", 300};
40 Gaudi::Property<int> m_retrialTimeOut{this, "ConnectionRetrialTimeOut", 3600};
42 Gaudi::Property<int> m_timeOut{this, "ConnectionTimeOut", 5};
44 Gaudi::Property<bool> m_connClean{this, "ConnectionCleanUp", false};
46 Gaudi::Property<int> m_frontierComp{this, "FrontierCompression", 5};
47 Gaudi::Property<std::vector<std::string>> m_frontierRefresh{this, "FrontierRefreshSchema", {}};
48
49 coral::Context* m_context{nullptr};
50 bool m_frontiergen{false};
51 std::string m_hostname;
52 typedef std::pair<std::string, int> ServerPair; //<! (priority, name) pair
53 std::vector<ServerPair> m_servermap;
54};
55
56#endif // DBREPLICASVC_DBREPLICASVC_H
Gaudi::Property< int > m_retrialTimeOut
ConnectionRetrialTimeOut, the retrial time out for CORAL Connection Service: default = 300 seconds.
std::string m_hostname
Gaudi::Property< bool > m_connClean
ConnectionCleanUp - whether to use CORAL connection management thread: default = false.
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_testhost
Gaudi::Property< bool > m_usegeomsqlite
coral::Context * m_context
void sort(std::vector< const coral::IDatabaseServiceDescription * > &replicaSet) override
Gaudi::Property< int > m_timeOut
ConnectionTimeOut, the time out for CORAL Connection Service: default = 5 seconds.
Gaudi::Property< std::vector< std::string > > m_frontierRefresh
std::pair< std::string, int > ServerPair
Gaudi::Property< int > m_frontierComp
Frontier proprties, compression level and list of schemas to be refreshed: default = 5.
Gaudi::Property< int > m_retrialPeriod
ConnectionRetrialPeriod, retry period for CORAL Connection Service: default = 30 seconds.
Gaudi::Property< bool > m_usecoolsqlite
Gaudi::Property< bool > m_nofailover
Gaudi::Property< std::string > m_coolsqlitepattern
std::vector< ServerPair > m_servermap
Gaudi::Property< std::string > m_configfile
StatusCode readConfig()
Gaudi::Property< bool > m_usecoolfrontier