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
5035ddba
Commit
5035ddba
authored
Apr 26, 2016
by
Steven Murray
Browse files
Renamed dataStructures::TapeFileLocation to TapeFile
parent
ab0bc303
Changes
11
Hide whitespace changes
Inline
Side-by-side
catalogue/Catalogue.hpp
View file @
5035ddba
...
...
@@ -52,7 +52,7 @@
#include
"common/dataStructures/StorageClass.hpp"
#include
"common/dataStructures/Tape.hpp"
#include
"common/dataStructures/TapeCopyToPoolMap.hpp"
#include
"common/dataStructures/TapeFile
Location
.hpp"
#include
"common/dataStructures/TapeFile.hpp"
#include
"common/dataStructures/TapePool.hpp"
#include
"common/dataStructures/UpdateFileInfoRequest.hpp"
#include
"common/dataStructures/UserIdentity.hpp"
...
...
@@ -207,7 +207,7 @@ public:
*/
virtual
void
fileWrittenToTape
(
const
cta
::
common
::
dataStructures
::
ArchiveRequest
&
archiveRequest
,
const
cta
::
common
::
dataStructures
::
TapeFile
Location
&
tapeFileLocation
)
=
0
;
const
cta
::
common
::
dataStructures
::
TapeFile
&
tapeFileLocation
)
=
0
;
virtual
cta
::
common
::
dataStructures
::
TapeCopyToPoolMap
getTapeCopyToPoolMap
(
const
std
::
string
&
storageClass
)
const
=
0
;
...
...
catalogue/SqliteCatalogue.cpp
View file @
5035ddba
...
...
@@ -19,7 +19,7 @@
#include
"catalogue/SqliteCatalogue.hpp"
#include
"catalogue/SqliteCatalogueSchema.hpp"
#include
"catalogue/SqliteStmt.hpp"
#include
"common/dataStructures/TapeFile
Location
.hpp"
#include
"common/dataStructures/TapeFile.hpp"
#include
"common/exception/Exception.hpp"
#include
<memory>
...
...
@@ -1756,7 +1756,7 @@ void SqliteCatalogue::setDriveStatus(const common::dataStructures::SecurityIdent
//------------------------------------------------------------------------------
void
SqliteCatalogue
::
fileWrittenToTape
(
const
cta
::
common
::
dataStructures
::
ArchiveRequest
&
archiveRequest
,
const
cta
::
common
::
dataStructures
::
TapeFile
Location
&
tapeFileLocation
)
{
const
cta
::
common
::
dataStructures
::
TapeFile
&
tapeFileLocation
)
{
}
//------------------------------------------------------------------------------
...
...
@@ -1975,7 +1975,7 @@ bool SqliteCatalogue::hostIsAdmin(const std::string &hostName)
//------------------------------------------------------------------------------
// createTapeFile
//------------------------------------------------------------------------------
void
SqliteCatalogue
::
createTapeFile
(
const
common
::
dataStructures
::
TapeFile
Location
&
tapeFile
,
void
SqliteCatalogue
::
createTapeFile
(
const
common
::
dataStructures
::
TapeFile
&
tapeFile
,
const
uint64_t
archiveFileId
)
{
const
time_t
now
=
time
(
NULL
);
const
char
*
const
sql
=
...
...
@@ -2005,8 +2005,8 @@ void SqliteCatalogue::createTapeFile(const common::dataStructures::TapeFileLocat
//------------------------------------------------------------------------------
// getTapeFiles
//------------------------------------------------------------------------------
std
::
list
<
common
::
dataStructures
::
TapeFile
Location
>
SqliteCatalogue
::
getTapeFiles
()
const
{
std
::
list
<
cta
::
common
::
dataStructures
::
TapeFile
Location
>
files
;
std
::
list
<
common
::
dataStructures
::
TapeFile
>
SqliteCatalogue
::
getTapeFiles
()
const
{
std
::
list
<
cta
::
common
::
dataStructures
::
TapeFile
>
files
;
const
char
*
const
sql
=
"SELECT "
"VID AS VID,"
...
...
@@ -2020,7 +2020,7 @@ std::list<common::dataStructures::TapeFileLocation> SqliteCatalogue::getTapeFile
if
(
nameToIdx
.
empty
())
{
nameToIdx
=
stmt
->
getColumnNameToIdx
();
}
common
::
dataStructures
::
TapeFile
Location
file
;
common
::
dataStructures
::
TapeFile
file
;
file
.
vid
=
stmt
->
columnText
(
nameToIdx
[
"VID"
]);
file
.
fSeq
=
stmt
->
columnUint64
(
nameToIdx
[
"FSEQ"
]);
...
...
catalogue/SqliteCatalogue.hpp
View file @
5035ddba
...
...
@@ -31,7 +31,7 @@ namespace dataStructures {
/**
* Forward declaration.
*/
class
TapeFile
Location
;
class
TapeFile
;
}
// namespace dataStructures
}
// namespace catalogue
...
...
@@ -167,7 +167,7 @@ public:
*/
virtual
void
fileWrittenToTape
(
const
cta
::
common
::
dataStructures
::
ArchiveRequest
&
archiveRequest
,
const
cta
::
common
::
dataStructures
::
TapeFile
Location
&
tapeFileLocation
);
const
cta
::
common
::
dataStructures
::
TapeFile
&
tapeFileLocation
);
/**
* Prepares the catalogue for a new archive file and returns the information
...
...
@@ -273,14 +273,14 @@ protected:
* @param archiveFileId The identifier of the archive file of which the tape
* file is a copy.
*/
void
createTapeFile
(
const
common
::
dataStructures
::
TapeFile
Location
&
tapeFile
,
const
uint64_t
archiveFileId
);
void
createTapeFile
(
const
common
::
dataStructures
::
TapeFile
&
tapeFile
,
const
uint64_t
archiveFileId
);
/**
* Returns the list of all the tape files in the catalogue.
*
* @return The list of all the tape files in the catalogue.
*/
std
::
list
<
common
::
dataStructures
::
TapeFile
Location
>
getTapeFiles
()
const
;
std
::
list
<
common
::
dataStructures
::
TapeFile
>
getTapeFiles
()
const
;
/**
* Sets the last FSeq of the specified tape to the specified value.
...
...
catalogue/SqliteCatalogueTest.cpp
View file @
5035ddba
...
...
@@ -1060,7 +1060,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTapeFile) {
ASSERT_TRUE
(
catalogue
.
getTapeFiles
().
empty
());
common
::
dataStructures
::
TapeFile
Location
tapeFile
;
common
::
dataStructures
::
TapeFile
tapeFile
;
tapeFile
.
vid
=
"VID"
;
tapeFile
.
fSeq
=
5678
;
tapeFile
.
blockId
=
9012
;
...
...
@@ -1069,7 +1069,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTapeFile) {
catalogue
.
createTapeFile
(
tapeFile
,
archiveFileId
);
const
std
::
list
<
common
::
dataStructures
::
TapeFile
Location
>
tapeFiles
=
catalogue
.
getTapeFiles
();
const
std
::
list
<
common
::
dataStructures
::
TapeFile
>
tapeFiles
=
catalogue
.
getTapeFiles
();
ASSERT_EQ
(
1
,
tapeFiles
.
size
());
ASSERT_EQ
(
tapeFile
.
vid
,
tapeFiles
.
front
().
vid
);
...
...
common/CMakeLists.txt
View file @
5035ddba
...
...
@@ -51,7 +51,7 @@ set (COMMON_LIB_SRC_FILES
dataStructures/SecurityIdentity.cpp
dataStructures/StorageClass.cpp
dataStructures/Tape.cpp
dataStructures/TapeFile
Location
.cpp
dataStructures/TapeFile.cpp
dataStructures/TapeLog.cpp
dataStructures/TapePool.cpp
dataStructures/TestSourceType.cpp
...
...
common/dataStructures/ArchiveFile.hpp
View file @
5035ddba
...
...
@@ -24,7 +24,7 @@
#include
<string>
#include
"common/dataStructures/DRData.hpp"
#include
"common/dataStructures/TapeFile
Location
.hpp"
#include
"common/dataStructures/TapeFile.hpp"
namespace
cta
{
namespace
common
{
...
...
@@ -49,7 +49,7 @@ struct ArchiveFile {
std
::
string
checksumValue
;
std
::
string
storageClass
;
cta
::
common
::
dataStructures
::
DRData
drData
;
std
::
map
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
Location
>
tapeCopies
;
std
::
map
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
>
tapeCopies
;
time_t
creationTime
;
time_t
reconciliationTime
;
...
...
common/dataStructures/RetrieveJob.hpp
View file @
5035ddba
...
...
@@ -24,7 +24,7 @@
#include
<string>
#include
"common/dataStructures/RetrieveRequest.hpp"
#include
"common/dataStructures/TapeFile
Location
.hpp"
#include
"common/dataStructures/TapeFile.hpp"
namespace
cta
{
namespace
common
{
...
...
@@ -43,7 +43,7 @@ struct RetrieveJob {
bool
operator
!=
(
const
RetrieveJob
&
rhs
)
const
;
cta
::
common
::
dataStructures
::
RetrieveRequest
request
;
std
::
map
<
std
::
string
,
std
::
pair
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
Location
>>
tapeCopies
;
std
::
map
<
std
::
string
,
std
::
pair
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
>>
tapeCopies
;
};
// struct RetrieveJob
...
...
common/dataStructures/TapeFile
Location
.cpp
→
common/dataStructures/TapeFile.cpp
View file @
5035ddba
...
...
@@ -16,14 +16,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"common/dataStructures/TapeFile
Location
.hpp"
#include
"common/dataStructures/TapeFile.hpp"
#include
"common/dataStructures/utils.hpp"
#include
"common/exception/Exception.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta
::
common
::
dataStructures
::
TapeFile
Location
::
TapeFile
Location
()
:
cta
::
common
::
dataStructures
::
TapeFile
::
TapeFile
()
:
fSeq
(
0
),
blockId
(
0
),
creationTime
(
0
)
{}
...
...
@@ -31,7 +31,7 @@ cta::common::dataStructures::TapeFileLocation::TapeFileLocation():
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool
cta
::
common
::
dataStructures
::
TapeFile
Location
::
operator
==
(
const
TapeFile
Location
&
rhs
)
const
{
bool
cta
::
common
::
dataStructures
::
TapeFile
::
operator
==
(
const
TapeFile
&
rhs
)
const
{
return
vid
==
rhs
.
vid
&&
fSeq
==
rhs
.
fSeq
&&
blockId
==
rhs
.
blockId
...
...
@@ -41,14 +41,14 @@ bool cta::common::dataStructures::TapeFileLocation::operator==(const TapeFileLoc
//------------------------------------------------------------------------------
// operator!=
//------------------------------------------------------------------------------
bool
cta
::
common
::
dataStructures
::
TapeFile
Location
::
operator
!=
(
const
TapeFile
Location
&
rhs
)
const
{
bool
cta
::
common
::
dataStructures
::
TapeFile
::
operator
!=
(
const
TapeFile
&
rhs
)
const
{
return
!
operator
==
(
rhs
);
}
//------------------------------------------------------------------------------
// operator<<
//------------------------------------------------------------------------------
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
cta
::
common
::
dataStructures
::
TapeFile
Location
&
obj
)
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
cta
::
common
::
dataStructures
::
TapeFile
&
obj
)
{
os
<<
"(vid="
<<
obj
.
vid
<<
" fSeq="
<<
obj
.
fSeq
<<
" blockId="
<<
obj
.
blockId
...
...
common/dataStructures/TapeFile
Location
.hpp
→
common/dataStructures/TapeFile.hpp
View file @
5035ddba
...
...
@@ -31,23 +31,23 @@ namespace dataStructures {
/**
* This struct holds location information of a specific tape file
*/
struct
TapeFile
Location
{
struct
TapeFile
{
TapeFile
Location
();
TapeFile
();
bool
operator
==
(
const
TapeFile
Location
&
rhs
)
const
;
bool
operator
==
(
const
TapeFile
&
rhs
)
const
;
bool
operator
!=
(
const
TapeFile
Location
&
rhs
)
const
;
bool
operator
!=
(
const
TapeFile
&
rhs
)
const
;
std
::
string
vid
;
uint64_t
fSeq
;
uint64_t
blockId
;
time_t
creationTime
;
};
// struct TapeFile
Location
};
// struct TapeFile
}
// namespace dataStructures
}
// namespace common
}
// namespace cta
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
cta
::
common
::
dataStructures
::
TapeFile
Location
&
obj
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
cta
::
common
::
dataStructures
::
TapeFile
&
obj
);
common/dataStructures/utils.cpp
View file @
5035ddba
...
...
@@ -18,7 +18,7 @@
#include
"common/dataStructures/utils.hpp"
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
Location
>
&
map
)
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
>
&
map
)
{
os
<<
"("
;
for
(
auto
it
=
map
.
begin
();
it
!=
map
.
end
();
it
++
)
{
os
<<
" key="
<<
it
->
first
<<
" value="
<<
it
->
second
<<
" "
;
...
...
@@ -50,7 +50,7 @@ std::ostream &operator<<(std::ostream &os, const std::map<uint64_t,std::pair<std
return
os
;
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
std
::
string
,
std
::
pair
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
Location
>>
&
map
)
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
std
::
string
,
std
::
pair
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
>>
&
map
)
{
os
<<
"("
;
for
(
auto
it
=
map
.
begin
();
it
!=
map
.
end
();
it
++
)
{
os
<<
" key="
<<
it
->
first
<<
" value.first="
<<
it
->
second
.
first
<<
" value.second="
<<
it
->
second
.
second
;
...
...
common/dataStructures/utils.hpp
View file @
5035ddba
...
...
@@ -18,14 +18,14 @@
#pragma once
#include
"common/dataStructures/TapeFile
Location
.hpp"
#include
"common/dataStructures/TapeFile.hpp"
#include
<iostream>
#include
<map>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
Location
>
&
map
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
>
&
map
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
uint64_t
,
std
::
string
>
&
map
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
pair
<
std
::
string
,
std
::
string
>
&
pair
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
uint64_t
,
std
::
pair
<
std
::
string
,
std
::
string
>>
&
map
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
std
::
string
,
std
::
pair
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
Location
>>
&
map
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
std
::
string
,
std
::
pair
<
uint64_t
,
cta
::
common
::
dataStructures
::
TapeFile
>>
&
map
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
std
::
map
<
uint64_t
,
std
::
pair
<
std
::
string
,
std
::
string
>>
&
map
);
\ No newline at end of file
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