Commit 601a4788 authored by Steven Murray's avatar Steven Murray
Browse files

DataTransferSession is now ran by the ProcessForker

parent 25ef0fb3
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// constructor // constructor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
castor::legacymsg::VdqmProxyTcpIp::VdqmProxyTcpIp(log::Logger &log, const std::string &vdqmHostName, const unsigned short vdqmPort, const int netTimeout) throw(): castor::legacymsg::VdqmProxyTcpIp::VdqmProxyTcpIp(log::Logger &log,
const std::string &vdqmHostName, const unsigned short vdqmPort,
const int netTimeout) throw():
m_log(log), m_log(log),
m_vdqmHostName(vdqmHostName), m_vdqmHostName(vdqmHostName),
m_vdqmPort(vdqmPort), m_vdqmPort(vdqmPort),
...@@ -48,7 +50,8 @@ castor::legacymsg::VdqmProxyTcpIp::~VdqmProxyTcpIp() throw() { ...@@ -48,7 +50,8 @@ castor::legacymsg::VdqmProxyTcpIp::~VdqmProxyTcpIp() throw() {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// setDriveDown // setDriveDown
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void castor::legacymsg::VdqmProxyTcpIp::setDriveDown(const std::string &server, const std::string &unitName, const std::string &dgn) { void castor::legacymsg::VdqmProxyTcpIp::setDriveDown(const std::string &server,
const std::string &unitName, const std::string &dgn) {
try { try {
legacymsg::VdqmDrvRqstMsgBody body; legacymsg::VdqmDrvRqstMsgBody body;
body.status = VDQM_UNIT_DOWN; body.status = VDQM_UNIT_DOWN;
...@@ -59,8 +62,9 @@ void castor::legacymsg::VdqmProxyTcpIp::setDriveDown(const std::string &server, ...@@ -59,8 +62,9 @@ void castor::legacymsg::VdqmProxyTcpIp::setDriveDown(const std::string &server,
setDriveStatus(body); setDriveStatus(body);
} catch(castor::exception::Exception &ne) { } catch(castor::exception::Exception &ne) {
castor::exception::Exception ex; castor::exception::Exception ex;
ex.getMessage() << "Failed to set status of tape drive " << unitName << ex.getMessage() << "Failed to set state of tape drive"
" to down: " << ne.getMessage().str(); ": server=" << server << " unitName=" << unitName << " dgn=" << dgn <<
" state=down: " << ne.getMessage().str();
throw ex; throw ex;
} }
} }
...@@ -68,7 +72,8 @@ void castor::legacymsg::VdqmProxyTcpIp::setDriveDown(const std::string &server, ...@@ -68,7 +72,8 @@ void castor::legacymsg::VdqmProxyTcpIp::setDriveDown(const std::string &server,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// setDriveUp // setDriveUp
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void castor::legacymsg::VdqmProxyTcpIp::setDriveUp(const std::string &server, const std::string &unitName, const std::string &dgn) { void castor::legacymsg::VdqmProxyTcpIp::setDriveUp(const std::string &server,
const std::string &unitName, const std::string &dgn) {
try { try {
legacymsg::VdqmDrvRqstMsgBody body; legacymsg::VdqmDrvRqstMsgBody body;
body.status = VDQM_UNIT_UP; body.status = VDQM_UNIT_UP;
...@@ -79,8 +84,9 @@ void castor::legacymsg::VdqmProxyTcpIp::setDriveUp(const std::string &server, co ...@@ -79,8 +84,9 @@ void castor::legacymsg::VdqmProxyTcpIp::setDriveUp(const std::string &server, co
setDriveStatus(body); setDriveStatus(body);
} catch(castor::exception::Exception &ne) { } catch(castor::exception::Exception &ne) {
castor::exception::Exception ex; castor::exception::Exception ex;
ex.getMessage() << "Failed to set status of tape drive " << unitName << ex.getMessage() << "Failed to set state of tape drive"
" to up: " << ne.getMessage().str(); ": server=" << server << " unitName=" << unitName << " dgn=" << dgn <<
" state=up: " << ne.getMessage().str();
throw ex; throw ex;
} }
} }
...@@ -88,7 +94,9 @@ void castor::legacymsg::VdqmProxyTcpIp::setDriveUp(const std::string &server, co ...@@ -88,7 +94,9 @@ void castor::legacymsg::VdqmProxyTcpIp::setDriveUp(const std::string &server, co
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// assignDrive // assignDrive
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void castor::legacymsg::VdqmProxyTcpIp::assignDrive(const std::string &server, const std::string &unitName, const std::string &dgn, const uint32_t mountTransactionId, const pid_t sessionPid) { void castor::legacymsg::VdqmProxyTcpIp::assignDrive(const std::string &server,
const std::string &unitName, const std::string &dgn,
const uint32_t mountTransactionId, const pid_t sessionPid) {
try { try {
legacymsg::VdqmDrvRqstMsgBody body; legacymsg::VdqmDrvRqstMsgBody body;
body.status = VDQM_UNIT_ASSIGN; body.status = VDQM_UNIT_ASSIGN;
...@@ -101,8 +109,10 @@ void castor::legacymsg::VdqmProxyTcpIp::assignDrive(const std::string &server, c ...@@ -101,8 +109,10 @@ void castor::legacymsg::VdqmProxyTcpIp::assignDrive(const std::string &server, c
setDriveStatus(body); setDriveStatus(body);
} catch(castor::exception::Exception &ne) { } catch(castor::exception::Exception &ne) {
castor::exception::Exception ex; castor::exception::Exception ex;
ex.getMessage() << "Failed to assign mount-session with process ID " << ex.getMessage() << "Failed to assign drive"
sessionPid << "to tape drive " << unitName << ": " << ne.getMessage().str(); ": server=" << server << " unitName=" << unitName << " dgn=" << dgn <<
" mountTransactionId=" << mountTransactionId << " sessionPid=" <<
sessionPid << ": " << ne.getMessage().str();
throw ex; throw ex;
} }
} }
...@@ -126,8 +136,10 @@ void castor::legacymsg::VdqmProxyTcpIp::tapeMounted(const std::string &server, ...@@ -126,8 +136,10 @@ void castor::legacymsg::VdqmProxyTcpIp::tapeMounted(const std::string &server,
setDriveStatus(body); setDriveStatus(body);
} catch(castor::exception::Exception &ne) { } catch(castor::exception::Exception &ne) {
castor::exception::Exception ex; castor::exception::Exception ex;
ex.getMessage() << "Failed to notify vdqm that tape " << vid << ex.getMessage() << "Failed to notify vdqm that tape is mounted"
" was mounted on tape drive " << unitName << ": " << ne.getMessage().str(); ": server=" << server << " unitName=" << unitName << " dgn=" << dgn <<
" vid=" << vid << " sessionPid=" << sessionPid << ": " <<
ne.getMessage().str();
throw ex; throw ex;
} }
} }
...@@ -155,8 +167,10 @@ void castor::legacymsg::VdqmProxyTcpIp::releaseDrive(const std::string &server, ...@@ -155,8 +167,10 @@ void castor::legacymsg::VdqmProxyTcpIp::releaseDrive(const std::string &server,
setDriveStatus(body); setDriveStatus(body);
} catch(castor::exception::Exception &ne) { } catch(castor::exception::Exception &ne) {
castor::exception::Exception ex; castor::exception::Exception ex;
ex.getMessage() << "Failed to release tape drive " << unitName << ": " << ex.getMessage() << "Failed to release tape drive"
ne.getMessage().str(); ": server=" << server << " unitName=" << unitName << " dgn=" << dgn <<
" forceUnmount=" << forceUnmount << " sessionPid=" << sessionPid << ": "
<< ne.getMessage().str();
throw ex; throw ex;
} }
} }
...@@ -164,7 +178,8 @@ void castor::legacymsg::VdqmProxyTcpIp::releaseDrive(const std::string &server, ...@@ -164,7 +178,8 @@ void castor::legacymsg::VdqmProxyTcpIp::releaseDrive(const std::string &server,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// setDriveStatus // setDriveStatus
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void castor::legacymsg::VdqmProxyTcpIp::setDriveStatus(const legacymsg::VdqmDrvRqstMsgBody &body) { void castor::legacymsg::VdqmProxyTcpIp::setDriveStatus(
const legacymsg::VdqmDrvRqstMsgBody &body) {
castor::utils::SmartFd fd(connectToVdqm()); castor::utils::SmartFd fd(connectToVdqm());
writeDriveStatusMsg(fd.get(), body); writeDriveStatusMsg(fd.get(), body);
readCommitAck(fd.get()); readCommitAck(fd.get());
...@@ -194,7 +209,8 @@ int castor::legacymsg::VdqmProxyTcpIp::connectToVdqm() const { ...@@ -194,7 +209,8 @@ int castor::legacymsg::VdqmProxyTcpIp::connectToVdqm() const {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// writeDriveStatusMsg // writeDriveStatusMsg
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void castor::legacymsg::VdqmProxyTcpIp::writeDriveStatusMsg(const int fd, const legacymsg::VdqmDrvRqstMsgBody &body) { void castor::legacymsg::VdqmProxyTcpIp::writeDriveStatusMsg(const int fd,
const legacymsg::VdqmDrvRqstMsgBody &body) {
char buf[VDQM_MSGBUFSIZ]; char buf[VDQM_MSGBUFSIZ];
const size_t len = legacymsg::marshal(buf, body); const size_t len = legacymsg::marshal(buf, body);
...@@ -252,7 +268,8 @@ void castor::legacymsg::VdqmProxyTcpIp::readCommitAck(const int fd) { ...@@ -252,7 +268,8 @@ void castor::legacymsg::VdqmProxyTcpIp::readCommitAck(const int fd) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// readAck // readAck
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
castor::legacymsg::MessageHeader castor::legacymsg::VdqmProxyTcpIp::readAck(const int fd) { castor::legacymsg::MessageHeader castor::legacymsg::VdqmProxyTcpIp::readAck(
const int fd) {
char buf[12]; // Magic + type + len char buf[12]; // Magic + type + len
legacymsg::MessageHeader ack; legacymsg::MessageHeader ack;
...@@ -275,7 +292,8 @@ castor::legacymsg::MessageHeader castor::legacymsg::VdqmProxyTcpIp::readAck(cons ...@@ -275,7 +292,8 @@ castor::legacymsg::MessageHeader castor::legacymsg::VdqmProxyTcpIp::readAck(cons
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// readDriveStatusMsgHeader // readDriveStatusMsgHeader
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
castor::legacymsg::MessageHeader castor::legacymsg::VdqmProxyTcpIp::readDriveStatusMsgHeader(const int fd) { castor::legacymsg::MessageHeader castor::legacymsg::VdqmProxyTcpIp::
readDriveStatusMsgHeader(const int fd) {
char buf[12]; // Magic + type + len char buf[12]; // Magic + type + len
legacymsg::MessageHeader header; legacymsg::MessageHeader header;
...@@ -316,7 +334,8 @@ castor::legacymsg::MessageHeader castor::legacymsg::VdqmProxyTcpIp::readDriveSta ...@@ -316,7 +334,8 @@ castor::legacymsg::MessageHeader castor::legacymsg::VdqmProxyTcpIp::readDriveSta
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// readDriveStatusMsgBody // readDriveStatusMsgBody
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
castor::legacymsg::VdqmDrvRqstMsgBody castor::legacymsg::VdqmProxyTcpIp::readDriveStatusMsgBody(const int fd, const uint32_t bodyLen) { castor::legacymsg::VdqmDrvRqstMsgBody castor::legacymsg::VdqmProxyTcpIp::
readDriveStatusMsgBody(const int fd, const uint32_t bodyLen) {
char buf[VDQM_MSGBUFSIZ]; char buf[VDQM_MSGBUFSIZ];
if(sizeof(buf) < bodyLen) { if(sizeof(buf) < bodyLen) {
...@@ -368,7 +387,9 @@ void castor::legacymsg::VdqmProxyTcpIp::writeCommitAck(const int fd) { ...@@ -368,7 +387,9 @@ void castor::legacymsg::VdqmProxyTcpIp::writeCommitAck(const int fd) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// tapeUnmounted // tapeUnmounted
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void castor::legacymsg::VdqmProxyTcpIp::tapeUnmounted(const std::string &server, const std::string &unitName, const std::string &dgn, const std::string &vid) { void castor::legacymsg::VdqmProxyTcpIp::tapeUnmounted(
const std::string &server, const std::string &unitName,
const std::string &dgn, const std::string &vid) {
int status = VDQM_VOL_UNMOUNT; int status = VDQM_VOL_UNMOUNT;
try { try {
......
add_library(castormessages SHARED add_library(castormessages SHARED
Exception.pb.cc
ForkCleaner.pb.cc ForkCleaner.pb.cc
ForkDataTransfer.pb.cc ForkDataTransfer.pb.cc
ForkLabel.pb.cc ForkLabel.pb.cc
...@@ -7,8 +8,9 @@ add_library(castormessages SHARED ...@@ -7,8 +8,9 @@ add_library(castormessages SHARED
Heartbeat.pb.cc Heartbeat.pb.cc
messages.cpp messages.cpp
NotifyDrive.pb.cc NotifyDrive.pb.cc
ProcessCrashed.pb.cc
ProcessExited.pb.cc
ReplyContainer.cpp ReplyContainer.cpp
Status.pb.cc
StopProcessForker.pb.cc StopProcessForker.pb.cc
TapeserverProxy.cpp TapeserverProxy.cpp
TapeserverProxyDummy.cpp TapeserverProxyDummy.cpp
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "Status.pb.h" #include "Exception.pb.h"
#include <google/protobuf/stubs/once.h> #include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h> #include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h> #include <google/protobuf/wire_format_lite_inl.h>
...@@ -15,35 +15,35 @@ namespace messages { ...@@ -15,35 +15,35 @@ namespace messages {
namespace { namespace {
const ::google::protobuf::Descriptor* Status_descriptor_ = NULL; const ::google::protobuf::Descriptor* Exception_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection* const ::google::protobuf::internal::GeneratedMessageReflection*
Status_reflection_ = NULL; Exception_reflection_ = NULL;
} // namespace } // namespace
void protobuf_AssignDesc_Status_2eproto() { void protobuf_AssignDesc_Exception_2eproto() {
protobuf_AddDesc_Status_2eproto(); protobuf_AddDesc_Exception_2eproto();
const ::google::protobuf::FileDescriptor* file = const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"Status.proto"); "Exception.proto");
GOOGLE_CHECK(file != NULL); GOOGLE_CHECK(file != NULL);
Status_descriptor_ = file->message_type(0); Exception_descriptor_ = file->message_type(0);
static const int Status_offsets_[2] = { static const int Exception_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Status, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Exception, code_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Status, message_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Exception, message_),
}; };
Status_reflection_ = Exception_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection( new ::google::protobuf::internal::GeneratedMessageReflection(
Status_descriptor_, Exception_descriptor_,
Status::default_instance_, Exception::default_instance_,
Status_offsets_, Exception_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Status, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Exception, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Status, _unknown_fields_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Exception, _unknown_fields_),
-1, -1,
::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(), ::google::protobuf::MessageFactory::generated_factory(),
sizeof(Status)); sizeof(Exception));
} }
namespace { namespace {
...@@ -51,80 +51,80 @@ namespace { ...@@ -51,80 +51,80 @@ namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() { inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_Status_2eproto); &protobuf_AssignDesc_Exception_2eproto);
} }
void protobuf_RegisterTypes(const ::std::string&) { void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce(); protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Status_descriptor_, &Status::default_instance()); Exception_descriptor_, &Exception::default_instance());
} }
} // namespace } // namespace
void protobuf_ShutdownFile_Status_2eproto() { void protobuf_ShutdownFile_Exception_2eproto() {
delete Status::default_instance_; delete Exception::default_instance_;
delete Status_reflection_; delete Exception_reflection_;
} }
void protobuf_AddDesc_Status_2eproto() { void protobuf_AddDesc_Exception_2eproto() {
static bool already_here = false; static bool already_here = false;
if (already_here) return; if (already_here) return;
already_here = true; already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION; GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile( ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\014Status.proto\022\017castor.messages\")\n\006Statu" "\n\017Exception.proto\022\017castor.messages\"*\n\tEx"
"s\022\016\n\006status\030\001 \002(\r\022\017\n\007message\030\002 \002(\t", 74); "ception\022\014\n\004code\030\001 \002(\r\022\017\n\007message\030\002 \002(\t", 78);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"Status.proto", &protobuf_RegisterTypes); "Exception.proto", &protobuf_RegisterTypes);
Status::default_instance_ = new Status(); Exception::default_instance_ = new Exception();
Status::default_instance_->InitAsDefaultInstance(); Exception::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Status_2eproto); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Exception_2eproto);
} }
// Force AddDescriptors() to be called at static initialization time. // Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_Status_2eproto { struct StaticDescriptorInitializer_Exception_2eproto {
StaticDescriptorInitializer_Status_2eproto() { StaticDescriptorInitializer_Exception_2eproto() {
protobuf_AddDesc_Status_2eproto(); protobuf_AddDesc_Exception_2eproto();
} }
} static_descriptor_initializer_Status_2eproto_; } static_descriptor_initializer_Exception_2eproto_;
// =================================================================== // ===================================================================
const ::std::string Status::_default_message_; const ::std::string Exception::_default_message_;
#ifndef _MSC_VER #ifndef _MSC_VER
const int Status::kStatusFieldNumber; const int Exception::kCodeFieldNumber;
const int Status::kMessageFieldNumber; const int Exception::kMessageFieldNumber;
#endif // !_MSC_VER #endif // !_MSC_VER
Status::Status() Exception::Exception()
: ::google::protobuf::Message() { : ::google::protobuf::Message() {
SharedCtor(); SharedCtor();
} }
void Status::InitAsDefaultInstance() { void Exception::InitAsDefaultInstance() {
} }
Status::Status(const Status& from) Exception::Exception(const Exception& from)
: ::google::protobuf::Message() { : ::google::protobuf::Message() {
SharedCtor(); SharedCtor();
MergeFrom(from); MergeFrom(from);
} }
void Status::SharedCtor() { void Exception::SharedCtor() {
_cached_size_ = 0; _cached_size_ = 0;
status_ = 0u; code_ = 0u;
message_ = const_cast< ::std::string*>(&_default_message_); message_ = const_cast< ::std::string*>(&_default_message_);
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
} }
Status::~Status() { Exception::~Exception() {
SharedDtor(); SharedDtor();
} }
void Status::SharedDtor() { void Exception::SharedDtor() {
if (message_ != &_default_message_) { if (message_ != &_default_message_) {
delete message_; delete message_;
} }
...@@ -132,29 +132,29 @@ void Status::SharedDtor() { ...@@ -132,29 +132,29 @@ void Status::SharedDtor() {
} }
} }
void Status::SetCachedSize(int size) const { void Exception::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size; _cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END(); GOOGLE_SAFE_CONCURRENT_WRITES_END();
} }
const ::google::protobuf::Descriptor* Status::descriptor() { const ::google::protobuf::Descriptor* Exception::descriptor() {
protobuf_AssignDescriptorsOnce(); protobuf_AssignDescriptorsOnce();
return Status_descriptor_; return Exception_descriptor_;
} }
const Status& Status::default_instance() { const Exception& Exception::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Status_2eproto(); return *default_instance_; if (default_instance_ == NULL) protobuf_AddDesc_Exception_2eproto(); return *default_instance_;
} }
Status* Status::default_instance_ = NULL; Exception* Exception::default_instance_ = NULL;
Status* Status::New() const { Exception* Exception::New() const {
return new Status; return new Exception;
} }
void Status::Clear() { void Exception::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
status_ = 0u; code_ = 0u;
if (_has_bit(1)) { if (_has_bit(1)) {
if (message_ != &_default_message_) { if (message_ != &_default_message_) {
message_->clear(); message_->clear();
...@@ -165,19 +165,19 @@ void Status::Clear() { ...@@ -165,19 +165,19 @@ void Status::Clear() {
mutable_unknown_fields()->Clear(); mutable_unknown_fields()->Clear();
} }
bool Status::MergePartialFromCodedStream( bool Exception::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) { ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag; ::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) { while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required uint32 status = 1; // required uint32 code = 1;
case 1: { case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &status_))); input, &code_)));
_set_bit(0); _set_bit(0);
} else { } else {
goto handle_uninterpreted; goto handle_uninterpreted;
...@@ -219,11 +219,11 @@ bool Status::MergePartialFromCodedStream( ...@@ -219,11 +219,11 @@ bool Status::MergePartialFromCodedStream(
#undef DO_ #undef DO_
} }
void Status::SerializeWithCachedSizes( void Exception::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const { ::google::protobuf::io::CodedOutputStream* output) const {
// required uint32 status = 1; // required uint32 code = 1;
if (_has_bit(0)) { if (_has_bit(0)) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->status(), output); ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->code(), output);
} }
// required string message = 2; // required string message = 2;
...@@ -241,11 +241,11 @@ void Status::SerializeWithCachedSizes( ...@@ -241,11 +241,11 @@ void Status::SerializeWithCachedSizes(
} }
} }
::google::protobuf::uint8* Status::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* Exception::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const { ::google::protobuf::uint8* target) const {
// required uint32 status = 1; // required uint32 code = 1;
if (_has_bit(0)) { if (_has_bit(0)) {