Skip to content
Snippets Groups Projects
Commit 175d1ea5 authored by Eric Cano's avatar Eric Cano
Browse files

Made archive queue algorithms more generic.

parent 21c50ac9
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ TEST(ObjectStore, Algorithms) {
re.initialize();
re.insert();
// Create the agent register
EntryLogSerDeser el("user0",
EntryLogSerDeser el("user0",
"unittesthost", time(NULL));
ScopedExclusiveLock rel(re);
re.addOrGetAgentRegisterPointerAndCommit(agentRef, el, lc);
......
......@@ -46,22 +46,22 @@ public:
static ElementAddress getElementAddress(const Element & e) { return e.archiveRequest->getAddressIfSet(); }
static void getLockedAndFetched(Container & cont, ScopedExclusiveLock & aqL, AgentReference & agRef, const ContainerIdentifyer & tapePool,
static void getLockedAndFetched(Container & cont, ScopedExclusiveLock & aqL, AgentReference & agRef, const ContainerIdentifyer & contId,
log::LogContext & lc) {
Helpers::getLockedAndFetchedQueue<ArchiveQueue>(cont, aqL, agRef, tapePool, QueueType::LiveJobs, lc);
Helpers::getLockedAndFetchedQueue<Container>(cont, aqL, agRef, contId, QueueType::LiveJobs, lc);
}
static void addReferencesAndCommit(Container & cont, ElementMemoryContainer & elemMemCont,
AgentReference & agentRef, log::LogContext & lc) {
std::list<ArchiveQueue::JobToAdd> jobsToAdd;
for (auto & e: elemMemCont) {
ArchiveRequest::JobDump jd;
ElementDescriptor jd;
jd.copyNb = e.copyNb;
jd.tapePool = cont.getTapePool();
jd.owner = cont.getAddressIfSet();
ArchiveRequest & ar = *e.archiveRequest;
jobsToAdd.push_back({jd, ar.getAddressIfSet(), e.archiveFile.archiveFileID, e.archiveFile.fileSize,
e.mountPolicy, time(NULL)});
e.mountPolicy, time(nullptr)});
}
cont.addJobsAndCommit(jobsToAdd, agentRef, lc);
}
......
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