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

[lpa_stream] Cleans up comments

parent caf06b90
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,11 @@
namespace cta {
//------------------------------------------------------------------------------
// QueueItor::getQueueJobs
// QueueItor::getQueueJobs (generic)
//------------------------------------------------------------------------------
template<typename JobQueuesQueue, typename JobQueue>
void QueueItor<JobQueuesQueue, JobQueue>::getQueueJobs()
void QueueItor<JobQueuesQueue, JobQueue>::
getQueueJobs()
{
// Behaviour is racy: it's possible that the queue can disappear before we read it.
// In this case, we ignore the error and move on.
......@@ -44,6 +45,41 @@ void QueueItor<JobQueuesQueue, JobQueue>::getQueueJobs()
}
}
//------------------------------------------------------------------------------
// QueueItor::QueueItor (Archive specialisation)
//------------------------------------------------------------------------------
template<>
QueueItor<objectstore::RootEntry::ArchiveQueueDump, objectstore::ArchiveQueue>::
QueueItor(objectstore::Backend &objectStore, const std::string &queue_id) :
m_objectStore(objectStore),
m_onlyThisQueueId(!queue_id.empty()),
m_jobQueueIt(m_jobQueue.begin())
{
objectstore::RootEntry re(m_objectStore);
objectstore::ScopedSharedLock rel(re);
re.fetch();
m_jobQueuesQueue = re.dumpArchiveQueues();
rel.release();
// Set queue iterator to the first queue in the list
m_jobQueuesQueueIt = m_jobQueuesQueue.begin();
// If we specified a tape pool, advance to the correct queue
if(m_onlyThisQueueId) {
for( ; m_jobQueuesQueueIt != m_jobQueuesQueue.end(); ++m_jobQueuesQueueIt) {
if(m_jobQueuesQueueIt->tapePool == queue_id) break;
}
if(m_jobQueuesQueueIt == m_jobQueuesQueue.end()) {
throw cta::exception::UserError("TapePool " + queue_id + " not found.");
}
}
// Find the first job in the queue
if(m_jobQueuesQueueIt != m_jobQueuesQueue.end()) {
getQueueJobs();
}
}
//------------------------------------------------------------------------------
// QueueItor::qid (Archive specialisation)
//------------------------------------------------------------------------------
......@@ -100,10 +136,10 @@ getJob() const
}
//------------------------------------------------------------------------------
// QueueItor::QueueItor (Archive specialisation)
// QueueItor::QueueItor (Retrieve specialisation)
//------------------------------------------------------------------------------
template<>
QueueItor<objectstore::RootEntry::ArchiveQueueDump, objectstore::ArchiveQueue>::
QueueItor<objectstore::RootEntry::RetrieveQueueDump, objectstore::RetrieveQueue>::
QueueItor(objectstore::Backend &objectStore, const std::string &queue_id) :
m_objectStore(objectStore),
m_onlyThisQueueId(!queue_id.empty()),
......@@ -112,21 +148,22 @@ QueueItor(objectstore::Backend &objectStore, const std::string &queue_id) :
objectstore::RootEntry re(m_objectStore);
objectstore::ScopedSharedLock rel(re);
re.fetch();
m_jobQueuesQueue = re.dumpArchiveQueues();
m_jobQueuesQueue = re.dumpRetrieveQueues();
rel.release();
// Set queue iterator to the first queue in the list
// Find the first queue
m_jobQueuesQueueIt = m_jobQueuesQueue.begin();
#if 0
// If we specified a tape pool, advance to the correct queue
if(m_onlyThisQueueId) {
for( ; m_jobQueuesQueueIt != m_jobQueuesQueue.end(); ++m_jobQueuesQueueIt) {
if(m_jobQueuesQueueIt->tapePool == queue_id) break;
}
if(m_jobQueuesQueueIt == m_jobQueuesQueue.end()) {
throw cta::exception::UserError("TapePool " + queue_id + " not found.");
if(m_jobQueuesQueueIt->tapePool == queue_id) {
break;
}
}
}
#endif
// Find the first job in the queue
if(m_jobQueuesQueueIt != m_jobQueuesQueue.end()) {
......@@ -146,7 +183,7 @@ qid() const
}
//------------------------------------------------------------------------------
// QueueItor::QueueItor (Retrieve specialisation)
// QueueItor::getJob (Retrieve specialisation)
//------------------------------------------------------------------------------
template<>
std::pair<bool,objectstore::RetrieveQueue::job_t>
......@@ -173,41 +210,4 @@ getJob() const
}
}
//------------------------------------------------------------------------------
// QueueItor::QueueItor (Retrieve specialisation)
//------------------------------------------------------------------------------
template<>
QueueItor<objectstore::RootEntry::RetrieveQueueDump, objectstore::RetrieveQueue>::
QueueItor(objectstore::Backend &objectStore, const std::string &queue_id) :
m_objectStore(objectStore),
m_onlyThisQueueId(!queue_id.empty()),
m_jobQueueIt(m_jobQueue.begin())
{
objectstore::RootEntry re(m_objectStore);
objectstore::ScopedSharedLock rel(re);
re.fetch();
m_jobQueuesQueue = re.dumpRetrieveQueues();
rel.release();
// Find the first queue
m_jobQueuesQueueIt = m_jobQueuesQueue.begin();
#if 0
// If we specified a tape pool, advance to the correct queue
if(m_onlyThisQueueId) {
for( ; m_jobQueuesQueueIt != m_jobQueuesQueue.end(); ++m_jobQueuesQueueIt) {
if(m_jobQueuesQueueIt->tapePool == queue_id) {
break;
}
}
}
#endif
// Find the first job in the queue
if(m_jobQueuesQueueIt != m_jobQueuesQueue.end()) {
getQueueJobs();
}
}
} // namespace cta
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