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
db412924
Commit
db412924
authored
6 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[lpa_stream] Adds cache for queue jobs and dereference operator
parent
642be592
Branches
Branches containing commit
Tags
v0.0-129
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scheduler/OStoreDB/QueueItor.cpp
+29
-0
29 additions, 0 deletions
scheduler/OStoreDB/QueueItor.cpp
scheduler/OStoreDB/QueueItor.hpp
+43
-14
43 additions, 14 deletions
scheduler/OStoreDB/QueueItor.hpp
with
72 additions
and
14 deletions
scheduler/OStoreDB/QueueItor.cpp
+
29
−
0
View file @
db412924
...
...
@@ -46,6 +46,35 @@ getQueueJobs()
}
}
//auto ArchiveQueue::dumpJobs() -> std::list<JobDump> {
//checkPayloadReadable();
// Go read the shards in parallel...
// std::list<JobDump> ret;
// std::list<ArchiveQueueShard> shards;
// std::list<std::unique_ptr<ArchiveQueueShard::AsyncLockfreeFetcher>> shardsFetchers;
// for (auto & sa: m_payload.archivequeueshards()) {
// shards.emplace_back(ArchiveQueueShard(sa.address(), m_objectStore));
// shardsFetchers.emplace_back(shards.back().asyncLockfreeFetch());
// }
// auto s = shards.begin();
// auto sf = shardsFetchers.begin();
// while (s != shards.end()) {
// try {
// (*sf)->wait();
// } catch (Backend::NoSuchObject & ex) {
// // We are possibly in read only mode, so we cannot rebuild.
// // Just skip this shard.
// goto nextShard;
// }
// for (auto & j: s->dumpJobs()) {
// ret.emplace_back(JobDump{j.size, j.address, j.copyNb});
// }
// nextShard:
// s++; sf++;
// }
// return ret;
// }
//------------------------------------------------------------------------------
// QueueItor::QueueItor (Archive specialisation)
//------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
scheduler/OStoreDB/QueueItor.hpp
+
43
−
14
View file @
db412924
...
...
@@ -31,12 +31,21 @@ namespace cta {
template
<
typename
JobQueuesQueue
,
typename
JobQueue
>
class
QueueItor
{
public:
//! Constructor
/*!
* Default constructor
*/
QueueItor
(
objectstore
::
Backend
&
objectStore
,
const
std
::
string
&
queue_id
=
""
);
/*!
* No assignment constructor
*/
QueueItor
operator
=
(
QueueItor
&
rhs
)
=
delete
;
// Default copy constructor is deleted in favour of move constructor
//! Move constructor
/*!
* Move constructor
*/
QueueItor
(
QueueItor
&&
rhs
)
:
m_objectStore
(
std
::
move
(
rhs
).
m_objectStore
),
m_onlyThisQueueId
(
std
::
move
(
rhs
).
m_onlyThisQueueId
),
...
...
@@ -57,9 +66,6 @@ public:
}
}
//! No assignment constructor
QueueItor
operator
=
(
QueueItor
&
rhs
)
=
delete
;
/*!
* Increment iterator
*
...
...
@@ -117,21 +123,44 @@ public:
return
m_jobQueuesQueueIt
==
m_jobQueuesQueue
.
end
()
||
(
m_onlyThisQueueId
&&
endq
());
}
//! Queue ID (returns tapepool for archives/vid for retrieves)
/*!
* Queue ID (returns tapepool for archives/vid for retrieves)
*/
const
std
::
string
&
qid
()
const
;
//! Get the current job, bool is set to true if the data retrieved is valid
/*!
* Dereference the QueueItor
*/
typename
JobQueue
::
job_t
&
operator
*
()
const
{
return
m_jobsCache
.
front
();
}
/*!
* Get the current job, bool is set to true if the data retrieved is valid
*/
std
::
pair
<
bool
,
typename
JobQueue
::
job_t
>
getJob
()
const
;
private
:
//! Get the list of jobs in the queue
/*!
* Get the list of jobs in the queue
*/
void
getQueueJobs
();
objectstore
::
Backend
&
m_objectStore
;
// Reference to ObjectStore Backend
bool
m_onlyThisQueueId
;
// true if a queue_id parameter was passed to the constructor
typename
std
::
list
<
JobQueuesQueue
>
m_jobQueuesQueue
;
// list of Archive or Retrieve Job Queues
typename
std
::
list
<
JobQueuesQueue
>::
const_iterator
m_jobQueuesQueueIt
;
// iterator across m_jobQueuesQueue
typename
std
::
list
<
typename
JobQueue
::
JobDump
>
m_jobQueue
;
// list of Archive or Retrieve Jobs
typename
std
::
list
<
typename
JobQueue
::
JobDump
>::
const_iterator
m_jobQueueIt
;
// iterator across m_jobQueue
/*!
* Update the cache of queue jobs
*/
void
updateJobsCache
();
const
int
JOB_CACHE_SIZE
=
100
;
//! Maximum number of jobs to asynchronously fetch from the queue at once
objectstore
::
Backend
&
m_objectStore
;
//! Reference to ObjectStore Backend
bool
m_onlyThisQueueId
;
//! true if a queue_id parameter was passed to the constructor
typename
std
::
list
<
JobQueuesQueue
>
m_jobQueuesQueue
;
//! list of Archive or Retrieve Job Queues
typename
std
::
list
<
JobQueuesQueue
>::
const_iterator
m_jobQueuesQueueIt
;
//! iterator across m_jobQueuesQueue
typename
std
::
list
<
typename
JobQueue
::
JobDump
>
m_jobQueue
;
//! list of Archive or Retrieve Jobs
typename
std
::
list
<
typename
JobQueue
::
JobDump
>::
const_iterator
m_jobQueueIt
;
//! iterator across m_jobQueue
typename
std
::
list
<
typename
JobQueue
::
job_t
>
m_jobsCache
;
//! local cache of queue jobs
};
}
// 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