Commit 6df77c47 authored by Steven Murray's avatar Steven Murray
Browse files

Remobed minimum files and bytes from MountPolicy

parent 4e37fa06
......@@ -2101,8 +2101,6 @@ cta::common::dataStructures::MountPolicy cta::catalogue::SqliteCatalogue::
const char *const sql =
"SELECT "
"ARCHIVE_PRIORITY AS ARCHIVE_PRIORITY,"
"MIN_ARCHIVE_FILES_QUEUED AS MIN_ARCHIVE_FILES_QUEUED,"
"MIN_ARCHIVE_BYTES_QUEUED AS MIN_ARCHIVE_BYTES_QUEUED,"
"MIN_ARCHIVE_REQUEST_AGE AS MIN_ARCHIVE_REQUEST_AGE,"
"MAX_DRIVES_ALLOWED AS MAX_DRIVES_ALLOWED "
......@@ -2117,8 +2115,6 @@ cta::common::dataStructures::MountPolicy cta::catalogue::SqliteCatalogue::
nameToIdx = stmt->getColumnNameToIdx();
common::dataStructures::MountPolicy policy;
policy.priority = stmt->columnUint64(nameToIdx["ARCHIVE_PRIORITY"]);
policy.minFilesQueued = stmt->columnUint64(nameToIdx["MIN_ARCHIVE_FILES_QUEUED"]);
policy.minBytesQueued = stmt->columnUint64(nameToIdx["MIN_ARCHIVE_BYTES_QUEUED"]);
policy.minRequestAge = stmt->columnUint64(nameToIdx["MIN_ARCHIVE_REQUEST_AGE"]);
policy.maxDrives = stmt->columnUint64(nameToIdx["MAX_DRIVES_ALLOWED"]);
return policy;
......@@ -2138,8 +2134,6 @@ cta::common::dataStructures::MountPolicy cta::catalogue::SqliteCatalogue::
const char *const sql =
"SELECT "
"RETRIEVE_PRIORITY AS RETRIEVE_PRIORITY,"
"MIN_RETRIEVE_FILES_QUEUED AS MIN_RETRIEVE_FILES_QUEUED,"
"MIN_RETRIEVE_BYTES_QUEUED AS MIN_RETRIEVE_BYTES_QUEUED,"
"MIN_RETRIEVE_REQUEST_AGE AS MIN_RETRIEVE_REQUEST_AGE,"
"MAX_DRIVES_ALLOWED AS MAX_DRIVES_ALLOWED "
......@@ -2154,8 +2148,6 @@ cta::common::dataStructures::MountPolicy cta::catalogue::SqliteCatalogue::
nameToIdx = stmt->getColumnNameToIdx();
common::dataStructures::MountPolicy policy;
policy.priority = stmt->columnUint64(nameToIdx["RETRIEVE_PRIORITY"]);
policy.minFilesQueued = stmt->columnUint64(nameToIdx["MIN_RETRIEVE_FILES_QUEUED"]);
policy.minBytesQueued = stmt->columnUint64(nameToIdx["MIN_RETRIEVE_BYTES_QUEUED"]);
policy.minRequestAge = stmt->columnUint64(nameToIdx["MIN_RETRIEVE_REQUEST_AGE"]);
policy.maxDrives = stmt->columnUint64(nameToIdx["MAX_DRIVES_ALLOWED"]);
return policy;
......
......@@ -908,14 +908,10 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, prepareForNewFile) {
const std::string mountGroupName = "mount_group";
const uint64_t archivePriority = 1;
const uint64_t minArchiveFilesQueued = 2;
const uint64_t minArchiveBytesQueued = 3;
const uint64_t minArchiveRequestAge = 4;
const uint64_t retrievePriority = 5;
const uint64_t minRetrieveFilesQueued = 6;
const uint64_t minRetrieveBytesQueued = 7;
const uint64_t minRetrieveRequestAge = 8;
const uint64_t maxDrivesAllowed = 9;
const uint64_t minArchiveRequestAge = 2;
const uint64_t retrievePriority = 3;
const uint64_t minRetrieveRequestAge = 4;
const uint64_t maxDrivesAllowed = 5;
catalogue.createMountGroup(
m_cliSI,
......@@ -950,8 +946,6 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, prepareForNewFile) {
catalogue.getArchiveMountPolicy(userName);
ASSERT_EQ(archivePriority, archivePolicy.priority);
ASSERT_EQ(minArchiveFilesQueued, archivePolicy.minFilesQueued);
ASSERT_EQ(minArchiveBytesQueued, archivePolicy.minBytesQueued);
ASSERT_EQ(minArchiveRequestAge, archivePolicy.minRequestAge);
ASSERT_EQ(maxDrivesAllowed, archivePolicy.maxDrives);
......@@ -959,8 +953,6 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, prepareForNewFile) {
catalogue.getRetrieveMountPolicy(userName);
ASSERT_EQ(retrievePriority, retrievePolicy.priority);
ASSERT_EQ(minRetrieveFilesQueued, retrievePolicy.minFilesQueued);
ASSERT_EQ(minRetrieveBytesQueued, retrievePolicy.minBytesQueued);
ASSERT_EQ(minRetrieveRequestAge, retrievePolicy.minRequestAge);
ASSERT_EQ(maxDrivesAllowed, retrievePolicy.maxDrives);
......@@ -1017,8 +1009,6 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, prepareForNewFile) {
ASSERT_EQ(copyNb, queueCriteria.copyToPoolMap.begin()->first);
ASSERT_EQ(tapePoolName, queueCriteria.copyToPoolMap.begin()->second);
ASSERT_EQ(archivePriority, queueCriteria.mountPolicy.priority);
ASSERT_EQ(minArchiveFilesQueued, queueCriteria.mountPolicy.minFilesQueued);
ASSERT_EQ(minArchiveBytesQueued, queueCriteria.mountPolicy.minBytesQueued);
ASSERT_EQ(minArchiveRequestAge, queueCriteria.mountPolicy.minRequestAge);
ASSERT_EQ(maxDrivesAllowed, queueCriteria.mountPolicy.maxDrives);
}
......
......@@ -24,11 +24,10 @@
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::MountPolicy::operator==(const MountPolicy &rhs) const {
return maxDrives==rhs.maxDrives
&& minBytesQueued==rhs.minBytesQueued
&& minFilesQueued==rhs.minFilesQueued
&& minRequestAge==rhs.minRequestAge
&& priority==rhs.priority;
return
maxDrives==rhs.maxDrives &&
minRequestAge==rhs.minRequestAge &&
priority==rhs.priority;
}
//------------------------------------------------------------------------------
......@@ -42,11 +41,11 @@ bool cta::common::dataStructures::MountPolicy::operator!=(const MountPolicy &rhs
// operator<<
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::MountPolicy &obj) {
os << "(maxDrives=" << obj.maxDrives
<< " minBytesQueued=" << obj.minBytesQueued
<< " minFilesQueued=" << obj.minFilesQueued
os << "("
<< "maxDrives=" << obj.maxDrives
<< " minRequestAge=" << obj.minRequestAge
<< " priority=" << obj.priority << ")";
<< " priority=" << obj.priority
<< ")";
return os;
}
......@@ -32,8 +32,6 @@ struct MountPolicy {
MountPolicy():
maxDrives(0),
minBytesQueued(0),
minFilesQueued(0),
minRequestAge(0),
priority(0) {
}
......@@ -43,8 +41,6 @@ struct MountPolicy {
bool operator!=(const MountPolicy &rhs) const;
uint64_t maxDrives;
uint64_t minBytesQueued;
uint64_t minFilesQueued;
uint64_t minRequestAge;
uint64_t priority;
......
......@@ -232,8 +232,6 @@ void cta::objectstore::ArchiveRequest::setMountPolicy(const cta::common::dataStr
checkPayloadWritable();
auto payloadMountPolicy = m_payload.mutable_mountpolicy();
payloadMountPolicy->set_maxdrives(mountPolicy.maxDrives);
payloadMountPolicy->set_minbytesqueued(mountPolicy.minBytesQueued);
payloadMountPolicy->set_minfilesqueued(mountPolicy.minFilesQueued);
payloadMountPolicy->set_minrequestage(mountPolicy.minRequestAge);
payloadMountPolicy->set_priority(mountPolicy.priority);
}
......@@ -246,8 +244,6 @@ cta::common::dataStructures::MountPolicy cta::objectstore::ArchiveRequest::getMo
cta::common::dataStructures::MountPolicy mountPolicy;
auto payloadMountPolicy = m_payload.mountpolicy();
mountPolicy.maxDrives=payloadMountPolicy.maxdrives();
mountPolicy.minBytesQueued=payloadMountPolicy.minbytesqueued();
mountPolicy.minFilesQueued=payloadMountPolicy.minfilesqueued();
mountPolicy.minRequestAge=payloadMountPolicy.minrequestage();
mountPolicy.priority=payloadMountPolicy.priority();
return mountPolicy;
......
......@@ -1121,7 +1121,7 @@ void XrdCtaFile::xCom_mountgroup(const std::vector<std::string> &tokens, const c
uint64_t minretrievebytesqueued; std::stringstream minretrievebytesqueued_ss; minretrievebytesqueued_ss << minretrievebytesqueued_s; minretrievebytesqueued_ss >> minretrievebytesqueued;
uint64_t minretrieverequestage; std::stringstream minretrieverequestage_ss; minretrieverequestage_ss << minretrieverequestage_s; minretrieverequestage_ss >> minretrieverequestage;
uint64_t maxdrivesallowed; std::stringstream maxdrivesallowed_ss; maxdrivesallowed_ss << maxdrivesallowed_s; maxdrivesallowed_ss >> maxdrivesallowed;
m_catalogue->createMountGroup(cliIdentity, group, archivepriority, minarchivefilesqueued, minarchivebytesqueued, minarchiverequestage, retrievepriority, minretrievefilesqueued, minretrievebytesqueued, minretrieverequestage, maxdrivesallowed, comment);
m_catalogue->createMountGroup(cliIdentity, group, archivepriority, minarchiverequestage, retrievepriority, minretrieverequestage, maxdrivesallowed, comment);
}
else if("ch" == tokens[2]) { //ch
if(archivepriority_s.empty()&&minarchivefilesqueued_s.empty()&&minarchivebytesqueued_s.empty()&&minarchiverequestage_s.empty()&&retrievepriority_s.empty()
......
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