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
5db5174d
Commit
5db5174d
authored
4 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[frontend] Adds showSuperseded to DB query for tapefile ls
parent
e8d90ad3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
catalogue/RdbmsCatalogueGetArchiveFilesItor.cpp
+1
-1
1 addition, 1 deletion
catalogue/RdbmsCatalogueGetArchiveFilesItor.cpp
xroot_plugins/XrdCtaTapeFileLs.hpp
+3
-11
3 additions, 11 deletions
xroot_plugins/XrdCtaTapeFileLs.hpp
with
4 additions
and
12 deletions
catalogue/RdbmsCatalogueGetArchiveFilesItor.cpp
+
1
−
1
View file @
5db5174d
...
...
@@ -162,7 +162,7 @@ RdbmsCatalogueGetArchiveFilesItor::RdbmsCatalogueGetArchiveFilesItor(
}
if
(
hideSuperseded
)
{
if
(
addedAWhereConstraint
)
sql
+=
" AND "
;
sql
+=
"TAPE_FILE.SUPERSEDED_BY_VID
!= ''
"
;
sql
+=
"TAPE_FILE.SUPERSEDED_BY_VID
IS NULL
"
;
addedAWhereConstraint
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
xroot_plugins/XrdCtaTapeFileLs.hpp
+
3
−
11
View file @
5db5174d
...
...
@@ -58,7 +58,6 @@ private:
catalogue
::
ArchiveFileItor
m_tapeFileItor
;
//!< Iterator across files which have been archived
grpc
::
EndpointMap
m_endpoints
;
//!< List of gRPC endpoints
bool
m_LookupNamespace
;
//!< True if namespace lookup is required
bool
m_ShowSuperseded
;
//!< True if superseded files should be included in the output
static
constexpr
const
char
*
const
LOG_SUFFIX
=
"TapeFileLsStream"
;
//!< Identifier for log messages
};
...
...
@@ -75,14 +74,14 @@ TapeFileLsStream::TapeFileLsStream(const RequestMessage &requestMsg,
XrdSsiPb
::
Log
::
Msg
(
XrdSsiPb
::
Log
::
DEBUG
,
LOG_SUFFIX
,
"TapeFileLsStream() constructor"
);
m_LookupNamespace
=
true
;
m_ShowSuperseded
=
requestMsg
.
has_flag
(
OptionBoolean
::
SHOW_SUPERSEDED
);
bool
has_any
=
false
;
// set to true if at least one optional option is set
// Get the search criteria from the optional options
cta
::
catalogue
::
TapeFileSearchCriteria
searchCriteria
;
searchCriteria
.
showSuperseded
=
requestMsg
.
has_flag
(
OptionBoolean
::
SHOW_SUPERSEDED
);
searchCriteria
.
vid
=
requestMsg
.
getOptional
(
OptionString
::
VID
,
&
has_any
);
// Disk file IDs can be a list or a single ID
auto
diskFileId
=
requestMsg
.
getOptional
(
OptionString
::
FXID
,
&
has_any
);
...
...
@@ -98,6 +97,7 @@ TapeFileLsStream::TapeFileLsStream(const RequestMessage &requestMsg,
}
searchCriteria
.
diskFileIds
->
push_back
(
std
::
to_string
(
fid
));
}
// Disk instance on its own does not give a valid set of search criteria (no &has_any)
searchCriteria
.
diskInstance
=
requestMsg
.
getOptional
(
OptionString
::
INSTANCE
);
if
(
!
has_any
)
{
...
...
@@ -116,14 +116,6 @@ int TapeFileLsStream::fillBuffer(XrdSsiPb::OStreamBuffer<Data> *streambuf) {
for
(
auto
jt
=
archiveFile
.
tapeFiles
.
cbegin
();
jt
!=
archiveFile
.
tapeFiles
.
cend
();
jt
++
)
{
Data
record
;
// Skip superseded files unless explicitly requested to show them
//
// Note: This could be implemented more efficiently by adding a showSuperseded flag to TapeFileSearchCriteria and
// filtering in the DB query in RdbmsCatalogueGetArchiveFilesItor. However, it is likely that the superseded
// files concept will be replaced by something else. Keeping the implementation here makes it easier to
// change the implementation.
if
(
!
(
m_ShowSuperseded
||
jt
->
supersededByVid
.
empty
()))
continue
;
// Archive file
auto
af
=
record
.
mutable_tfls_item
()
->
mutable_af
();
af
->
set_archive_id
(
archiveFile
.
archiveFileID
);
...
...
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