Commit 91d83785 authored by Eric Cano's avatar Eric Cano
Browse files

Added a counter for map rebuilds events in ArchiveQueue.

Fixed missing decrement of size total when dequeueing ArchiveRequest.
parent b16d8231
......@@ -58,6 +58,8 @@ void ArchiveQueue::initialize(const std::string& name) {
// set the archive jobs counter to zero
m_payload.set_archivejobstotalsize(0);
m_payload.set_oldestjobcreationtime(0);
// set the initial summary map rebuild count to zero
m_payload.set_mapsrebuildcount(0);
// This object is good to go (to storage)
m_payloadInterpreted = true;
}
......@@ -79,6 +81,7 @@ void ArchiveQueue::commit() {
priorityMap.incCount(m_payload.pendingarchivejobs(i).priority());
minArchiveRequestAgeMap.incCount(m_payload.pendingarchivejobs(i).priority());
}
m_payload.set_mapsrebuildcount(m_payload.mapsrebuildcount()+1);
}
ObjectOps<serializers::ArchiveQueue, serializers::ArchiveQueue_t>::commit();
}
......@@ -241,6 +244,7 @@ void ArchiveQueue::removeJob(const std::string& archiveToFileAddress) {
priorityMap.decCount(jl->Get(i).priority());
ValueCountMap minArchiveRequestAgeMap(m_payload.mutable_minarchiverequestagemap());
minArchiveRequestAgeMap.decCount(jl->Get(i).minarchiverequestage());
m_payload.set_archivejobstotalsize(m_payload.archivejobstotalsize() - jl->Get(i).size());
while (i+1 < (size_t)jl->size()) {
jl->SwapElements(i, i+1);
i++;
......
......@@ -386,6 +386,7 @@ message ArchiveQueue {
repeated ValueCountPair maxdrivesallowedmap = 10033;
required uint64 archivejobstotalsize = 10040;
required uint64 oldestjobcreationtime = 10050;
required uint64 mapsrebuildcount = 10060;
}
message RetrieveQueue {
......
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