Skip to content
Snippets Groups Projects
Commit 55ef03d1 authored by Michael Davis's avatar Michael Davis
Browse files

[EOS-CTA] Refactors protobuf wrapper

No wrapper for sent messages (as only one message type can be sent). Defines a
wrapper for received messages. Defines message types for errors and alerts.

Changes to protobuf breaks cta-xrootd_plugins-write-notification-msg, so
I removed it from the build in this branch.
parent b998c3f8
No related branches found
No related tags found
No related merge requests found
syntax = "proto3";
package eos.wfe;
message Clock {
uint64 sec = 1; //< seconds of a clock
uint64 nsec = 2; //< nanoseconds of a clock
}
message Checksum {
string value = 1; //< checksum value
string name = 2; //< checksum name
......@@ -19,11 +24,6 @@ message Id {
string groupname = 4; //< group name
}
message Clock {
uint64 sec = 1; //< seconds of a clock
uint64 nsec = 2; //< nanoseconds of a clock
}
message Metadata {
uint64 fid = 1; //< file/container id
uint64 pid = 2; //< parent id
......@@ -97,44 +97,46 @@ message Xattr {
}
message Tapereplica {
enum Status { NONE = 0; OFFTAPE = 1; ONTAPE = 2; ONTAPESAVE = 3; }
uint64 fid = 1; //< file id
Status status = 2; //< state state for file ID
uint64 size = 3; //< File size as recorded on tape for cross check
Checksum cks = 4; //< File checksum as computer while writing to tape
enum Status { NONE = 0; OFFTAPE = 1; ONTAPE = 2; ONTAPESAVE = 3; }
uint64 fid = 1; //< file id
Status status = 2; //< status for file id
uint64 size = 3; //< File size as recorded on tape, for cross-check
Checksum cks = 4; //< File checksum as computer while writing to tape
}
message Response {
enum ResponseType { XATTR_RSP = 0; TAPEREPLICA_RSP = 1; }
ResponseType rsp_type = 1; //< Encode the type of this reply
oneof response {
Xattr xattr = 2; //< Payload for Xattr response type
Tapereplica tapereplica = 3; //< Payload for Tapereplica response type
}
}
message Error {
//
// Error handling
//
// Message type for the Alert callback (generates a log message or response for the user)
message Alert {
// What is the purpose of Audience NONE?
enum Audience { NONE = 0; EOSLOG = 1; ENDUSER = 2; }
Audience audience = 1; //< The intended audience of the error message
uint64 code = 2; //< Zero means success, non-zero means error
string message = 3; //< An empty if success, else an error message
}
// The following message is used to wrap all messages sent between EOS and its
// peers.
//
// This wrapper message allows new message types to be added to the protocol in
// the future.
//
// This wrapper message also allows EOS peers to receive non-EOS messages as
// long as the following two conditions are met:
// 1. The peer uses a wrapper message with exactly the same (simple) structure.
// 2. No two message types use the same numeric tag value.
//
// The structure of this message is based on the "Union Types" section of the
// following Google protocol buffers web page:
//
// https://developers.google.com/protocol-buffers/docs/techniques
//
// A protocol buffer parser cannot determine a message type based solely on its
// contents. The type field of this wrapper message provides the required
// metadata.
message Wrapper {
enum Type {NONE = 0; ERROR = 1; NOTIFICATION = 2; XATTR = 3; TAPEREPLICA = 4; }
Type type = 1;
Error error = 2;
Notification notification = 3;
Xattr xattr = 4;
Tapereplica tapereplica = 5;
// Message type for the Error callback (throws an exception)
message Exception {
enum ErrorCode {
SERVER_NO_RSP = 0; //< No response from server
PB_PARSE_ERR = 1; //< Protocol buffer parse error
// ... define other exception types
}
ErrorCode error = 1; //< Defines what went wrong
}
......@@ -24,7 +24,8 @@ include_directories(${CMAKE_SOURCE_DIR}/tapeserver)
find_package(Protobuf3 REQUIRED)
include_directories(${PROTOBUF3_INCLUDE_DIRS})
add_library (XrdCtaOfs MODULE ListArchiveFilesCmd.cpp XrdCtaFilesystem.cpp XrdCtaFile.cpp XrdCtaDir.cpp)
#add_library (XrdCtaOfs MODULE ListArchiveFilesCmd.cpp XrdCtaFilesystem.cpp XrdCtaFile.cpp XrdCtaDir.cpp)
add_library (XrdCtaOfs MODULE ListArchiveFilesCmd.cpp XrdCtaFile.cpp XrdCtaDir.cpp)
target_link_libraries (XrdCtaOfs ctacatalogue ctaeosmessages ctascheduler ctacommon ${PROTOBUF3_LIBRARIES} ctaobjectstore cryptopp)
set_target_properties(XrdCtaOfs PROPERTIES INSTALL_RPATH ${PROTOBUF3_RPATH})
......@@ -49,6 +50,6 @@ set (WRITE_NOTIFICATION_MSG_CMD_SRC_FILES
WriteNotificationMsgCmdLineArgs.cpp
WriteNotificationMsgCmdMain.cpp)
add_executable (cta-xrootd_plugins-write-notification-msg ${WRITE_NOTIFICATION_MSG_CMD_SRC_FILES})
add_dependencies (cta-xrootd_plugins-write-notification-msg generate_notification.pb.h)
target_link_libraries (cta-xrootd_plugins-write-notification-msg ctacommon ctaeosmessages)
#add_executable (cta-xrootd_plugins-write-notification-msg ${WRITE_NOTIFICATION_MSG_CMD_SRC_FILES})
#add_dependencies (cta-xrootd_plugins-write-notification-msg generate_notification.pb.h)
#target_link_libraries (cta-xrootd_plugins-write-notification-msg ctacommon ctaeosmessages)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment