Commit 9a3fd1fa authored by Eric Cano's avatar Eric Cano
Browse files

Added taped config parameter for mount criteria

The new parameter is called: "taped MountCriteria".
It is a pair (size, bytes) and defaults to "80000000, 500".
parent c5a8d8d1
......@@ -37,6 +37,7 @@ echo ${DATABASEURL} >/etc/cta/cta_catalogue_db.conf
# cta-taped setup
echo "taped BufferCount 10" > /etc/cta/cta.conf
echo "taped MountCriteria 2000000, 5" >> /etc/cta/cta.conf
echo "general ObjectStoreURL $OBJECTSTOREURL" >> /etc/cta/cta.conf
echo "${tpconfig}" > /etc/cta/TPCONFIG
......
......@@ -40,6 +40,7 @@ echo ${DATABASEURL} >/etc/cta/cta_catalogue_db.conf
# cta-taped setup
echo "taped BufferCount 10" > /etc/cta/cta.conf
echo "taped MountCriteria 2000000, 5" >> /etc/cta/cta.conf
echo "general ObjectStoreURL $OBJECTSTOREURL" >> /etc/cta/cta.conf
echo "${tpconfig}" > /etc/cta/TPCONFIG
......
......@@ -46,7 +46,8 @@ target_link_libraries(ctatapedaemon
add_library(ctadaemonunittests SHARED
ConfigurationFileTests.cpp
TapedConfigurationTests.cpp
TpconfigTests.cpp)
TpconfigTests.cpp
SourcedParameterTests.cpp)
add_library(ctadaemonunittests-multiprocess SHARED
ProcessManagerTests.cpp
......
......@@ -886,7 +886,8 @@ int DriveHandler::runChild() {
sleep(1);
return castor::tape::tapeserver::daemon::Session::MARK_DRIVE_AS_DOWN;
}
cta::Scheduler scheduler(*catalogue, *osdb, 5, 2*1000*1000); //TODO: we have hardcoded the mount policy parameters here temporarily we will remove them once we know where to put them
cta::Scheduler scheduler(*catalogue, *osdb, m_tapedConfig.mountCriteria.value().maxFiles,
m_tapedConfig.mountCriteria.value().maxBytes);
// Before launching the transfer session, we validate that the scheduler is reachable.
try {
scheduler.ping();
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtest/gtest.h>
#include "SourcedParameter.hpp"
#include "FetchReportOrFlushLimits.hpp"
namespace unitTests {
TEST(cta_Daemon, SourcedParameter) {
cta::tape::daemon::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);
}
} // namespace unitTests
......@@ -47,6 +47,8 @@ TapedConfiguration TapedConfiguration::createFromCtaConf(
ret.archiveFetchBytesFiles.setFromConfigurationFile(cf, generalConfigPath);
ret.archiveFlushBytesFiles.setFromConfigurationFile(cf, generalConfigPath);
ret.retrieveFetchBytesFiles.setFromConfigurationFile(cf, generalConfigPath);
// Mount criteria
ret.mountCriteria.setFromConfigurationFile(cf, generalConfigPath);
// Disk file access parameters
ret.nbDiskThreads.setFromConfigurationFile(cf, generalConfigPath);
// Watchdog: parameters for timeouts in various situations.
......@@ -71,6 +73,8 @@ TapedConfiguration TapedConfiguration::createFromCtaConf(
ret.archiveFlushBytesFiles.log(log);
ret.retrieveFetchBytesFiles.log(log);
ret.mountCriteria.log(log);
ret.nbDiskThreads.log(log);
ret.wdIdleSessionTimer.log(log);
......
......@@ -76,6 +76,11 @@ struct TapedConfiguration {
SourcedParameter<FetchReportOrFlushLimits> retrieveFetchBytesFiles{
"taped", "RetrieveFetchBytesFiles", {80L*1000*1000*1000, 500}, "Compile time default"};
//----------------------------------------------------------------------------
// Scheduling limits
//----------------------------------------------------------------------------
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.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment