Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
c13af0b6
Commit
c13af0b6
authored
Sep 03, 2020
by
Cedric Caffy
Browse files
[lto_rao] Added RAOFile to store each job with its index and its position
parent
713d845f
Changes
4
Hide whitespace changes
Inline
Side-by-side
tapeserver/castor/tape/tapeserver/RAO/CMakeLists.txt
View file @
c13af0b6
...
...
@@ -24,6 +24,7 @@ set(CTARAO_LIBRARY_SRCS
InterpolationFilePositionEstimator.cpp
RAOHelpers.cpp
CTACostHeuristic.cpp
RAOFile.cpp
)
add_library
(
ctarao SHARED
...
...
tapeserver/castor/tape/tapeserver/RAO/RAOFile.cpp
0 → 100644
View file @
c13af0b6
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2019 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"RAOFile.hpp"
namespace
castor
{
namespace
tape
{
namespace
tapeserver
{
namespace
rao
{
RAOFile
::
RAOFile
(
const
uint64_t
index
,
const
FilePositionInfos
&
filePositionInfos
)
:
m_index
(
index
),
m_filePositionInfos
(
filePositionInfos
)
{
}
RAOFile
::
RAOFile
(
const
RAOFile
&
other
)
{
if
(
this
!=
&
other
){
m_index
=
other
.
m_index
;
m_filePositionInfos
=
other
.
m_filePositionInfos
;
}
}
RAOFile
&
RAOFile
::
operator
=
(
const
RAOFile
&
other
){
if
(
this
!=
&
other
){
m_index
=
other
.
m_index
;
m_filePositionInfos
=
other
.
m_filePositionInfos
;
}
return
*
this
;
}
uint64_t
RAOFile
::
getIndex
()
const
{
return
m_index
;
}
FilePositionInfos
RAOFile
::
getFilePositionInfos
()
const
{
return
m_filePositionInfos
;
}
RAOFile
::~
RAOFile
()
{
}
}}}}
\ No newline at end of file
tapeserver/castor/tape/tapeserver/RAO/RAOFile.hpp
0 → 100644
View file @
c13af0b6
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2019 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include
"FilePositionInfos.hpp"
namespace
castor
{
namespace
tape
{
namespace
tapeserver
{
namespace
rao
{
class
RAOFile
{
public:
RAOFile
(
const
uint64_t
index
,
const
FilePositionInfos
&
filePositionInfos
);
RAOFile
(
const
RAOFile
&
other
);
RAOFile
&
operator
=
(
const
RAOFile
&
other
);
uint64_t
getIndex
()
const
;
FilePositionInfos
getFilePositionInfos
()
const
;
virtual
~
RAOFile
();
private:
uint64_t
m_index
;
FilePositionInfos
m_filePositionInfos
;
};
}}}}
tapeserver/castor/tape/tapeserver/RAO/SLTFRAOAlgorithm.cpp
View file @
c13af0b6
...
...
@@ -20,6 +20,7 @@
#include
"InterpolationFilePositionEstimator.hpp"
#include
"RAOHelpers.hpp"
#include
"CTACostHeuristic.hpp"
#include
"RAOFile.hpp"
namespace
castor
{
namespace
tape
{
namespace
tapeserver
{
namespace
rao
{
...
...
@@ -27,6 +28,12 @@ SLTFRAOAlgorithm::SLTFRAOAlgorithm() {}
std
::
vector
<
uint64_t
>
SLTFRAOAlgorithm
::
performRAO
(
const
std
::
vector
<
std
::
unique_ptr
<
cta
::
RetrieveJob
>
>&
jobs
)
{
std
::
vector
<
uint64_t
>
ret
;
//Determine all the files position
std
::
vector
<
RAOFile
>
files
;
for
(
uint64_t
i
=
0
;
i
<
jobs
.
size
();
++
i
){
files
.
push_back
(
RAOFile
(
i
,
m_filePositionEstimator
->
getFilePosition
(
*
(
jobs
.
at
(
i
)))));
}
//Determine the matrix of the costs between each file
return
ret
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment