Belle II Software  release-05-02-19
ConditionsDatabase.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015-2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Thomas Kuhr, Martin Ritter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <framework/database/ConditionsDatabase.h>
12 #include <framework/database/Configuration.h>
13 #include <framework/logging/Logger.h>
14 
15 // we know all of this is deprecated, we don't want the warnings when compiling the service itself ...
16 #ifdef __INTEL_COMPILER
17 #pragma warning (disable:1478) //[[deprecated]]
18 #pragma warning (disable:1786) //[[deprecated("message")]]
19 #else
20 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
21 #endif
22 
23 namespace Belle2 {
29  void ConditionsDatabase::createDefaultInstance(const std::string& globalTag, LogConfig::ELogLevel,
30  const std::string& payloadDir)
31  {
32  if (!payloadDir.empty()) {
34  }
36  }
37 
38  void ConditionsDatabase::createInstance(const std::string& globalTag, const std::string& restBaseName,
39  const std::string& fileBaseName,
40  const std::string& fileBaseLocal, LogConfig::ELogLevel,
41  bool)
42  {
43  if (!(restBaseName.empty() and fileBaseName.empty() and fileBaseLocal.empty())) {
44  B2FATAL(R"fatal(Expert settings for central databases are no longer supported".
45  Please use the conditions configuration object for these seetings
46 
47  >>> basf2.conditions.metadata_provider = [restBaseName]
48  >>> basf2.conditions.prepend_globaltag(globalTag)
49  >>> basf2.conditions.payload_locations = [fileBaseLocal, fileBaseName])fatal");
50  }
52  }
53 
55 }
Belle2::Conditions::Configuration::prependGlobalTag
void prependGlobalTag(const std::string &globalTag)
preprend a globaltag
Definition: Configuration.h:89
Belle2::ConditionsDatabase::createInstance
static void createInstance(const std::string &globalTag, const std::string &restBaseName, const std::string &fileBaseName, const std::string &fileBaseLocal, LogConfig::ELogLevel logLevel=LogConfig::c_Warning, bool invertLogging=false)
Method to set the database instance to the central database.
Belle2::Conditions::Configuration::prependPayloadLocation
void prependPayloadLocation(const std::string &location)
Prepend a payload to the list of locations.
Definition: Configuration.h:257
Belle2::LogConfig::ELogLevel
ELogLevel
Definition of the supported log levels.
Definition: LogConfig.h:36
Belle2::Conditions::Configuration::getInstance
static Configuration & getInstance()
Get a reference to the instance which will be used when the Database is initialized.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ConditionsDatabase::createDefaultInstance
static void createDefaultInstance(const std::string &globalTag, LogConfig::ELogLevel logLevel=LogConfig::c_Warning, const std::string &payloadDir="centraldb")
Method to set the database instance to the central database with default parameters.