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
c68c67eb
Commit
c68c67eb
authored
6 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[lpa_stream] QueueItor does async fetch of retrieve jobs
parent
19872d46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scheduler/OStoreDB/QueueItor.cpp
+29
-16
29 additions, 16 deletions
scheduler/OStoreDB/QueueItor.cpp
with
29 additions
and
16 deletions
scheduler/OStoreDB/QueueItor.cpp
+
29
−
16
View file @
c68c67eb
...
...
@@ -91,20 +91,20 @@ std::cerr << "ArchiveQueue getQueueJobs() : fetching " << jobQueueChunk.size() <
// Async fetch of the archive jobs from the objectstore
for
(
auto
&
j
:
jobQueueChunk
)
{
auto
ar
=
ArchiveRequest
(
j
.
address
,
m_objectStore
);
requests
.
push_back
(
std
::
make_pair
(
ar
,
std
::
unique_ptr
<
ArchiveRequest
::
AsyncLockfreeFetcher
>
(
ar
.
asyncLockfreeFetch
())
))
;
requests
.
push_back
(
std
::
make_pair
(
ArchiveRequest
(
j
.
address
,
m_objectStore
)
,
nullptr
))
;
requests
.
back
().
second
.
reset
(
requests
.
back
().
first
.
asyncLockfreeFetch
());
}
// Populate the jobs cache from the archive jobs
for
(
auto
&
osar
:
requests
)
{
try
{
osar
.
second
->
wait
();
}
catch
(
Backend
::
NoSuchObject
&
ex
)
{
}
catch
(
Backend
::
NoSuchObject
&
ex
)
{
// Skip non-existent objects
continue
;
}
// Find the copy
number
for this
t
ape
p
ool
// Find the copy for this
T
ape
P
ool
for
(
auto
&
j
:
osar
.
first
.
dumpJobs
())
{
if
(
j
.
tapePool
==
m_jobQueuesQueueIt
->
tapePool
)
{
auto
job
=
cta
::
common
::
dataStructures
::
ArchiveJob
();
...
...
@@ -187,24 +187,37 @@ getQueueJobs(const jobQueue_t &jobQueueChunk)
using
namespace
objectstore
;
std
::
cerr
<<
"RetrieveQueue getQueueJobs() : fetching "
<<
jobQueueChunk
.
size
()
<<
" jobs."
<<
std
::
endl
;
// Populate the jobs cache from the retrieve jobs
for
(
auto
&
j
:
jobQueueChunk
)
{
typedef
std
::
pair
<
RetrieveRequest
,
std
::
unique_ptr
<
RetrieveRequest
::
AsyncLockfreeFetcher
>>
retrieveJob_t
;
std
::
list
<
retrieveJob_t
>
requests
;
// Async fetch of the retrieve jobs from the objectstore
for
(
auto
&
j
:
jobQueueChunk
)
{
requests
.
push_back
(
std
::
make_pair
(
RetrieveRequest
(
j
.
address
,
m_objectStore
),
nullptr
));
requests
.
back
().
second
.
reset
(
requests
.
back
().
first
.
asyncLockfreeFetch
());
}
// Populate the jobs cache from the retrieve jobs
for
(
auto
&
osrr
:
requests
)
{
try
{
auto
job
=
cta
::
common
::
dataStructures
::
RetrieveJob
();
osrr
.
second
->
wait
();
}
catch
(
Backend
::
NoSuchObject
&
ex
)
{
// Skip non-existent objects
continue
;
}
// Find the copy for this Volume ID
for
(
auto
&
tf
:
osrr
.
first
.
getArchiveFile
().
tapeFiles
)
{
if
(
tf
.
second
.
vid
==
m_jobQueuesQueueIt
->
vid
)
{
auto
job
=
cta
::
common
::
dataStructures
::
RetrieveJob
();
objectstore
::
RetrieveRequest
rr
(
j
.
address
,
m_objectStore
);
objectstore
::
ScopedSharedLock
rrl
(
rr
);
rr
.
fetch
();
job
.
request
=
rr
.
getSchedulerRequest
();
for
(
auto
&
tf
:
rr
.
getArchiveFile
().
tapeFiles
)
{
job
.
tapeCopies
[
tf
.
second
.
vid
].
first
=
tf
.
second
.
copyNb
;
job
.
tapeCopies
[
tf
.
second
.
vid
].
second
=
tf
.
second
;
}
m_jobCache
.
push_back
(
job
);
}
catch
(...)
{
// This implementation gives imperfect consistency and is racy. If the queue has gone, move on.
m_jobCache
.
push_back
(
job
);
}
}
}
}
...
...
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