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
ee6c61df
Commit
ee6c61df
authored
6 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[os-generic-queues] Implements Retrieve referenceAndSwitchOwnershipIfNecessary()
parent
d3c25dc5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
objectstore/Algorithms.hpp
+6
-4
6 additions, 4 deletions
objectstore/Algorithms.hpp
objectstore/AlgorithmsTest.cpp
+8
-0
8 additions, 0 deletions
objectstore/AlgorithmsTest.cpp
objectstore/RetrieveQueueAlgorithms.cpp
+7
-14
7 additions, 14 deletions
objectstore/RetrieveQueueAlgorithms.cpp
with
21 additions
and
18 deletions
objectstore/Algorithms.hpp
+
6
−
4
View file @
ee6c61df
...
...
@@ -205,10 +205,12 @@ public:
}
}
/** Reference objects in the container if needed and then switch their ownership (if needed). Objects
* are expected to be owned by agent, and not listed in the container but situations might vary.
* This function is typically used by the garbage collector. We do noe take care of dereferencing
* the object from the caller.
/**
* Reference objects in the container if needed and then switch their ownership (if needed).
*
* Objects are expected to be owned by an agent and not listed in the container, but situations
* might vary. This function is typically used by the garbage collector. We do not take care of
* dereferencing the object from the caller.
*/
void
referenceAndSwitchOwnershipIfNecessary
(
const
typename
ContainerTraits
<
C
>::
ContainerIdentifier
&
contId
,
typename
ContainerTraits
<
C
>::
ContainerAddress
&
previousOwnerAddress
,
...
...
This diff is collapsed.
Click to expand it.
objectstore/AlgorithmsTest.cpp
+
8
−
0
View file @
ee6c61df
...
...
@@ -177,7 +177,15 @@ TEST(ObjectStore, RetrieveQueueAlgorithms) {
ContainerAlgorithms
<
RetrieveQueue
>
retrieveAlgos
(
be
,
agentRef
);
try
{
ASSERT_EQ
(
requests
.
size
(),
10
);
#if 1
auto
a1
=
agentRef
.
getAgentAddress
();
auto
a2
=
agentRef
.
getAgentAddress
();
retrieveAlgos
.
referenceAndSwitchOwnershipIfNecessary
(
"VID"
,
a1
,
a2
,
requests
,
lc
);
#else
retrieveAlgos
.
referenceAndSwitchOwnership
(
"VID"
,
requests
,
lc
);
#endif
// Now get the requests back
ContainerTraits
<
RetrieveQueue
>::
PopCriteria
popCriteria
;
popCriteria
.
bytes
=
std
::
numeric_limits
<
decltype
(
popCriteria
.
bytes
)
>::
max
();
...
...
This diff is collapsed.
Click to expand it.
objectstore/RetrieveQueueAlgorithms.cpp
+
7
−
14
View file @
ee6c61df
...
...
@@ -149,23 +149,16 @@ addReferencesAndCommit(Container &cont, InsertedElement::list &elemMemCont, Agen
}
template
<
>
void
ContainerTraits
<
RetrieveQueue
>::
addReferencesIfNecessaryAndCommit
(
Container
&
cont
,
InsertedElement
::
list
&
elemMemCont
,
AgentReference
&
agentRef
,
log
::
LogContext
&
lc
)
void
ContainerTraits
<
RetrieveQueue
>::
addReferencesIfNecessaryAndCommit
(
Container
&
cont
,
InsertedElement
::
list
&
elemMemCont
,
AgentReference
&
agentRef
,
log
::
LogContext
&
lc
)
{
throw
std
::
runtime_error
(
"ContainerTraits<RetrieveQueue>::addReferencesIfNecessaryAndCommit(): Not implemented"
);
#if 0
std::list<ArchiveQueue::JobToAdd> jobsToAdd;
for (auto & e: elemMemCont) {
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(nullptr)});
std
::
list
<
RetrieveQueue
::
JobToAdd
>
jobsToAdd
;
for
(
auto
&
e
:
elemMemCont
)
{
RetrieveRequest
&
rr
=
*
e
.
retrieveRequest
;
jobsToAdd
.
push_back
({
e
.
copyNb
,
e
.
fSeq
,
rr
.
getAddressIfSet
(),
e
.
filesize
,
e
.
policy
,
::
time
(
nullptr
)});
}
cont
.
addJobsIfNecessaryAndCommit
(
jobsToAdd
,
agentRef
,
lc
);
#endif
}
template
<
>
...
...
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