Skip to content
Snippets Groups Projects
Commit e6f87278 authored by Michael Davis's avatar Michael Davis
Browse files

[os-generic-queues] Adds copyNb into RetrieveQueue PoppedItem

parent 6f1cb6db
No related branches found
Tags v0.0-171
No related merge requests found
......@@ -154,7 +154,7 @@ template<>
void ContainerTraits<RetrieveQueue>::addReferencesIfNecessaryAndCommit(Container& cont,
InsertedElement::list& elemMemCont, AgentReference& agentRef, log::LogContext& lc)
{
throw std::runtime_error("5 Not implemented.");
throw std::runtime_error("ContainerTraits<RetrieveQueue>::addReferencesIfNecessaryAndCommit(): Not implemented");
#if 0
std::list<ArchiveQueue::JobToAdd> jobsToAdd;
for (auto & e: elemMemCont) {
......@@ -236,6 +236,8 @@ getPoppingElementsCandidates(Container &cont, PopCriteria &unfulfilledCriteria,
for(auto &cjfq : candidateJobsFromQueue.candidates) {
ret.elements.emplace_back(PoppedElement{
cta::make_unique<RetrieveRequest>(cjfq.address, cont.m_objectStore),
cjfq.copyNb,
cjfq.size,
common::dataStructures::ArchiveFile()
});
ret.summary.bytes += cjfq.size;
......@@ -248,13 +250,13 @@ getPoppingElementsCandidates(Container &cont, PopCriteria &unfulfilledCriteria,
template<>
auto ContainerTraits<RetrieveQueue>::
getElementSummary(const PoppedElement &poppedElement) -> PoppedElementsSummary {
throw std::runtime_error("8 Not implemented.");
PoppedElementsSummary ret;
throw std::runtime_error("ContainerTraits<RetrieveQueue>::getElementSummary(): Not implemented");
#if 0
PoppedElementsSummary ret;
ret.bytes = poppedElement.bytes;
ret.files = 1;
#endif
return ret;
#endif
}
template<>
......@@ -267,8 +269,7 @@ switchElementsOwnership(PoppedElementsBatch &poppedElementBatch, const Container
std::list<std::unique_ptr<RetrieveRequest::AsyncJobOwnerUpdater>> updaters;
for(auto &e : poppedElementBatch.elements) {
RetrieveRequest &re = *e.retrieveRequest;
auto copyNb = re.getActiveCopyNumber();
updaters.emplace_back(re.asyncUpdateJobOwner(copyNb, contAddress, previousOwnerAddress));
updaters.emplace_back(re.asyncUpdateJobOwner(e.copyNb, contAddress, previousOwnerAddress));
}
timingList.insertAndReset("asyncUpdateLaunchTime", t);
......
......@@ -46,6 +46,8 @@ struct ContainerTraitsTypes<RetrieveQueue>
struct PoppedElement {
std::unique_ptr<RetrieveRequest> retrieveRequest;
uint16_t copyNb;
uint64_t bytes;
common::dataStructures::ArchiveFile archiveFile;
};
struct PoppedElementsSummary;
......
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