Skip to content
Snippets Groups Projects
Commit de5b0cdd authored by Anastasia Karachaliou's avatar Anastasia Karachaliou
Browse files

Correction of the namespace in SourcedParameter

parent ab2e6543
No related branches found
No related tags found
No related merge requests found
......@@ -22,8 +22,6 @@
namespace cta {
namespace tape {
namespace daemon {
template<>
void SourcedParameter<time_t>::set(const std::string & value, const std::string & source) {
......@@ -75,4 +73,4 @@ void SourcedParameter<std::string>::addLogParamForValue(log::LogContext & lc) {
lc.pushOrReplace({"value", m_value});
}
}}} // namespace cta::tape::daemon
} // namespace cta
......@@ -27,8 +27,6 @@
namespace cta {
namespace tape {
namespace daemon {
/**
* A templated class allowing the tracking of parameter with their source.
* If the parameter is not set (implicitly defined as the source being
......@@ -115,4 +113,4 @@ private:
}}} // namespace cta::tape::daemon
} // namespace cta
......@@ -24,7 +24,7 @@
namespace unitTests {
TEST(cta_Daemon, SourcedParameter) {
cta::tape::daemon::SourcedParameter<cta::tape::daemon::FetchReportOrFlushLimits> mountCriteria("unitTest", "mountCriteria");
cta::SourcedParameter<cta::tape::daemon::FetchReportOrFlushLimits> mountCriteria("unitTest", "mountCriteria");
mountCriteria.set("12, 34", "Unit test");
ASSERT_EQ(12, mountCriteria.value().maxBytes);
ASSERT_EQ(34, mountCriteria.value().maxFiles);
......
......@@ -22,13 +22,12 @@
#include <algorithm>
namespace cta { namespace tape { namespace daemon {
namespace cta {
//------------------------------------------------------------------------------
// addLogParamForValue
//------------------------------------------------------------------------------
template<>
void SourcedParameter<TpconfigLine>::addLogParamForValue(log::LogContext & lc) {
void SourcedParameter<tape::daemon::TpconfigLine>::addLogParamForValue(log::LogContext & lc) {
lc.pushOrReplace({"category", "TPCONFIG Entry"});
lc.pushOrReplace({"unitName", m_value.unitName});
lc.pushOrReplace({"logicalLibrary", m_value.logicalLibrary});
......@@ -40,7 +39,7 @@ void SourcedParameter<TpconfigLine>::addLogParamForValue(log::LogContext & lc) {
// addLogParamForValue
//------------------------------------------------------------------------------
template<>
void SourcedParameter<FetchReportOrFlushLimits>::addLogParamForValue(log::LogContext & lc) {
void SourcedParameter<tape::daemon::FetchReportOrFlushLimits>::addLogParamForValue(log::LogContext & lc) {
lc.pushOrReplace({"maxBytes", m_value.maxBytes});
lc.pushOrReplace({"maxFiles", m_value.maxFiles});
}
......@@ -49,7 +48,7 @@ void SourcedParameter<FetchReportOrFlushLimits>::addLogParamForValue(log::LogCon
// set
//------------------------------------------------------------------------------
template<>
void SourcedParameter<FetchReportOrFlushLimits>::set(const std::string & value,
void SourcedParameter<tape::daemon::FetchReportOrFlushLimits>::set(const std::string & value,
const std::string & source) {
// We expect an entry in the form "<size limit>, <file limit>"
// There should be one and only one comma in the parameter.
......@@ -79,6 +78,9 @@ void SourcedParameter<FetchReportOrFlushLimits>::set(const std::string & value,
m_source = source;
m_set = true;
}
}
namespace cta { namespace tape { namespace daemon {
//------------------------------------------------------------------------------
// GlobalConfiguration::createFromCtaConf w path
......
......@@ -45,16 +45,16 @@ struct TapedConfiguration {
// Basics: tp config
//----------------------------------------------------------------------------
/// The user name of the cta-taped daemon process
SourcedParameter<std::string> daemonUserName{
cta::SourcedParameter<std::string> daemonUserName{
"taped", "DaemonUserName", "cta", "Compile time default"};
/// The group name of the cta-taped daemon process
SourcedParameter<std::string> daemonGroupName{
cta::SourcedParameter<std::string> daemonGroupName{
"taped", "DaemonGroupName", "tape", "Compile time default"};
/// The log mask. Logs with a level lower than this value will be masked.
SourcedParameter<std::string> logMask{
cta::SourcedParameter<std::string> logMask{
"taped", "LogMask", "DEBUG", "Compile time default"};
/// Path to the file describing the tape drives (TPCONFIG)
SourcedParameter<std::string> tpConfigPath{
cta::SourcedParameter<std::string> tpConfigPath{
"taped" , "TpConfigPath", "/etc/cta/TPCONFIG", "Compile time default"};
/// Extracted drives configuration.
Tpconfig driveConfigs;
......@@ -62,63 +62,63 @@ struct TapedConfiguration {
// Memory management
//----------------------------------------------------------------------------
/// Memory buffer size in bytes (with a default of 5MB). TODO-switch to 32MB once validated in CASTOR.
SourcedParameter<uint64_t> bufferSizeBytes{
cta::SourcedParameter<uint64_t> bufferSizeBytes{
"taped", "BufferSizeBytes", 5*1024*1024, "Compile time default"};
/// Memory buffer count per drive. There is no default to this one.
SourcedParameter<uint64_t> bufferCount{
cta::SourcedParameter<uint64_t> bufferCount{
"taped", "BufferCount"};
//----------------------------------------------------------------------------
// Batched metadata access and tape write flush parameters
//----------------------------------------------------------------------------
/// The fetch size for archive requests
SourcedParameter<FetchReportOrFlushLimits> archiveFetchBytesFiles{
cta::SourcedParameter<FetchReportOrFlushLimits> archiveFetchBytesFiles{
"taped", "ArchiveFetchBytesFiles", {80L*1000*1000*1000, 500}, "Compile time default"};
/// The flush to tape criteria for archiving
SourcedParameter<FetchReportOrFlushLimits> archiveFlushBytesFiles{
cta::SourcedParameter<FetchReportOrFlushLimits> archiveFlushBytesFiles{
"taped", "ArchiveFlushBytesFiles", {32L*1000*1000*1000, 200}, "Compile time default"};
/// The fetch and report size for retrieve requests
SourcedParameter<FetchReportOrFlushLimits> retrieveFetchBytesFiles{
cta::SourcedParameter<FetchReportOrFlushLimits> retrieveFetchBytesFiles{
"taped", "RetrieveFetchBytesFiles", {80L*1000*1000*1000, 500}, "Compile time default"};
//----------------------------------------------------------------------------
// Scheduling limits
//----------------------------------------------------------------------------
SourcedParameter<FetchReportOrFlushLimits> mountCriteria{
cta::SourcedParameter<FetchReportOrFlushLimits> mountCriteria{
"taped", "MountCriteria", {80L*1000*1000*1000, 500}, "Compile time default"};
//----------------------------------------------------------------------------
// Disk file access parameters
//----------------------------------------------------------------------------
/// Number of disk threads. This is the number of parallel file transfers.
SourcedParameter<uint64_t> nbDiskThreads{
cta::SourcedParameter<uint64_t> nbDiskThreads{
"taped", "NbDiskThreads", 10, "Compile time default"};
//----------------------------------------------------------------------------
// Recommended Access Order usage
//----------------------------------------------------------------------------
/// Usage of Recommended Access Order for file recall
SourcedParameter<std::string> useRAO{
cta::SourcedParameter<std::string> useRAO{
"taped", "UseRAO", "no", "Compile time default"};
//----------------------------------------------------------------------------
// Watchdog: parameters for timeouts in various situations.
//----------------------------------------------------------------------------
/// Maximum time allowed to complete a single mount scheduling.
SourcedParameter<time_t> wdScheduleMaxSecs{
cta::SourcedParameter<time_t> wdScheduleMaxSecs{
"taped", "WatchdogScheduleMaxSecs", 60, "Compile time default"};
/// Maximum time allowed to complete mount a tape.
SourcedParameter<time_t> wdMountMaxSecs{
cta::SourcedParameter<time_t> wdMountMaxSecs{
"taped", "WatchdogMountMaxSecs", 900, "Compile time default"};
/// Maximum time allowed after mounting without a single tape block move
SourcedParameter<time_t> wdNoBlockMoveMaxSecs{
cta::SourcedParameter<time_t> wdNoBlockMoveMaxSecs{
"taped", "WatchdogNoBlockMoveMaxSecs", 1800, "Compile time default"};
/// Time to wait after scheduling came up idle
SourcedParameter<time_t> wdIdleSessionTimer{
cta::SourcedParameter<time_t> wdIdleSessionTimer{
"taped", "WatchdogIdleSessionTimer", 10, "Compile time default"};
//----------------------------------------------------------------------------
// The central storage access configuration
//----------------------------------------------------------------------------
/// URL of the object store.
SourcedParameter<std::string> backendPath{
cta::SourcedParameter<std::string> backendPath{
"ObjectStore", "BackendPath"};
/// Path to the file catalog config file
SourcedParameter<std::string> fileCatalogConfigFile{
cta::SourcedParameter<std::string> fileCatalogConfigFile{
"general", "FileCatalogConfigFile", "/etc/cta/cta-catalogue.conf", "Compile time default"};
private:
......
......@@ -39,7 +39,7 @@ TEST(cta_Daemon, TapedConfiguration) {
TempFile emptyTpConfig;
completeConfFile.stringAppend(emptyTpConfig.path());
ASSERT_THROW(cta::tape::daemon::TapedConfiguration::createFromCtaConf(incompleteConfFile.path()),
cta::tape::daemon::SourcedParameter<uint64_t>::MandatoryParameterNotDefined);
cta::SourcedParameter<uint64_t>::MandatoryParameterNotDefined);
auto completeConfig =
cta::tape::daemon::TapedConfiguration::createFromCtaConf(completeConfFile.path());
ASSERT_EQ(completeConfFile.path()+":2", completeConfig.backendPath.source());
......
......@@ -29,7 +29,7 @@ namespace cta { namespace tape { namespace daemon {
/**
* A map of lines parsed from a TPCONFIG file (key is the drive name)
*/
class Tpconfig: public std::map<std::string, SourcedParameter<TpconfigLine>> {
class Tpconfig: public std::map<std::string, cta::SourcedParameter<TpconfigLine>> {
public:
CTA_GENERATE_EXCEPTION_CLASS(InvalidArgument);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment