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
029ed184
Commit
029ed184
authored
8 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
FSctl now parses EOS notifcation message
parent
637de930
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
xroot_plugins/CMakeLists.txt
+1
-1
1 addition, 1 deletion
xroot_plugins/CMakeLists.txt
xroot_plugins/XrdCtaFilesystem.cpp
+28
-24
28 additions, 24 deletions
xroot_plugins/XrdCtaFilesystem.cpp
with
29 additions
and
25 deletions
xroot_plugins/CMakeLists.txt
+
1
−
1
View file @
029ed184
...
...
@@ -25,7 +25,7 @@ include_directories(${CMAKE_BINARY_DIR})
include_directories
(
${
CMAKE_SOURCE_DIR
}
/tapeserver
)
add_library
(
XrdCtaOfs MODULE XrdCtaFilesystem.cpp XrdCtaFile.cpp XrdCtaDir.cpp
)
target_link_libraries
(
XrdCtaOfs ctacatalogue ctascheduler ctacommon protobuf ctaobjectstore cryptopp
)
target_link_libraries
(
XrdCtaOfs ctacatalogue
ctafrontendmessages
ctascheduler ctacommon protobuf ctaobjectstore cryptopp
)
INSTALL
(
TARGETS XrdCtaOfs DESTINATION usr/
${
CMAKE_INSTALL_LIBDIR
}
)
INSTALL
(
FILES xrootd-cta.cfg DESTINATION /etc/xrootd/
)
...
...
This diff is collapsed.
Click to expand it.
xroot_plugins/XrdCtaFilesystem.cpp
+
28
−
24
View file @
029ed184
...
...
@@ -37,6 +37,7 @@
#include
"XrdOuc/XrdOucString.hh"
#include
"XrdSec/XrdSecEntity.hh"
#include
"XrdVersion.hh"
#include
"xroot_plugins/messages/notification.pb.h"
#include
"xroot_plugins/XrdCtaFilesystem.hpp"
#include
"xroot_plugins/XrdCtaFile.hpp"
#include
"XrdCtaDir.hpp"
...
...
@@ -85,30 +86,33 @@ int XrdCtaFilesystem::FSctl(const int cmd, XrdSfsFSctl &args, XrdOucErrInfo &eIn
return
SFS_ERROR
;
}
std
::
unique_ptr
<
char
[]
>
arg1
(
new
char
[
args
.
Arg1Len
+
1
]);
strncpy
(
arg1
.
get
(),
args
.
Arg1
,
args
.
Arg1Len
);
arg1
[
args
.
Arg1Len
]
=
'\0'
;
std
::
unique_ptr
<
char
[]
>
arg2
(
new
char
[
args
.
Arg2Len
+
1
]);
strncpy
(
arg2
.
get
(),
args
.
Arg2
,
args
.
Arg2Len
);
arg2
[
args
.
Arg2Len
]
=
'\0'
;
std
::
list
<
cta
::
log
::
Param
>
params
;
params
.
push_back
({
"args.Arg1Len"
,
args
.
Arg1Len
});
params
.
push_back
({
"arg1"
,
arg1
.
get
()});
params
.
push_back
({
"args.Arg2Len"
,
args
.
Arg2Len
});
params
.
push_back
({
"arg2"
,
arg2
.
get
()});
params
.
push_back
({
"client->host"
,
client
->
host
});
params
.
push_back
({
"client->name"
,
client
->
name
});
(
*
m_log
)(
log
::
INFO
,
"FSctl called"
,
params
);
//if(strcmp(arg1.get(), "/eos_cta_interface") && strcmp(arg1.get(), "/eos_cta_interface/")) {
// std::ostringstream msg;
// msg << arg1.get() << " does not exist";
// eInfo.setErrInfo(ENOENT, msg.str().c_str());
// return SFS_ERROR;
//}
{
std
::
list
<
cta
::
log
::
Param
>
params
;
params
.
push_back
({
"args.Arg1Len"
,
args
.
Arg1Len
});
params
.
push_back
({
"args.Arg2Len"
,
args
.
Arg2Len
});
params
.
push_back
({
"client->host"
,
client
->
host
});
params
.
push_back
({
"client->name"
,
client
->
name
});
(
*
m_log
)(
log
::
INFO
,
"FSctl called"
,
params
);
}
if
(
args
.
Arg1
==
nullptr
||
args
.
Arg1Len
==
0
)
{
eInfo
.
setErrInfo
(
EINVAL
,
"Did not receive a query argument"
);
return
SFS_ERROR
;
}
const
std
::
string
query
(
args
.
Arg1
,
args
.
Arg1Len
);
eos
::
wfe
::
notification
notification
;
notification
.
ParseFromString
(
query
);
{
std
::
list
<
cta
::
log
::
Param
>
params
;
params
.
push_back
({
"wf.event"
,
notification
.
wf
().
event
()});
params
.
push_back
({
"wf.queue"
,
notification
.
wf
().
queue
()});
params
.
push_back
({
"wf.wfname"
,
notification
.
wf
().
wfname
()});
params
.
push_back
({
"eosfid"
,
notification
.
file
().
fid
()});
params
.
push_back
({
"eoslpath"
,
notification
.
file
().
lpath
()});
(
*
m_log
)(
log
::
INFO
,
"FSctl received notification message"
,
params
);
}
const
size_t
sizeOfMsg
=
10
*
1024
*
1024
;
char
*
const
msg
=
static_cast
<
char
*>
(
malloc
(
sizeOfMsg
));
...
...
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