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
d9e8b88e
Commit
d9e8b88e
authored
Sep 10, 2019
by
Michael Davis
Browse files
[migration] Implements eos-import-files --list-failures and --list-failure-modes
parent
ff27302b
Changes
1
Hide whitespace changes
Inline
Side-by-side
migration/gRPC/EosImportFiles.cpp
View file @
d9e8b88e
...
...
@@ -82,15 +82,14 @@ EosImportFiles::EosImportFiles(const std::string &configfile, bool retry) :
void
EosImportFiles
::
listFailureModes
()
{
#if 0
const std::string sql = "SELECT "
"RETC, "
"REGEXP_REPLACE(REPLACE(MESSAGE, PATH, '<path>'), 'id=[0-9]*', 'id=<id>') AS MSG, "
"COUNT(*) AS CNT "
"FROM CTADIRSFAILED "
"GROUP BY RETC, "
"REGEXP_REPLACE(REPLACE(MESSAGE, PATH, '<path>'), 'id=[0-9]*', 'id=<id>') "
"ORDER BY RETC, MSG";
const
std
::
string
sql
=
"SELECT"
" RETC,"
" REGEXP_REPLACE(MESSAGE, 'id=[0-9]*', 'id=<id>') AS MSG,"
" COUNT(*) AS CNT"
" FROM CTAFILESFAILED"
" GROUP BY RETC,"
" REGEXP_REPLACE(MESSAGE, 'id=[0-9]*', 'id=<id>')"
" ORDER BY RETC, MSG"
;
auto
stmt
=
m_dbConn
.
createStmt
(
sql
);
auto
rset
=
stmt
.
executeQuery
();
...
...
@@ -98,34 +97,34 @@ void EosImportFiles::listFailureModes()
std
::
cout
<<
rset
.
columnString
(
"MSG"
)
<<
" (retc="
<<
rset
.
columnUint64
(
"RETC"
)
<<
", count="
<<
rset
.
columnUint64
(
"CNT"
)
<<
")"
<<
std
::
endl
;
}
#endif
}
void
EosImportFiles
::
listFailures
()
{
#if 0
const std::string sql = "SELECT FILEID, PATH, RETC, MESSAGE FROM CTADIRSFAILED";
const
std
::
string
sql
=
"SELECT"
" A.FILEID, B.PATH, A.FILENAME, A.RETC, A.MESSAGE"
" FROM CTAFILESFAILED A, CTADIRSHELPER B"
" WHERE A.PARENT_FILEID = B.FILEID"
;
m_selectFilesDbStmt
=
m_dbConn
.
createStmt
(
sql
);
auto
stmt
=
m_dbConn
.
createStmt
(
sql
);
auto
rset
=
stmt
.
executeQuery
();
while
(
rset
.
next
())
{
std::cout << rset.columnString("FILEID") << " " << rset.columnString("PATH") << " "
std
::
cout
<<
rset
.
columnString
(
"FILEID"
)
<<
" "
<<
rset
.
columnString
(
"PATH"
)
<<
"/"
<<
rset
.
columnString
(
"FILENAME"
)
<<
" "
<<
rset
.
columnString
(
"MESSAGE"
)
<<
" (retc="
<<
rset
.
columnUint64
(
"RETC"
)
<<
")"
<<
std
::
endl
;
}
#endif
}
void
EosImportFiles
::
forgetFailures
()
{
#if 0
const std::string sql = "DELETE FROM CTADIRSFAILED WHERE PATH LIKE '" + m_topLevelPath + "%'";
const
std
::
string
sql
=
"DELETE FROM CTAFILESFAILED"
;
auto
stmt
=
m_dbConn
.
createStmt
(
sql
);
std::cerr << "Deleting from CTA
DIR
SFAILED...";
std
::
cerr
<<
"Deleting from CTA
FILE
SFAILED..."
;
stmt
.
executeNonQuery
();
std
::
cerr
<<
"done."
<<
std
::
endl
;
#endif
}
...
...
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