Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aleksandr Konstantinov
arc
Commits
d3451c38
Commit
d3451c38
authored
May 17, 2018
by
Aleksandr Konstantinov
Browse files
Making sqlite default option for jobs storage. Adding jobs storage conversion option to arcsync.
parent
3a8d0430
Pipeline
#1764
passed with stage
in 69 minutes and 7 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/clients/compute/arcsync.cpp
View file @
d3451c38
...
...
@@ -168,6 +168,36 @@ int RUNMAIN(arcsync)(int argc, char **argv) {
return
1
;
}
if
(
opt
.
convert
)
{
Arc
::
JobInformationStorage
*
jobstore
=
createJobInformationStorage
(
usercfg
);
if
(
jobstore
==
NULL
)
{
std
::
cerr
<<
Arc
::
IString
(
"Warning: Unable to open job list file (%s), unknown format"
,
usercfg
.
JobListFile
())
<<
std
::
endl
;
return
1
;
}
// Read current jobs
std
::
list
<
Arc
::
Job
>
jobs
;
if
(
!
jobstore
->
ReadAll
(
jobs
))
{
std
::
cerr
<<
Arc
::
IString
(
"Warning: Unable to read local list of jobs from file (%s)"
,
usercfg
.
JobListFile
())
<<
std
::
endl
;
return
1
;
}
// Delete existing database so new on is created with specified format
if
(
!
jobstore
->
Clean
())
{
std
::
cerr
<<
Arc
::
IString
(
"Warning: Unable to truncate local list of jobs in file (%s)"
,
usercfg
.
JobListFile
())
<<
std
::
endl
;
return
1
;
}
delete
jobstore
;
jobstore
=
createJobInformationStorage
(
usercfg
);
if
(
jobstore
==
NULL
)
{
std
::
cerr
<<
Arc
::
IString
(
"Warning: Unable to create job list file (%s), jobs list is destroyed"
,
usercfg
.
JobListFile
())
<<
std
::
endl
;
return
1
;
}
if
(
!
jobstore
->
Write
(
jobs
))
{
std
::
cerr
<<
Arc
::
IString
(
"Warning: Failed to write local list of jobs into file (%s), jobs list is destroyed"
,
usercfg
.
JobListFile
())
<<
std
::
endl
;
return
1
;
}
return
0
;
}
if
(
opt
.
timeout
>
0
)
usercfg
.
Timeout
(
opt
.
timeout
);
...
...
src/clients/compute/utils.cpp
View file @
d3451c38
...
...
@@ -256,6 +256,7 @@ ClientOptions::ClientOptions(Client_t c,
keep
(
false
),
forcesync
(
false
),
truncate
(
false
),
convert
(
false
),
longlist
(
false
),
printids
(
false
),
same
(
false
),
...
...
@@ -318,6 +319,10 @@ ClientOptions::ClientOptions(Client_t c,
AddOption
(
'T'
,
"truncate"
,
istring
(
"truncate the joblist before synchronizing"
),
truncate
);
AddOption
(
'C'
,
"convert"
,
istring
(
"do not collect information, only convert jobs storage format"
),
convert
);
}
if
(
c
==
CO_INFO
||
c
==
CO_STAT
)
{
...
...
src/clients/compute/utils.h
View file @
d3451c38
...
...
@@ -138,6 +138,7 @@ public:
bool
keep
;
bool
forcesync
;
bool
truncate
;
bool
convert
;
bool
longlist
;
bool
printids
;
bool
same
;
...
...
src/hed/libs/compute/JobInformationStorageDescriptor.cpp
View file @
d3451c38
...
...
@@ -15,11 +15,11 @@
namespace
Arc
{
JobInformationStorageDescriptor
JobInformationStorage
::
AVAILABLE_TYPES
[]
=
{
#ifdef DBJSTORE_ENABLED
{
"BDB"
,
&
JobInformationStorageBDB
::
Instance
},
#endif
#ifdef HAVE_SQLITE
{
"SQLITE"
,
&
JobInformationStorageSQLite
::
Instance
},
#endif
#ifdef DBJSTORE_ENABLED
{
"BDB"
,
&
JobInformationStorageBDB
::
Instance
},
#endif
{
"XML"
,
&
JobInformationStorageXML
::
Instance
},
{
NULL
,
NULL
}
...
...
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