Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
JAliEn
JAliEn-ROOT
Commits
ca871b0a
Commit
ca871b0a
authored
Jul 05, 2019
by
Nikola Hardi
Browse files
Expand the result of find command to include turl based on lfn
parent
fc96abc5
Pipeline
#984917
passed with stage
in 5 minutes and 37 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
inc/TJAlienConnectionManager.h
View file @
ca871b0a
...
...
@@ -76,7 +76,7 @@ public:
TJAlienResult
*
RunJsonCommand
(
TString
*
command
,
TList
*
options
);
// Parse the result from Json structure
TJAlienResult
*
GetCommandResult
(
json_object
*
json_response
);
TJAlienResult
*
GetCommandResult
(
json_object
*
json_response
,
bool
expand_find
=
false
);
// Format command to Json structure
json_object
*
CreateJsonCommand
(
TString
*
command
,
TList
*
options
);
...
...
src/TJAlien.cxx
View file @
ca871b0a
...
...
@@ -230,7 +230,7 @@ TGridResult *TJAlien::Command(const char *command, bool interactive, UInt_t stre
TString
*
s
=
new
TString
(
sCommand
->
GetString
());
result
=
(
TJAlienResult
*
)
connection
.
RunJsonCommand
(
s
,
options
);
TJAlienResultRewriter
().
Rewrite
(
(
std
::
string
)
sCommand
->
GetString
(),
result
);
TJAlienResultRewriter
().
Rewrite
(
sCommand
->
GetString
()
.
Data
()
,
result
);
if
(
interactive
)
{
...
...
src/TJAlienCollection.cxx
View file @
ca871b0a
...
...
@@ -410,13 +410,7 @@ Bool_t TJAlienCollection::ExportXML(TFile * exportfile, Bool_t selected, Bool_t
tagval
=
(
TObjString
*
)
((
TMap
*
)
nextgroup
->
GetValue
(
attributes
->
GetName
()))
->
GetValue
(
tagname
);
if
(
TString
(
tagname
->
GetName
())
!=
"evlist"
)
{
// NOTE: (nhardi) dirty hack - see find command json output and compare TGridResult with alien
if
(
TString
(
tagname
->
GetName
())
!=
"lfn"
)
{
snprintf
(
outline
,
4096
,
"%s=
\"
%s
\"
"
,
tagname
->
GetName
(),
tagval
->
GetName
());
}
else
{
snprintf
(
outline
,
4096
,
"lfn=
\"
%s
\"
turl=
\"
alien://%s
\"
"
,
tagval
->
GetName
(),
tagval
->
GetName
());
}
snprintf
(
outline
,
4096
,
"%s=
\"
%s
\"
"
,
tagname
->
GetName
(),
tagval
->
GetName
());
}
else
{
// the eventlist has to be converted from TEventList to a string list with komma separation
TEntryList
*
xmlentrylist
=
(
TEntryList
*
)
tagval
;
...
...
src/TJAlienConnectionManager.cxx
View file @
ca871b0a
...
...
@@ -484,13 +484,13 @@ TJAlienResult *TJAlienConnectionManager::RunJsonCommand(TString *command, TList
json_object
*
jobj_res
=
json_tokener_parse
(
readBuffer
.
c_str
());
// get response
TJAlienResult
*
GridResult
=
this
->
GetCommandResult
(
jobj_res
);
TJAlienResult
*
GridResult
=
this
->
GetCommandResult
(
jobj_res
,
*
command
==
"find"
);
return
GridResult
;
}
//______________________________________________________________________________
TJAlienResult
*
TJAlienConnectionManager
::
GetCommandResult
(
json_object
*
json_response
)
TJAlienResult
*
TJAlienConnectionManager
::
GetCommandResult
(
json_object
*
json_response
,
bool
expand_find
)
{
// JSON parser of the JBox result
// - parsing the meta information
...
...
@@ -527,7 +527,12 @@ TJAlienResult* TJAlienConnectionManager::GetCommandResult(json_object *json_resp
TMap
*
t
=
new
TMap
();
json_object_object_foreach
(
jvalue
,
key
,
val
)
{
t
->
Add
(
new
TObjString
(
key
),
new
TObjString
(
json_object_get_string
(
val
)));
TString
sValue
=
json_object_get_string
(
val
);
TString
sKey
=
key
;
t
->
Add
(
new
TObjString
(
key
),
new
TObjString
(
sValue
));
if
(
expand_find
&&
sKey
==
"lfn"
)
{
t
->
Add
(
new
TObjString
(
"turl"
),
new
TObjString
(
"alien://"
+
sValue
));
}
}
gridResult
->
Add
(
t
);
}
...
...
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