Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
d12d772f
Commit
d12d772f
authored
6 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[lpa_stream] Cleans up comments
parent
caf06b90
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scheduler/OStoreDB/QueueItor.cpp
+48
-48
48 additions, 48 deletions
scheduler/OStoreDB/QueueItor.cpp
with
48 additions
and
48 deletions
scheduler/OStoreDB/QueueItor.cpp
+
48
−
48
View file @
d12d772f
...
@@ -24,10 +24,11 @@
...
@@ -24,10 +24,11 @@
namespace
cta
{
namespace
cta
{
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// QueueItor::getQueueJobs
// QueueItor::getQueueJobs
(generic)
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
template
<
typename
JobQueuesQueue
,
typename
JobQueue
>
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.
// 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.
// In this case, we ignore the error and move on.
...
@@ -44,6 +45,41 @@ void QueueItor<JobQueuesQueue, JobQueue>::getQueueJobs()
...
@@ -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)
// QueueItor::qid (Archive specialisation)
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -100,10 +136,10 @@ getJob() const
...
@@ -100,10 +136,10 @@ getJob() const
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// QueueItor::QueueItor (
Archi
ve specialisation)
// QueueItor::QueueItor (
Retrie
ve specialisation)
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
template
<
>
template
<
>
QueueItor
<
objectstore
::
RootEntry
::
Archi
veQueueDump
,
objectstore
::
Archi
veQueue
>::
QueueItor
<
objectstore
::
RootEntry
::
Retrie
veQueueDump
,
objectstore
::
Retrie
veQueue
>::
QueueItor
(
objectstore
::
Backend
&
objectStore
,
const
std
::
string
&
queue_id
)
:
QueueItor
(
objectstore
::
Backend
&
objectStore
,
const
std
::
string
&
queue_id
)
:
m_objectStore
(
objectStore
),
m_objectStore
(
objectStore
),
m_onlyThisQueueId
(
!
queue_id
.
empty
()),
m_onlyThisQueueId
(
!
queue_id
.
empty
()),
...
@@ -112,21 +148,22 @@ QueueItor(objectstore::Backend &objectStore, const std::string &queue_id) :
...
@@ -112,21 +148,22 @@ QueueItor(objectstore::Backend &objectStore, const std::string &queue_id) :
objectstore
::
RootEntry
re
(
m_objectStore
);
objectstore
::
RootEntry
re
(
m_objectStore
);
objectstore
::
ScopedSharedLock
rel
(
re
);
objectstore
::
ScopedSharedLock
rel
(
re
);
re
.
fetch
();
re
.
fetch
();
m_jobQueuesQueue
=
re
.
dump
Archi
veQueues
();
m_jobQueuesQueue
=
re
.
dump
Retrie
veQueues
();
rel
.
release
();
rel
.
release
();
//
Set queue iterator to
the first queue
in the list
//
Find
the first queue
m_jobQueuesQueueIt
=
m_jobQueuesQueue
.
begin
();
m_jobQueuesQueueIt
=
m_jobQueuesQueue
.
begin
();
#if 0
// If we specified a tape pool, advance to the correct queue
// If we specified a tape pool, advance to the correct queue
if(m_onlyThisQueueId) {
if(m_onlyThisQueueId) {
for( ; m_jobQueuesQueueIt != m_jobQueuesQueue.end(); ++m_jobQueuesQueueIt) {
for( ; m_jobQueuesQueueIt != m_jobQueuesQueue.end(); ++m_jobQueuesQueueIt) {
if
(
m_jobQueuesQueueIt
->
tapePool
==
queue_id
)
break
;
if(m_jobQueuesQueueIt->tapePool == queue_id) {
}
break;
if
(
m_jobQueuesQueueIt
==
m_jobQueuesQueue
.
end
())
{
}
throw
cta
::
exception
::
UserError
(
"TapePool "
+
queue_id
+
" not found."
);
}
}
}
}
#endif
// Find the first job in the queue
// Find the first job in the queue
if
(
m_jobQueuesQueueIt
!=
m_jobQueuesQueue
.
end
())
{
if
(
m_jobQueuesQueueIt
!=
m_jobQueuesQueue
.
end
())
{
...
@@ -146,7 +183,7 @@ qid() const
...
@@ -146,7 +183,7 @@ qid() const
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// QueueItor::
QueueItor
(Retrieve specialisation)
// QueueItor::
getJob
(Retrieve specialisation)
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
template
<
>
template
<
>
std
::
pair
<
bool
,
objectstore
::
RetrieveQueue
::
job_t
>
std
::
pair
<
bool
,
objectstore
::
RetrieveQueue
::
job_t
>
...
@@ -173,41 +210,4 @@ getJob() const
...
@@ -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
}
// namespace cta
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment