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
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
561aa1cd
Commit
561aa1cd
authored
5 years ago
by
Eric Cano
Browse files
Options
Downloads
Patches
Plain Diff
#471 Added activity ordering in scheduler.
parent
0f92c4ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scheduler/SchedulerDatabase.hpp
+26
-1
26 additions, 1 deletion
scheduler/SchedulerDatabase.hpp
xroot_plugins/XrdSsiCtaRequestMessage.cpp
+3
-1
3 additions, 1 deletion
xroot_plugins/XrdSsiCtaRequestMessage.cpp
with
29 additions
and
2 deletions
scheduler/SchedulerDatabase.hpp
+
26
−
1
View file @
561aa1cd
...
...
@@ -543,6 +543,16 @@ public:
std
::
string
logicalLibrary
;
/**< The logical library (for a retrieve) */
double
ratioOfMountQuotaUsed
;
/**< The [ 0.0, 1.0 ] ratio of existing
* mounts/quota (for faire share of mounts)*/
uint32_t
mountCount
;
/**< The number of mounts for this tape pool (which is the current "chargeable" entity for quotas. */
struct
ActivityNameAndWeightedMountCount
{
std
::
string
activity
;
double
weight
;
double
weightedMountCount
;
};
/**< Struct describing the activity if we have one for this mount. */
optional
<
ActivityNameAndWeightedMountCount
>
activityNameAndWeightedMountCount
;
/**< Description if the activity for this potential mount. */
bool
operator
<
(
const
PotentialMount
&
other
)
const
{
if
(
priority
<
other
.
priority
)
...
...
@@ -553,8 +563,21 @@ public:
return
false
;
if
(
other
.
type
==
cta
::
common
::
dataStructures
::
MountType
::
ArchiveForUser
&&
type
!=
cta
::
common
::
dataStructures
::
MountType
::
ArchiveForUser
)
return
true
;
if
(
ratioOfMountQuotaUsed
<
other
.
ratioOfMountQuotaUsed
)
// If we have achieved a HIGHER ratio of our mount allowance, then the other mount will be privileged
if
(
ratioOfMountQuotaUsed
>
other
.
ratioOfMountQuotaUsed
)
return
true
;
if
(
ratioOfMountQuotaUsed
<
other
.
ratioOfMountQuotaUsed
)
return
false
;
// If we have activities (and the mounts are for the same tape pool) we can compare them.
// If not, it does not matter too much: one mount will go, increasing its ratio, and next time it will
// the tapepool. So for different tape pools, we do not order. Likewise, both mounts should have an activity to
// be comparable
if
(
activityNameAndWeightedMountCount
&&
other
.
activityNameAndWeightedMountCount
&&
tapePool
==
other
.
tapePool
)
{
if
(
activityNameAndWeightedMountCount
.
value
().
weightedMountCount
>
other
.
activityNameAndWeightedMountCount
.
value
().
weight
)
return
true
;
if
(
activityNameAndWeightedMountCount
.
value
().
weightedMountCount
<
other
.
activityNameAndWeightedMountCount
.
value
().
weight
)
return
false
;
}
if
(
minRequestAge
<
other
.
minRequestAge
)
return
true
;
if
(
minRequestAge
>
other
.
minRequestAge
)
...
...
@@ -585,6 +608,8 @@ public:
uint64_t
bytesTransferred
;
uint64_t
filesTransferred
;
double
latestBandwidth
;
uint64_t
priority
;
optional
<
std
::
string
>
activity
;
};
/**
...
...
This diff is collapsed.
Click to expand it.
xroot_plugins/XrdSsiCtaRequestMessage.cpp
+
3
−
1
View file @
561aa1cd
...
...
@@ -861,7 +861,7 @@ void RequestMessage::processDrive_Ls(cta::xrd::Response &response)
std
::
vector
<
std
::
vector
<
std
::
string
>>
responseTable
;
std
::
vector
<
std
::
string
>
headers
=
{
"library"
,
"drive"
,
"host"
,
"desired"
,
"request"
,
"status"
,
"since"
,
"vid"
,
"tapepool"
,
"files"
,
"MBytes"
,
"MB/s"
,
"session"
,
"age"
"MBytes"
,
"MB/s"
,
"session"
,
"
priority"
,
"activity"
,
"
age"
};
responseTable
.
push_back
(
headers
);
...
...
@@ -928,6 +928,8 @@ void RequestMessage::processDrive_Ls(cta::xrd::Response &response)
default:
currentRow
.
push_back
(
std
::
to_string
(
static_cast
<
unsigned
long
long
>
(
ds
.
sessionId
)));
}
currentRow
.
push_back
(
std
::
to_string
(
ds
.
currentPriority
));
currentRow
.
push_back
(
ds
.
currentActivityAndWeight
?
ds
.
currentActivityAndWeight
.
value
().
activity
:
"-"
);
currentRow
.
push_back
(
std
::
to_string
(
timeSinceLastUpdate_s
)
+
(
timeSinceLastUpdate_s
>
DRIVE_TIMEOUT
?
" [STALE]"
:
""
));
responseTable
.
push_back
(
currentRow
);
...
...
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