Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
368 lines (311 sloc) 11.1 KB
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
#include "GCMonitorService.h"
namespace accumulo { namespace gc {
uint32_t GCMonitorService_getStatus_args::read(::apache::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
std::string fname;
::apache::thrift::protocol::TType ftype;
int16_t fid;
xfer += iprot->readStructBegin(fname);
using ::apache::thrift::protocol::TProtocolException;
while (true)
{
xfer += iprot->readFieldBegin(fname, ftype, fid);
if (ftype == ::apache::thrift::protocol::T_STOP) {
break;
}
switch (fid)
{
case 2:
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
xfer += this->tinfo.read(iprot);
this->__isset.tinfo = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 1:
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
xfer += this->credentials.read(iprot);
this->__isset.credentials = true;
} else {
xfer += iprot->skip(ftype);
}
break;
default:
xfer += iprot->skip(ftype);
break;
}
xfer += iprot->readFieldEnd();
}
xfer += iprot->readStructEnd();
return xfer;
}
uint32_t GCMonitorService_getStatus_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
xfer += oprot->writeStructBegin("GCMonitorService_getStatus_args");
xfer += oprot->writeFieldBegin("credentials", ::apache::thrift::protocol::T_STRUCT, 1);
xfer += this->credentials.write(oprot);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("tinfo", ::apache::thrift::protocol::T_STRUCT, 2);
xfer += this->tinfo.write(oprot);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
return xfer;
}
uint32_t GCMonitorService_getStatus_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
xfer += oprot->writeStructBegin("GCMonitorService_getStatus_pargs");
xfer += oprot->writeFieldBegin("credentials", ::apache::thrift::protocol::T_STRUCT, 1);
xfer += (*(this->credentials)).write(oprot);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldBegin("tinfo", ::apache::thrift::protocol::T_STRUCT, 2);
xfer += (*(this->tinfo)).write(oprot);
xfer += oprot->writeFieldEnd();
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
return xfer;
}
uint32_t GCMonitorService_getStatus_result::read(::apache::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
std::string fname;
::apache::thrift::protocol::TType ftype;
int16_t fid;
xfer += iprot->readStructBegin(fname);
using ::apache::thrift::protocol::TProtocolException;
while (true)
{
xfer += iprot->readFieldBegin(fname, ftype, fid);
if (ftype == ::apache::thrift::protocol::T_STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
xfer += this->success.read(iprot);
this->__isset.success = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 1:
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
xfer += this->sec.read(iprot);
this->__isset.sec = true;
} else {
xfer += iprot->skip(ftype);
}
break;
default:
xfer += iprot->skip(ftype);
break;
}
xfer += iprot->readFieldEnd();
}
xfer += iprot->readStructEnd();
return xfer;
}
uint32_t GCMonitorService_getStatus_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
xfer += oprot->writeStructBegin("GCMonitorService_getStatus_result");
if (this->__isset.success) {
xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
xfer += this->success.write(oprot);
xfer += oprot->writeFieldEnd();
} else if (this->__isset.sec) {
xfer += oprot->writeFieldBegin("sec", ::apache::thrift::protocol::T_STRUCT, 1);
xfer += this->sec.write(oprot);
xfer += oprot->writeFieldEnd();
}
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
return xfer;
}
uint32_t GCMonitorService_getStatus_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
std::string fname;
::apache::thrift::protocol::TType ftype;
int16_t fid;
xfer += iprot->readStructBegin(fname);
using ::apache::thrift::protocol::TProtocolException;
while (true)
{
xfer += iprot->readFieldBegin(fname, ftype, fid);
if (ftype == ::apache::thrift::protocol::T_STOP) {
break;
}
switch (fid)
{
case 0:
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
xfer += (*(this->success)).read(iprot);
this->__isset.success = true;
} else {
xfer += iprot->skip(ftype);
}
break;
case 1:
if (ftype == ::apache::thrift::protocol::T_STRUCT) {
xfer += this->sec.read(iprot);
this->__isset.sec = true;
} else {
xfer += iprot->skip(ftype);
}
break;
default:
xfer += iprot->skip(ftype);
break;
}
xfer += iprot->readFieldEnd();
}
xfer += iprot->readStructEnd();
return xfer;
}
void GCMonitorServiceClient::getStatus(GCStatus& _return, const accumulo::cloudtrace::TInfo& tinfo, const accumulo::security::AuthInfo& credentials)
{
send_getStatus(tinfo, credentials);
recv_getStatus(_return);
}
void GCMonitorServiceClient::send_getStatus(const accumulo::cloudtrace::TInfo& tinfo, const accumulo::security::AuthInfo& credentials)
{
int32_t cseqid = 0;
oprot_->writeMessageBegin("getStatus", ::apache::thrift::protocol::T_CALL, cseqid);
GCMonitorService_getStatus_pargs args;
args.tinfo = &tinfo;
args.credentials = &credentials;
args.write(oprot_);
oprot_->writeMessageEnd();
oprot_->getTransport()->writeEnd();
oprot_->getTransport()->flush();
}
void GCMonitorServiceClient::recv_getStatus(GCStatus& _return)
{
int32_t rseqid = 0;
std::string fname;
::apache::thrift::protocol::TMessageType mtype;
iprot_->readMessageBegin(fname, mtype, rseqid);
if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
::apache::thrift::TApplicationException x;
x.read(iprot_);
iprot_->readMessageEnd();
iprot_->getTransport()->readEnd();
throw x;
}
if (mtype != ::apache::thrift::protocol::T_REPLY) {
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
iprot_->readMessageEnd();
iprot_->getTransport()->readEnd();
}
if (fname.compare("getStatus") != 0) {
iprot_->skip(::apache::thrift::protocol::T_STRUCT);
iprot_->readMessageEnd();
iprot_->getTransport()->readEnd();
}
GCMonitorService_getStatus_presult result;
result.success = &_return;
result.read(iprot_);
iprot_->readMessageEnd();
iprot_->getTransport()->readEnd();
if (result.__isset.success) {
// _return pointer has now been filled
return;
}
if (result.__isset.sec) {
throw result.sec;
}
throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getStatus failed: unknown result");
}
bool GCMonitorServiceProcessor::process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot, void* callContext) {
::apache::thrift::protocol::TProtocol* iprot = piprot.get();
::apache::thrift::protocol::TProtocol* oprot = poprot.get();
std::string fname;
::apache::thrift::protocol::TMessageType mtype;
int32_t seqid;
iprot->readMessageBegin(fname, mtype, seqid);
if (mtype != ::apache::thrift::protocol::T_CALL && mtype != ::apache::thrift::protocol::T_ONEWAY) {
iprot->skip(::apache::thrift::protocol::T_STRUCT);
iprot->readMessageEnd();
iprot->getTransport()->readEnd();
::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE);
oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
x.write(oprot);
oprot->writeMessageEnd();
oprot->getTransport()->writeEnd();
oprot->getTransport()->flush();
return true;
}
return process_fn(iprot, oprot, fname, seqid, callContext);
}
bool GCMonitorServiceProcessor::process_fn(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid, void* callContext) {
std::map<std::string, void (GCMonitorServiceProcessor::*)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*)>::iterator pfn;
pfn = processMap_.find(fname);
if (pfn == processMap_.end()) {
iprot->skip(::apache::thrift::protocol::T_STRUCT);
iprot->readMessageEnd();
iprot->getTransport()->readEnd();
::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'");
oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
x.write(oprot);
oprot->writeMessageEnd();
oprot->getTransport()->writeEnd();
oprot->getTransport()->flush();
return true;
}
(this->*(pfn->second))(seqid, iprot, oprot, callContext);
return true;
}
void GCMonitorServiceProcessor::process_getStatus(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
void* ctx = NULL;
if (eventHandler_.get() != NULL) {
ctx = eventHandler_->getContext("GCMonitorService.getStatus", callContext);
}
::apache::thrift::TProcessorContextFreer freer(eventHandler_.get(), ctx, "GCMonitorService.getStatus");
if (eventHandler_.get() != NULL) {
eventHandler_->preRead(ctx, "GCMonitorService.getStatus");
}
GCMonitorService_getStatus_args args;
args.read(iprot);
iprot->readMessageEnd();
uint32_t bytes = iprot->getTransport()->readEnd();
if (eventHandler_.get() != NULL) {
eventHandler_->postRead(ctx, "GCMonitorService.getStatus", bytes);
}
GCMonitorService_getStatus_result result;
try {
iface_->getStatus(result.success, args.tinfo, args.credentials);
result.__isset.success = true;
} catch (accumulo::security::ThriftSecurityException &sec) {
result.sec = sec;
result.__isset.sec = true;
} catch (const std::exception& e) {
if (eventHandler_.get() != NULL) {
eventHandler_->handlerError(ctx, "GCMonitorService.getStatus");
}
::apache::thrift::TApplicationException x(e.what());
oprot->writeMessageBegin("getStatus", ::apache::thrift::protocol::T_EXCEPTION, seqid);
x.write(oprot);
oprot->writeMessageEnd();
oprot->getTransport()->writeEnd();
oprot->getTransport()->flush();
return;
}
if (eventHandler_.get() != NULL) {
eventHandler_->preWrite(ctx, "GCMonitorService.getStatus");
}
oprot->writeMessageBegin("getStatus", ::apache::thrift::protocol::T_REPLY, seqid);
result.write(oprot);
oprot->writeMessageEnd();
bytes = oprot->getTransport()->writeEnd();
oprot->getTransport()->flush();
if (eventHandler_.get() != NULL) {
eventHandler_->postWrite(ctx, "GCMonitorService.getStatus", bytes);
}
}
}} // namespace