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
46081822
Commit
46081822
authored
6 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[os-generic-queues] Removes "bytes" from RetrieveQueue partial specialisation
parent
cfb0dbff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
objectstore/RetrieveQueueAlgorithms.hpp
+59
-21
59 additions, 21 deletions
objectstore/RetrieveQueueAlgorithms.hpp
with
59 additions
and
21 deletions
objectstore/RetrieveQueueAlgorithms.hpp
+
59
−
21
View file @
46081822
...
...
@@ -54,22 +54,20 @@ struct ContainerTraits<RetrieveQueue,C>
};
struct
PoppedElementsSummary
;
struct
PopCriteria
{
PopCriteria
(
uint64_t
f
=
0
,
uint64_t
b
=
0
)
:
files
(
f
),
bytes
(
b
)
{}
PopCriteria
&
operator
-=
(
const
PoppedElementsSummary
&
);
uint64_t
files
;
uint64_t
bytes
;
PopCriteria
(
uint64_t
f
=
0
)
:
files
(
f
)
{}
PopCriteria
&
operator
-=
(
const
PoppedElementsSummary
&
);
};
struct
PoppedElementsSummary
{
uint64_t
bytes
=
0
;
uint64_t
files
=
0
;
uint64_t
files
;
PoppedElementsSummary
(
uint64_t
f
=
0
)
:
files
(
f
)
{}
bool
operator
==
(
const
PoppedElementsSummary
&
pes
)
const
{
return
bytes
==
pes
.
bytes
&&
files
==
pes
.
files
;
return
files
==
pes
.
files
;
}
bool
operator
<
(
const
PopCriteria
&
pc
)
const
{
return
bytes
<
pc
.
bytes
&&
files
<
pc
.
files
;
return
files
<
pc
.
files
;
}
PoppedElementsSummary
&
operator
+=
(
const
PoppedElementsSummary
&
other
)
{
bytes
+=
other
.
bytes
;
files
+=
other
.
files
;
return
*
this
;
}
...
...
@@ -149,18 +147,7 @@ struct ContainerTraits<RetrieveQueue,C>
// RetrieveQueue partial specialisations for ContainerTraits.
//
// Add a full specialisation to override for a specific ArchiveQueue type.
template
<
typename
C
>
void
ContainerTraits
<
RetrieveQueue
,
C
>::
PoppedElementsSummary
::
addDeltaToLog
(
const
PoppedElementsSummary
&
previous
,
log
::
ScopedParamContainer
&
params
)
const
{
params
.
add
(
"filesAdded"
,
files
-
previous
.
files
)
.
add
(
"bytesAdded"
,
bytes
-
previous
.
bytes
)
.
add
(
"filesBefore"
,
previous
.
files
)
.
add
(
"bytesBefore"
,
previous
.
bytes
)
.
add
(
"filesAfter"
,
files
)
.
add
(
"bytesAfter"
,
bytes
);
}
// Add a full specialisation to override for a specific RetrieveQueue type.
template
<
typename
C
>
void
ContainerTraits
<
RetrieveQueue
,
C
>::
ContainerSummary
::
...
...
@@ -174,11 +161,18 @@ addDeltaToLog(const ContainerSummary &previous, log::ScopedParamContainer ¶m
template
<
typename
C
>
auto
ContainerTraits
<
RetrieveQueue
,
C
>::
PopCriteria
::
operator
-=
(
const
PoppedElementsSummary
&
pes
)
->
PopCriteria
&
{
bytes
-=
pes
.
bytes
;
files
-=
pes
.
files
;
return
*
this
;
}
template
<
typename
C
>
void
ContainerTraits
<
RetrieveQueue
,
C
>::
PoppedElementsSummary
::
addDeltaToLog
(
const
PoppedElementsSummary
&
previous
,
log
::
ScopedParamContainer
&
params
)
const
{
params
.
add
(
"filesAdded"
,
files
-
previous
.
files
)
.
add
(
"filesBefore"
,
previous
.
files
)
.
add
(
"filesAfter"
,
files
);
}
template
<
typename
C
>
void
ContainerTraits
<
RetrieveQueue
,
C
>::
PoppedElementsList
::
insertBack
(
PoppedElementsList
&&
insertedList
)
{
...
...
@@ -441,4 +435,48 @@ trimContainerIfNeeded(Container &cont, ScopedExclusiveLock &contLock, const Cont
}
}
// RetrieveQueue full specialisations for ContainerTraits.
template
<
>
struct
ContainerTraits
<
RetrieveQueue
,
RetrieveQueueToTransfer
>::
PopCriteria
{
uint64_t
files
;
uint64_t
bytes
;
PopCriteria
(
uint64_t
f
=
0
,
uint64_t
b
=
0
)
:
files
(
f
),
bytes
(
b
)
{}
template
<
typename
PoppedElementsSummary_t
>
PopCriteria
&
operator
-=
(
const
PoppedElementsSummary_t
&
pes
)
{
bytes
-=
pes
.
bytes
;
files
-=
pes
.
files
;
return
*
this
;
}
};
template
<
>
struct
ContainerTraits
<
RetrieveQueue
,
RetrieveQueueToTransfer
>::
PoppedElementsSummary
{
uint64_t
files
;
uint64_t
bytes
;
PoppedElementsSummary
(
uint64_t
f
=
0
,
uint64_t
b
=
0
)
:
files
(
f
),
bytes
(
b
)
{}
bool
operator
==
(
const
PoppedElementsSummary
&
pes
)
const
{
return
bytes
==
pes
.
bytes
&&
files
==
pes
.
files
;
}
bool
operator
<
(
const
PopCriteria
&
pc
)
const
{
// This returns false if bytes or files are equal but the other value is less. Is that the intended behaviour?
return
bytes
<
pc
.
bytes
&&
files
<
pc
.
files
;
}
PoppedElementsSummary
&
operator
+=
(
const
PoppedElementsSummary
&
other
)
{
bytes
+=
other
.
bytes
;
files
+=
other
.
files
;
return
*
this
;
}
void
addDeltaToLog
(
const
PoppedElementsSummary
&
previous
,
log
::
ScopedParamContainer
&
params
)
{
params
.
add
(
"filesAdded"
,
files
-
previous
.
files
)
.
add
(
"bytesAdded"
,
bytes
-
previous
.
bytes
)
.
add
(
"filesBefore"
,
previous
.
files
)
.
add
(
"bytesBefore"
,
previous
.
bytes
)
.
add
(
"filesAfter"
,
files
)
.
add
(
"bytesAfter"
,
bytes
);
}
};
}}
// namespace cta::objectstore
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