diff --git a/itests/hive-unit/src/test/java/org/apache/hive/service/cli/TestEmbeddedThriftBinaryCLIService.java b/itests/hive-unit/src/test/java/org/apache/hive/service/cli/TestEmbeddedThriftBinaryCLIService.java index de66d9efb1cace9d32174e3020920d5e4002dc85..c8ac92f8b84dd835d49af56de28316e5f642a974 100644 --- a/itests/hive-unit/src/test/java/org/apache/hive/service/cli/TestEmbeddedThriftBinaryCLIService.java +++ b/itests/hive-unit/src/test/java/org/apache/hive/service/cli/TestEmbeddedThriftBinaryCLIService.java @@ -42,6 +42,12 @@ public static void setUpBeforeClass() throws Exception { client = new ThriftCLIServiceClient(service); } + @Override + void restartService() throws Exception { + service.stop(); + service.start(); + } + /* (non-Javadoc) * @see org.apache.hive.service.cli.CLIServiceTest#setUp() */ diff --git a/service-rpc/if/TCLIService.thrift b/service-rpc/if/TCLIService.thrift index 0aa9d13464bf284a3048092372299efb8e1d6bcc..1c8bc21b2cbb39017578035c18906a351c126467 100644 --- a/service-rpc/if/TCLIService.thrift +++ b/service-rpc/if/TCLIService.thrift @@ -579,6 +579,42 @@ struct TOpenSessionResp { 4: optional map configuration } +// RestoreSession() +// +// Restore an already created session (connection) on the server against +// which operations may be executed. +struct TRestoreSessionReq { + // The version of the HiveServer2 protocol that the client is using. + 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8 + + 2: required TSessionHandle sessionHandle + // Username and password for authentication. + // Depending on the authentication scheme being used, + // this information may instead be provided by a lower + // protocol layer, in which case these fields may be + // left unset. + 3: optional string username + 4: optional string password + + // Configuration overlay which is applied when the session is + // first created. + 5: optional map configuration +} + +// restore session response is same as open session response +struct TRestoreSessionResp { + 1: required TStatus status + + // The protocol version that the server is using. + 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8 + + // Session Handle + 3: optional TSessionHandle sessionHandle + + // The configuration settings for this session. + 4: optional map configuration +} + // CloseSession() // @@ -1136,6 +1172,8 @@ service TCLIService { TOpenSessionResp OpenSession(1:TOpenSessionReq req); + TRestoreSessionResp RestoreSession(1:TRestoreSessionReq req); + TCloseSessionResp CloseSession(1:TCloseSessionReq req); TGetInfoResp GetInfo(1:TGetInfoReq req); diff --git a/service-rpc/src/gen/thrift/gen-cpp/TCLIService.h b/service-rpc/src/gen/thrift/gen-cpp/TCLIService.h index 3407564de27c56cf8f0ee057eee4fcfb8f6ca81e..968f38c843bef045e3a4cd19cbdd124251764f32 100644 --- a/service-rpc/src/gen/thrift/gen-cpp/TCLIService.h +++ b/service-rpc/src/gen/thrift/gen-cpp/TCLIService.h @@ -22,6 +22,7 @@ class TCLIServiceIf { public: virtual ~TCLIServiceIf() {} virtual void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) = 0; + virtual void RestoreSession(TRestoreSessionResp& _return, const TRestoreSessionReq& req) = 0; virtual void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) = 0; virtual void GetInfo(TGetInfoResp& _return, const TGetInfoReq& req) = 0; virtual void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) = 0; @@ -72,6 +73,9 @@ class TCLIServiceNull : virtual public TCLIServiceIf { void OpenSession(TOpenSessionResp& /* _return */, const TOpenSessionReq& /* req */) { return; } + void RestoreSession(TRestoreSessionResp& /* _return */, const TRestoreSessionReq& /* req */) { + return; + } void CloseSession(TCloseSessionResp& /* _return */, const TCloseSessionReq& /* req */) { return; } @@ -232,6 +236,110 @@ class TCLIService_OpenSession_presult { }; +typedef struct _TCLIService_RestoreSession_args__isset { + _TCLIService_RestoreSession_args__isset() : req(false) {} + bool req :1; +} _TCLIService_RestoreSession_args__isset; + +class TCLIService_RestoreSession_args { + public: + + TCLIService_RestoreSession_args(const TCLIService_RestoreSession_args&); + TCLIService_RestoreSession_args& operator=(const TCLIService_RestoreSession_args&); + TCLIService_RestoreSession_args() { + } + + virtual ~TCLIService_RestoreSession_args() throw(); + TRestoreSessionReq req; + + _TCLIService_RestoreSession_args__isset __isset; + + void __set_req(const TRestoreSessionReq& val); + + bool operator == (const TCLIService_RestoreSession_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_RestoreSession_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_RestoreSession_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_RestoreSession_pargs { + public: + + + virtual ~TCLIService_RestoreSession_pargs() throw(); + const TRestoreSessionReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_RestoreSession_result__isset { + _TCLIService_RestoreSession_result__isset() : success(false) {} + bool success :1; +} _TCLIService_RestoreSession_result__isset; + +class TCLIService_RestoreSession_result { + public: + + TCLIService_RestoreSession_result(const TCLIService_RestoreSession_result&); + TCLIService_RestoreSession_result& operator=(const TCLIService_RestoreSession_result&); + TCLIService_RestoreSession_result() { + } + + virtual ~TCLIService_RestoreSession_result() throw(); + TRestoreSessionResp success; + + _TCLIService_RestoreSession_result__isset __isset; + + void __set_success(const TRestoreSessionResp& val); + + bool operator == (const TCLIService_RestoreSession_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_RestoreSession_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_RestoreSession_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_RestoreSession_presult__isset { + _TCLIService_RestoreSession_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_RestoreSession_presult__isset; + +class TCLIService_RestoreSession_presult { + public: + + + virtual ~TCLIService_RestoreSession_presult() throw(); + TRestoreSessionResp* success; + + _TCLIService_RestoreSession_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + typedef struct _TCLIService_CloseSession_args__isset { _TCLIService_CloseSession_args__isset() : req(false) {} bool req :1; @@ -2132,6 +2240,9 @@ class TCLIServiceClient : virtual public TCLIServiceIf { void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req); void send_OpenSession(const TOpenSessionReq& req); void recv_OpenSession(TOpenSessionResp& _return); + void RestoreSession(TRestoreSessionResp& _return, const TRestoreSessionReq& req); + void send_RestoreSession(const TRestoreSessionReq& req); + void recv_RestoreSession(TRestoreSessionResp& _return); void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req); void send_CloseSession(const TCloseSessionReq& req); void recv_CloseSession(TCloseSessionResp& _return); @@ -2202,6 +2313,7 @@ class TCLIServiceProcessor : public ::apache::thrift::TDispatchProcessor { typedef std::map ProcessMap; ProcessMap processMap_; void process_OpenSession(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_RestoreSession(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_CloseSession(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_GetInfo(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_ExecuteStatement(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); @@ -2224,6 +2336,7 @@ class TCLIServiceProcessor : public ::apache::thrift::TDispatchProcessor { TCLIServiceProcessor(boost::shared_ptr iface) : iface_(iface) { processMap_["OpenSession"] = &TCLIServiceProcessor::process_OpenSession; + processMap_["RestoreSession"] = &TCLIServiceProcessor::process_RestoreSession; processMap_["CloseSession"] = &TCLIServiceProcessor::process_CloseSession; processMap_["GetInfo"] = &TCLIServiceProcessor::process_GetInfo; processMap_["ExecuteStatement"] = &TCLIServiceProcessor::process_ExecuteStatement; @@ -2280,6 +2393,16 @@ class TCLIServiceMultiface : virtual public TCLIServiceIf { return; } + void RestoreSession(TRestoreSessionResp& _return, const TRestoreSessionReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->RestoreSession(_return, req); + } + ifaces_[i]->RestoreSession(_return, req); + return; + } + void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) { size_t sz = ifaces_.size(); size_t i = 0; @@ -2493,6 +2616,9 @@ class TCLIServiceConcurrentClient : virtual public TCLIServiceIf { void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req); int32_t send_OpenSession(const TOpenSessionReq& req); void recv_OpenSession(TOpenSessionResp& _return, const int32_t seqid); + void RestoreSession(TRestoreSessionResp& _return, const TRestoreSessionReq& req); + int32_t send_RestoreSession(const TRestoreSessionReq& req); + void recv_RestoreSession(TRestoreSessionResp& _return, const int32_t seqid); void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req); int32_t send_CloseSession(const TCloseSessionReq& req); void recv_CloseSession(TCloseSessionResp& _return, const int32_t seqid); diff --git a/service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp b/service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp index fc82b884d9d0cae47a43f8a734689af0cf6771ef..0e1fd33faac6bc949fbc6dc2b100d8c694fddb0b 100644 --- a/service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp +++ b/service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp @@ -196,6 +196,193 @@ uint32_t TCLIService_OpenSession_presult::read(::apache::thrift::protocol::TProt } +TCLIService_RestoreSession_args::~TCLIService_RestoreSession_args() throw() { +} + + +uint32_t TCLIService_RestoreSession_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->req.read(iprot); + this->__isset.req = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_RestoreSession_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_RestoreSession_args"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->req.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +TCLIService_RestoreSession_pargs::~TCLIService_RestoreSession_pargs() throw() { +} + + +uint32_t TCLIService_RestoreSession_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_RestoreSession_pargs"); + + xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->req)).write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +TCLIService_RestoreSession_result::~TCLIService_RestoreSession_result() throw() { +} + + +uint32_t TCLIService_RestoreSession_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TCLIService_RestoreSession_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_RestoreSession_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +TCLIService_RestoreSession_presult::~TCLIService_RestoreSession_presult() throw() { +} + + +uint32_t TCLIService_RestoreSession_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + TCLIService_CloseSession_args::~TCLIService_CloseSession_args() throw() { } @@ -3619,6 +3806,64 @@ void TCLIServiceClient::recv_OpenSession(TOpenSessionResp& _return) throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "OpenSession failed: unknown result"); } +void TCLIServiceClient::RestoreSession(TRestoreSessionResp& _return, const TRestoreSessionReq& req) +{ + send_RestoreSession(req); + recv_RestoreSession(_return); +} + +void TCLIServiceClient::send_RestoreSession(const TRestoreSessionReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("RestoreSession", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_RestoreSession_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_RestoreSession(TRestoreSessionResp& _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("RestoreSession") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_RestoreSession_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "RestoreSession failed: unknown result"); +} + void TCLIServiceClient::CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) { send_CloseSession(req); @@ -4736,6 +4981,60 @@ void TCLIServiceProcessor::process_OpenSession(int32_t seqid, ::apache::thrift:: } } +void TCLIServiceProcessor::process_RestoreSession(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("TCLIService.RestoreSession", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.RestoreSession"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.RestoreSession"); + } + + TCLIService_RestoreSession_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.RestoreSession", bytes); + } + + TCLIService_RestoreSession_result result; + try { + iface_->RestoreSession(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.RestoreSession"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("RestoreSession", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "TCLIService.RestoreSession"); + } + + oprot->writeMessageBegin("RestoreSession", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "TCLIService.RestoreSession", bytes); + } +} + void TCLIServiceProcessor::process_CloseSession(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { void* ctx = NULL; @@ -5799,6 +6098,90 @@ void TCLIServiceConcurrentClient::recv_OpenSession(TOpenSessionResp& _return, co } // end while(true) } +void TCLIServiceConcurrentClient::RestoreSession(TRestoreSessionResp& _return, const TRestoreSessionReq& req) +{ + int32_t seqid = send_RestoreSession(req); + recv_RestoreSession(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_RestoreSession(const TRestoreSessionReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("RestoreSession", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_RestoreSession_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_RestoreSession(TRestoreSessionResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("RestoreSession") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_RestoreSession_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "RestoreSession failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + void TCLIServiceConcurrentClient::CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) { int32_t seqid = send_CloseSession(req); diff --git a/service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp index 66ed6a7c7e51b212e9d6e190fb4376f06abb4098..17cedde021166dc9a265f318760981c1189aa90c 100644 --- a/service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp +++ b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp @@ -27,6 +27,11 @@ class TCLIServiceHandler : virtual public TCLIServiceIf { printf("OpenSession\n"); } + void RestoreSession(TRestoreSessionResp& _return, const TRestoreSessionReq& req) { + // Your implementation goes here + printf("RestoreSession\n"); + } + void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) { // Your implementation goes here printf("CloseSession\n"); diff --git a/service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h index 53642939829ec137db6b5ded46c6c3edef3b9e69..84173a550e5f4164daf5da8a4bc4bf8787259e97 100644 --- a/service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h +++ b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h @@ -255,6 +255,10 @@ class TOpenSessionReq; class TOpenSessionResp; +class TRestoreSessionReq; + +class TRestoreSessionResp; + class TCloseSessionReq; class TCloseSessionResp; @@ -2230,6 +2234,150 @@ inline std::ostream& operator<<(std::ostream& out, const TOpenSessionResp& obj) return out; } +typedef struct _TRestoreSessionReq__isset { + _TRestoreSessionReq__isset() : username(false), password(false), configuration(false) {} + bool username :1; + bool password :1; + bool configuration :1; +} _TRestoreSessionReq__isset; + +class TRestoreSessionReq { + public: + + TRestoreSessionReq(const TRestoreSessionReq&); + TRestoreSessionReq& operator=(const TRestoreSessionReq&); + TRestoreSessionReq() : client_protocol((TProtocolVersion::type)7), username(), password() { + client_protocol = (TProtocolVersion::type)7; + + } + + virtual ~TRestoreSessionReq() throw(); + TProtocolVersion::type client_protocol; + TSessionHandle sessionHandle; + std::string username; + std::string password; + std::map configuration; + + _TRestoreSessionReq__isset __isset; + + void __set_client_protocol(const TProtocolVersion::type val); + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_username(const std::string& val); + + void __set_password(const std::string& val); + + void __set_configuration(const std::map & val); + + bool operator == (const TRestoreSessionReq & rhs) const + { + if (!(client_protocol == rhs.client_protocol)) + return false; + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.username != rhs.__isset.username) + return false; + else if (__isset.username && !(username == rhs.username)) + return false; + if (__isset.password != rhs.__isset.password) + return false; + else if (__isset.password && !(password == rhs.password)) + return false; + if (__isset.configuration != rhs.__isset.configuration) + return false; + else if (__isset.configuration && !(configuration == rhs.configuration)) + return false; + return true; + } + bool operator != (const TRestoreSessionReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TRestoreSessionReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TRestoreSessionReq &a, TRestoreSessionReq &b); + +inline std::ostream& operator<<(std::ostream& out, const TRestoreSessionReq& obj) +{ + obj.printTo(out); + return out; +} + +typedef struct _TRestoreSessionResp__isset { + _TRestoreSessionResp__isset() : sessionHandle(false), configuration(false) {} + bool sessionHandle :1; + bool configuration :1; +} _TRestoreSessionResp__isset; + +class TRestoreSessionResp { + public: + + TRestoreSessionResp(const TRestoreSessionResp&); + TRestoreSessionResp& operator=(const TRestoreSessionResp&); + TRestoreSessionResp() : serverProtocolVersion((TProtocolVersion::type)7) { + serverProtocolVersion = (TProtocolVersion::type)7; + + } + + virtual ~TRestoreSessionResp() throw(); + TStatus status; + TProtocolVersion::type serverProtocolVersion; + TSessionHandle sessionHandle; + std::map configuration; + + _TRestoreSessionResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_serverProtocolVersion(const TProtocolVersion::type val); + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_configuration(const std::map & val); + + bool operator == (const TRestoreSessionResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (!(serverProtocolVersion == rhs.serverProtocolVersion)) + return false; + if (__isset.sessionHandle != rhs.__isset.sessionHandle) + return false; + else if (__isset.sessionHandle && !(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.configuration != rhs.__isset.configuration) + return false; + else if (__isset.configuration && !(configuration == rhs.configuration)) + return false; + return true; + } + bool operator != (const TRestoreSessionResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TRestoreSessionResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TRestoreSessionResp &a, TRestoreSessionResp &b); + +inline std::ostream& operator<<(std::ostream& out, const TRestoreSessionResp& obj) +{ + obj.printTo(out); + return out; +} + class TCloseSessionReq { public: diff --git a/service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp index e62e8b720e967dac6bbd4f53328a85256a07e022..41e38ca132b5921f0d5b7737c2cca9405e462553 100644 --- a/service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp +++ b/service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp @@ -4931,6 +4931,392 @@ void TOpenSessionResp::printTo(std::ostream& out) const { } +TRestoreSessionReq::~TRestoreSessionReq() throw() { +} + + +void TRestoreSessionReq::__set_client_protocol(const TProtocolVersion::type val) { + this->client_protocol = val; +} + +void TRestoreSessionReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TRestoreSessionReq::__set_username(const std::string& val) { + this->username = val; +__isset.username = true; +} + +void TRestoreSessionReq::__set_password(const std::string& val) { + this->password = val; +__isset.password = true; +} + +void TRestoreSessionReq::__set_configuration(const std::map & val) { + this->configuration = val; +__isset.configuration = true; +} + +uint32_t TRestoreSessionReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + bool isset_client_protocol = false; + bool isset_sessionHandle = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast203; + xfer += iprot->readI32(ecast203); + this->client_protocol = (TProtocolVersion::type)ecast203; + isset_client_protocol = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sessionHandle.read(iprot); + isset_sessionHandle = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->username); + this->__isset.username = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->password); + this->__isset.password = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->configuration.clear(); + uint32_t _size204; + ::apache::thrift::protocol::TType _ktype205; + ::apache::thrift::protocol::TType _vtype206; + xfer += iprot->readMapBegin(_ktype205, _vtype206, _size204); + uint32_t _i208; + for (_i208 = 0; _i208 < _size204; ++_i208) + { + std::string _key209; + xfer += iprot->readString(_key209); + std::string& _val210 = this->configuration[_key209]; + xfer += iprot->readString(_val210); + } + xfer += iprot->readMapEnd(); + } + this->__isset.configuration = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_client_protocol) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_sessionHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TRestoreSessionReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TRestoreSessionReq"); + + xfer += oprot->writeFieldBegin("client_protocol", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((int32_t)this->client_protocol); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.username) { + xfer += oprot->writeFieldBegin("username", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->username); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.password) { + xfer += oprot->writeFieldBegin("password", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->password); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.configuration) { + xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 5); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); + std::map ::const_iterator _iter211; + for (_iter211 = this->configuration.begin(); _iter211 != this->configuration.end(); ++_iter211) + { + xfer += oprot->writeString(_iter211->first); + xfer += oprot->writeString(_iter211->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TRestoreSessionReq &a, TRestoreSessionReq &b) { + using ::std::swap; + swap(a.client_protocol, b.client_protocol); + swap(a.sessionHandle, b.sessionHandle); + swap(a.username, b.username); + swap(a.password, b.password); + swap(a.configuration, b.configuration); + swap(a.__isset, b.__isset); +} + +TRestoreSessionReq::TRestoreSessionReq(const TRestoreSessionReq& other212) { + client_protocol = other212.client_protocol; + sessionHandle = other212.sessionHandle; + username = other212.username; + password = other212.password; + configuration = other212.configuration; + __isset = other212.__isset; +} +TRestoreSessionReq& TRestoreSessionReq::operator=(const TRestoreSessionReq& other213) { + client_protocol = other213.client_protocol; + sessionHandle = other213.sessionHandle; + username = other213.username; + password = other213.password; + configuration = other213.configuration; + __isset = other213.__isset; + return *this; +} +void TRestoreSessionReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TRestoreSessionReq("; + out << "client_protocol=" << to_string(client_protocol); + out << ", " << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "username="; (__isset.username ? (out << to_string(username)) : (out << "")); + out << ", " << "password="; (__isset.password ? (out << to_string(password)) : (out << "")); + out << ", " << "configuration="; (__isset.configuration ? (out << to_string(configuration)) : (out << "")); + out << ")"; +} + + +TRestoreSessionResp::~TRestoreSessionResp() throw() { +} + + +void TRestoreSessionResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TRestoreSessionResp::__set_serverProtocolVersion(const TProtocolVersion::type val) { + this->serverProtocolVersion = val; +} + +void TRestoreSessionResp::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +__isset.sessionHandle = true; +} + +void TRestoreSessionResp::__set_configuration(const std::map & val) { + this->configuration = val; +__isset.configuration = true; +} + +uint32_t TRestoreSessionResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + bool isset_status = false; + bool isset_serverProtocolVersion = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->status.read(iprot); + isset_status = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast214; + xfer += iprot->readI32(ecast214); + this->serverProtocolVersion = (TProtocolVersion::type)ecast214; + isset_serverProtocolVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sessionHandle.read(iprot); + this->__isset.sessionHandle = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->configuration.clear(); + uint32_t _size215; + ::apache::thrift::protocol::TType _ktype216; + ::apache::thrift::protocol::TType _vtype217; + xfer += iprot->readMapBegin(_ktype216, _vtype217, _size215); + uint32_t _i219; + for (_i219 = 0; _i219 < _size215; ++_i219) + { + std::string _key220; + xfer += iprot->readString(_key220); + std::string& _val221 = this->configuration[_key220]; + xfer += iprot->readString(_val221); + } + xfer += iprot->readMapEnd(); + } + this->__isset.configuration = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_status) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_serverProtocolVersion) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TRestoreSessionResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TRestoreSessionResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("serverProtocolVersion", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->serverProtocolVersion); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.sessionHandle) { + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.configuration) { + xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 4); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); + std::map ::const_iterator _iter222; + for (_iter222 = this->configuration.begin(); _iter222 != this->configuration.end(); ++_iter222) + { + xfer += oprot->writeString(_iter222->first); + xfer += oprot->writeString(_iter222->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TRestoreSessionResp &a, TRestoreSessionResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.serverProtocolVersion, b.serverProtocolVersion); + swap(a.sessionHandle, b.sessionHandle); + swap(a.configuration, b.configuration); + swap(a.__isset, b.__isset); +} + +TRestoreSessionResp::TRestoreSessionResp(const TRestoreSessionResp& other223) { + status = other223.status; + serverProtocolVersion = other223.serverProtocolVersion; + sessionHandle = other223.sessionHandle; + configuration = other223.configuration; + __isset = other223.__isset; +} +TRestoreSessionResp& TRestoreSessionResp::operator=(const TRestoreSessionResp& other224) { + status = other224.status; + serverProtocolVersion = other224.serverProtocolVersion; + sessionHandle = other224.sessionHandle; + configuration = other224.configuration; + __isset = other224.__isset; + return *this; +} +void TRestoreSessionResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TRestoreSessionResp("; + out << "status=" << to_string(status); + out << ", " << "serverProtocolVersion=" << to_string(serverProtocolVersion); + out << ", " << "sessionHandle="; (__isset.sessionHandle ? (out << to_string(sessionHandle)) : (out << "")); + out << ", " << "configuration="; (__isset.configuration ? (out << to_string(configuration)) : (out << "")); + out << ")"; +} + + TCloseSessionReq::~TCloseSessionReq() throw() { } @@ -5002,11 +5388,11 @@ void swap(TCloseSessionReq &a, TCloseSessionReq &b) { swap(a.sessionHandle, b.sessionHandle); } -TCloseSessionReq::TCloseSessionReq(const TCloseSessionReq& other203) { - sessionHandle = other203.sessionHandle; +TCloseSessionReq::TCloseSessionReq(const TCloseSessionReq& other225) { + sessionHandle = other225.sessionHandle; } -TCloseSessionReq& TCloseSessionReq::operator=(const TCloseSessionReq& other204) { - sessionHandle = other204.sessionHandle; +TCloseSessionReq& TCloseSessionReq::operator=(const TCloseSessionReq& other226) { + sessionHandle = other226.sessionHandle; return *this; } void TCloseSessionReq::printTo(std::ostream& out) const { @@ -5088,11 +5474,11 @@ void swap(TCloseSessionResp &a, TCloseSessionResp &b) { swap(a.status, b.status); } -TCloseSessionResp::TCloseSessionResp(const TCloseSessionResp& other205) { - status = other205.status; +TCloseSessionResp::TCloseSessionResp(const TCloseSessionResp& other227) { + status = other227.status; } -TCloseSessionResp& TCloseSessionResp::operator=(const TCloseSessionResp& other206) { - status = other206.status; +TCloseSessionResp& TCloseSessionResp::operator=(const TCloseSessionResp& other228) { + status = other228.status; return *this; } void TCloseSessionResp::printTo(std::ostream& out) const { @@ -5257,23 +5643,23 @@ void swap(TGetInfoValue &a, TGetInfoValue &b) { swap(a.__isset, b.__isset); } -TGetInfoValue::TGetInfoValue(const TGetInfoValue& other207) { - stringValue = other207.stringValue; - smallIntValue = other207.smallIntValue; - integerBitmask = other207.integerBitmask; - integerFlag = other207.integerFlag; - binaryValue = other207.binaryValue; - lenValue = other207.lenValue; - __isset = other207.__isset; -} -TGetInfoValue& TGetInfoValue::operator=(const TGetInfoValue& other208) { - stringValue = other208.stringValue; - smallIntValue = other208.smallIntValue; - integerBitmask = other208.integerBitmask; - integerFlag = other208.integerFlag; - binaryValue = other208.binaryValue; - lenValue = other208.lenValue; - __isset = other208.__isset; +TGetInfoValue::TGetInfoValue(const TGetInfoValue& other229) { + stringValue = other229.stringValue; + smallIntValue = other229.smallIntValue; + integerBitmask = other229.integerBitmask; + integerFlag = other229.integerFlag; + binaryValue = other229.binaryValue; + lenValue = other229.lenValue; + __isset = other229.__isset; +} +TGetInfoValue& TGetInfoValue::operator=(const TGetInfoValue& other230) { + stringValue = other230.stringValue; + smallIntValue = other230.smallIntValue; + integerBitmask = other230.integerBitmask; + integerFlag = other230.integerFlag; + binaryValue = other230.binaryValue; + lenValue = other230.lenValue; + __isset = other230.__isset; return *this; } void TGetInfoValue::printTo(std::ostream& out) const { @@ -5334,9 +5720,9 @@ uint32_t TGetInfoReq::read(::apache::thrift::protocol::TProtocol* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast209; - xfer += iprot->readI32(ecast209); - this->infoType = (TGetInfoType::type)ecast209; + int32_t ecast231; + xfer += iprot->readI32(ecast231); + this->infoType = (TGetInfoType::type)ecast231; isset_infoType = true; } else { xfer += iprot->skip(ftype); @@ -5382,13 +5768,13 @@ void swap(TGetInfoReq &a, TGetInfoReq &b) { swap(a.infoType, b.infoType); } -TGetInfoReq::TGetInfoReq(const TGetInfoReq& other210) { - sessionHandle = other210.sessionHandle; - infoType = other210.infoType; +TGetInfoReq::TGetInfoReq(const TGetInfoReq& other232) { + sessionHandle = other232.sessionHandle; + infoType = other232.infoType; } -TGetInfoReq& TGetInfoReq::operator=(const TGetInfoReq& other211) { - sessionHandle = other211.sessionHandle; - infoType = other211.infoType; +TGetInfoReq& TGetInfoReq::operator=(const TGetInfoReq& other233) { + sessionHandle = other233.sessionHandle; + infoType = other233.infoType; return *this; } void TGetInfoReq::printTo(std::ostream& out) const { @@ -5491,13 +5877,13 @@ void swap(TGetInfoResp &a, TGetInfoResp &b) { swap(a.infoValue, b.infoValue); } -TGetInfoResp::TGetInfoResp(const TGetInfoResp& other212) { - status = other212.status; - infoValue = other212.infoValue; +TGetInfoResp::TGetInfoResp(const TGetInfoResp& other234) { + status = other234.status; + infoValue = other234.infoValue; } -TGetInfoResp& TGetInfoResp::operator=(const TGetInfoResp& other213) { - status = other213.status; - infoValue = other213.infoValue; +TGetInfoResp& TGetInfoResp::operator=(const TGetInfoResp& other235) { + status = other235.status; + infoValue = other235.infoValue; return *this; } void TGetInfoResp::printTo(std::ostream& out) const { @@ -5574,17 +5960,17 @@ uint32_t TExecuteStatementReq::read(::apache::thrift::protocol::TProtocol* iprot if (ftype == ::apache::thrift::protocol::T_MAP) { { this->confOverlay.clear(); - uint32_t _size214; - ::apache::thrift::protocol::TType _ktype215; - ::apache::thrift::protocol::TType _vtype216; - xfer += iprot->readMapBegin(_ktype215, _vtype216, _size214); - uint32_t _i218; - for (_i218 = 0; _i218 < _size214; ++_i218) + uint32_t _size236; + ::apache::thrift::protocol::TType _ktype237; + ::apache::thrift::protocol::TType _vtype238; + xfer += iprot->readMapBegin(_ktype237, _vtype238, _size236); + uint32_t _i240; + for (_i240 = 0; _i240 < _size236; ++_i240) { - std::string _key219; - xfer += iprot->readString(_key219); - std::string& _val220 = this->confOverlay[_key219]; - xfer += iprot->readString(_val220); + std::string _key241; + xfer += iprot->readString(_key241); + std::string& _val242 = this->confOverlay[_key241]; + xfer += iprot->readString(_val242); } xfer += iprot->readMapEnd(); } @@ -5634,11 +6020,11 @@ uint32_t TExecuteStatementReq::write(::apache::thrift::protocol::TProtocol* opro xfer += oprot->writeFieldBegin("confOverlay", ::apache::thrift::protocol::T_MAP, 3); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->confOverlay.size())); - std::map ::const_iterator _iter221; - for (_iter221 = this->confOverlay.begin(); _iter221 != this->confOverlay.end(); ++_iter221) + std::map ::const_iterator _iter243; + for (_iter243 = this->confOverlay.begin(); _iter243 != this->confOverlay.end(); ++_iter243) { - xfer += oprot->writeString(_iter221->first); - xfer += oprot->writeString(_iter221->second); + xfer += oprot->writeString(_iter243->first); + xfer += oprot->writeString(_iter243->second); } xfer += oprot->writeMapEnd(); } @@ -5663,19 +6049,19 @@ void swap(TExecuteStatementReq &a, TExecuteStatementReq &b) { swap(a.__isset, b.__isset); } -TExecuteStatementReq::TExecuteStatementReq(const TExecuteStatementReq& other222) { - sessionHandle = other222.sessionHandle; - statement = other222.statement; - confOverlay = other222.confOverlay; - runAsync = other222.runAsync; - __isset = other222.__isset; +TExecuteStatementReq::TExecuteStatementReq(const TExecuteStatementReq& other244) { + sessionHandle = other244.sessionHandle; + statement = other244.statement; + confOverlay = other244.confOverlay; + runAsync = other244.runAsync; + __isset = other244.__isset; } -TExecuteStatementReq& TExecuteStatementReq::operator=(const TExecuteStatementReq& other223) { - sessionHandle = other223.sessionHandle; - statement = other223.statement; - confOverlay = other223.confOverlay; - runAsync = other223.runAsync; - __isset = other223.__isset; +TExecuteStatementReq& TExecuteStatementReq::operator=(const TExecuteStatementReq& other245) { + sessionHandle = other245.sessionHandle; + statement = other245.statement; + confOverlay = other245.confOverlay; + runAsync = other245.runAsync; + __isset = other245.__isset; return *this; } void TExecuteStatementReq::printTo(std::ostream& out) const { @@ -5780,15 +6166,15 @@ void swap(TExecuteStatementResp &a, TExecuteStatementResp &b) { swap(a.__isset, b.__isset); } -TExecuteStatementResp::TExecuteStatementResp(const TExecuteStatementResp& other224) { - status = other224.status; - operationHandle = other224.operationHandle; - __isset = other224.__isset; +TExecuteStatementResp::TExecuteStatementResp(const TExecuteStatementResp& other246) { + status = other246.status; + operationHandle = other246.operationHandle; + __isset = other246.__isset; } -TExecuteStatementResp& TExecuteStatementResp::operator=(const TExecuteStatementResp& other225) { - status = other225.status; - operationHandle = other225.operationHandle; - __isset = other225.__isset; +TExecuteStatementResp& TExecuteStatementResp::operator=(const TExecuteStatementResp& other247) { + status = other247.status; + operationHandle = other247.operationHandle; + __isset = other247.__isset; return *this; } void TExecuteStatementResp::printTo(std::ostream& out) const { @@ -5871,11 +6257,11 @@ void swap(TGetTypeInfoReq &a, TGetTypeInfoReq &b) { swap(a.sessionHandle, b.sessionHandle); } -TGetTypeInfoReq::TGetTypeInfoReq(const TGetTypeInfoReq& other226) { - sessionHandle = other226.sessionHandle; +TGetTypeInfoReq::TGetTypeInfoReq(const TGetTypeInfoReq& other248) { + sessionHandle = other248.sessionHandle; } -TGetTypeInfoReq& TGetTypeInfoReq::operator=(const TGetTypeInfoReq& other227) { - sessionHandle = other227.sessionHandle; +TGetTypeInfoReq& TGetTypeInfoReq::operator=(const TGetTypeInfoReq& other249) { + sessionHandle = other249.sessionHandle; return *this; } void TGetTypeInfoReq::printTo(std::ostream& out) const { @@ -5977,15 +6363,15 @@ void swap(TGetTypeInfoResp &a, TGetTypeInfoResp &b) { swap(a.__isset, b.__isset); } -TGetTypeInfoResp::TGetTypeInfoResp(const TGetTypeInfoResp& other228) { - status = other228.status; - operationHandle = other228.operationHandle; - __isset = other228.__isset; +TGetTypeInfoResp::TGetTypeInfoResp(const TGetTypeInfoResp& other250) { + status = other250.status; + operationHandle = other250.operationHandle; + __isset = other250.__isset; } -TGetTypeInfoResp& TGetTypeInfoResp::operator=(const TGetTypeInfoResp& other229) { - status = other229.status; - operationHandle = other229.operationHandle; - __isset = other229.__isset; +TGetTypeInfoResp& TGetTypeInfoResp::operator=(const TGetTypeInfoResp& other251) { + status = other251.status; + operationHandle = other251.operationHandle; + __isset = other251.__isset; return *this; } void TGetTypeInfoResp::printTo(std::ostream& out) const { @@ -6068,11 +6454,11 @@ void swap(TGetCatalogsReq &a, TGetCatalogsReq &b) { swap(a.sessionHandle, b.sessionHandle); } -TGetCatalogsReq::TGetCatalogsReq(const TGetCatalogsReq& other230) { - sessionHandle = other230.sessionHandle; +TGetCatalogsReq::TGetCatalogsReq(const TGetCatalogsReq& other252) { + sessionHandle = other252.sessionHandle; } -TGetCatalogsReq& TGetCatalogsReq::operator=(const TGetCatalogsReq& other231) { - sessionHandle = other231.sessionHandle; +TGetCatalogsReq& TGetCatalogsReq::operator=(const TGetCatalogsReq& other253) { + sessionHandle = other253.sessionHandle; return *this; } void TGetCatalogsReq::printTo(std::ostream& out) const { @@ -6174,15 +6560,15 @@ void swap(TGetCatalogsResp &a, TGetCatalogsResp &b) { swap(a.__isset, b.__isset); } -TGetCatalogsResp::TGetCatalogsResp(const TGetCatalogsResp& other232) { - status = other232.status; - operationHandle = other232.operationHandle; - __isset = other232.__isset; +TGetCatalogsResp::TGetCatalogsResp(const TGetCatalogsResp& other254) { + status = other254.status; + operationHandle = other254.operationHandle; + __isset = other254.__isset; } -TGetCatalogsResp& TGetCatalogsResp::operator=(const TGetCatalogsResp& other233) { - status = other233.status; - operationHandle = other233.operationHandle; - __isset = other233.__isset; +TGetCatalogsResp& TGetCatalogsResp::operator=(const TGetCatalogsResp& other255) { + status = other255.status; + operationHandle = other255.operationHandle; + __isset = other255.__isset; return *this; } void TGetCatalogsResp::printTo(std::ostream& out) const { @@ -6304,17 +6690,17 @@ void swap(TGetSchemasReq &a, TGetSchemasReq &b) { swap(a.__isset, b.__isset); } -TGetSchemasReq::TGetSchemasReq(const TGetSchemasReq& other234) { - sessionHandle = other234.sessionHandle; - catalogName = other234.catalogName; - schemaName = other234.schemaName; - __isset = other234.__isset; +TGetSchemasReq::TGetSchemasReq(const TGetSchemasReq& other256) { + sessionHandle = other256.sessionHandle; + catalogName = other256.catalogName; + schemaName = other256.schemaName; + __isset = other256.__isset; } -TGetSchemasReq& TGetSchemasReq::operator=(const TGetSchemasReq& other235) { - sessionHandle = other235.sessionHandle; - catalogName = other235.catalogName; - schemaName = other235.schemaName; - __isset = other235.__isset; +TGetSchemasReq& TGetSchemasReq::operator=(const TGetSchemasReq& other257) { + sessionHandle = other257.sessionHandle; + catalogName = other257.catalogName; + schemaName = other257.schemaName; + __isset = other257.__isset; return *this; } void TGetSchemasReq::printTo(std::ostream& out) const { @@ -6418,15 +6804,15 @@ void swap(TGetSchemasResp &a, TGetSchemasResp &b) { swap(a.__isset, b.__isset); } -TGetSchemasResp::TGetSchemasResp(const TGetSchemasResp& other236) { - status = other236.status; - operationHandle = other236.operationHandle; - __isset = other236.__isset; +TGetSchemasResp::TGetSchemasResp(const TGetSchemasResp& other258) { + status = other258.status; + operationHandle = other258.operationHandle; + __isset = other258.__isset; } -TGetSchemasResp& TGetSchemasResp::operator=(const TGetSchemasResp& other237) { - status = other237.status; - operationHandle = other237.operationHandle; - __isset = other237.__isset; +TGetSchemasResp& TGetSchemasResp::operator=(const TGetSchemasResp& other259) { + status = other259.status; + operationHandle = other259.operationHandle; + __isset = other259.__isset; return *this; } void TGetSchemasResp::printTo(std::ostream& out) const { @@ -6524,14 +6910,14 @@ uint32_t TGetTablesReq::read(::apache::thrift::protocol::TProtocol* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->tableTypes.clear(); - uint32_t _size238; - ::apache::thrift::protocol::TType _etype241; - xfer += iprot->readListBegin(_etype241, _size238); - this->tableTypes.resize(_size238); - uint32_t _i242; - for (_i242 = 0; _i242 < _size238; ++_i242) + uint32_t _size260; + ::apache::thrift::protocol::TType _etype263; + xfer += iprot->readListBegin(_etype263, _size260); + this->tableTypes.resize(_size260); + uint32_t _i264; + for (_i264 = 0; _i264 < _size260; ++_i264) { - xfer += iprot->readString(this->tableTypes[_i242]); + xfer += iprot->readString(this->tableTypes[_i264]); } xfer += iprot->readListEnd(); } @@ -6582,10 +6968,10 @@ uint32_t TGetTablesReq::write(::apache::thrift::protocol::TProtocol* oprot) cons xfer += oprot->writeFieldBegin("tableTypes", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tableTypes.size())); - std::vector ::const_iterator _iter243; - for (_iter243 = this->tableTypes.begin(); _iter243 != this->tableTypes.end(); ++_iter243) + std::vector ::const_iterator _iter265; + for (_iter265 = this->tableTypes.begin(); _iter265 != this->tableTypes.end(); ++_iter265) { - xfer += oprot->writeString((*_iter243)); + xfer += oprot->writeString((*_iter265)); } xfer += oprot->writeListEnd(); } @@ -6606,21 +6992,21 @@ void swap(TGetTablesReq &a, TGetTablesReq &b) { swap(a.__isset, b.__isset); } -TGetTablesReq::TGetTablesReq(const TGetTablesReq& other244) { - sessionHandle = other244.sessionHandle; - catalogName = other244.catalogName; - schemaName = other244.schemaName; - tableName = other244.tableName; - tableTypes = other244.tableTypes; - __isset = other244.__isset; -} -TGetTablesReq& TGetTablesReq::operator=(const TGetTablesReq& other245) { - sessionHandle = other245.sessionHandle; - catalogName = other245.catalogName; - schemaName = other245.schemaName; - tableName = other245.tableName; - tableTypes = other245.tableTypes; - __isset = other245.__isset; +TGetTablesReq::TGetTablesReq(const TGetTablesReq& other266) { + sessionHandle = other266.sessionHandle; + catalogName = other266.catalogName; + schemaName = other266.schemaName; + tableName = other266.tableName; + tableTypes = other266.tableTypes; + __isset = other266.__isset; +} +TGetTablesReq& TGetTablesReq::operator=(const TGetTablesReq& other267) { + sessionHandle = other267.sessionHandle; + catalogName = other267.catalogName; + schemaName = other267.schemaName; + tableName = other267.tableName; + tableTypes = other267.tableTypes; + __isset = other267.__isset; return *this; } void TGetTablesReq::printTo(std::ostream& out) const { @@ -6726,15 +7112,15 @@ void swap(TGetTablesResp &a, TGetTablesResp &b) { swap(a.__isset, b.__isset); } -TGetTablesResp::TGetTablesResp(const TGetTablesResp& other246) { - status = other246.status; - operationHandle = other246.operationHandle; - __isset = other246.__isset; +TGetTablesResp::TGetTablesResp(const TGetTablesResp& other268) { + status = other268.status; + operationHandle = other268.operationHandle; + __isset = other268.__isset; } -TGetTablesResp& TGetTablesResp::operator=(const TGetTablesResp& other247) { - status = other247.status; - operationHandle = other247.operationHandle; - __isset = other247.__isset; +TGetTablesResp& TGetTablesResp::operator=(const TGetTablesResp& other269) { + status = other269.status; + operationHandle = other269.operationHandle; + __isset = other269.__isset; return *this; } void TGetTablesResp::printTo(std::ostream& out) const { @@ -6817,11 +7203,11 @@ void swap(TGetTableTypesReq &a, TGetTableTypesReq &b) { swap(a.sessionHandle, b.sessionHandle); } -TGetTableTypesReq::TGetTableTypesReq(const TGetTableTypesReq& other248) { - sessionHandle = other248.sessionHandle; +TGetTableTypesReq::TGetTableTypesReq(const TGetTableTypesReq& other270) { + sessionHandle = other270.sessionHandle; } -TGetTableTypesReq& TGetTableTypesReq::operator=(const TGetTableTypesReq& other249) { - sessionHandle = other249.sessionHandle; +TGetTableTypesReq& TGetTableTypesReq::operator=(const TGetTableTypesReq& other271) { + sessionHandle = other271.sessionHandle; return *this; } void TGetTableTypesReq::printTo(std::ostream& out) const { @@ -6923,15 +7309,15 @@ void swap(TGetTableTypesResp &a, TGetTableTypesResp &b) { swap(a.__isset, b.__isset); } -TGetTableTypesResp::TGetTableTypesResp(const TGetTableTypesResp& other250) { - status = other250.status; - operationHandle = other250.operationHandle; - __isset = other250.__isset; +TGetTableTypesResp::TGetTableTypesResp(const TGetTableTypesResp& other272) { + status = other272.status; + operationHandle = other272.operationHandle; + __isset = other272.__isset; } -TGetTableTypesResp& TGetTableTypesResp::operator=(const TGetTableTypesResp& other251) { - status = other251.status; - operationHandle = other251.operationHandle; - __isset = other251.__isset; +TGetTableTypesResp& TGetTableTypesResp::operator=(const TGetTableTypesResp& other273) { + status = other273.status; + operationHandle = other273.operationHandle; + __isset = other273.__isset; return *this; } void TGetTableTypesResp::printTo(std::ostream& out) const { @@ -7091,21 +7477,21 @@ void swap(TGetColumnsReq &a, TGetColumnsReq &b) { swap(a.__isset, b.__isset); } -TGetColumnsReq::TGetColumnsReq(const TGetColumnsReq& other252) { - sessionHandle = other252.sessionHandle; - catalogName = other252.catalogName; - schemaName = other252.schemaName; - tableName = other252.tableName; - columnName = other252.columnName; - __isset = other252.__isset; -} -TGetColumnsReq& TGetColumnsReq::operator=(const TGetColumnsReq& other253) { - sessionHandle = other253.sessionHandle; - catalogName = other253.catalogName; - schemaName = other253.schemaName; - tableName = other253.tableName; - columnName = other253.columnName; - __isset = other253.__isset; +TGetColumnsReq::TGetColumnsReq(const TGetColumnsReq& other274) { + sessionHandle = other274.sessionHandle; + catalogName = other274.catalogName; + schemaName = other274.schemaName; + tableName = other274.tableName; + columnName = other274.columnName; + __isset = other274.__isset; +} +TGetColumnsReq& TGetColumnsReq::operator=(const TGetColumnsReq& other275) { + sessionHandle = other275.sessionHandle; + catalogName = other275.catalogName; + schemaName = other275.schemaName; + tableName = other275.tableName; + columnName = other275.columnName; + __isset = other275.__isset; return *this; } void TGetColumnsReq::printTo(std::ostream& out) const { @@ -7211,15 +7597,15 @@ void swap(TGetColumnsResp &a, TGetColumnsResp &b) { swap(a.__isset, b.__isset); } -TGetColumnsResp::TGetColumnsResp(const TGetColumnsResp& other254) { - status = other254.status; - operationHandle = other254.operationHandle; - __isset = other254.__isset; +TGetColumnsResp::TGetColumnsResp(const TGetColumnsResp& other276) { + status = other276.status; + operationHandle = other276.operationHandle; + __isset = other276.__isset; } -TGetColumnsResp& TGetColumnsResp::operator=(const TGetColumnsResp& other255) { - status = other255.status; - operationHandle = other255.operationHandle; - __isset = other255.__isset; +TGetColumnsResp& TGetColumnsResp::operator=(const TGetColumnsResp& other277) { + status = other277.status; + operationHandle = other277.operationHandle; + __isset = other277.__isset; return *this; } void TGetColumnsResp::printTo(std::ostream& out) const { @@ -7361,19 +7747,19 @@ void swap(TGetFunctionsReq &a, TGetFunctionsReq &b) { swap(a.__isset, b.__isset); } -TGetFunctionsReq::TGetFunctionsReq(const TGetFunctionsReq& other256) { - sessionHandle = other256.sessionHandle; - catalogName = other256.catalogName; - schemaName = other256.schemaName; - functionName = other256.functionName; - __isset = other256.__isset; +TGetFunctionsReq::TGetFunctionsReq(const TGetFunctionsReq& other278) { + sessionHandle = other278.sessionHandle; + catalogName = other278.catalogName; + schemaName = other278.schemaName; + functionName = other278.functionName; + __isset = other278.__isset; } -TGetFunctionsReq& TGetFunctionsReq::operator=(const TGetFunctionsReq& other257) { - sessionHandle = other257.sessionHandle; - catalogName = other257.catalogName; - schemaName = other257.schemaName; - functionName = other257.functionName; - __isset = other257.__isset; +TGetFunctionsReq& TGetFunctionsReq::operator=(const TGetFunctionsReq& other279) { + sessionHandle = other279.sessionHandle; + catalogName = other279.catalogName; + schemaName = other279.schemaName; + functionName = other279.functionName; + __isset = other279.__isset; return *this; } void TGetFunctionsReq::printTo(std::ostream& out) const { @@ -7478,15 +7864,15 @@ void swap(TGetFunctionsResp &a, TGetFunctionsResp &b) { swap(a.__isset, b.__isset); } -TGetFunctionsResp::TGetFunctionsResp(const TGetFunctionsResp& other258) { - status = other258.status; - operationHandle = other258.operationHandle; - __isset = other258.__isset; +TGetFunctionsResp::TGetFunctionsResp(const TGetFunctionsResp& other280) { + status = other280.status; + operationHandle = other280.operationHandle; + __isset = other280.__isset; } -TGetFunctionsResp& TGetFunctionsResp::operator=(const TGetFunctionsResp& other259) { - status = other259.status; - operationHandle = other259.operationHandle; - __isset = other259.__isset; +TGetFunctionsResp& TGetFunctionsResp::operator=(const TGetFunctionsResp& other281) { + status = other281.status; + operationHandle = other281.operationHandle; + __isset = other281.__isset; return *this; } void TGetFunctionsResp::printTo(std::ostream& out) const { @@ -7569,11 +7955,11 @@ void swap(TGetOperationStatusReq &a, TGetOperationStatusReq &b) { swap(a.operationHandle, b.operationHandle); } -TGetOperationStatusReq::TGetOperationStatusReq(const TGetOperationStatusReq& other260) { - operationHandle = other260.operationHandle; +TGetOperationStatusReq::TGetOperationStatusReq(const TGetOperationStatusReq& other282) { + operationHandle = other282.operationHandle; } -TGetOperationStatusReq& TGetOperationStatusReq::operator=(const TGetOperationStatusReq& other261) { - operationHandle = other261.operationHandle; +TGetOperationStatusReq& TGetOperationStatusReq::operator=(const TGetOperationStatusReq& other283) { + operationHandle = other283.operationHandle; return *this; } void TGetOperationStatusReq::printTo(std::ostream& out) const { @@ -7644,9 +8030,9 @@ uint32_t TGetOperationStatusResp::read(::apache::thrift::protocol::TProtocol* ip break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast262; - xfer += iprot->readI32(ecast262); - this->operationState = (TOperationState::type)ecast262; + int32_t ecast284; + xfer += iprot->readI32(ecast284); + this->operationState = (TOperationState::type)ecast284; this->__isset.operationState = true; } else { xfer += iprot->skip(ftype); @@ -7734,21 +8120,21 @@ void swap(TGetOperationStatusResp &a, TGetOperationStatusResp &b) { swap(a.__isset, b.__isset); } -TGetOperationStatusResp::TGetOperationStatusResp(const TGetOperationStatusResp& other263) { - status = other263.status; - operationState = other263.operationState; - sqlState = other263.sqlState; - errorCode = other263.errorCode; - errorMessage = other263.errorMessage; - __isset = other263.__isset; -} -TGetOperationStatusResp& TGetOperationStatusResp::operator=(const TGetOperationStatusResp& other264) { - status = other264.status; - operationState = other264.operationState; - sqlState = other264.sqlState; - errorCode = other264.errorCode; - errorMessage = other264.errorMessage; - __isset = other264.__isset; +TGetOperationStatusResp::TGetOperationStatusResp(const TGetOperationStatusResp& other285) { + status = other285.status; + operationState = other285.operationState; + sqlState = other285.sqlState; + errorCode = other285.errorCode; + errorMessage = other285.errorMessage; + __isset = other285.__isset; +} +TGetOperationStatusResp& TGetOperationStatusResp::operator=(const TGetOperationStatusResp& other286) { + status = other286.status; + operationState = other286.operationState; + sqlState = other286.sqlState; + errorCode = other286.errorCode; + errorMessage = other286.errorMessage; + __isset = other286.__isset; return *this; } void TGetOperationStatusResp::printTo(std::ostream& out) const { @@ -7834,11 +8220,11 @@ void swap(TCancelOperationReq &a, TCancelOperationReq &b) { swap(a.operationHandle, b.operationHandle); } -TCancelOperationReq::TCancelOperationReq(const TCancelOperationReq& other265) { - operationHandle = other265.operationHandle; +TCancelOperationReq::TCancelOperationReq(const TCancelOperationReq& other287) { + operationHandle = other287.operationHandle; } -TCancelOperationReq& TCancelOperationReq::operator=(const TCancelOperationReq& other266) { - operationHandle = other266.operationHandle; +TCancelOperationReq& TCancelOperationReq::operator=(const TCancelOperationReq& other288) { + operationHandle = other288.operationHandle; return *this; } void TCancelOperationReq::printTo(std::ostream& out) const { @@ -7920,11 +8306,11 @@ void swap(TCancelOperationResp &a, TCancelOperationResp &b) { swap(a.status, b.status); } -TCancelOperationResp::TCancelOperationResp(const TCancelOperationResp& other267) { - status = other267.status; +TCancelOperationResp::TCancelOperationResp(const TCancelOperationResp& other289) { + status = other289.status; } -TCancelOperationResp& TCancelOperationResp::operator=(const TCancelOperationResp& other268) { - status = other268.status; +TCancelOperationResp& TCancelOperationResp::operator=(const TCancelOperationResp& other290) { + status = other290.status; return *this; } void TCancelOperationResp::printTo(std::ostream& out) const { @@ -8006,11 +8392,11 @@ void swap(TCloseOperationReq &a, TCloseOperationReq &b) { swap(a.operationHandle, b.operationHandle); } -TCloseOperationReq::TCloseOperationReq(const TCloseOperationReq& other269) { - operationHandle = other269.operationHandle; +TCloseOperationReq::TCloseOperationReq(const TCloseOperationReq& other291) { + operationHandle = other291.operationHandle; } -TCloseOperationReq& TCloseOperationReq::operator=(const TCloseOperationReq& other270) { - operationHandle = other270.operationHandle; +TCloseOperationReq& TCloseOperationReq::operator=(const TCloseOperationReq& other292) { + operationHandle = other292.operationHandle; return *this; } void TCloseOperationReq::printTo(std::ostream& out) const { @@ -8092,11 +8478,11 @@ void swap(TCloseOperationResp &a, TCloseOperationResp &b) { swap(a.status, b.status); } -TCloseOperationResp::TCloseOperationResp(const TCloseOperationResp& other271) { - status = other271.status; +TCloseOperationResp::TCloseOperationResp(const TCloseOperationResp& other293) { + status = other293.status; } -TCloseOperationResp& TCloseOperationResp::operator=(const TCloseOperationResp& other272) { - status = other272.status; +TCloseOperationResp& TCloseOperationResp::operator=(const TCloseOperationResp& other294) { + status = other294.status; return *this; } void TCloseOperationResp::printTo(std::ostream& out) const { @@ -8178,11 +8564,11 @@ void swap(TGetResultSetMetadataReq &a, TGetResultSetMetadataReq &b) { swap(a.operationHandle, b.operationHandle); } -TGetResultSetMetadataReq::TGetResultSetMetadataReq(const TGetResultSetMetadataReq& other273) { - operationHandle = other273.operationHandle; +TGetResultSetMetadataReq::TGetResultSetMetadataReq(const TGetResultSetMetadataReq& other295) { + operationHandle = other295.operationHandle; } -TGetResultSetMetadataReq& TGetResultSetMetadataReq::operator=(const TGetResultSetMetadataReq& other274) { - operationHandle = other274.operationHandle; +TGetResultSetMetadataReq& TGetResultSetMetadataReq::operator=(const TGetResultSetMetadataReq& other296) { + operationHandle = other296.operationHandle; return *this; } void TGetResultSetMetadataReq::printTo(std::ostream& out) const { @@ -8284,15 +8670,15 @@ void swap(TGetResultSetMetadataResp &a, TGetResultSetMetadataResp &b) { swap(a.__isset, b.__isset); } -TGetResultSetMetadataResp::TGetResultSetMetadataResp(const TGetResultSetMetadataResp& other275) { - status = other275.status; - schema = other275.schema; - __isset = other275.__isset; +TGetResultSetMetadataResp::TGetResultSetMetadataResp(const TGetResultSetMetadataResp& other297) { + status = other297.status; + schema = other297.schema; + __isset = other297.__isset; } -TGetResultSetMetadataResp& TGetResultSetMetadataResp::operator=(const TGetResultSetMetadataResp& other276) { - status = other276.status; - schema = other276.schema; - __isset = other276.__isset; +TGetResultSetMetadataResp& TGetResultSetMetadataResp::operator=(const TGetResultSetMetadataResp& other298) { + status = other298.status; + schema = other298.schema; + __isset = other298.__isset; return *this; } void TGetResultSetMetadataResp::printTo(std::ostream& out) const { @@ -8359,9 +8745,9 @@ uint32_t TFetchResultsReq::read(::apache::thrift::protocol::TProtocol* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast277; - xfer += iprot->readI32(ecast277); - this->orientation = (TFetchOrientation::type)ecast277; + int32_t ecast299; + xfer += iprot->readI32(ecast299); + this->orientation = (TFetchOrientation::type)ecast299; isset_orientation = true; } else { xfer += iprot->skip(ftype); @@ -8437,19 +8823,19 @@ void swap(TFetchResultsReq &a, TFetchResultsReq &b) { swap(a.__isset, b.__isset); } -TFetchResultsReq::TFetchResultsReq(const TFetchResultsReq& other278) { - operationHandle = other278.operationHandle; - orientation = other278.orientation; - maxRows = other278.maxRows; - fetchType = other278.fetchType; - __isset = other278.__isset; +TFetchResultsReq::TFetchResultsReq(const TFetchResultsReq& other300) { + operationHandle = other300.operationHandle; + orientation = other300.orientation; + maxRows = other300.maxRows; + fetchType = other300.fetchType; + __isset = other300.__isset; } -TFetchResultsReq& TFetchResultsReq::operator=(const TFetchResultsReq& other279) { - operationHandle = other279.operationHandle; - orientation = other279.orientation; - maxRows = other279.maxRows; - fetchType = other279.fetchType; - __isset = other279.__isset; +TFetchResultsReq& TFetchResultsReq::operator=(const TFetchResultsReq& other301) { + operationHandle = other301.operationHandle; + orientation = other301.orientation; + maxRows = other301.maxRows; + fetchType = other301.fetchType; + __isset = other301.__isset; return *this; } void TFetchResultsReq::printTo(std::ostream& out) const { @@ -8573,17 +8959,17 @@ void swap(TFetchResultsResp &a, TFetchResultsResp &b) { swap(a.__isset, b.__isset); } -TFetchResultsResp::TFetchResultsResp(const TFetchResultsResp& other280) { - status = other280.status; - hasMoreRows = other280.hasMoreRows; - results = other280.results; - __isset = other280.__isset; +TFetchResultsResp::TFetchResultsResp(const TFetchResultsResp& other302) { + status = other302.status; + hasMoreRows = other302.hasMoreRows; + results = other302.results; + __isset = other302.__isset; } -TFetchResultsResp& TFetchResultsResp::operator=(const TFetchResultsResp& other281) { - status = other281.status; - hasMoreRows = other281.hasMoreRows; - results = other281.results; - __isset = other281.__isset; +TFetchResultsResp& TFetchResultsResp::operator=(const TFetchResultsResp& other303) { + status = other303.status; + hasMoreRows = other303.hasMoreRows; + results = other303.results; + __isset = other303.__isset; return *this; } void TFetchResultsResp::printTo(std::ostream& out) const { @@ -8707,15 +9093,15 @@ void swap(TGetDelegationTokenReq &a, TGetDelegationTokenReq &b) { swap(a.renewer, b.renewer); } -TGetDelegationTokenReq::TGetDelegationTokenReq(const TGetDelegationTokenReq& other282) { - sessionHandle = other282.sessionHandle; - owner = other282.owner; - renewer = other282.renewer; +TGetDelegationTokenReq::TGetDelegationTokenReq(const TGetDelegationTokenReq& other304) { + sessionHandle = other304.sessionHandle; + owner = other304.owner; + renewer = other304.renewer; } -TGetDelegationTokenReq& TGetDelegationTokenReq::operator=(const TGetDelegationTokenReq& other283) { - sessionHandle = other283.sessionHandle; - owner = other283.owner; - renewer = other283.renewer; +TGetDelegationTokenReq& TGetDelegationTokenReq::operator=(const TGetDelegationTokenReq& other305) { + sessionHandle = other305.sessionHandle; + owner = other305.owner; + renewer = other305.renewer; return *this; } void TGetDelegationTokenReq::printTo(std::ostream& out) const { @@ -8819,15 +9205,15 @@ void swap(TGetDelegationTokenResp &a, TGetDelegationTokenResp &b) { swap(a.__isset, b.__isset); } -TGetDelegationTokenResp::TGetDelegationTokenResp(const TGetDelegationTokenResp& other284) { - status = other284.status; - delegationToken = other284.delegationToken; - __isset = other284.__isset; +TGetDelegationTokenResp::TGetDelegationTokenResp(const TGetDelegationTokenResp& other306) { + status = other306.status; + delegationToken = other306.delegationToken; + __isset = other306.__isset; } -TGetDelegationTokenResp& TGetDelegationTokenResp::operator=(const TGetDelegationTokenResp& other285) { - status = other285.status; - delegationToken = other285.delegationToken; - __isset = other285.__isset; +TGetDelegationTokenResp& TGetDelegationTokenResp::operator=(const TGetDelegationTokenResp& other307) { + status = other307.status; + delegationToken = other307.delegationToken; + __isset = other307.__isset; return *this; } void TGetDelegationTokenResp::printTo(std::ostream& out) const { @@ -8930,13 +9316,13 @@ void swap(TCancelDelegationTokenReq &a, TCancelDelegationTokenReq &b) { swap(a.delegationToken, b.delegationToken); } -TCancelDelegationTokenReq::TCancelDelegationTokenReq(const TCancelDelegationTokenReq& other286) { - sessionHandle = other286.sessionHandle; - delegationToken = other286.delegationToken; +TCancelDelegationTokenReq::TCancelDelegationTokenReq(const TCancelDelegationTokenReq& other308) { + sessionHandle = other308.sessionHandle; + delegationToken = other308.delegationToken; } -TCancelDelegationTokenReq& TCancelDelegationTokenReq::operator=(const TCancelDelegationTokenReq& other287) { - sessionHandle = other287.sessionHandle; - delegationToken = other287.delegationToken; +TCancelDelegationTokenReq& TCancelDelegationTokenReq::operator=(const TCancelDelegationTokenReq& other309) { + sessionHandle = other309.sessionHandle; + delegationToken = other309.delegationToken; return *this; } void TCancelDelegationTokenReq::printTo(std::ostream& out) const { @@ -9019,11 +9405,11 @@ void swap(TCancelDelegationTokenResp &a, TCancelDelegationTokenResp &b) { swap(a.status, b.status); } -TCancelDelegationTokenResp::TCancelDelegationTokenResp(const TCancelDelegationTokenResp& other288) { - status = other288.status; +TCancelDelegationTokenResp::TCancelDelegationTokenResp(const TCancelDelegationTokenResp& other310) { + status = other310.status; } -TCancelDelegationTokenResp& TCancelDelegationTokenResp::operator=(const TCancelDelegationTokenResp& other289) { - status = other289.status; +TCancelDelegationTokenResp& TCancelDelegationTokenResp::operator=(const TCancelDelegationTokenResp& other311) { + status = other311.status; return *this; } void TCancelDelegationTokenResp::printTo(std::ostream& out) const { @@ -9125,13 +9511,13 @@ void swap(TRenewDelegationTokenReq &a, TRenewDelegationTokenReq &b) { swap(a.delegationToken, b.delegationToken); } -TRenewDelegationTokenReq::TRenewDelegationTokenReq(const TRenewDelegationTokenReq& other290) { - sessionHandle = other290.sessionHandle; - delegationToken = other290.delegationToken; +TRenewDelegationTokenReq::TRenewDelegationTokenReq(const TRenewDelegationTokenReq& other312) { + sessionHandle = other312.sessionHandle; + delegationToken = other312.delegationToken; } -TRenewDelegationTokenReq& TRenewDelegationTokenReq::operator=(const TRenewDelegationTokenReq& other291) { - sessionHandle = other291.sessionHandle; - delegationToken = other291.delegationToken; +TRenewDelegationTokenReq& TRenewDelegationTokenReq::operator=(const TRenewDelegationTokenReq& other313) { + sessionHandle = other313.sessionHandle; + delegationToken = other313.delegationToken; return *this; } void TRenewDelegationTokenReq::printTo(std::ostream& out) const { @@ -9214,11 +9600,11 @@ void swap(TRenewDelegationTokenResp &a, TRenewDelegationTokenResp &b) { swap(a.status, b.status); } -TRenewDelegationTokenResp::TRenewDelegationTokenResp(const TRenewDelegationTokenResp& other292) { - status = other292.status; +TRenewDelegationTokenResp::TRenewDelegationTokenResp(const TRenewDelegationTokenResp& other314) { + status = other314.status; } -TRenewDelegationTokenResp& TRenewDelegationTokenResp::operator=(const TRenewDelegationTokenResp& other293) { - status = other293.status; +TRenewDelegationTokenResp& TRenewDelegationTokenResp::operator=(const TRenewDelegationTokenResp& other315) { + status = other315.status; return *this; } void TRenewDelegationTokenResp::printTo(std::ostream& out) const { diff --git a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java index c684f895127e4a1efed53fa0e6dda5221a935c28..a6151fac5455e3eacaed214a66e1d984440101af 100644 --- a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java +++ b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java @@ -41,6 +41,8 @@ public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException; + public TRestoreSessionResp RestoreSession(TRestoreSessionReq req) throws org.apache.thrift.TException; + public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException; public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException; @@ -83,6 +85,8 @@ public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void RestoreSession(TRestoreSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -164,6 +168,29 @@ public TOpenSessionResp recv_OpenSession() throws org.apache.thrift.TException throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "OpenSession failed: unknown result"); } + public TRestoreSessionResp RestoreSession(TRestoreSessionReq req) throws org.apache.thrift.TException + { + send_RestoreSession(req); + return recv_RestoreSession(); + } + + public void send_RestoreSession(TRestoreSessionReq req) throws org.apache.thrift.TException + { + RestoreSession_args args = new RestoreSession_args(); + args.setReq(req); + sendBase("RestoreSession", args); + } + + public TRestoreSessionResp recv_RestoreSession() throws org.apache.thrift.TException + { + RestoreSession_result result = new RestoreSession_result(); + receiveBase(result, "RestoreSession"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RestoreSession failed: unknown result"); + } + public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException { send_CloseSession(req); @@ -628,6 +655,38 @@ public TOpenSessionResp getResult() throws org.apache.thrift.TException { } } + public void RestoreSession(TRestoreSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + RestoreSession_call method_call = new RestoreSession_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class RestoreSession_call extends org.apache.thrift.async.TAsyncMethodCall { + private TRestoreSessionReq req; + public RestoreSession_call(TRestoreSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.req = req; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("RestoreSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); + RestoreSession_args args = new RestoreSession_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TRestoreSessionResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_RestoreSession(); + } + } + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CloseSession_call method_call = new CloseSession_call(req, resultHandler, this, ___protocolFactory, ___transport); @@ -1218,6 +1277,7 @@ protected Processor(I iface, Map Map> getProcessMap(Map> processMap) { processMap.put("OpenSession", new OpenSession()); + processMap.put("RestoreSession", new RestoreSession()); processMap.put("CloseSession", new CloseSession()); processMap.put("GetInfo", new GetInfo()); processMap.put("ExecuteStatement", new ExecuteStatement()); @@ -1259,6 +1319,26 @@ public OpenSession_result getResult(I iface, OpenSession_args args) throws org.a } } + public static class RestoreSession extends org.apache.thrift.ProcessFunction { + public RestoreSession() { + super("RestoreSession"); + } + + public RestoreSession_args getEmptyArgsInstance() { + return new RestoreSession_args(); + } + + protected boolean isOneway() { + return false; + } + + public RestoreSession_result getResult(I iface, RestoreSession_args args) throws org.apache.thrift.TException { + RestoreSession_result result = new RestoreSession_result(); + result.success = iface.RestoreSession(args.req); + return result; + } + } + public static class CloseSession extends org.apache.thrift.ProcessFunction { public CloseSession() { super("CloseSession"); @@ -1633,6 +1713,7 @@ protected AsyncProcessor(I iface, Map Map> getProcessMap(Map> processMap) { processMap.put("OpenSession", new OpenSession()); + processMap.put("RestoreSession", new RestoreSession()); processMap.put("CloseSession", new CloseSession()); processMap.put("GetInfo", new GetInfo()); processMap.put("ExecuteStatement", new ExecuteStatement()); @@ -1705,6 +1786,57 @@ public void start(I iface, OpenSession_args args, org.apache.thrift.async.AsyncM } } + public static class RestoreSession extends org.apache.thrift.AsyncProcessFunction { + public RestoreSession() { + super("RestoreSession"); + } + + public RestoreSession_args getEmptyArgsInstance() { + return new RestoreSession_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TRestoreSessionResp o) { + RestoreSession_result result = new RestoreSession_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + RestoreSession_result result = new RestoreSession_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, RestoreSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.RestoreSession(args.req,resultHandler); + } + } + public static class CloseSession extends org.apache.thrift.AsyncProcessFunction { public CloseSession() { super("CloseSession"); @@ -3351,6 +3483,732 @@ public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_result s } + public static class RestoreSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RestoreSession_args"); + + private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new RestoreSession_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RestoreSession_argsTupleSchemeFactory()); + } + + private TRestoreSessionReq req; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + REQ((short)1, "req"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // REQ + return REQ; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRestoreSessionReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RestoreSession_args.class, metaDataMap); + } + + public RestoreSession_args() { + } + + public RestoreSession_args( + TRestoreSessionReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public RestoreSession_args(RestoreSession_args other) { + if (other.isSetReq()) { + this.req = new TRestoreSessionReq(other.req); + } + } + + public RestoreSession_args deepCopy() { + return new RestoreSession_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TRestoreSessionReq getReq() { + return this.req; + } + + public void setReq(TRestoreSessionReq req) { + this.req = req; + } + + public void unsetReq() { + this.req = null; + } + + /** Returns true if field req is set (has been assigned a value) and false otherwise */ + public boolean isSetReq() { + return this.req != null; + } + + public void setReqIsSet(boolean value) { + if (!value) { + this.req = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TRestoreSessionReq)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof RestoreSession_args) + return this.equals((RestoreSession_args)that); + return false; + } + + public boolean equals(RestoreSession_args that) { + if (that == null) + return false; + + boolean this_present_req = true && this.isSetReq(); + boolean that_present_req = true && that.isSetReq(); + if (this_present_req || that_present_req) { + if (!(this_present_req && that_present_req)) + return false; + if (!this.req.equals(that.req)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(RestoreSession_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("RestoreSession_args("); + boolean first = true; + + sb.append("req:"); + if (this.req == null) { + sb.append("null"); + } else { + sb.append(this.req); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (req != null) { + req.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class RestoreSession_argsStandardSchemeFactory implements SchemeFactory { + public RestoreSession_argsStandardScheme getScheme() { + return new RestoreSession_argsStandardScheme(); + } + } + + private static class RestoreSession_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RestoreSession_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // REQ + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.req = new TRestoreSessionReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, RestoreSession_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.req != null) { + oprot.writeFieldBegin(REQ_FIELD_DESC); + struct.req.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class RestoreSession_argsTupleSchemeFactory implements SchemeFactory { + public RestoreSession_argsTupleScheme getScheme() { + return new RestoreSession_argsTupleScheme(); + } + } + + private static class RestoreSession_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RestoreSession_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetReq()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetReq()) { + struct.req.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, RestoreSession_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TRestoreSessionReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + public static class RestoreSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RestoreSession_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new RestoreSession_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RestoreSession_resultTupleSchemeFactory()); + } + + private TRestoreSessionResp success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRestoreSessionResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RestoreSession_result.class, metaDataMap); + } + + public RestoreSession_result() { + } + + public RestoreSession_result( + TRestoreSessionResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public RestoreSession_result(RestoreSession_result other) { + if (other.isSetSuccess()) { + this.success = new TRestoreSessionResp(other.success); + } + } + + public RestoreSession_result deepCopy() { + return new RestoreSession_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TRestoreSessionResp getSuccess() { + return this.success; + } + + public void setSuccess(TRestoreSessionResp success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TRestoreSessionResp)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof RestoreSession_result) + return this.equals((RestoreSession_result)that); + return false; + } + + public boolean equals(RestoreSession_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(RestoreSession_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("RestoreSession_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class RestoreSession_resultStandardSchemeFactory implements SchemeFactory { + public RestoreSession_resultStandardScheme getScheme() { + return new RestoreSession_resultStandardScheme(); + } + } + + private static class RestoreSession_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RestoreSession_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TRestoreSessionResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, RestoreSession_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class RestoreSession_resultTupleSchemeFactory implements SchemeFactory { + public RestoreSession_resultTupleScheme getScheme() { + return new RestoreSession_resultTupleScheme(); + } + } + + private static class RestoreSession_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RestoreSession_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, RestoreSession_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TRestoreSessionResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + public static class CloseSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_args"); diff --git a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TExecuteStatementReq.java b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TExecuteStatementReq.java index 2eb4d091f0d500d5c03b7e803a81400726deaf67..9d58c49f466f909a763bb08114dcf3102d11b427 100644 --- a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TExecuteStatementReq.java +++ b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TExecuteStatementReq.java @@ -617,15 +617,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementRe case 3: // CONF_OVERLAY if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); - struct.confOverlay = new HashMap(2*_map162.size); - String _key163; - String _val164; - for (int _i165 = 0; _i165 < _map162.size; ++_i165) + org.apache.thrift.protocol.TMap _map182 = iprot.readMapBegin(); + struct.confOverlay = new HashMap(2*_map182.size); + String _key183; + String _val184; + for (int _i185 = 0; _i185 < _map182.size; ++_i185) { - _key163 = iprot.readString(); - _val164 = iprot.readString(); - struct.confOverlay.put(_key163, _val164); + _key183 = iprot.readString(); + _val184 = iprot.readString(); + struct.confOverlay.put(_key183, _val184); } iprot.readMapEnd(); } @@ -670,10 +670,10 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementR oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size())); - for (Map.Entry _iter166 : struct.confOverlay.entrySet()) + for (Map.Entry _iter186 : struct.confOverlay.entrySet()) { - oprot.writeString(_iter166.getKey()); - oprot.writeString(_iter166.getValue()); + oprot.writeString(_iter186.getKey()); + oprot.writeString(_iter186.getValue()); } oprot.writeMapEnd(); } @@ -715,10 +715,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRe if (struct.isSetConfOverlay()) { { oprot.writeI32(struct.confOverlay.size()); - for (Map.Entry _iter167 : struct.confOverlay.entrySet()) + for (Map.Entry _iter187 : struct.confOverlay.entrySet()) { - oprot.writeString(_iter167.getKey()); - oprot.writeString(_iter167.getValue()); + oprot.writeString(_iter187.getKey()); + oprot.writeString(_iter187.getValue()); } } } @@ -738,15 +738,15 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.confOverlay = new HashMap(2*_map168.size); - String _key169; - String _val170; - for (int _i171 = 0; _i171 < _map168.size; ++_i171) + org.apache.thrift.protocol.TMap _map188 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.confOverlay = new HashMap(2*_map188.size); + String _key189; + String _val190; + for (int _i191 = 0; _i191 < _map188.size; ++_i191) { - _key169 = iprot.readString(); - _val170 = iprot.readString(); - struct.confOverlay.put(_key169, _val170); + _key189 = iprot.readString(); + _val190 = iprot.readString(); + struct.confOverlay.put(_key189, _val190); } } struct.setConfOverlayIsSet(true); diff --git a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetTablesReq.java b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetTablesReq.java index 1aa3f946727b6d4b5bf39af40acd5d3b3119949c..13e815555e4277f9b009472c6d9c63e8578fb6ef 100644 --- a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetTablesReq.java +++ b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetTablesReq.java @@ -712,13 +712,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struc case 5: // TABLE_TYPES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list172 = iprot.readListBegin(); - struct.tableTypes = new ArrayList(_list172.size); - String _elem173; - for (int _i174 = 0; _i174 < _list172.size; ++_i174) + org.apache.thrift.protocol.TList _list192 = iprot.readListBegin(); + struct.tableTypes = new ArrayList(_list192.size); + String _elem193; + for (int _i194 = 0; _i194 < _list192.size; ++_i194) { - _elem173 = iprot.readString(); - struct.tableTypes.add(_elem173); + _elem193 = iprot.readString(); + struct.tableTypes.add(_elem193); } iprot.readListEnd(); } @@ -771,9 +771,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq stru oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); - for (String _iter175 : struct.tableTypes) + for (String _iter195 : struct.tableTypes) { - oprot.writeString(_iter175); + oprot.writeString(_iter195); } oprot.writeListEnd(); } @@ -824,9 +824,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struc if (struct.isSetTableTypes()) { { oprot.writeI32(struct.tableTypes.size()); - for (String _iter176 : struct.tableTypes) + for (String _iter196 : struct.tableTypes) { - oprot.writeString(_iter176); + oprot.writeString(_iter196); } } } @@ -853,13 +853,13 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct } if (incoming.get(3)) { { - org.apache.thrift.protocol.TList _list177 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tableTypes = new ArrayList(_list177.size); - String _elem178; - for (int _i179 = 0; _i179 < _list177.size; ++_i179) + org.apache.thrift.protocol.TList _list197 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.tableTypes = new ArrayList(_list197.size); + String _elem198; + for (int _i199 = 0; _i199 < _list197.size; ++_i199) { - _elem178 = iprot.readString(); - struct.tableTypes.add(_elem178); + _elem198 = iprot.readString(); + struct.tableTypes.add(_elem198); } } struct.setTableTypesIsSet(true); diff --git a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TRestoreSessionReq.java b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TRestoreSessionReq.java new file mode 100644 index 0000000000000000000000000000000000000000..9e9ea8fceb779690a04010dc245a5b8bd0c62537 --- /dev/null +++ b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TRestoreSessionReq.java @@ -0,0 +1,884 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hive.service.rpc.thrift; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +public class TRestoreSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRestoreSessionReq"); + + private static final org.apache.thrift.protocol.TField CLIENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("client_protocol", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRestoreSessionReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRestoreSessionReqTupleSchemeFactory()); + } + + private TProtocolVersion client_protocol; // required + private TSessionHandle sessionHandle; // required + private String username; // optional + private String password; // optional + private Map configuration; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + /** + * + * @see TProtocolVersion + */ + CLIENT_PROTOCOL((short)1, "client_protocol"), + SESSION_HANDLE((short)2, "sessionHandle"), + USERNAME((short)3, "username"), + PASSWORD((short)4, "password"), + CONFIGURATION((short)5, "configuration"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // CLIENT_PROTOCOL + return CLIENT_PROTOCOL; + case 2: // SESSION_HANDLE + return SESSION_HANDLE; + case 3: // USERNAME + return USERNAME; + case 4: // PASSWORD + return PASSWORD; + case 5: // CONFIGURATION + return CONFIGURATION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.USERNAME,_Fields.PASSWORD,_Fields.CONFIGURATION}; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); + tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); + tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRestoreSessionReq.class, metaDataMap); + } + + public TRestoreSessionReq() { + this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; + + } + + public TRestoreSessionReq( + TProtocolVersion client_protocol, + TSessionHandle sessionHandle) + { + this(); + this.client_protocol = client_protocol; + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TRestoreSessionReq(TRestoreSessionReq other) { + if (other.isSetClient_protocol()) { + this.client_protocol = other.client_protocol; + } + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetUsername()) { + this.username = other.username; + } + if (other.isSetPassword()) { + this.password = other.password; + } + if (other.isSetConfiguration()) { + Map __this__configuration = new HashMap(other.configuration); + this.configuration = __this__configuration; + } + } + + public TRestoreSessionReq deepCopy() { + return new TRestoreSessionReq(this); + } + + @Override + public void clear() { + this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; + + this.sessionHandle = null; + this.username = null; + this.password = null; + this.configuration = null; + } + + /** + * + * @see TProtocolVersion + */ + public TProtocolVersion getClient_protocol() { + return this.client_protocol; + } + + /** + * + * @see TProtocolVersion + */ + public void setClient_protocol(TProtocolVersion client_protocol) { + this.client_protocol = client_protocol; + } + + public void unsetClient_protocol() { + this.client_protocol = null; + } + + /** Returns true if field client_protocol is set (has been assigned a value) and false otherwise */ + public boolean isSetClient_protocol() { + return this.client_protocol != null; + } + + public void setClient_protocolIsSet(boolean value) { + if (!value) { + this.client_protocol = null; + } + } + + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(TSessionHandle sessionHandle) { + this.sessionHandle = sessionHandle; + } + + public void unsetSessionHandle() { + this.sessionHandle = null; + } + + /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ + public boolean isSetSessionHandle() { + return this.sessionHandle != null; + } + + public void setSessionHandleIsSet(boolean value) { + if (!value) { + this.sessionHandle = null; + } + } + + public String getUsername() { + return this.username; + } + + public void setUsername(String username) { + this.username = username; + } + + public void unsetUsername() { + this.username = null; + } + + /** Returns true if field username is set (has been assigned a value) and false otherwise */ + public boolean isSetUsername() { + return this.username != null; + } + + public void setUsernameIsSet(boolean value) { + if (!value) { + this.username = null; + } + } + + public String getPassword() { + return this.password; + } + + public void setPassword(String password) { + this.password = password; + } + + public void unsetPassword() { + this.password = null; + } + + /** Returns true if field password is set (has been assigned a value) and false otherwise */ + public boolean isSetPassword() { + return this.password != null; + } + + public void setPasswordIsSet(boolean value) { + if (!value) { + this.password = null; + } + } + + public int getConfigurationSize() { + return (this.configuration == null) ? 0 : this.configuration.size(); + } + + public void putToConfiguration(String key, String val) { + if (this.configuration == null) { + this.configuration = new HashMap(); + } + this.configuration.put(key, val); + } + + public Map getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Map configuration) { + this.configuration = configuration; + } + + public void unsetConfiguration() { + this.configuration = null; + } + + /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ + public boolean isSetConfiguration() { + return this.configuration != null; + } + + public void setConfigurationIsSet(boolean value) { + if (!value) { + this.configuration = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case CLIENT_PROTOCOL: + if (value == null) { + unsetClient_protocol(); + } else { + setClient_protocol((TProtocolVersion)value); + } + break; + + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case USERNAME: + if (value == null) { + unsetUsername(); + } else { + setUsername((String)value); + } + break; + + case PASSWORD: + if (value == null) { + unsetPassword(); + } else { + setPassword((String)value); + } + break; + + case CONFIGURATION: + if (value == null) { + unsetConfiguration(); + } else { + setConfiguration((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case CLIENT_PROTOCOL: + return getClient_protocol(); + + case SESSION_HANDLE: + return getSessionHandle(); + + case USERNAME: + return getUsername(); + + case PASSWORD: + return getPassword(); + + case CONFIGURATION: + return getConfiguration(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case CLIENT_PROTOCOL: + return isSetClient_protocol(); + case SESSION_HANDLE: + return isSetSessionHandle(); + case USERNAME: + return isSetUsername(); + case PASSWORD: + return isSetPassword(); + case CONFIGURATION: + return isSetConfiguration(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRestoreSessionReq) + return this.equals((TRestoreSessionReq)that); + return false; + } + + public boolean equals(TRestoreSessionReq that) { + if (that == null) + return false; + + boolean this_present_client_protocol = true && this.isSetClient_protocol(); + boolean that_present_client_protocol = true && that.isSetClient_protocol(); + if (this_present_client_protocol || that_present_client_protocol) { + if (!(this_present_client_protocol && that_present_client_protocol)) + return false; + if (!this.client_protocol.equals(that.client_protocol)) + return false; + } + + boolean this_present_sessionHandle = true && this.isSetSessionHandle(); + boolean that_present_sessionHandle = true && that.isSetSessionHandle(); + if (this_present_sessionHandle || that_present_sessionHandle) { + if (!(this_present_sessionHandle && that_present_sessionHandle)) + return false; + if (!this.sessionHandle.equals(that.sessionHandle)) + return false; + } + + boolean this_present_username = true && this.isSetUsername(); + boolean that_present_username = true && that.isSetUsername(); + if (this_present_username || that_present_username) { + if (!(this_present_username && that_present_username)) + return false; + if (!this.username.equals(that.username)) + return false; + } + + boolean this_present_password = true && this.isSetPassword(); + boolean that_present_password = true && that.isSetPassword(); + if (this_present_password || that_present_password) { + if (!(this_present_password && that_present_password)) + return false; + if (!this.password.equals(that.password)) + return false; + } + + boolean this_present_configuration = true && this.isSetConfiguration(); + boolean that_present_configuration = true && that.isSetConfiguration(); + if (this_present_configuration || that_present_configuration) { + if (!(this_present_configuration && that_present_configuration)) + return false; + if (!this.configuration.equals(that.configuration)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_client_protocol = true && (isSetClient_protocol()); + list.add(present_client_protocol); + if (present_client_protocol) + list.add(client_protocol.getValue()); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_username = true && (isSetUsername()); + list.add(present_username); + if (present_username) + list.add(username); + + boolean present_password = true && (isSetPassword()); + list.add(present_password); + if (present_password) + list.add(password); + + boolean present_configuration = true && (isSetConfiguration()); + list.add(present_configuration); + if (present_configuration) + list.add(configuration); + + return list.hashCode(); + } + + @Override + public int compareTo(TRestoreSessionReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetClient_protocol()).compareTo(other.isSetClient_protocol()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetClient_protocol()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_protocol, other.client_protocol); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUsername()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPassword()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfiguration()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TRestoreSessionReq("); + boolean first = true; + + sb.append("client_protocol:"); + if (this.client_protocol == null) { + sb.append("null"); + } else { + sb.append(this.client_protocol); + } + first = false; + if (!first) sb.append(", "); + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetUsername()) { + if (!first) sb.append(", "); + sb.append("username:"); + if (this.username == null) { + sb.append("null"); + } else { + sb.append(this.username); + } + first = false; + } + if (isSetPassword()) { + if (!first) sb.append(", "); + sb.append("password:"); + if (this.password == null) { + sb.append("null"); + } else { + sb.append(this.password); + } + first = false; + } + if (isSetConfiguration()) { + if (!first) sb.append(", "); + sb.append("configuration:"); + if (this.configuration == null) { + sb.append("null"); + } else { + sb.append(this.configuration); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetClient_protocol()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_protocol' is unset! Struct:" + toString()); + } + + if (!isSetSessionHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class TRestoreSessionReqStandardSchemeFactory implements SchemeFactory { + public TRestoreSessionReqStandardScheme getScheme() { + return new TRestoreSessionReqStandardScheme(); + } + } + + private static class TRestoreSessionReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRestoreSessionReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // CLIENT_PROTOCOL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); + struct.setClient_protocolIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SESSION_HANDLE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // USERNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // PASSWORD + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // CONFIGURATION + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); + struct.configuration = new HashMap(2*_map162.size); + String _key163; + String _val164; + for (int _i165 = 0; _i165 < _map162.size; ++_i165) + { + _key163 = iprot.readString(); + _val164 = iprot.readString(); + struct.configuration.put(_key163, _val164); + } + iprot.readMapEnd(); + } + struct.setConfigurationIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TRestoreSessionReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.client_protocol != null) { + oprot.writeFieldBegin(CLIENT_PROTOCOL_FIELD_DESC); + oprot.writeI32(struct.client_protocol.getValue()); + oprot.writeFieldEnd(); + } + if (struct.sessionHandle != null) { + oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); + struct.sessionHandle.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.username != null) { + if (struct.isSetUsername()) { + oprot.writeFieldBegin(USERNAME_FIELD_DESC); + oprot.writeString(struct.username); + oprot.writeFieldEnd(); + } + } + if (struct.password != null) { + if (struct.isSetPassword()) { + oprot.writeFieldBegin(PASSWORD_FIELD_DESC); + oprot.writeString(struct.password); + oprot.writeFieldEnd(); + } + } + if (struct.configuration != null) { + if (struct.isSetConfiguration()) { + oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); + for (Map.Entry _iter166 : struct.configuration.entrySet()) + { + oprot.writeString(_iter166.getKey()); + oprot.writeString(_iter166.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRestoreSessionReqTupleSchemeFactory implements SchemeFactory { + public TRestoreSessionReqTupleScheme getScheme() { + return new TRestoreSessionReqTupleScheme(); + } + } + + private static class TRestoreSessionReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRestoreSessionReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.client_protocol.getValue()); + struct.sessionHandle.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetUsername()) { + optionals.set(0); + } + if (struct.isSetPassword()) { + optionals.set(1); + } + if (struct.isSetConfiguration()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUsername()) { + oprot.writeString(struct.username); + } + if (struct.isSetPassword()) { + oprot.writeString(struct.password); + } + if (struct.isSetConfiguration()) { + { + oprot.writeI32(struct.configuration.size()); + for (Map.Entry _iter167 : struct.configuration.entrySet()) + { + oprot.writeString(_iter167.getKey()); + oprot.writeString(_iter167.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRestoreSessionReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); + struct.setClient_protocolIsSet(true); + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } + if (incoming.get(1)) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new HashMap(2*_map168.size); + String _key169; + String _val170; + for (int _i171 = 0; _i171 < _map168.size; ++_i171) + { + _key169 = iprot.readString(); + _val170 = iprot.readString(); + struct.configuration.put(_key169, _val170); + } + } + struct.setConfigurationIsSet(true); + } + } + } + +} + diff --git a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TRestoreSessionResp.java b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TRestoreSessionResp.java new file mode 100644 index 0000000000000000000000000000000000000000..6b863b8d79812e2e9cd6aa41584e17714cdf0fda --- /dev/null +++ b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TRestoreSessionResp.java @@ -0,0 +1,783 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hive.service.rpc.thrift; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +public class TRestoreSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRestoreSessionResp"); + + private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField SERVER_PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("serverProtocolVersion", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRestoreSessionRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRestoreSessionRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TProtocolVersion serverProtocolVersion; // required + private TSessionHandle sessionHandle; // optional + private Map configuration; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + STATUS((short)1, "status"), + /** + * + * @see TProtocolVersion + */ + SERVER_PROTOCOL_VERSION((short)2, "serverProtocolVersion"), + SESSION_HANDLE((short)3, "sessionHandle"), + CONFIGURATION((short)4, "configuration"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + case 2: // SERVER_PROTOCOL_VERSION + return SERVER_PROTOCOL_VERSION; + case 3: // SESSION_HANDLE + return SESSION_HANDLE; + case 4: // CONFIGURATION + return CONFIGURATION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.SESSION_HANDLE,_Fields.CONFIGURATION}; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); + tmpMap.put(_Fields.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); + tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); + tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRestoreSessionResp.class, metaDataMap); + } + + public TRestoreSessionResp() { + this.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; + + } + + public TRestoreSessionResp( + TStatus status, + TProtocolVersion serverProtocolVersion) + { + this(); + this.status = status; + this.serverProtocolVersion = serverProtocolVersion; + } + + /** + * Performs a deep copy on other. + */ + public TRestoreSessionResp(TRestoreSessionResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetServerProtocolVersion()) { + this.serverProtocolVersion = other.serverProtocolVersion; + } + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetConfiguration()) { + Map __this__configuration = new HashMap(other.configuration); + this.configuration = __this__configuration; + } + } + + public TRestoreSessionResp deepCopy() { + return new TRestoreSessionResp(this); + } + + @Override + public void clear() { + this.status = null; + this.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; + + this.sessionHandle = null; + this.configuration = null; + } + + public TStatus getStatus() { + return this.status; + } + + public void setStatus(TStatus status) { + this.status = status; + } + + public void unsetStatus() { + this.status = null; + } + + /** Returns true if field status is set (has been assigned a value) and false otherwise */ + public boolean isSetStatus() { + return this.status != null; + } + + public void setStatusIsSet(boolean value) { + if (!value) { + this.status = null; + } + } + + /** + * + * @see TProtocolVersion + */ + public TProtocolVersion getServerProtocolVersion() { + return this.serverProtocolVersion; + } + + /** + * + * @see TProtocolVersion + */ + public void setServerProtocolVersion(TProtocolVersion serverProtocolVersion) { + this.serverProtocolVersion = serverProtocolVersion; + } + + public void unsetServerProtocolVersion() { + this.serverProtocolVersion = null; + } + + /** Returns true if field serverProtocolVersion is set (has been assigned a value) and false otherwise */ + public boolean isSetServerProtocolVersion() { + return this.serverProtocolVersion != null; + } + + public void setServerProtocolVersionIsSet(boolean value) { + if (!value) { + this.serverProtocolVersion = null; + } + } + + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(TSessionHandle sessionHandle) { + this.sessionHandle = sessionHandle; + } + + public void unsetSessionHandle() { + this.sessionHandle = null; + } + + /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ + public boolean isSetSessionHandle() { + return this.sessionHandle != null; + } + + public void setSessionHandleIsSet(boolean value) { + if (!value) { + this.sessionHandle = null; + } + } + + public int getConfigurationSize() { + return (this.configuration == null) ? 0 : this.configuration.size(); + } + + public void putToConfiguration(String key, String val) { + if (this.configuration == null) { + this.configuration = new HashMap(); + } + this.configuration.put(key, val); + } + + public Map getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Map configuration) { + this.configuration = configuration; + } + + public void unsetConfiguration() { + this.configuration = null; + } + + /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ + public boolean isSetConfiguration() { + return this.configuration != null; + } + + public void setConfigurationIsSet(boolean value) { + if (!value) { + this.configuration = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case SERVER_PROTOCOL_VERSION: + if (value == null) { + unsetServerProtocolVersion(); + } else { + setServerProtocolVersion((TProtocolVersion)value); + } + break; + + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CONFIGURATION: + if (value == null) { + unsetConfiguration(); + } else { + setConfiguration((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case SERVER_PROTOCOL_VERSION: + return getServerProtocolVersion(); + + case SESSION_HANDLE: + return getSessionHandle(); + + case CONFIGURATION: + return getConfiguration(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case SERVER_PROTOCOL_VERSION: + return isSetServerProtocolVersion(); + case SESSION_HANDLE: + return isSetSessionHandle(); + case CONFIGURATION: + return isSetConfiguration(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRestoreSessionResp) + return this.equals((TRestoreSessionResp)that); + return false; + } + + public boolean equals(TRestoreSessionResp that) { + if (that == null) + return false; + + boolean this_present_status = true && this.isSetStatus(); + boolean that_present_status = true && that.isSetStatus(); + if (this_present_status || that_present_status) { + if (!(this_present_status && that_present_status)) + return false; + if (!this.status.equals(that.status)) + return false; + } + + boolean this_present_serverProtocolVersion = true && this.isSetServerProtocolVersion(); + boolean that_present_serverProtocolVersion = true && that.isSetServerProtocolVersion(); + if (this_present_serverProtocolVersion || that_present_serverProtocolVersion) { + if (!(this_present_serverProtocolVersion && that_present_serverProtocolVersion)) + return false; + if (!this.serverProtocolVersion.equals(that.serverProtocolVersion)) + return false; + } + + boolean this_present_sessionHandle = true && this.isSetSessionHandle(); + boolean that_present_sessionHandle = true && that.isSetSessionHandle(); + if (this_present_sessionHandle || that_present_sessionHandle) { + if (!(this_present_sessionHandle && that_present_sessionHandle)) + return false; + if (!this.sessionHandle.equals(that.sessionHandle)) + return false; + } + + boolean this_present_configuration = true && this.isSetConfiguration(); + boolean that_present_configuration = true && that.isSetConfiguration(); + if (this_present_configuration || that_present_configuration) { + if (!(this_present_configuration && that_present_configuration)) + return false; + if (!this.configuration.equals(that.configuration)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_serverProtocolVersion = true && (isSetServerProtocolVersion()); + list.add(present_serverProtocolVersion); + if (present_serverProtocolVersion) + list.add(serverProtocolVersion.getValue()); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_configuration = true && (isSetConfiguration()); + list.add(present_configuration); + if (present_configuration) + list.add(configuration); + + return list.hashCode(); + } + + @Override + public int compareTo(TRestoreSessionResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServerProtocolVersion()).compareTo(other.isSetServerProtocolVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServerProtocolVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverProtocolVersion, other.serverProtocolVersion); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfiguration()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TRestoreSessionResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (!first) sb.append(", "); + sb.append("serverProtocolVersion:"); + if (this.serverProtocolVersion == null) { + sb.append("null"); + } else { + sb.append(this.serverProtocolVersion); + } + first = false; + if (isSetSessionHandle()) { + if (!first) sb.append(", "); + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + } + if (isSetConfiguration()) { + if (!first) sb.append(", "); + sb.append("configuration:"); + if (this.configuration == null) { + sb.append("null"); + } else { + sb.append(this.configuration); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + if (!isSetServerProtocolVersion()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverProtocolVersion' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.validate(); + } + if (sessionHandle != null) { + sessionHandle.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class TRestoreSessionRespStandardSchemeFactory implements SchemeFactory { + public TRestoreSessionRespStandardScheme getScheme() { + return new TRestoreSessionRespStandardScheme(); + } + } + + private static class TRestoreSessionRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRestoreSessionResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // STATUS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SERVER_PROTOCOL_VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); + struct.setServerProtocolVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SESSION_HANDLE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONFIGURATION + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map172 = iprot.readMapBegin(); + struct.configuration = new HashMap(2*_map172.size); + String _key173; + String _val174; + for (int _i175 = 0; _i175 < _map172.size; ++_i175) + { + _key173 = iprot.readString(); + _val174 = iprot.readString(); + struct.configuration.put(_key173, _val174); + } + iprot.readMapEnd(); + } + struct.setConfigurationIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TRestoreSessionResp struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.status != null) { + oprot.writeFieldBegin(STATUS_FIELD_DESC); + struct.status.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.serverProtocolVersion != null) { + oprot.writeFieldBegin(SERVER_PROTOCOL_VERSION_FIELD_DESC); + oprot.writeI32(struct.serverProtocolVersion.getValue()); + oprot.writeFieldEnd(); + } + if (struct.sessionHandle != null) { + if (struct.isSetSessionHandle()) { + oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); + struct.sessionHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.configuration != null) { + if (struct.isSetConfiguration()) { + oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); + for (Map.Entry _iter176 : struct.configuration.entrySet()) + { + oprot.writeString(_iter176.getKey()); + oprot.writeString(_iter176.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRestoreSessionRespTupleSchemeFactory implements SchemeFactory { + public TRestoreSessionRespTupleScheme getScheme() { + return new TRestoreSessionRespTupleScheme(); + } + } + + private static class TRestoreSessionRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRestoreSessionResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + oprot.writeI32(struct.serverProtocolVersion.getValue()); + BitSet optionals = new BitSet(); + if (struct.isSetSessionHandle()) { + optionals.set(0); + } + if (struct.isSetConfiguration()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSessionHandle()) { + struct.sessionHandle.write(oprot); + } + if (struct.isSetConfiguration()) { + { + oprot.writeI32(struct.configuration.size()); + for (Map.Entry _iter177 : struct.configuration.entrySet()) + { + oprot.writeString(_iter177.getKey()); + oprot.writeString(_iter177.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRestoreSessionResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + struct.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); + struct.setServerProtocolVersionIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TMap _map178 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new HashMap(2*_map178.size); + String _key179; + String _val180; + for (int _i181 = 0; _i181 < _map178.size; ++_i181) + { + _key179 = iprot.readString(); + _val180 = iprot.readString(); + struct.configuration.put(_key179, _val180); + } + } + struct.setConfigurationIsSet(true); + } + } + } + +} + diff --git a/service-rpc/src/gen/thrift/gen-php/TCLIService.php b/service-rpc/src/gen/thrift/gen-php/TCLIService.php index eba62f12de0899280b9961dd82330bb149d40758..dbb04c0e244dfecbdb2e7d0d8fd72b2f608992f5 100644 --- a/service-rpc/src/gen/thrift/gen-php/TCLIService.php +++ b/service-rpc/src/gen/thrift/gen-php/TCLIService.php @@ -22,6 +22,11 @@ interface TCLIServiceIf { */ public function OpenSession(\TOpenSessionReq $req); /** + * @param \TRestoreSessionReq $req + * @return \TRestoreSessionResp + */ + public function RestoreSession(\TRestoreSessionReq $req); + /** * @param \TCloseSessionReq $req * @return \TCloseSessionResp */ @@ -175,6 +180,57 @@ class TCLIServiceClient implements \TCLIServiceIf { throw new \Exception("OpenSession failed: unknown result"); } + public function RestoreSession(\TRestoreSessionReq $req) + { + $this->send_RestoreSession($req); + return $this->recv_RestoreSession(); + } + + public function send_RestoreSession(\TRestoreSessionReq $req) + { + $args = new \TCLIService_RestoreSession_args(); + $args->req = $req; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'RestoreSession', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('RestoreSession', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_RestoreSession() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\TCLIService_RestoreSession_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \TCLIService_RestoreSession_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + throw new \Exception("RestoreSession failed: unknown result"); + } + public function CloseSession(\TCloseSessionReq $req) { $this->send_CloseSession($req); @@ -1257,6 +1313,166 @@ class TCLIService_OpenSession_result { } +class TCLIService_RestoreSession_args { + static $_TSPEC; + + /** + * @var \TRestoreSessionReq + */ + public $req = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'req', + 'type' => TType::STRUCT, + 'class' => '\TRestoreSessionReq', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['req'])) { + $this->req = $vals['req']; + } + } + } + + public function getName() { + return 'TCLIService_RestoreSession_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->req = new \TRestoreSessionReq(); + $xfer += $this->req->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('TCLIService_RestoreSession_args'); + if ($this->req !== null) { + if (!is_object($this->req)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('req', TType::STRUCT, 1); + $xfer += $this->req->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class TCLIService_RestoreSession_result { + static $_TSPEC; + + /** + * @var \TRestoreSessionResp + */ + public $success = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => '\TRestoreSessionResp', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + } + } + + public function getName() { + return 'TCLIService_RestoreSession_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new \TRestoreSessionResp(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('TCLIService_RestoreSession_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class TCLIService_CloseSession_args { static $_TSPEC; diff --git a/service-rpc/src/gen/thrift/gen-php/Types.php b/service-rpc/src/gen/thrift/gen-php/Types.php index 76805df4910a31636dccbd119abe91dfbb1568a1..461068b844dd15020c9144d34b3f91b94d926fbd 100644 --- a/service-rpc/src/gen/thrift/gen-php/Types.php +++ b/service-rpc/src/gen/thrift/gen-php/Types.php @@ -4820,6 +4820,400 @@ class TOpenSessionResp { } +class TRestoreSessionReq { + static $_TSPEC; + + /** + * @var int + */ + public $client_protocol = 7; + /** + * @var \TSessionHandle + */ + public $sessionHandle = null; + /** + * @var string + */ + public $username = null; + /** + * @var string + */ + public $password = null; + /** + * @var array + */ + public $configuration = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'client_protocol', + 'type' => TType::I32, + ), + 2 => array( + 'var' => 'sessionHandle', + 'type' => TType::STRUCT, + 'class' => '\TSessionHandle', + ), + 3 => array( + 'var' => 'username', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'password', + 'type' => TType::STRING, + ), + 5 => array( + 'var' => 'configuration', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['client_protocol'])) { + $this->client_protocol = $vals['client_protocol']; + } + if (isset($vals['sessionHandle'])) { + $this->sessionHandle = $vals['sessionHandle']; + } + if (isset($vals['username'])) { + $this->username = $vals['username']; + } + if (isset($vals['password'])) { + $this->password = $vals['password']; + } + if (isset($vals['configuration'])) { + $this->configuration = $vals['configuration']; + } + } + } + + public function getName() { + return 'TRestoreSessionReq'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->client_protocol); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->sessionHandle = new \TSessionHandle(); + $xfer += $this->sessionHandle->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->username); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->password); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::MAP) { + $this->configuration = array(); + $_size143 = 0; + $_ktype144 = 0; + $_vtype145 = 0; + $xfer += $input->readMapBegin($_ktype144, $_vtype145, $_size143); + for ($_i147 = 0; $_i147 < $_size143; ++$_i147) + { + $key148 = ''; + $val149 = ''; + $xfer += $input->readString($key148); + $xfer += $input->readString($val149); + $this->configuration[$key148] = $val149; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('TRestoreSessionReq'); + if ($this->client_protocol !== null) { + $xfer += $output->writeFieldBegin('client_protocol', TType::I32, 1); + $xfer += $output->writeI32($this->client_protocol); + $xfer += $output->writeFieldEnd(); + } + if ($this->sessionHandle !== null) { + if (!is_object($this->sessionHandle)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('sessionHandle', TType::STRUCT, 2); + $xfer += $this->sessionHandle->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->username !== null) { + $xfer += $output->writeFieldBegin('username', TType::STRING, 3); + $xfer += $output->writeString($this->username); + $xfer += $output->writeFieldEnd(); + } + if ($this->password !== null) { + $xfer += $output->writeFieldBegin('password', TType::STRING, 4); + $xfer += $output->writeString($this->password); + $xfer += $output->writeFieldEnd(); + } + if ($this->configuration !== null) { + if (!is_array($this->configuration)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('configuration', TType::MAP, 5); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->configuration)); + { + foreach ($this->configuration as $kiter150 => $viter151) + { + $xfer += $output->writeString($kiter150); + $xfer += $output->writeString($viter151); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class TRestoreSessionResp { + static $_TSPEC; + + /** + * @var \TStatus + */ + public $status = null; + /** + * @var int + */ + public $serverProtocolVersion = 7; + /** + * @var \TSessionHandle + */ + public $sessionHandle = null; + /** + * @var array + */ + public $configuration = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'status', + 'type' => TType::STRUCT, + 'class' => '\TStatus', + ), + 2 => array( + 'var' => 'serverProtocolVersion', + 'type' => TType::I32, + ), + 3 => array( + 'var' => 'sessionHandle', + 'type' => TType::STRUCT, + 'class' => '\TSessionHandle', + ), + 4 => array( + 'var' => 'configuration', + 'type' => TType::MAP, + 'ktype' => TType::STRING, + 'vtype' => TType::STRING, + 'key' => array( + 'type' => TType::STRING, + ), + 'val' => array( + 'type' => TType::STRING, + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['status'])) { + $this->status = $vals['status']; + } + if (isset($vals['serverProtocolVersion'])) { + $this->serverProtocolVersion = $vals['serverProtocolVersion']; + } + if (isset($vals['sessionHandle'])) { + $this->sessionHandle = $vals['sessionHandle']; + } + if (isset($vals['configuration'])) { + $this->configuration = $vals['configuration']; + } + } + } + + public function getName() { + return 'TRestoreSessionResp'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->status = new \TStatus(); + $xfer += $this->status->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->serverProtocolVersion); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->sessionHandle = new \TSessionHandle(); + $xfer += $this->sessionHandle->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::MAP) { + $this->configuration = array(); + $_size152 = 0; + $_ktype153 = 0; + $_vtype154 = 0; + $xfer += $input->readMapBegin($_ktype153, $_vtype154, $_size152); + for ($_i156 = 0; $_i156 < $_size152; ++$_i156) + { + $key157 = ''; + $val158 = ''; + $xfer += $input->readString($key157); + $xfer += $input->readString($val158); + $this->configuration[$key157] = $val158; + } + $xfer += $input->readMapEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('TRestoreSessionResp'); + if ($this->status !== null) { + if (!is_object($this->status)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('status', TType::STRUCT, 1); + $xfer += $this->status->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->serverProtocolVersion !== null) { + $xfer += $output->writeFieldBegin('serverProtocolVersion', TType::I32, 2); + $xfer += $output->writeI32($this->serverProtocolVersion); + $xfer += $output->writeFieldEnd(); + } + if ($this->sessionHandle !== null) { + if (!is_object($this->sessionHandle)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('sessionHandle', TType::STRUCT, 3); + $xfer += $this->sessionHandle->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->configuration !== null) { + if (!is_array($this->configuration)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('configuration', TType::MAP, 4); + { + $output->writeMapBegin(TType::STRING, TType::STRING, count($this->configuration)); + { + foreach ($this->configuration as $kiter159 => $viter160) + { + $xfer += $output->writeString($kiter159); + $xfer += $output->writeString($viter160); + } + } + $output->writeMapEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class TCloseSessionReq { static $_TSPEC; @@ -5484,17 +5878,17 @@ class TExecuteStatementReq { case 3: if ($ftype == TType::MAP) { $this->confOverlay = array(); - $_size143 = 0; - $_ktype144 = 0; - $_vtype145 = 0; - $xfer += $input->readMapBegin($_ktype144, $_vtype145, $_size143); - for ($_i147 = 0; $_i147 < $_size143; ++$_i147) + $_size161 = 0; + $_ktype162 = 0; + $_vtype163 = 0; + $xfer += $input->readMapBegin($_ktype162, $_vtype163, $_size161); + for ($_i165 = 0; $_i165 < $_size161; ++$_i165) { - $key148 = ''; - $val149 = ''; - $xfer += $input->readString($key148); - $xfer += $input->readString($val149); - $this->confOverlay[$key148] = $val149; + $key166 = ''; + $val167 = ''; + $xfer += $input->readString($key166); + $xfer += $input->readString($val167); + $this->confOverlay[$key166] = $val167; } $xfer += $input->readMapEnd(); } else { @@ -5542,10 +5936,10 @@ class TExecuteStatementReq { { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->confOverlay)); { - foreach ($this->confOverlay as $kiter150 => $viter151) + foreach ($this->confOverlay as $kiter168 => $viter169) { - $xfer += $output->writeString($kiter150); - $xfer += $output->writeString($viter151); + $xfer += $output->writeString($kiter168); + $xfer += $output->writeString($viter169); } } $output->writeMapEnd(); @@ -6406,14 +6800,14 @@ class TGetTablesReq { case 5: if ($ftype == TType::LST) { $this->tableTypes = array(); - $_size152 = 0; - $_etype155 = 0; - $xfer += $input->readListBegin($_etype155, $_size152); - for ($_i156 = 0; $_i156 < $_size152; ++$_i156) + $_size170 = 0; + $_etype173 = 0; + $xfer += $input->readListBegin($_etype173, $_size170); + for ($_i174 = 0; $_i174 < $_size170; ++$_i174) { - $elem157 = null; - $xfer += $input->readString($elem157); - $this->tableTypes []= $elem157; + $elem175 = null; + $xfer += $input->readString($elem175); + $this->tableTypes []= $elem175; } $xfer += $input->readListEnd(); } else { @@ -6464,9 +6858,9 @@ class TGetTablesReq { { $output->writeListBegin(TType::STRING, count($this->tableTypes)); { - foreach ($this->tableTypes as $iter158) + foreach ($this->tableTypes as $iter176) { - $xfer += $output->writeString($iter158); + $xfer += $output->writeString($iter176); } } $output->writeListEnd(); diff --git a/service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote b/service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote old mode 100644 new mode 100755 index 56f5c5dc36d44627a2cd571c2bc1fcd1a79e62f2..6bca17c9890278508c3e8e1ca2cd7b1c16c6cc38 --- a/service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote +++ b/service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService-remote @@ -25,6 +25,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print('') print('Functions:') print(' TOpenSessionResp OpenSession(TOpenSessionReq req)') + print(' TRestoreSessionResp RestoreSession(TRestoreSessionReq req)') print(' TCloseSessionResp CloseSession(TCloseSessionReq req)') print(' TGetInfoResp GetInfo(TGetInfoReq req)') print(' TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req)') @@ -105,6 +106,12 @@ if cmd == 'OpenSession': sys.exit(1) pp.pprint(client.OpenSession(eval(args[0]),)) +elif cmd == 'RestoreSession': + if len(args) != 1: + print('RestoreSession requires 1 args') + sys.exit(1) + pp.pprint(client.RestoreSession(eval(args[0]),)) + elif cmd == 'CloseSession': if len(args) != 1: print('CloseSession requires 1 args') diff --git a/service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py b/service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py index ad2d71d720376c76632d9e3a147f227b3ff67c17..40a9345f0a8c5e92beb89a0bd90c6a657e499eef 100644 --- a/service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py +++ b/service-rpc/src/gen/thrift/gen-py/TCLIService/TCLIService.py @@ -26,6 +26,13 @@ def OpenSession(self, req): """ pass + def RestoreSession(self, req): + """ + Parameters: + - req + """ + pass + def CloseSession(self, req): """ Parameters: @@ -191,6 +198,37 @@ def recv_OpenSession(self): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "OpenSession failed: unknown result") + def RestoreSession(self, req): + """ + Parameters: + - req + """ + self.send_RestoreSession(req) + return self.recv_RestoreSession() + + def send_RestoreSession(self, req): + self._oprot.writeMessageBegin('RestoreSession', TMessageType.CALL, self._seqid) + args = RestoreSession_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_RestoreSession(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = RestoreSession_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "RestoreSession failed: unknown result") + def CloseSession(self, req): """ Parameters: @@ -755,6 +793,7 @@ def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["OpenSession"] = Processor.process_OpenSession + self._processMap["RestoreSession"] = Processor.process_RestoreSession self._processMap["CloseSession"] = Processor.process_CloseSession self._processMap["GetInfo"] = Processor.process_GetInfo self._processMap["ExecuteStatement"] = Processor.process_ExecuteStatement @@ -808,6 +847,25 @@ def process_OpenSession(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() + def process_RestoreSession(self, seqid, iprot, oprot): + args = RestoreSession_args() + args.read(iprot) + iprot.readMessageEnd() + result = RestoreSession_result() + try: + result.success = self._handler.RestoreSession(args.req) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("RestoreSession", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_CloseSession(self, seqid, iprot, oprot): args = CloseSession_args() args.read(iprot) @@ -1284,6 +1342,137 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +class RestoreSession_args: + """ + Attributes: + - req + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', (TRestoreSessionReq, TRestoreSessionReq.thrift_spec), None, ), # 1 + ) + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.req = TRestoreSessionReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('RestoreSession_args') + if self.req is not None: + oprot.writeFieldBegin('req', TType.STRUCT, 1) + self.req.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.req) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class RestoreSession_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (TRestoreSessionResp, TRestoreSessionResp.thrift_spec), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = TRestoreSessionResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('RestoreSession_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + class CloseSession_args: """ Attributes: diff --git a/service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py b/service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py index ef5f5f568ffec92c093bdd0904c154f8ee67606e..76a19b7874df26841093fa70b5ad038c8a83c05a 100644 --- a/service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py +++ b/service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py @@ -3696,6 +3696,258 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +class TRestoreSessionReq: + """ + Attributes: + - client_protocol + - sessionHandle + - username + - password + - configuration + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'client_protocol', None, 7, ), # 1 + (2, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 2 + (3, TType.STRING, 'username', None, None, ), # 3 + (4, TType.STRING, 'password', None, None, ), # 4 + (5, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 5 + ) + + def __init__(self, client_protocol=thrift_spec[1][4], sessionHandle=None, username=None, password=None, configuration=None,): + self.client_protocol = client_protocol + self.sessionHandle = sessionHandle + self.username = username + self.password = password + self.configuration = configuration + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.client_protocol = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.sessionHandle = TSessionHandle() + self.sessionHandle.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.username = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.password = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.MAP: + self.configuration = {} + (_ktype144, _vtype145, _size143 ) = iprot.readMapBegin() + for _i147 in xrange(_size143): + _key148 = iprot.readString() + _val149 = iprot.readString() + self.configuration[_key148] = _val149 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TRestoreSessionReq') + if self.client_protocol is not None: + oprot.writeFieldBegin('client_protocol', TType.I32, 1) + oprot.writeI32(self.client_protocol) + oprot.writeFieldEnd() + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 2) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.username is not None: + oprot.writeFieldBegin('username', TType.STRING, 3) + oprot.writeString(self.username) + oprot.writeFieldEnd() + if self.password is not None: + oprot.writeFieldBegin('password', TType.STRING, 4) + oprot.writeString(self.password) + oprot.writeFieldEnd() + if self.configuration is not None: + oprot.writeFieldBegin('configuration', TType.MAP, 5) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) + for kiter150,viter151 in self.configuration.items(): + oprot.writeString(kiter150) + oprot.writeString(viter151) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.client_protocol is None: + raise TProtocol.TProtocolException(message='Required field client_protocol is unset!') + if self.sessionHandle is None: + raise TProtocol.TProtocolException(message='Required field sessionHandle is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.client_protocol) + value = (value * 31) ^ hash(self.sessionHandle) + value = (value * 31) ^ hash(self.username) + value = (value * 31) ^ hash(self.password) + value = (value * 31) ^ hash(self.configuration) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class TRestoreSessionResp: + """ + Attributes: + - status + - serverProtocolVersion + - sessionHandle + - configuration + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1 + (2, TType.I32, 'serverProtocolVersion', None, 7, ), # 2 + (3, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 3 + (4, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 4 + ) + + def __init__(self, status=None, serverProtocolVersion=thrift_spec[2][4], sessionHandle=None, configuration=None,): + self.status = status + self.serverProtocolVersion = serverProtocolVersion + self.sessionHandle = sessionHandle + self.configuration = configuration + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.status = TStatus() + self.status.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.serverProtocolVersion = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.sessionHandle = TSessionHandle() + self.sessionHandle.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.MAP: + self.configuration = {} + (_ktype153, _vtype154, _size152 ) = iprot.readMapBegin() + for _i156 in xrange(_size152): + _key157 = iprot.readString() + _val158 = iprot.readString() + self.configuration[_key157] = _val158 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TRestoreSessionResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + if self.serverProtocolVersion is not None: + oprot.writeFieldBegin('serverProtocolVersion', TType.I32, 2) + oprot.writeI32(self.serverProtocolVersion) + oprot.writeFieldEnd() + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 3) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.configuration is not None: + oprot.writeFieldBegin('configuration', TType.MAP, 4) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) + for kiter159,viter160 in self.configuration.items(): + oprot.writeString(kiter159) + oprot.writeString(viter160) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocol.TProtocolException(message='Required field status is unset!') + if self.serverProtocolVersion is None: + raise TProtocol.TProtocolException(message='Required field serverProtocolVersion is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.status) + value = (value * 31) ^ hash(self.serverProtocolVersion) + value = (value * 31) ^ hash(self.sessionHandle) + value = (value * 31) ^ hash(self.configuration) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + class TCloseSessionReq: """ Attributes: @@ -4175,11 +4427,11 @@ def read(self, iprot): elif fid == 3: if ftype == TType.MAP: self.confOverlay = {} - (_ktype144, _vtype145, _size143 ) = iprot.readMapBegin() - for _i147 in xrange(_size143): - _key148 = iprot.readString() - _val149 = iprot.readString() - self.confOverlay[_key148] = _val149 + (_ktype162, _vtype163, _size161 ) = iprot.readMapBegin() + for _i165 in xrange(_size161): + _key166 = iprot.readString() + _val167 = iprot.readString() + self.confOverlay[_key166] = _val167 iprot.readMapEnd() else: iprot.skip(ftype) @@ -4209,9 +4461,9 @@ def write(self, oprot): if self.confOverlay is not None: oprot.writeFieldBegin('confOverlay', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.confOverlay)) - for kiter150,viter151 in self.confOverlay.items(): - oprot.writeString(kiter150) - oprot.writeString(viter151) + for kiter168,viter169 in self.confOverlay.items(): + oprot.writeString(kiter168) + oprot.writeString(viter169) oprot.writeMapEnd() oprot.writeFieldEnd() if self.runAsync is not None: @@ -4865,10 +5117,10 @@ def read(self, iprot): elif fid == 5: if ftype == TType.LIST: self.tableTypes = [] - (_etype155, _size152) = iprot.readListBegin() - for _i156 in xrange(_size152): - _elem157 = iprot.readString() - self.tableTypes.append(_elem157) + (_etype173, _size170) = iprot.readListBegin() + for _i174 in xrange(_size170): + _elem175 = iprot.readString() + self.tableTypes.append(_elem175) iprot.readListEnd() else: iprot.skip(ftype) @@ -4901,8 +5153,8 @@ def write(self, oprot): if self.tableTypes is not None: oprot.writeFieldBegin('tableTypes', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.tableTypes)) - for iter158 in self.tableTypes: - oprot.writeString(iter158) + for iter176 in self.tableTypes: + oprot.writeString(iter176) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() diff --git a/service-rpc/src/gen/thrift/gen-py/__init__.py b/service-rpc/src/gen/thrift/gen-py/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb b/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb index 7d7f7a78a17cab50b18fa77805022bf4ca0197d9..08f9d14aba0d9d0d557d3b96a23d30862c788322 100644 --- a/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb +++ b/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service.rb @@ -26,6 +26,21 @@ module TCLIService raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'OpenSession failed: unknown result') end + def RestoreSession(req) + send_RestoreSession(req) + return recv_RestoreSession() + end + + def send_RestoreSession(req) + send_message('RestoreSession', RestoreSession_args, :req => req) + end + + def recv_RestoreSession() + result = receive_message(RestoreSession_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'RestoreSession failed: unknown result') + end + def CloseSession(req) send_CloseSession(req) return recv_CloseSession() @@ -308,6 +323,13 @@ module TCLIService write_result(result, oprot, 'OpenSession', seqid) end + def process_RestoreSession(seqid, iprot, oprot) + args = read_args(iprot, RestoreSession_args) + result = RestoreSession_result.new() + result.success = @handler.RestoreSession(args.req) + write_result(result, oprot, 'RestoreSession', seqid) + end + def process_CloseSession(seqid, iprot, oprot) args = read_args(iprot, CloseSession_args) result = CloseSession_result.new() @@ -470,6 +492,38 @@ module TCLIService ::Thrift::Struct.generate_accessors self end + class RestoreSession_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TRestoreSessionReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class RestoreSession_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TRestoreSessionResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + class CloseSession_args include ::Thrift::Struct, ::Thrift::Struct_Union REQ = 1 diff --git a/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb b/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb index f004ec40afd29ab4ed452f65f306cb1af5ff5207..6b20c5fb80b98d355f336505edc121b7c45a0c10 100644 --- a/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb +++ b/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb @@ -995,6 +995,62 @@ class TOpenSessionResp ::Thrift::Struct.generate_accessors self end +class TRestoreSessionReq + include ::Thrift::Struct, ::Thrift::Struct_Union + CLIENT_PROTOCOL = 1 + SESSIONHANDLE = 2 + USERNAME = 3 + PASSWORD = 4 + CONFIGURATION = 5 + + FIELDS = { + CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol', :default => 7, :enum_class => ::TProtocolVersion}, + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username', :optional => true}, + PASSWORD => {:type => ::Thrift::Types::STRING, :name => 'password', :optional => true}, + CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field client_protocol is unset!') unless @client_protocol + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + unless @client_protocol.nil? || ::TProtocolVersion::VALID_VALUES.include?(@client_protocol) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field client_protocol!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class TRestoreSessionResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + SERVERPROTOCOLVERSION = 2 + SESSIONHANDLE = 3 + CONFIGURATION = 4 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion', :default => 7, :enum_class => ::TProtocolVersion}, + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle, :optional => true}, + CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field serverProtocolVersion is unset!') unless @serverProtocolVersion + unless @serverProtocolVersion.nil? || ::TProtocolVersion::VALID_VALUES.include?(@serverProtocolVersion) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field serverProtocolVersion!') + end + end + + ::Thrift::Struct.generate_accessors self +end + class TCloseSessionReq include ::Thrift::Struct, ::Thrift::Struct_Union SESSIONHANDLE = 1 diff --git a/service/src/gen/thrift/gen-cpp/ThriftHive.h b/service/src/gen/thrift/gen-cpp/ThriftHive.h new file mode 100644 index 0000000000000000000000000000000000000000..902bd4b62a2eb1c042150501b7e5de6f851906c6 --- /dev/null +++ b/service/src/gen/thrift/gen-cpp/ThriftHive.h @@ -0,0 +1,1224 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef ThriftHive_H +#define ThriftHive_H + +#include +#include +#include "hive_service_types.h" +#include "ThriftHiveMetastore.h" + +namespace Apache { namespace Hadoop { namespace Hive { + +#ifdef _WIN32 + #pragma warning( push ) + #pragma warning (disable : 4250 ) //inheriting methods via dominance +#endif + +class ThriftHiveIf : virtual public ::Apache::Hadoop::Hive::ThriftHiveMetastoreIf { + public: + virtual ~ThriftHiveIf() {} + virtual void execute(const std::string& query) = 0; + virtual void fetchOne(std::string& _return) = 0; + virtual void fetchN(std::vector & _return, const int32_t numRows) = 0; + virtual void fetchAll(std::vector & _return) = 0; + virtual void getSchema( ::Apache::Hadoop::Hive::Schema& _return) = 0; + virtual void getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return) = 0; + virtual void getClusterStatus(HiveClusterStatus& _return) = 0; + virtual void getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return) = 0; + virtual void clean() = 0; +}; + +class ThriftHiveIfFactory : virtual public ::Apache::Hadoop::Hive::ThriftHiveMetastoreIfFactory { + public: + typedef ThriftHiveIf Handler; + + virtual ~ThriftHiveIfFactory() {} + + virtual ThriftHiveIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; + virtual void releaseHandler( ::facebook::fb303::FacebookServiceIf* /* handler */) = 0; +}; + +class ThriftHiveIfSingletonFactory : virtual public ThriftHiveIfFactory { + public: + ThriftHiveIfSingletonFactory(const boost::shared_ptr& iface) : iface_(iface) {} + virtual ~ThriftHiveIfSingletonFactory() {} + + virtual ThriftHiveIf* getHandler(const ::apache::thrift::TConnectionInfo&) { + return iface_.get(); + } + virtual void releaseHandler( ::facebook::fb303::FacebookServiceIf* /* handler */) {} + + protected: + boost::shared_ptr iface_; +}; + +class ThriftHiveNull : virtual public ThriftHiveIf , virtual public ::Apache::Hadoop::Hive::ThriftHiveMetastoreNull { + public: + virtual ~ThriftHiveNull() {} + void execute(const std::string& /* query */) { + return; + } + void fetchOne(std::string& /* _return */) { + return; + } + void fetchN(std::vector & /* _return */, const int32_t /* numRows */) { + return; + } + void fetchAll(std::vector & /* _return */) { + return; + } + void getSchema( ::Apache::Hadoop::Hive::Schema& /* _return */) { + return; + } + void getThriftSchema( ::Apache::Hadoop::Hive::Schema& /* _return */) { + return; + } + void getClusterStatus(HiveClusterStatus& /* _return */) { + return; + } + void getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& /* _return */) { + return; + } + void clean() { + return; + } +}; + +typedef struct _ThriftHive_execute_args__isset { + _ThriftHive_execute_args__isset() : query(false) {} + bool query :1; +} _ThriftHive_execute_args__isset; + +class ThriftHive_execute_args { + public: + + ThriftHive_execute_args(const ThriftHive_execute_args&); + ThriftHive_execute_args& operator=(const ThriftHive_execute_args&); + ThriftHive_execute_args() : query() { + } + + virtual ~ThriftHive_execute_args() throw(); + std::string query; + + _ThriftHive_execute_args__isset __isset; + + void __set_query(const std::string& val); + + bool operator == (const ThriftHive_execute_args & rhs) const + { + if (!(query == rhs.query)) + return false; + return true; + } + bool operator != (const ThriftHive_execute_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_execute_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_execute_pargs { + public: + + + virtual ~ThriftHive_execute_pargs() throw(); + const std::string* query; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_execute_result__isset { + _ThriftHive_execute_result__isset() : ex(false) {} + bool ex :1; +} _ThriftHive_execute_result__isset; + +class ThriftHive_execute_result { + public: + + ThriftHive_execute_result(const ThriftHive_execute_result&); + ThriftHive_execute_result& operator=(const ThriftHive_execute_result&); + ThriftHive_execute_result() { + } + + virtual ~ThriftHive_execute_result() throw(); + HiveServerException ex; + + _ThriftHive_execute_result__isset __isset; + + void __set_ex(const HiveServerException& val); + + bool operator == (const ThriftHive_execute_result & rhs) const + { + if (!(ex == rhs.ex)) + return false; + return true; + } + bool operator != (const ThriftHive_execute_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_execute_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_execute_presult__isset { + _ThriftHive_execute_presult__isset() : ex(false) {} + bool ex :1; +} _ThriftHive_execute_presult__isset; + +class ThriftHive_execute_presult { + public: + + + virtual ~ThriftHive_execute_presult() throw(); + HiveServerException ex; + + _ThriftHive_execute_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHive_fetchOne_args { + public: + + ThriftHive_fetchOne_args(const ThriftHive_fetchOne_args&); + ThriftHive_fetchOne_args& operator=(const ThriftHive_fetchOne_args&); + ThriftHive_fetchOne_args() { + } + + virtual ~ThriftHive_fetchOne_args() throw(); + + bool operator == (const ThriftHive_fetchOne_args & /* rhs */) const + { + return true; + } + bool operator != (const ThriftHive_fetchOne_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_fetchOne_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_fetchOne_pargs { + public: + + + virtual ~ThriftHive_fetchOne_pargs() throw(); + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_fetchOne_result__isset { + _ThriftHive_fetchOne_result__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_fetchOne_result__isset; + +class ThriftHive_fetchOne_result { + public: + + ThriftHive_fetchOne_result(const ThriftHive_fetchOne_result&); + ThriftHive_fetchOne_result& operator=(const ThriftHive_fetchOne_result&); + ThriftHive_fetchOne_result() : success() { + } + + virtual ~ThriftHive_fetchOne_result() throw(); + std::string success; + HiveServerException ex; + + _ThriftHive_fetchOne_result__isset __isset; + + void __set_success(const std::string& val); + + void __set_ex(const HiveServerException& val); + + bool operator == (const ThriftHive_fetchOne_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ex == rhs.ex)) + return false; + return true; + } + bool operator != (const ThriftHive_fetchOne_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_fetchOne_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_fetchOne_presult__isset { + _ThriftHive_fetchOne_presult__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_fetchOne_presult__isset; + +class ThriftHive_fetchOne_presult { + public: + + + virtual ~ThriftHive_fetchOne_presult() throw(); + std::string* success; + HiveServerException ex; + + _ThriftHive_fetchOne_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _ThriftHive_fetchN_args__isset { + _ThriftHive_fetchN_args__isset() : numRows(false) {} + bool numRows :1; +} _ThriftHive_fetchN_args__isset; + +class ThriftHive_fetchN_args { + public: + + ThriftHive_fetchN_args(const ThriftHive_fetchN_args&); + ThriftHive_fetchN_args& operator=(const ThriftHive_fetchN_args&); + ThriftHive_fetchN_args() : numRows(0) { + } + + virtual ~ThriftHive_fetchN_args() throw(); + int32_t numRows; + + _ThriftHive_fetchN_args__isset __isset; + + void __set_numRows(const int32_t val); + + bool operator == (const ThriftHive_fetchN_args & rhs) const + { + if (!(numRows == rhs.numRows)) + return false; + return true; + } + bool operator != (const ThriftHive_fetchN_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_fetchN_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_fetchN_pargs { + public: + + + virtual ~ThriftHive_fetchN_pargs() throw(); + const int32_t* numRows; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_fetchN_result__isset { + _ThriftHive_fetchN_result__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_fetchN_result__isset; + +class ThriftHive_fetchN_result { + public: + + ThriftHive_fetchN_result(const ThriftHive_fetchN_result&); + ThriftHive_fetchN_result& operator=(const ThriftHive_fetchN_result&); + ThriftHive_fetchN_result() { + } + + virtual ~ThriftHive_fetchN_result() throw(); + std::vector success; + HiveServerException ex; + + _ThriftHive_fetchN_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_ex(const HiveServerException& val); + + bool operator == (const ThriftHive_fetchN_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ex == rhs.ex)) + return false; + return true; + } + bool operator != (const ThriftHive_fetchN_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_fetchN_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_fetchN_presult__isset { + _ThriftHive_fetchN_presult__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_fetchN_presult__isset; + +class ThriftHive_fetchN_presult { + public: + + + virtual ~ThriftHive_fetchN_presult() throw(); + std::vector * success; + HiveServerException ex; + + _ThriftHive_fetchN_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHive_fetchAll_args { + public: + + ThriftHive_fetchAll_args(const ThriftHive_fetchAll_args&); + ThriftHive_fetchAll_args& operator=(const ThriftHive_fetchAll_args&); + ThriftHive_fetchAll_args() { + } + + virtual ~ThriftHive_fetchAll_args() throw(); + + bool operator == (const ThriftHive_fetchAll_args & /* rhs */) const + { + return true; + } + bool operator != (const ThriftHive_fetchAll_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_fetchAll_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_fetchAll_pargs { + public: + + + virtual ~ThriftHive_fetchAll_pargs() throw(); + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_fetchAll_result__isset { + _ThriftHive_fetchAll_result__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_fetchAll_result__isset; + +class ThriftHive_fetchAll_result { + public: + + ThriftHive_fetchAll_result(const ThriftHive_fetchAll_result&); + ThriftHive_fetchAll_result& operator=(const ThriftHive_fetchAll_result&); + ThriftHive_fetchAll_result() { + } + + virtual ~ThriftHive_fetchAll_result() throw(); + std::vector success; + HiveServerException ex; + + _ThriftHive_fetchAll_result__isset __isset; + + void __set_success(const std::vector & val); + + void __set_ex(const HiveServerException& val); + + bool operator == (const ThriftHive_fetchAll_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ex == rhs.ex)) + return false; + return true; + } + bool operator != (const ThriftHive_fetchAll_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_fetchAll_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_fetchAll_presult__isset { + _ThriftHive_fetchAll_presult__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_fetchAll_presult__isset; + +class ThriftHive_fetchAll_presult { + public: + + + virtual ~ThriftHive_fetchAll_presult() throw(); + std::vector * success; + HiveServerException ex; + + _ThriftHive_fetchAll_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHive_getSchema_args { + public: + + ThriftHive_getSchema_args(const ThriftHive_getSchema_args&); + ThriftHive_getSchema_args& operator=(const ThriftHive_getSchema_args&); + ThriftHive_getSchema_args() { + } + + virtual ~ThriftHive_getSchema_args() throw(); + + bool operator == (const ThriftHive_getSchema_args & /* rhs */) const + { + return true; + } + bool operator != (const ThriftHive_getSchema_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_getSchema_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_getSchema_pargs { + public: + + + virtual ~ThriftHive_getSchema_pargs() throw(); + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_getSchema_result__isset { + _ThriftHive_getSchema_result__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_getSchema_result__isset; + +class ThriftHive_getSchema_result { + public: + + ThriftHive_getSchema_result(const ThriftHive_getSchema_result&); + ThriftHive_getSchema_result& operator=(const ThriftHive_getSchema_result&); + ThriftHive_getSchema_result() { + } + + virtual ~ThriftHive_getSchema_result() throw(); + ::Apache::Hadoop::Hive::Schema success; + HiveServerException ex; + + _ThriftHive_getSchema_result__isset __isset; + + void __set_success(const ::Apache::Hadoop::Hive::Schema& val); + + void __set_ex(const HiveServerException& val); + + bool operator == (const ThriftHive_getSchema_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ex == rhs.ex)) + return false; + return true; + } + bool operator != (const ThriftHive_getSchema_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_getSchema_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_getSchema_presult__isset { + _ThriftHive_getSchema_presult__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_getSchema_presult__isset; + +class ThriftHive_getSchema_presult { + public: + + + virtual ~ThriftHive_getSchema_presult() throw(); + ::Apache::Hadoop::Hive::Schema* success; + HiveServerException ex; + + _ThriftHive_getSchema_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHive_getThriftSchema_args { + public: + + ThriftHive_getThriftSchema_args(const ThriftHive_getThriftSchema_args&); + ThriftHive_getThriftSchema_args& operator=(const ThriftHive_getThriftSchema_args&); + ThriftHive_getThriftSchema_args() { + } + + virtual ~ThriftHive_getThriftSchema_args() throw(); + + bool operator == (const ThriftHive_getThriftSchema_args & /* rhs */) const + { + return true; + } + bool operator != (const ThriftHive_getThriftSchema_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_getThriftSchema_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_getThriftSchema_pargs { + public: + + + virtual ~ThriftHive_getThriftSchema_pargs() throw(); + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_getThriftSchema_result__isset { + _ThriftHive_getThriftSchema_result__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_getThriftSchema_result__isset; + +class ThriftHive_getThriftSchema_result { + public: + + ThriftHive_getThriftSchema_result(const ThriftHive_getThriftSchema_result&); + ThriftHive_getThriftSchema_result& operator=(const ThriftHive_getThriftSchema_result&); + ThriftHive_getThriftSchema_result() { + } + + virtual ~ThriftHive_getThriftSchema_result() throw(); + ::Apache::Hadoop::Hive::Schema success; + HiveServerException ex; + + _ThriftHive_getThriftSchema_result__isset __isset; + + void __set_success(const ::Apache::Hadoop::Hive::Schema& val); + + void __set_ex(const HiveServerException& val); + + bool operator == (const ThriftHive_getThriftSchema_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ex == rhs.ex)) + return false; + return true; + } + bool operator != (const ThriftHive_getThriftSchema_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_getThriftSchema_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_getThriftSchema_presult__isset { + _ThriftHive_getThriftSchema_presult__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_getThriftSchema_presult__isset; + +class ThriftHive_getThriftSchema_presult { + public: + + + virtual ~ThriftHive_getThriftSchema_presult() throw(); + ::Apache::Hadoop::Hive::Schema* success; + HiveServerException ex; + + _ThriftHive_getThriftSchema_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHive_getClusterStatus_args { + public: + + ThriftHive_getClusterStatus_args(const ThriftHive_getClusterStatus_args&); + ThriftHive_getClusterStatus_args& operator=(const ThriftHive_getClusterStatus_args&); + ThriftHive_getClusterStatus_args() { + } + + virtual ~ThriftHive_getClusterStatus_args() throw(); + + bool operator == (const ThriftHive_getClusterStatus_args & /* rhs */) const + { + return true; + } + bool operator != (const ThriftHive_getClusterStatus_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_getClusterStatus_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_getClusterStatus_pargs { + public: + + + virtual ~ThriftHive_getClusterStatus_pargs() throw(); + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_getClusterStatus_result__isset { + _ThriftHive_getClusterStatus_result__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_getClusterStatus_result__isset; + +class ThriftHive_getClusterStatus_result { + public: + + ThriftHive_getClusterStatus_result(const ThriftHive_getClusterStatus_result&); + ThriftHive_getClusterStatus_result& operator=(const ThriftHive_getClusterStatus_result&); + ThriftHive_getClusterStatus_result() { + } + + virtual ~ThriftHive_getClusterStatus_result() throw(); + HiveClusterStatus success; + HiveServerException ex; + + _ThriftHive_getClusterStatus_result__isset __isset; + + void __set_success(const HiveClusterStatus& val); + + void __set_ex(const HiveServerException& val); + + bool operator == (const ThriftHive_getClusterStatus_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ex == rhs.ex)) + return false; + return true; + } + bool operator != (const ThriftHive_getClusterStatus_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_getClusterStatus_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_getClusterStatus_presult__isset { + _ThriftHive_getClusterStatus_presult__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_getClusterStatus_presult__isset; + +class ThriftHive_getClusterStatus_presult { + public: + + + virtual ~ThriftHive_getClusterStatus_presult() throw(); + HiveClusterStatus* success; + HiveServerException ex; + + _ThriftHive_getClusterStatus_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHive_getQueryPlan_args { + public: + + ThriftHive_getQueryPlan_args(const ThriftHive_getQueryPlan_args&); + ThriftHive_getQueryPlan_args& operator=(const ThriftHive_getQueryPlan_args&); + ThriftHive_getQueryPlan_args() { + } + + virtual ~ThriftHive_getQueryPlan_args() throw(); + + bool operator == (const ThriftHive_getQueryPlan_args & /* rhs */) const + { + return true; + } + bool operator != (const ThriftHive_getQueryPlan_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_getQueryPlan_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_getQueryPlan_pargs { + public: + + + virtual ~ThriftHive_getQueryPlan_pargs() throw(); + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_getQueryPlan_result__isset { + _ThriftHive_getQueryPlan_result__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_getQueryPlan_result__isset; + +class ThriftHive_getQueryPlan_result { + public: + + ThriftHive_getQueryPlan_result(const ThriftHive_getQueryPlan_result&); + ThriftHive_getQueryPlan_result& operator=(const ThriftHive_getQueryPlan_result&); + ThriftHive_getQueryPlan_result() { + } + + virtual ~ThriftHive_getQueryPlan_result() throw(); + ::Apache::Hadoop::Hive::QueryPlan success; + HiveServerException ex; + + _ThriftHive_getQueryPlan_result__isset __isset; + + void __set_success(const ::Apache::Hadoop::Hive::QueryPlan& val); + + void __set_ex(const HiveServerException& val); + + bool operator == (const ThriftHive_getQueryPlan_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ex == rhs.ex)) + return false; + return true; + } + bool operator != (const ThriftHive_getQueryPlan_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_getQueryPlan_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHive_getQueryPlan_presult__isset { + _ThriftHive_getQueryPlan_presult__isset() : success(false), ex(false) {} + bool success :1; + bool ex :1; +} _ThriftHive_getQueryPlan_presult__isset; + +class ThriftHive_getQueryPlan_presult { + public: + + + virtual ~ThriftHive_getQueryPlan_presult() throw(); + ::Apache::Hadoop::Hive::QueryPlan* success; + HiveServerException ex; + + _ThriftHive_getQueryPlan_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class ThriftHive_clean_args { + public: + + ThriftHive_clean_args(const ThriftHive_clean_args&); + ThriftHive_clean_args& operator=(const ThriftHive_clean_args&); + ThriftHive_clean_args() { + } + + virtual ~ThriftHive_clean_args() throw(); + + bool operator == (const ThriftHive_clean_args & /* rhs */) const + { + return true; + } + bool operator != (const ThriftHive_clean_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_clean_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_clean_pargs { + public: + + + virtual ~ThriftHive_clean_pargs() throw(); + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_clean_result { + public: + + ThriftHive_clean_result(const ThriftHive_clean_result&); + ThriftHive_clean_result& operator=(const ThriftHive_clean_result&); + ThriftHive_clean_result() { + } + + virtual ~ThriftHive_clean_result() throw(); + + bool operator == (const ThriftHive_clean_result & /* rhs */) const + { + return true; + } + bool operator != (const ThriftHive_clean_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHive_clean_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHive_clean_presult { + public: + + + virtual ~ThriftHive_clean_presult() throw(); + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +class ThriftHiveClient : virtual public ThriftHiveIf, public ::Apache::Hadoop::Hive::ThriftHiveMetastoreClient { + public: + ThriftHiveClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) : + ::Apache::Hadoop::Hive::ThriftHiveMetastoreClient(prot, prot) {} + ThriftHiveClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) : ::Apache::Hadoop::Hive::ThriftHiveMetastoreClient(iprot, oprot) {} + boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + void execute(const std::string& query); + void send_execute(const std::string& query); + void recv_execute(); + void fetchOne(std::string& _return); + void send_fetchOne(); + void recv_fetchOne(std::string& _return); + void fetchN(std::vector & _return, const int32_t numRows); + void send_fetchN(const int32_t numRows); + void recv_fetchN(std::vector & _return); + void fetchAll(std::vector & _return); + void send_fetchAll(); + void recv_fetchAll(std::vector & _return); + void getSchema( ::Apache::Hadoop::Hive::Schema& _return); + void send_getSchema(); + void recv_getSchema( ::Apache::Hadoop::Hive::Schema& _return); + void getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return); + void send_getThriftSchema(); + void recv_getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return); + void getClusterStatus(HiveClusterStatus& _return); + void send_getClusterStatus(); + void recv_getClusterStatus(HiveClusterStatus& _return); + void getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return); + void send_getQueryPlan(); + void recv_getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return); + void clean(); + void send_clean(); + void recv_clean(); +}; + +class ThriftHiveProcessor : public ::Apache::Hadoop::Hive::ThriftHiveMetastoreProcessor { + protected: + boost::shared_ptr iface_; + virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext); + private: + typedef void (ThriftHiveProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); + typedef std::map ProcessMap; + ProcessMap processMap_; + void process_execute(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_fetchOne(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_fetchN(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_fetchAll(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getSchema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getThriftSchema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getClusterStatus(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_getQueryPlan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_clean(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + public: + ThriftHiveProcessor(boost::shared_ptr iface) : + ::Apache::Hadoop::Hive::ThriftHiveMetastoreProcessor(iface), + iface_(iface) { + processMap_["execute"] = &ThriftHiveProcessor::process_execute; + processMap_["fetchOne"] = &ThriftHiveProcessor::process_fetchOne; + processMap_["fetchN"] = &ThriftHiveProcessor::process_fetchN; + processMap_["fetchAll"] = &ThriftHiveProcessor::process_fetchAll; + processMap_["getSchema"] = &ThriftHiveProcessor::process_getSchema; + processMap_["getThriftSchema"] = &ThriftHiveProcessor::process_getThriftSchema; + processMap_["getClusterStatus"] = &ThriftHiveProcessor::process_getClusterStatus; + processMap_["getQueryPlan"] = &ThriftHiveProcessor::process_getQueryPlan; + processMap_["clean"] = &ThriftHiveProcessor::process_clean; + } + + virtual ~ThriftHiveProcessor() {} +}; + +class ThriftHiveProcessorFactory : public ::apache::thrift::TProcessorFactory { + public: + ThriftHiveProcessorFactory(const ::boost::shared_ptr< ThriftHiveIfFactory >& handlerFactory) : + handlerFactory_(handlerFactory) {} + + ::boost::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo); + + protected: + ::boost::shared_ptr< ThriftHiveIfFactory > handlerFactory_; +}; + +class ThriftHiveMultiface : virtual public ThriftHiveIf, public ::Apache::Hadoop::Hive::ThriftHiveMetastoreMultiface { + public: + ThriftHiveMultiface(std::vector >& ifaces) : ifaces_(ifaces) { + std::vector >::iterator iter; + for (iter = ifaces.begin(); iter != ifaces.end(); ++iter) { + ::Apache::Hadoop::Hive::ThriftHiveMetastoreMultiface::add(*iter); + } + } + virtual ~ThriftHiveMultiface() {} + protected: + std::vector > ifaces_; + ThriftHiveMultiface() {} + void add(boost::shared_ptr iface) { + ::Apache::Hadoop::Hive::ThriftHiveMetastoreMultiface::add(iface); + ifaces_.push_back(iface); + } + public: + void execute(const std::string& query) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->execute(query); + } + ifaces_[i]->execute(query); + } + + void fetchOne(std::string& _return) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->fetchOne(_return); + } + ifaces_[i]->fetchOne(_return); + return; + } + + void fetchN(std::vector & _return, const int32_t numRows) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->fetchN(_return, numRows); + } + ifaces_[i]->fetchN(_return, numRows); + return; + } + + void fetchAll(std::vector & _return) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->fetchAll(_return); + } + ifaces_[i]->fetchAll(_return); + return; + } + + void getSchema( ::Apache::Hadoop::Hive::Schema& _return) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getSchema(_return); + } + ifaces_[i]->getSchema(_return); + return; + } + + void getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getThriftSchema(_return); + } + ifaces_[i]->getThriftSchema(_return); + return; + } + + void getClusterStatus(HiveClusterStatus& _return) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getClusterStatus(_return); + } + ifaces_[i]->getClusterStatus(_return); + return; + } + + void getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->getQueryPlan(_return); + } + ifaces_[i]->getQueryPlan(_return); + return; + } + + void clean() { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->clean(); + } + ifaces_[i]->clean(); + } + +}; + +// The 'concurrent' client is a thread safe client that correctly handles +// out of order responses. It is slower than the regular client, so should +// only be used when you need to share a connection among multiple threads +class ThriftHiveConcurrentClient : virtual public ThriftHiveIf, public ::Apache::Hadoop::Hive::ThriftHiveMetastoreConcurrentClient { + public: + ThriftHiveConcurrentClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) : + ::Apache::Hadoop::Hive::ThriftHiveMetastoreConcurrentClient(prot, prot) {} + ThriftHiveConcurrentClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) : ::Apache::Hadoop::Hive::ThriftHiveMetastoreConcurrentClient(iprot, oprot) {} + boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + void execute(const std::string& query); + int32_t send_execute(const std::string& query); + void recv_execute(const int32_t seqid); + void fetchOne(std::string& _return); + int32_t send_fetchOne(); + void recv_fetchOne(std::string& _return, const int32_t seqid); + void fetchN(std::vector & _return, const int32_t numRows); + int32_t send_fetchN(const int32_t numRows); + void recv_fetchN(std::vector & _return, const int32_t seqid); + void fetchAll(std::vector & _return); + int32_t send_fetchAll(); + void recv_fetchAll(std::vector & _return, const int32_t seqid); + void getSchema( ::Apache::Hadoop::Hive::Schema& _return); + int32_t send_getSchema(); + void recv_getSchema( ::Apache::Hadoop::Hive::Schema& _return, const int32_t seqid); + void getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return); + int32_t send_getThriftSchema(); + void recv_getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return, const int32_t seqid); + void getClusterStatus(HiveClusterStatus& _return); + int32_t send_getClusterStatus(); + void recv_getClusterStatus(HiveClusterStatus& _return, const int32_t seqid); + void getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return); + int32_t send_getQueryPlan(); + void recv_getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return, const int32_t seqid); + void clean(); + int32_t send_clean(); + void recv_clean(const int32_t seqid); +}; + +#ifdef _WIN32 + #pragma warning( pop ) +#endif + +}}} // namespace + +#endif diff --git a/service/src/gen/thrift/gen-cpp/ThriftHive.cpp b/service/src/gen/thrift/gen-cpp/ThriftHive.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a5448f09d02685fba6b6165d03f472bf800c90fd --- /dev/null +++ b/service/src/gen/thrift/gen-cpp/ThriftHive.cpp @@ -0,0 +1,3544 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "ThriftHive.h" + +namespace Apache { namespace Hadoop { namespace Hive { + + +ThriftHive_execute_args::~ThriftHive_execute_args() throw() { +} + + +uint32_t ThriftHive_execute_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->query); + this->__isset.query = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_execute_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_execute_args"); + + xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->query); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_execute_pargs::~ThriftHive_execute_pargs() throw() { +} + + +uint32_t ThriftHive_execute_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_execute_pargs"); + + xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->query))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_execute_result::~ThriftHive_execute_result() throw() { +} + + +uint32_t ThriftHive_execute_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_execute_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHive_execute_result"); + + if (this->__isset.ex) { + xfer += oprot->writeFieldBegin("ex", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ex.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_execute_presult::~ThriftHive_execute_presult() throw() { +} + + +uint32_t ThriftHive_execute_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHive_fetchOne_args::~ThriftHive_fetchOne_args() throw() { +} + + +uint32_t ThriftHive_fetchOne_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_fetchOne_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_fetchOne_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_fetchOne_pargs::~ThriftHive_fetchOne_pargs() throw() { +} + + +uint32_t ThriftHive_fetchOne_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_fetchOne_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_fetchOne_result::~ThriftHive_fetchOne_result() throw() { +} + + +uint32_t ThriftHive_fetchOne_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_fetchOne_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHive_fetchOne_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ex) { + xfer += oprot->writeFieldBegin("ex", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ex.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_fetchOne_presult::~ThriftHive_fetchOne_presult() throw() { +} + + +uint32_t ThriftHive_fetchOne_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHive_fetchN_args::~ThriftHive_fetchN_args() throw() { +} + + +uint32_t ThriftHive_fetchN_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->numRows); + this->__isset.numRows = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_fetchN_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_fetchN_args"); + + xfer += oprot->writeFieldBegin("numRows", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->numRows); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_fetchN_pargs::~ThriftHive_fetchN_pargs() throw() { +} + + +uint32_t ThriftHive_fetchN_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_fetchN_pargs"); + + xfer += oprot->writeFieldBegin("numRows", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((*(this->numRows))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_fetchN_result::~ThriftHive_fetchN_result() throw() { +} + + +uint32_t ThriftHive_fetchN_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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_LIST) { + { + this->success.clear(); + uint32_t _size5; + ::apache::thrift::protocol::TType _etype8; + xfer += iprot->readListBegin(_etype8, _size5); + this->success.resize(_size5); + uint32_t _i9; + for (_i9 = 0; _i9 < _size5; ++_i9) + { + xfer += iprot->readString(this->success[_i9]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_fetchN_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHive_fetchN_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter10; + for (_iter10 = this->success.begin(); _iter10 != this->success.end(); ++_iter10) + { + xfer += oprot->writeString((*_iter10)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ex) { + xfer += oprot->writeFieldBegin("ex", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ex.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_fetchN_presult::~ThriftHive_fetchN_presult() throw() { +} + + +uint32_t ThriftHive_fetchN_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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_LIST) { + { + (*(this->success)).clear(); + uint32_t _size11; + ::apache::thrift::protocol::TType _etype14; + xfer += iprot->readListBegin(_etype14, _size11); + (*(this->success)).resize(_size11); + uint32_t _i15; + for (_i15 = 0; _i15 < _size11; ++_i15) + { + xfer += iprot->readString((*(this->success))[_i15]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHive_fetchAll_args::~ThriftHive_fetchAll_args() throw() { +} + + +uint32_t ThriftHive_fetchAll_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_fetchAll_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_fetchAll_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_fetchAll_pargs::~ThriftHive_fetchAll_pargs() throw() { +} + + +uint32_t ThriftHive_fetchAll_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_fetchAll_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_fetchAll_result::~ThriftHive_fetchAll_result() throw() { +} + + +uint32_t ThriftHive_fetchAll_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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_LIST) { + { + this->success.clear(); + uint32_t _size16; + ::apache::thrift::protocol::TType _etype19; + xfer += iprot->readListBegin(_etype19, _size16); + this->success.resize(_size16); + uint32_t _i20; + for (_i20 = 0; _i20 < _size16; ++_i20) + { + xfer += iprot->readString(this->success[_i20]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_fetchAll_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHive_fetchAll_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); + std::vector ::const_iterator _iter21; + for (_iter21 = this->success.begin(); _iter21 != this->success.end(); ++_iter21) + { + xfer += oprot->writeString((*_iter21)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ex) { + xfer += oprot->writeFieldBegin("ex", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ex.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_fetchAll_presult::~ThriftHive_fetchAll_presult() throw() { +} + + +uint32_t ThriftHive_fetchAll_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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_LIST) { + { + (*(this->success)).clear(); + uint32_t _size22; + ::apache::thrift::protocol::TType _etype25; + xfer += iprot->readListBegin(_etype25, _size22); + (*(this->success)).resize(_size22); + uint32_t _i26; + for (_i26 = 0; _i26 < _size22; ++_i26) + { + xfer += iprot->readString((*(this->success))[_i26]); + } + xfer += iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHive_getSchema_args::~ThriftHive_getSchema_args() throw() { +} + + +uint32_t ThriftHive_getSchema_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_getSchema_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_getSchema_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getSchema_pargs::~ThriftHive_getSchema_pargs() throw() { +} + + +uint32_t ThriftHive_getSchema_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_getSchema_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getSchema_result::~ThriftHive_getSchema_result() throw() { +} + + +uint32_t ThriftHive_getSchema_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_getSchema_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHive_getSchema_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.ex) { + xfer += oprot->writeFieldBegin("ex", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ex.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getSchema_presult::~ThriftHive_getSchema_presult() throw() { +} + + +uint32_t ThriftHive_getSchema_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHive_getThriftSchema_args::~ThriftHive_getThriftSchema_args() throw() { +} + + +uint32_t ThriftHive_getThriftSchema_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_getThriftSchema_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_getThriftSchema_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getThriftSchema_pargs::~ThriftHive_getThriftSchema_pargs() throw() { +} + + +uint32_t ThriftHive_getThriftSchema_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_getThriftSchema_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getThriftSchema_result::~ThriftHive_getThriftSchema_result() throw() { +} + + +uint32_t ThriftHive_getThriftSchema_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_getThriftSchema_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHive_getThriftSchema_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.ex) { + xfer += oprot->writeFieldBegin("ex", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ex.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getThriftSchema_presult::~ThriftHive_getThriftSchema_presult() throw() { +} + + +uint32_t ThriftHive_getThriftSchema_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHive_getClusterStatus_args::~ThriftHive_getClusterStatus_args() throw() { +} + + +uint32_t ThriftHive_getClusterStatus_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_getClusterStatus_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_getClusterStatus_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getClusterStatus_pargs::~ThriftHive_getClusterStatus_pargs() throw() { +} + + +uint32_t ThriftHive_getClusterStatus_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_getClusterStatus_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getClusterStatus_result::~ThriftHive_getClusterStatus_result() throw() { +} + + +uint32_t ThriftHive_getClusterStatus_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_getClusterStatus_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHive_getClusterStatus_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.ex) { + xfer += oprot->writeFieldBegin("ex", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ex.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getClusterStatus_presult::~ThriftHive_getClusterStatus_presult() throw() { +} + + +uint32_t ThriftHive_getClusterStatus_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHive_getQueryPlan_args::~ThriftHive_getQueryPlan_args() throw() { +} + + +uint32_t ThriftHive_getQueryPlan_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_getQueryPlan_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_getQueryPlan_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getQueryPlan_pargs::~ThriftHive_getQueryPlan_pargs() throw() { +} + + +uint32_t ThriftHive_getQueryPlan_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_getQueryPlan_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getQueryPlan_result::~ThriftHive_getQueryPlan_result() throw() { +} + + +uint32_t ThriftHive_getQueryPlan_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_getQueryPlan_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHive_getQueryPlan_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.ex) { + xfer += oprot->writeFieldBegin("ex", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ex.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_getQueryPlan_presult::~ThriftHive_getQueryPlan_presult() throw() { +} + + +uint32_t ThriftHive_getQueryPlan_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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->ex.read(iprot); + this->__isset.ex = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + +ThriftHive_clean_args::~ThriftHive_clean_args() throw() { +} + + +uint32_t ThriftHive_clean_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_clean_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_clean_args"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_clean_pargs::~ThriftHive_clean_pargs() throw() { +} + + +uint32_t ThriftHive_clean_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHive_clean_pargs"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_clean_result::~ThriftHive_clean_result() throw() { +} + + +uint32_t ThriftHive_clean_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHive_clean_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHive_clean_result"); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHive_clean_presult::~ThriftHive_clean_presult() throw() { +} + + +uint32_t ThriftHive_clean_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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; + } + xfer += iprot->skip(ftype); + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +void ThriftHiveClient::execute(const std::string& query) +{ + send_execute(query); + recv_execute(); +} + +void ThriftHiveClient::send_execute(const std::string& query) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("execute", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_execute_pargs args; + args.query = &query; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveClient::recv_execute() +{ + + 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("execute") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHive_execute_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ex) { + throw result.ex; + } + return; +} + +void ThriftHiveClient::fetchOne(std::string& _return) +{ + send_fetchOne(); + recv_fetchOne(_return); +} + +void ThriftHiveClient::send_fetchOne() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("fetchOne", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_fetchOne_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveClient::recv_fetchOne(std::string& _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("fetchOne") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHive_fetchOne_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.ex) { + throw result.ex; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fetchOne failed: unknown result"); +} + +void ThriftHiveClient::fetchN(std::vector & _return, const int32_t numRows) +{ + send_fetchN(numRows); + recv_fetchN(_return); +} + +void ThriftHiveClient::send_fetchN(const int32_t numRows) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("fetchN", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_fetchN_pargs args; + args.numRows = &numRows; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveClient::recv_fetchN(std::vector & _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("fetchN") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHive_fetchN_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.ex) { + throw result.ex; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fetchN failed: unknown result"); +} + +void ThriftHiveClient::fetchAll(std::vector & _return) +{ + send_fetchAll(); + recv_fetchAll(_return); +} + +void ThriftHiveClient::send_fetchAll() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("fetchAll", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_fetchAll_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveClient::recv_fetchAll(std::vector & _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("fetchAll") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHive_fetchAll_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.ex) { + throw result.ex; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fetchAll failed: unknown result"); +} + +void ThriftHiveClient::getSchema( ::Apache::Hadoop::Hive::Schema& _return) +{ + send_getSchema(); + recv_getSchema(_return); +} + +void ThriftHiveClient::send_getSchema() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getSchema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_getSchema_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveClient::recv_getSchema( ::Apache::Hadoop::Hive::Schema& _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("getSchema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHive_getSchema_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.ex) { + throw result.ex; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getSchema failed: unknown result"); +} + +void ThriftHiveClient::getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return) +{ + send_getThriftSchema(); + recv_getThriftSchema(_return); +} + +void ThriftHiveClient::send_getThriftSchema() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getThriftSchema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_getThriftSchema_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveClient::recv_getThriftSchema( ::Apache::Hadoop::Hive::Schema& _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("getThriftSchema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHive_getThriftSchema_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.ex) { + throw result.ex; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getThriftSchema failed: unknown result"); +} + +void ThriftHiveClient::getClusterStatus(HiveClusterStatus& _return) +{ + send_getClusterStatus(); + recv_getClusterStatus(_return); +} + +void ThriftHiveClient::send_getClusterStatus() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getClusterStatus", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_getClusterStatus_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveClient::recv_getClusterStatus(HiveClusterStatus& _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("getClusterStatus") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHive_getClusterStatus_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.ex) { + throw result.ex; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getClusterStatus failed: unknown result"); +} + +void ThriftHiveClient::getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return) +{ + send_getQueryPlan(); + recv_getQueryPlan(_return); +} + +void ThriftHiveClient::send_getQueryPlan() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("getQueryPlan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_getQueryPlan_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveClient::recv_getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _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("getQueryPlan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHive_getQueryPlan_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.ex) { + throw result.ex; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getQueryPlan failed: unknown result"); +} + +void ThriftHiveClient::clean() +{ + send_clean(); + recv_clean(); +} + +void ThriftHiveClient::send_clean() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("clean", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_clean_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void ThriftHiveClient::recv_clean() +{ + + 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("clean") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + ThriftHive_clean_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + return; +} + +bool ThriftHiveProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) { + ProcessMap::iterator pfn; + pfn = processMap_.find(fname); + if (pfn == processMap_.end()) { + return ::Apache::Hadoop::Hive::ThriftHiveMetastoreProcessor::dispatchCall(iprot, oprot, fname, seqid, callContext); + } + (this->*(pfn->second))(seqid, iprot, oprot, callContext); + return true; +} + +void ThriftHiveProcessor::process_execute(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHive.execute", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHive.execute"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHive.execute"); + } + + ThriftHive_execute_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHive.execute", bytes); + } + + ThriftHive_execute_result result; + try { + iface_->execute(args.query); + } catch (HiveServerException &ex) { + result.ex = ex; + result.__isset.ex = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHive.execute"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("execute", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHive.execute"); + } + + oprot->writeMessageBegin("execute", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHive.execute", bytes); + } +} + +void ThriftHiveProcessor::process_fetchOne(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHive.fetchOne", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHive.fetchOne"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHive.fetchOne"); + } + + ThriftHive_fetchOne_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHive.fetchOne", bytes); + } + + ThriftHive_fetchOne_result result; + try { + iface_->fetchOne(result.success); + result.__isset.success = true; + } catch (HiveServerException &ex) { + result.ex = ex; + result.__isset.ex = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHive.fetchOne"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("fetchOne", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHive.fetchOne"); + } + + oprot->writeMessageBegin("fetchOne", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHive.fetchOne", bytes); + } +} + +void ThriftHiveProcessor::process_fetchN(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHive.fetchN", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHive.fetchN"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHive.fetchN"); + } + + ThriftHive_fetchN_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHive.fetchN", bytes); + } + + ThriftHive_fetchN_result result; + try { + iface_->fetchN(result.success, args.numRows); + result.__isset.success = true; + } catch (HiveServerException &ex) { + result.ex = ex; + result.__isset.ex = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHive.fetchN"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("fetchN", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHive.fetchN"); + } + + oprot->writeMessageBegin("fetchN", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHive.fetchN", bytes); + } +} + +void ThriftHiveProcessor::process_fetchAll(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHive.fetchAll", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHive.fetchAll"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHive.fetchAll"); + } + + ThriftHive_fetchAll_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHive.fetchAll", bytes); + } + + ThriftHive_fetchAll_result result; + try { + iface_->fetchAll(result.success); + result.__isset.success = true; + } catch (HiveServerException &ex) { + result.ex = ex; + result.__isset.ex = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHive.fetchAll"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("fetchAll", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHive.fetchAll"); + } + + oprot->writeMessageBegin("fetchAll", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHive.fetchAll", bytes); + } +} + +void ThriftHiveProcessor::process_getSchema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHive.getSchema", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHive.getSchema"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHive.getSchema"); + } + + ThriftHive_getSchema_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHive.getSchema", bytes); + } + + ThriftHive_getSchema_result result; + try { + iface_->getSchema(result.success); + result.__isset.success = true; + } catch (HiveServerException &ex) { + result.ex = ex; + result.__isset.ex = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHive.getSchema"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getSchema", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHive.getSchema"); + } + + oprot->writeMessageBegin("getSchema", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHive.getSchema", bytes); + } +} + +void ThriftHiveProcessor::process_getThriftSchema(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHive.getThriftSchema", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHive.getThriftSchema"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHive.getThriftSchema"); + } + + ThriftHive_getThriftSchema_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHive.getThriftSchema", bytes); + } + + ThriftHive_getThriftSchema_result result; + try { + iface_->getThriftSchema(result.success); + result.__isset.success = true; + } catch (HiveServerException &ex) { + result.ex = ex; + result.__isset.ex = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHive.getThriftSchema"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getThriftSchema", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHive.getThriftSchema"); + } + + oprot->writeMessageBegin("getThriftSchema", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHive.getThriftSchema", bytes); + } +} + +void ThriftHiveProcessor::process_getClusterStatus(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHive.getClusterStatus", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHive.getClusterStatus"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHive.getClusterStatus"); + } + + ThriftHive_getClusterStatus_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHive.getClusterStatus", bytes); + } + + ThriftHive_getClusterStatus_result result; + try { + iface_->getClusterStatus(result.success); + result.__isset.success = true; + } catch (HiveServerException &ex) { + result.ex = ex; + result.__isset.ex = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHive.getClusterStatus"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getClusterStatus", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHive.getClusterStatus"); + } + + oprot->writeMessageBegin("getClusterStatus", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHive.getClusterStatus", bytes); + } +} + +void ThriftHiveProcessor::process_getQueryPlan(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHive.getQueryPlan", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHive.getQueryPlan"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHive.getQueryPlan"); + } + + ThriftHive_getQueryPlan_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHive.getQueryPlan", bytes); + } + + ThriftHive_getQueryPlan_result result; + try { + iface_->getQueryPlan(result.success); + result.__isset.success = true; + } catch (HiveServerException &ex) { + result.ex = ex; + result.__isset.ex = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHive.getQueryPlan"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("getQueryPlan", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHive.getQueryPlan"); + } + + oprot->writeMessageBegin("getQueryPlan", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHive.getQueryPlan", bytes); + } +} + +void ThriftHiveProcessor::process_clean(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("ThriftHive.clean", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHive.clean"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHive.clean"); + } + + ThriftHive_clean_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHive.clean", bytes); + } + + ThriftHive_clean_result result; + try { + iface_->clean(); + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHive.clean"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("clean", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "ThriftHive.clean"); + } + + oprot->writeMessageBegin("clean", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "ThriftHive.clean", bytes); + } +} + +::boost::shared_ptr< ::apache::thrift::TProcessor > ThriftHiveProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) { + ::apache::thrift::ReleaseHandler< ThriftHiveIfFactory > cleanup(handlerFactory_); + ::boost::shared_ptr< ThriftHiveIf > handler(handlerFactory_->getHandler(connInfo), cleanup); + ::boost::shared_ptr< ::apache::thrift::TProcessor > processor(new ThriftHiveProcessor(handler)); + return processor; +} + +void ThriftHiveConcurrentClient::execute(const std::string& query) +{ + int32_t seqid = send_execute(query); + recv_execute(seqid); +} + +int32_t ThriftHiveConcurrentClient::send_execute(const std::string& query) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("execute", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_execute_pargs args; + args.query = &query; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveConcurrentClient::recv_execute(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("execute") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHive_execute_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ex) { + sentry.commit(); + throw result.ex; + } + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveConcurrentClient::fetchOne(std::string& _return) +{ + int32_t seqid = send_fetchOne(); + recv_fetchOne(_return, seqid); +} + +int32_t ThriftHiveConcurrentClient::send_fetchOne() +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("fetchOne", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_fetchOne_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveConcurrentClient::recv_fetchOne(std::string& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("fetchOne") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHive_fetchOne_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.ex) { + sentry.commit(); + throw result.ex; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fetchOne failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveConcurrentClient::fetchN(std::vector & _return, const int32_t numRows) +{ + int32_t seqid = send_fetchN(numRows); + recv_fetchN(_return, seqid); +} + +int32_t ThriftHiveConcurrentClient::send_fetchN(const int32_t numRows) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("fetchN", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_fetchN_pargs args; + args.numRows = &numRows; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveConcurrentClient::recv_fetchN(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("fetchN") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHive_fetchN_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.ex) { + sentry.commit(); + throw result.ex; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fetchN failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveConcurrentClient::fetchAll(std::vector & _return) +{ + int32_t seqid = send_fetchAll(); + recv_fetchAll(_return, seqid); +} + +int32_t ThriftHiveConcurrentClient::send_fetchAll() +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("fetchAll", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_fetchAll_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveConcurrentClient::recv_fetchAll(std::vector & _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("fetchAll") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHive_fetchAll_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.ex) { + sentry.commit(); + throw result.ex; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "fetchAll failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveConcurrentClient::getSchema( ::Apache::Hadoop::Hive::Schema& _return) +{ + int32_t seqid = send_getSchema(); + recv_getSchema(_return, seqid); +} + +int32_t ThriftHiveConcurrentClient::send_getSchema() +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("getSchema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_getSchema_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveConcurrentClient::recv_getSchema( ::Apache::Hadoop::Hive::Schema& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getSchema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHive_getSchema_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.ex) { + sentry.commit(); + throw result.ex; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getSchema failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveConcurrentClient::getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return) +{ + int32_t seqid = send_getThriftSchema(); + recv_getThriftSchema(_return, seqid); +} + +int32_t ThriftHiveConcurrentClient::send_getThriftSchema() +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("getThriftSchema", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_getThriftSchema_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveConcurrentClient::recv_getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getThriftSchema") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHive_getThriftSchema_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.ex) { + sentry.commit(); + throw result.ex; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getThriftSchema failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveConcurrentClient::getClusterStatus(HiveClusterStatus& _return) +{ + int32_t seqid = send_getClusterStatus(); + recv_getClusterStatus(_return, seqid); +} + +int32_t ThriftHiveConcurrentClient::send_getClusterStatus() +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("getClusterStatus", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_getClusterStatus_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveConcurrentClient::recv_getClusterStatus(HiveClusterStatus& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getClusterStatus") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHive_getClusterStatus_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.ex) { + sentry.commit(); + throw result.ex; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getClusterStatus failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveConcurrentClient::getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return) +{ + int32_t seqid = send_getQueryPlan(); + recv_getQueryPlan(_return, seqid); +} + +int32_t ThriftHiveConcurrentClient::send_getQueryPlan() +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("getQueryPlan", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_getQueryPlan_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveConcurrentClient::recv_getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("getQueryPlan") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHive_getQueryPlan_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + if (result.__isset.ex) { + sentry.commit(); + throw result.ex; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getQueryPlan failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void ThriftHiveConcurrentClient::clean() +{ + int32_t seqid = send_clean(); + recv_clean(seqid); +} + +int32_t ThriftHiveConcurrentClient::send_clean() +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("clean", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHive_clean_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void ThriftHiveConcurrentClient::recv_clean(const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("clean") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + ThriftHive_clean_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + sentry.commit(); + return; + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +}}} // namespace + diff --git a/service/src/gen/thrift/gen-cpp/ThriftHive_server.skeleton.cpp b/service/src/gen/thrift/gen-cpp/ThriftHive_server.skeleton.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3b61b7686719e8a47a24935b2f525b6d5638d279 --- /dev/null +++ b/service/src/gen/thrift/gen-cpp/ThriftHive_server.skeleton.cpp @@ -0,0 +1,84 @@ +// This autogenerated skeleton file illustrates how to build a server. +// You should copy it to another filename to avoid overwriting it. + +#include "ThriftHive.h" +#include +#include +#include +#include + +using namespace ::apache::thrift; +using namespace ::apache::thrift::protocol; +using namespace ::apache::thrift::transport; +using namespace ::apache::thrift::server; + +using boost::shared_ptr; + +using namespace ::Apache::Hadoop::Hive; + +class ThriftHiveHandler : virtual public ThriftHiveIf { + public: + ThriftHiveHandler() { + // Your initialization goes here + } + + void execute(const std::string& query) { + // Your implementation goes here + printf("execute\n"); + } + + void fetchOne(std::string& _return) { + // Your implementation goes here + printf("fetchOne\n"); + } + + void fetchN(std::vector & _return, const int32_t numRows) { + // Your implementation goes here + printf("fetchN\n"); + } + + void fetchAll(std::vector & _return) { + // Your implementation goes here + printf("fetchAll\n"); + } + + void getSchema( ::Apache::Hadoop::Hive::Schema& _return) { + // Your implementation goes here + printf("getSchema\n"); + } + + void getThriftSchema( ::Apache::Hadoop::Hive::Schema& _return) { + // Your implementation goes here + printf("getThriftSchema\n"); + } + + void getClusterStatus(HiveClusterStatus& _return) { + // Your implementation goes here + printf("getClusterStatus\n"); + } + + void getQueryPlan( ::Apache::Hadoop::Hive::QueryPlan& _return) { + // Your implementation goes here + printf("getQueryPlan\n"); + } + + void clean() { + // Your implementation goes here + printf("clean\n"); + } + +}; + +int main(int argc, char **argv) { + int port = 9090; + shared_ptr handler(new ThriftHiveHandler()); + shared_ptr processor(new ThriftHiveProcessor(handler)); + shared_ptr serverTransport(new TServerSocket(port)); + shared_ptr transportFactory(new TBufferedTransportFactory()); + shared_ptr protocolFactory(new TBinaryProtocolFactory()); + + TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); + server.serve(); + return 0; +} + diff --git a/service/src/gen/thrift/gen-cpp/hive_service_constants.h b/service/src/gen/thrift/gen-cpp/hive_service_constants.h new file mode 100644 index 0000000000000000000000000000000000000000..e0887f4c26eff5fc48565a7ce283895dd16a91c7 --- /dev/null +++ b/service/src/gen/thrift/gen-cpp/hive_service_constants.h @@ -0,0 +1,24 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef hive_service_CONSTANTS_H +#define hive_service_CONSTANTS_H + +#include "hive_service_types.h" + +namespace Apache { namespace Hadoop { namespace Hive { + +class hive_serviceConstants { + public: + hive_serviceConstants(); + +}; + +extern const hive_serviceConstants g_hive_service_constants; + +}}} // namespace + +#endif diff --git a/service/src/gen/thrift/gen-cpp/hive_service_constants.cpp b/service/src/gen/thrift/gen-cpp/hive_service_constants.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e2bbe71071cb3fafbcdb2c6ec8afd2b683edbf97 --- /dev/null +++ b/service/src/gen/thrift/gen-cpp/hive_service_constants.cpp @@ -0,0 +1,17 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "hive_service_constants.h" + +namespace Apache { namespace Hadoop { namespace Hive { + +const hive_serviceConstants g_hive_service_constants; + +hive_serviceConstants::hive_serviceConstants() { +} + +}}} // namespace + diff --git a/service/src/gen/thrift/gen-cpp/hive_service_types.h b/service/src/gen/thrift/gen-cpp/hive_service_types.h new file mode 100644 index 0000000000000000000000000000000000000000..266f8eaa69fb28fff067efa73970d6dcaeff21ad --- /dev/null +++ b/service/src/gen/thrift/gen-cpp/hive_service_types.h @@ -0,0 +1,176 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef hive_service_TYPES_H +#define hive_service_TYPES_H + +#include + +#include +#include +#include +#include + +#include +#include "fb303_types.h" +#include "hive_metastore_types.h" +#include "queryplan_types.h" + + +namespace Apache { namespace Hadoop { namespace Hive { + +struct JobTrackerState { + enum type { + INITIALIZING = 1, + RUNNING = 2 + }; +}; + +extern const std::map _JobTrackerState_VALUES_TO_NAMES; + +class HiveClusterStatus; + +class HiveServerException; + +typedef struct _HiveClusterStatus__isset { + _HiveClusterStatus__isset() : taskTrackers(false), mapTasks(false), reduceTasks(false), maxMapTasks(false), maxReduceTasks(false), state(false) {} + bool taskTrackers :1; + bool mapTasks :1; + bool reduceTasks :1; + bool maxMapTasks :1; + bool maxReduceTasks :1; + bool state :1; +} _HiveClusterStatus__isset; + +class HiveClusterStatus { + public: + + HiveClusterStatus(const HiveClusterStatus&); + HiveClusterStatus& operator=(const HiveClusterStatus&); + HiveClusterStatus() : taskTrackers(0), mapTasks(0), reduceTasks(0), maxMapTasks(0), maxReduceTasks(0), state((JobTrackerState::type)0) { + } + + virtual ~HiveClusterStatus() throw(); + int32_t taskTrackers; + int32_t mapTasks; + int32_t reduceTasks; + int32_t maxMapTasks; + int32_t maxReduceTasks; + JobTrackerState::type state; + + _HiveClusterStatus__isset __isset; + + void __set_taskTrackers(const int32_t val); + + void __set_mapTasks(const int32_t val); + + void __set_reduceTasks(const int32_t val); + + void __set_maxMapTasks(const int32_t val); + + void __set_maxReduceTasks(const int32_t val); + + void __set_state(const JobTrackerState::type val); + + bool operator == (const HiveClusterStatus & rhs) const + { + if (!(taskTrackers == rhs.taskTrackers)) + return false; + if (!(mapTasks == rhs.mapTasks)) + return false; + if (!(reduceTasks == rhs.reduceTasks)) + return false; + if (!(maxMapTasks == rhs.maxMapTasks)) + return false; + if (!(maxReduceTasks == rhs.maxReduceTasks)) + return false; + if (!(state == rhs.state)) + return false; + return true; + } + bool operator != (const HiveClusterStatus &rhs) const { + return !(*this == rhs); + } + + bool operator < (const HiveClusterStatus & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(HiveClusterStatus &a, HiveClusterStatus &b); + +inline std::ostream& operator<<(std::ostream& out, const HiveClusterStatus& obj) +{ + obj.printTo(out); + return out; +} + +typedef struct _HiveServerException__isset { + _HiveServerException__isset() : message(false), errorCode(false), SQLState(false) {} + bool message :1; + bool errorCode :1; + bool SQLState :1; +} _HiveServerException__isset; + +class HiveServerException : public ::apache::thrift::TException { + public: + + HiveServerException(const HiveServerException&); + HiveServerException& operator=(const HiveServerException&); + HiveServerException() : message(), errorCode(0), SQLState() { + } + + virtual ~HiveServerException() throw(); + std::string message; + int32_t errorCode; + std::string SQLState; + + _HiveServerException__isset __isset; + + void __set_message(const std::string& val); + + void __set_errorCode(const int32_t val); + + void __set_SQLState(const std::string& val); + + bool operator == (const HiveServerException & rhs) const + { + if (!(message == rhs.message)) + return false; + if (!(errorCode == rhs.errorCode)) + return false; + if (!(SQLState == rhs.SQLState)) + return false; + return true; + } + bool operator != (const HiveServerException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const HiveServerException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; + mutable std::string thriftTExceptionMessageHolder_; + const char* what() const throw(); +}; + +void swap(HiveServerException &a, HiveServerException &b); + +inline std::ostream& operator<<(std::ostream& out, const HiveServerException& obj) +{ + obj.printTo(out); + return out; +} + +}}} // namespace + +#endif diff --git a/service/src/gen/thrift/gen-cpp/hive_service_types.cpp b/service/src/gen/thrift/gen-cpp/hive_service_types.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9ddf7c11fdee23cef7775ce25753d476a019ba22 --- /dev/null +++ b/service/src/gen/thrift/gen-cpp/hive_service_types.cpp @@ -0,0 +1,351 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "hive_service_types.h" + +#include +#include + +#include + +namespace Apache { namespace Hadoop { namespace Hive { + +int _kJobTrackerStateValues[] = { + JobTrackerState::INITIALIZING, + JobTrackerState::RUNNING +}; +const char* _kJobTrackerStateNames[] = { + "INITIALIZING", + "RUNNING" +}; +const std::map _JobTrackerState_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kJobTrackerStateValues, _kJobTrackerStateNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + + +HiveClusterStatus::~HiveClusterStatus() throw() { +} + + +void HiveClusterStatus::__set_taskTrackers(const int32_t val) { + this->taskTrackers = val; +} + +void HiveClusterStatus::__set_mapTasks(const int32_t val) { + this->mapTasks = val; +} + +void HiveClusterStatus::__set_reduceTasks(const int32_t val) { + this->reduceTasks = val; +} + +void HiveClusterStatus::__set_maxMapTasks(const int32_t val) { + this->maxMapTasks = val; +} + +void HiveClusterStatus::__set_maxReduceTasks(const int32_t val) { + this->maxReduceTasks = val; +} + +void HiveClusterStatus::__set_state(const JobTrackerState::type val) { + this->state = val; +} + +uint32_t HiveClusterStatus::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->taskTrackers); + this->__isset.taskTrackers = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->mapTasks); + this->__isset.mapTasks = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->reduceTasks); + this->__isset.reduceTasks = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->maxMapTasks); + this->__isset.maxMapTasks = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->maxReduceTasks); + this->__isset.maxReduceTasks = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast0; + xfer += iprot->readI32(ecast0); + this->state = (JobTrackerState::type)ecast0; + this->__isset.state = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t HiveClusterStatus::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("HiveClusterStatus"); + + xfer += oprot->writeFieldBegin("taskTrackers", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->taskTrackers); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("mapTasks", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->mapTasks); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("reduceTasks", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(this->reduceTasks); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("maxMapTasks", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->maxMapTasks); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("maxReduceTasks", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->maxReduceTasks); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_I32, 6); + xfer += oprot->writeI32((int32_t)this->state); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(HiveClusterStatus &a, HiveClusterStatus &b) { + using ::std::swap; + swap(a.taskTrackers, b.taskTrackers); + swap(a.mapTasks, b.mapTasks); + swap(a.reduceTasks, b.reduceTasks); + swap(a.maxMapTasks, b.maxMapTasks); + swap(a.maxReduceTasks, b.maxReduceTasks); + swap(a.state, b.state); + swap(a.__isset, b.__isset); +} + +HiveClusterStatus::HiveClusterStatus(const HiveClusterStatus& other1) { + taskTrackers = other1.taskTrackers; + mapTasks = other1.mapTasks; + reduceTasks = other1.reduceTasks; + maxMapTasks = other1.maxMapTasks; + maxReduceTasks = other1.maxReduceTasks; + state = other1.state; + __isset = other1.__isset; +} +HiveClusterStatus& HiveClusterStatus::operator=(const HiveClusterStatus& other2) { + taskTrackers = other2.taskTrackers; + mapTasks = other2.mapTasks; + reduceTasks = other2.reduceTasks; + maxMapTasks = other2.maxMapTasks; + maxReduceTasks = other2.maxReduceTasks; + state = other2.state; + __isset = other2.__isset; + return *this; +} +void HiveClusterStatus::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "HiveClusterStatus("; + out << "taskTrackers=" << to_string(taskTrackers); + out << ", " << "mapTasks=" << to_string(mapTasks); + out << ", " << "reduceTasks=" << to_string(reduceTasks); + out << ", " << "maxMapTasks=" << to_string(maxMapTasks); + out << ", " << "maxReduceTasks=" << to_string(maxReduceTasks); + out << ", " << "state=" << to_string(state); + out << ")"; +} + + +HiveServerException::~HiveServerException() throw() { +} + + +void HiveServerException::__set_message(const std::string& val) { + this->message = val; +} + +void HiveServerException::__set_errorCode(const int32_t val) { + this->errorCode = val; +} + +void HiveServerException::__set_SQLState(const std::string& val) { + this->SQLState = val; +} + +uint32_t HiveServerException::read(::apache::thrift::protocol::TProtocol* iprot) { + + apache::thrift::protocol::TInputRecursionTracker tracker(*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 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->message); + this->__isset.message = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->errorCode); + this->__isset.errorCode = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->SQLState); + this->__isset.SQLState = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t HiveServerException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("HiveServerException"); + + xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->message); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("errorCode", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->errorCode); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("SQLState", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->SQLState); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(HiveServerException &a, HiveServerException &b) { + using ::std::swap; + swap(a.message, b.message); + swap(a.errorCode, b.errorCode); + swap(a.SQLState, b.SQLState); + swap(a.__isset, b.__isset); +} + +HiveServerException::HiveServerException(const HiveServerException& other3) : TException() { + message = other3.message; + errorCode = other3.errorCode; + SQLState = other3.SQLState; + __isset = other3.__isset; +} +HiveServerException& HiveServerException::operator=(const HiveServerException& other4) { + message = other4.message; + errorCode = other4.errorCode; + SQLState = other4.SQLState; + __isset = other4.__isset; + return *this; +} +void HiveServerException::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "HiveServerException("; + out << "message=" << to_string(message); + out << ", " << "errorCode=" << to_string(errorCode); + out << ", " << "SQLState=" << to_string(SQLState); + out << ")"; +} + +const char* HiveServerException::what() const throw() { + try { + std::stringstream ss; + ss << "TException - service has thrown: " << *this; + this->thriftTExceptionMessageHolder_ = ss.str(); + return this->thriftTExceptionMessageHolder_.c_str(); + } catch (const std::exception&) { + return "TException - service has thrown: HiveServerException"; + } +} + +}}} // namespace diff --git a/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/HiveClusterStatus.java b/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/HiveClusterStatus.java new file mode 100644 index 0000000000000000000000000000000000000000..ad898678d86b81072cc32891e2e9ecab55f8d14c --- /dev/null +++ b/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/HiveClusterStatus.java @@ -0,0 +1,901 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.service; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +public class HiveClusterStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HiveClusterStatus"); + + private static final org.apache.thrift.protocol.TField TASK_TRACKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskTrackers", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField MAP_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("mapTasks", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField REDUCE_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("reduceTasks", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField MAX_MAP_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxMapTasks", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField MAX_REDUCE_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxReduceTasks", org.apache.thrift.protocol.TType.I32, (short)5); + private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("state", org.apache.thrift.protocol.TType.I32, (short)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new HiveClusterStatusStandardSchemeFactory()); + schemes.put(TupleScheme.class, new HiveClusterStatusTupleSchemeFactory()); + } + + private int taskTrackers; // required + private int mapTasks; // required + private int reduceTasks; // required + private int maxMapTasks; // required + private int maxReduceTasks; // required + private JobTrackerState state; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TASK_TRACKERS((short)1, "taskTrackers"), + MAP_TASKS((short)2, "mapTasks"), + REDUCE_TASKS((short)3, "reduceTasks"), + MAX_MAP_TASKS((short)4, "maxMapTasks"), + MAX_REDUCE_TASKS((short)5, "maxReduceTasks"), + /** + * + * @see JobTrackerState + */ + STATE((short)6, "state"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TASK_TRACKERS + return TASK_TRACKERS; + case 2: // MAP_TASKS + return MAP_TASKS; + case 3: // REDUCE_TASKS + return REDUCE_TASKS; + case 4: // MAX_MAP_TASKS + return MAX_MAP_TASKS; + case 5: // MAX_REDUCE_TASKS + return MAX_REDUCE_TASKS; + case 6: // STATE + return STATE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TASKTRACKERS_ISSET_ID = 0; + private static final int __MAPTASKS_ISSET_ID = 1; + private static final int __REDUCETASKS_ISSET_ID = 2; + private static final int __MAXMAPTASKS_ISSET_ID = 3; + private static final int __MAXREDUCETASKS_ISSET_ID = 4; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TASK_TRACKERS, new org.apache.thrift.meta_data.FieldMetaData("taskTrackers", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.MAP_TASKS, new org.apache.thrift.meta_data.FieldMetaData("mapTasks", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.REDUCE_TASKS, new org.apache.thrift.meta_data.FieldMetaData("reduceTasks", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.MAX_MAP_TASKS, new org.apache.thrift.meta_data.FieldMetaData("maxMapTasks", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.MAX_REDUCE_TASKS, new org.apache.thrift.meta_data.FieldMetaData("maxReduceTasks", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, JobTrackerState.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HiveClusterStatus.class, metaDataMap); + } + + public HiveClusterStatus() { + } + + public HiveClusterStatus( + int taskTrackers, + int mapTasks, + int reduceTasks, + int maxMapTasks, + int maxReduceTasks, + JobTrackerState state) + { + this(); + this.taskTrackers = taskTrackers; + setTaskTrackersIsSet(true); + this.mapTasks = mapTasks; + setMapTasksIsSet(true); + this.reduceTasks = reduceTasks; + setReduceTasksIsSet(true); + this.maxMapTasks = maxMapTasks; + setMaxMapTasksIsSet(true); + this.maxReduceTasks = maxReduceTasks; + setMaxReduceTasksIsSet(true); + this.state = state; + } + + /** + * Performs a deep copy on other. + */ + public HiveClusterStatus(HiveClusterStatus other) { + __isset_bitfield = other.__isset_bitfield; + this.taskTrackers = other.taskTrackers; + this.mapTasks = other.mapTasks; + this.reduceTasks = other.reduceTasks; + this.maxMapTasks = other.maxMapTasks; + this.maxReduceTasks = other.maxReduceTasks; + if (other.isSetState()) { + this.state = other.state; + } + } + + public HiveClusterStatus deepCopy() { + return new HiveClusterStatus(this); + } + + @Override + public void clear() { + setTaskTrackersIsSet(false); + this.taskTrackers = 0; + setMapTasksIsSet(false); + this.mapTasks = 0; + setReduceTasksIsSet(false); + this.reduceTasks = 0; + setMaxMapTasksIsSet(false); + this.maxMapTasks = 0; + setMaxReduceTasksIsSet(false); + this.maxReduceTasks = 0; + this.state = null; + } + + public int getTaskTrackers() { + return this.taskTrackers; + } + + public void setTaskTrackers(int taskTrackers) { + this.taskTrackers = taskTrackers; + setTaskTrackersIsSet(true); + } + + public void unsetTaskTrackers() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TASKTRACKERS_ISSET_ID); + } + + /** Returns true if field taskTrackers is set (has been assigned a value) and false otherwise */ + public boolean isSetTaskTrackers() { + return EncodingUtils.testBit(__isset_bitfield, __TASKTRACKERS_ISSET_ID); + } + + public void setTaskTrackersIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TASKTRACKERS_ISSET_ID, value); + } + + public int getMapTasks() { + return this.mapTasks; + } + + public void setMapTasks(int mapTasks) { + this.mapTasks = mapTasks; + setMapTasksIsSet(true); + } + + public void unsetMapTasks() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAPTASKS_ISSET_ID); + } + + /** Returns true if field mapTasks is set (has been assigned a value) and false otherwise */ + public boolean isSetMapTasks() { + return EncodingUtils.testBit(__isset_bitfield, __MAPTASKS_ISSET_ID); + } + + public void setMapTasksIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAPTASKS_ISSET_ID, value); + } + + public int getReduceTasks() { + return this.reduceTasks; + } + + public void setReduceTasks(int reduceTasks) { + this.reduceTasks = reduceTasks; + setReduceTasksIsSet(true); + } + + public void unsetReduceTasks() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REDUCETASKS_ISSET_ID); + } + + /** Returns true if field reduceTasks is set (has been assigned a value) and false otherwise */ + public boolean isSetReduceTasks() { + return EncodingUtils.testBit(__isset_bitfield, __REDUCETASKS_ISSET_ID); + } + + public void setReduceTasksIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REDUCETASKS_ISSET_ID, value); + } + + public int getMaxMapTasks() { + return this.maxMapTasks; + } + + public void setMaxMapTasks(int maxMapTasks) { + this.maxMapTasks = maxMapTasks; + setMaxMapTasksIsSet(true); + } + + public void unsetMaxMapTasks() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXMAPTASKS_ISSET_ID); + } + + /** Returns true if field maxMapTasks is set (has been assigned a value) and false otherwise */ + public boolean isSetMaxMapTasks() { + return EncodingUtils.testBit(__isset_bitfield, __MAXMAPTASKS_ISSET_ID); + } + + public void setMaxMapTasksIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXMAPTASKS_ISSET_ID, value); + } + + public int getMaxReduceTasks() { + return this.maxReduceTasks; + } + + public void setMaxReduceTasks(int maxReduceTasks) { + this.maxReduceTasks = maxReduceTasks; + setMaxReduceTasksIsSet(true); + } + + public void unsetMaxReduceTasks() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXREDUCETASKS_ISSET_ID); + } + + /** Returns true if field maxReduceTasks is set (has been assigned a value) and false otherwise */ + public boolean isSetMaxReduceTasks() { + return EncodingUtils.testBit(__isset_bitfield, __MAXREDUCETASKS_ISSET_ID); + } + + public void setMaxReduceTasksIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXREDUCETASKS_ISSET_ID, value); + } + + /** + * + * @see JobTrackerState + */ + public JobTrackerState getState() { + return this.state; + } + + /** + * + * @see JobTrackerState + */ + public void setState(JobTrackerState state) { + this.state = state; + } + + public void unsetState() { + this.state = null; + } + + /** Returns true if field state is set (has been assigned a value) and false otherwise */ + public boolean isSetState() { + return this.state != null; + } + + public void setStateIsSet(boolean value) { + if (!value) { + this.state = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TASK_TRACKERS: + if (value == null) { + unsetTaskTrackers(); + } else { + setTaskTrackers((Integer)value); + } + break; + + case MAP_TASKS: + if (value == null) { + unsetMapTasks(); + } else { + setMapTasks((Integer)value); + } + break; + + case REDUCE_TASKS: + if (value == null) { + unsetReduceTasks(); + } else { + setReduceTasks((Integer)value); + } + break; + + case MAX_MAP_TASKS: + if (value == null) { + unsetMaxMapTasks(); + } else { + setMaxMapTasks((Integer)value); + } + break; + + case MAX_REDUCE_TASKS: + if (value == null) { + unsetMaxReduceTasks(); + } else { + setMaxReduceTasks((Integer)value); + } + break; + + case STATE: + if (value == null) { + unsetState(); + } else { + setState((JobTrackerState)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TASK_TRACKERS: + return getTaskTrackers(); + + case MAP_TASKS: + return getMapTasks(); + + case REDUCE_TASKS: + return getReduceTasks(); + + case MAX_MAP_TASKS: + return getMaxMapTasks(); + + case MAX_REDUCE_TASKS: + return getMaxReduceTasks(); + + case STATE: + return getState(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case TASK_TRACKERS: + return isSetTaskTrackers(); + case MAP_TASKS: + return isSetMapTasks(); + case REDUCE_TASKS: + return isSetReduceTasks(); + case MAX_MAP_TASKS: + return isSetMaxMapTasks(); + case MAX_REDUCE_TASKS: + return isSetMaxReduceTasks(); + case STATE: + return isSetState(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof HiveClusterStatus) + return this.equals((HiveClusterStatus)that); + return false; + } + + public boolean equals(HiveClusterStatus that) { + if (that == null) + return false; + + boolean this_present_taskTrackers = true; + boolean that_present_taskTrackers = true; + if (this_present_taskTrackers || that_present_taskTrackers) { + if (!(this_present_taskTrackers && that_present_taskTrackers)) + return false; + if (this.taskTrackers != that.taskTrackers) + return false; + } + + boolean this_present_mapTasks = true; + boolean that_present_mapTasks = true; + if (this_present_mapTasks || that_present_mapTasks) { + if (!(this_present_mapTasks && that_present_mapTasks)) + return false; + if (this.mapTasks != that.mapTasks) + return false; + } + + boolean this_present_reduceTasks = true; + boolean that_present_reduceTasks = true; + if (this_present_reduceTasks || that_present_reduceTasks) { + if (!(this_present_reduceTasks && that_present_reduceTasks)) + return false; + if (this.reduceTasks != that.reduceTasks) + return false; + } + + boolean this_present_maxMapTasks = true; + boolean that_present_maxMapTasks = true; + if (this_present_maxMapTasks || that_present_maxMapTasks) { + if (!(this_present_maxMapTasks && that_present_maxMapTasks)) + return false; + if (this.maxMapTasks != that.maxMapTasks) + return false; + } + + boolean this_present_maxReduceTasks = true; + boolean that_present_maxReduceTasks = true; + if (this_present_maxReduceTasks || that_present_maxReduceTasks) { + if (!(this_present_maxReduceTasks && that_present_maxReduceTasks)) + return false; + if (this.maxReduceTasks != that.maxReduceTasks) + return false; + } + + boolean this_present_state = true && this.isSetState(); + boolean that_present_state = true && that.isSetState(); + if (this_present_state || that_present_state) { + if (!(this_present_state && that_present_state)) + return false; + if (!this.state.equals(that.state)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_taskTrackers = true; + list.add(present_taskTrackers); + if (present_taskTrackers) + list.add(taskTrackers); + + boolean present_mapTasks = true; + list.add(present_mapTasks); + if (present_mapTasks) + list.add(mapTasks); + + boolean present_reduceTasks = true; + list.add(present_reduceTasks); + if (present_reduceTasks) + list.add(reduceTasks); + + boolean present_maxMapTasks = true; + list.add(present_maxMapTasks); + if (present_maxMapTasks) + list.add(maxMapTasks); + + boolean present_maxReduceTasks = true; + list.add(present_maxReduceTasks); + if (present_maxReduceTasks) + list.add(maxReduceTasks); + + boolean present_state = true && (isSetState()); + list.add(present_state); + if (present_state) + list.add(state.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(HiveClusterStatus other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTaskTrackers()).compareTo(other.isSetTaskTrackers()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTaskTrackers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskTrackers, other.taskTrackers); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMapTasks()).compareTo(other.isSetMapTasks()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMapTasks()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mapTasks, other.mapTasks); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetReduceTasks()).compareTo(other.isSetReduceTasks()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReduceTasks()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reduceTasks, other.reduceTasks); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMaxMapTasks()).compareTo(other.isSetMaxMapTasks()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMaxMapTasks()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxMapTasks, other.maxMapTasks); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMaxReduceTasks()).compareTo(other.isSetMaxReduceTasks()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMaxReduceTasks()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxReduceTasks, other.maxReduceTasks); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetState()).compareTo(other.isSetState()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetState()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, other.state); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("HiveClusterStatus("); + boolean first = true; + + sb.append("taskTrackers:"); + sb.append(this.taskTrackers); + first = false; + if (!first) sb.append(", "); + sb.append("mapTasks:"); + sb.append(this.mapTasks); + first = false; + if (!first) sb.append(", "); + sb.append("reduceTasks:"); + sb.append(this.reduceTasks); + first = false; + if (!first) sb.append(", "); + sb.append("maxMapTasks:"); + sb.append(this.maxMapTasks); + first = false; + if (!first) sb.append(", "); + sb.append("maxReduceTasks:"); + sb.append(this.maxReduceTasks); + first = false; + if (!first) sb.append(", "); + sb.append("state:"); + if (this.state == null) { + sb.append("null"); + } else { + sb.append(this.state); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class HiveClusterStatusStandardSchemeFactory implements SchemeFactory { + public HiveClusterStatusStandardScheme getScheme() { + return new HiveClusterStatusStandardScheme(); + } + } + + private static class HiveClusterStatusStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, HiveClusterStatus struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TASK_TRACKERS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.taskTrackers = iprot.readI32(); + struct.setTaskTrackersIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MAP_TASKS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.mapTasks = iprot.readI32(); + struct.setMapTasksIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // REDUCE_TASKS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.reduceTasks = iprot.readI32(); + struct.setReduceTasksIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // MAX_MAP_TASKS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.maxMapTasks = iprot.readI32(); + struct.setMaxMapTasksIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // MAX_REDUCE_TASKS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.maxReduceTasks = iprot.readI32(); + struct.setMaxReduceTasksIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // STATE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.state = org.apache.hadoop.hive.service.JobTrackerState.findByValue(iprot.readI32()); + struct.setStateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, HiveClusterStatus struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TASK_TRACKERS_FIELD_DESC); + oprot.writeI32(struct.taskTrackers); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(MAP_TASKS_FIELD_DESC); + oprot.writeI32(struct.mapTasks); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(REDUCE_TASKS_FIELD_DESC); + oprot.writeI32(struct.reduceTasks); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(MAX_MAP_TASKS_FIELD_DESC); + oprot.writeI32(struct.maxMapTasks); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(MAX_REDUCE_TASKS_FIELD_DESC); + oprot.writeI32(struct.maxReduceTasks); + oprot.writeFieldEnd(); + if (struct.state != null) { + oprot.writeFieldBegin(STATE_FIELD_DESC); + oprot.writeI32(struct.state.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class HiveClusterStatusTupleSchemeFactory implements SchemeFactory { + public HiveClusterStatusTupleScheme getScheme() { + return new HiveClusterStatusTupleScheme(); + } + } + + private static class HiveClusterStatusTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, HiveClusterStatus struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTaskTrackers()) { + optionals.set(0); + } + if (struct.isSetMapTasks()) { + optionals.set(1); + } + if (struct.isSetReduceTasks()) { + optionals.set(2); + } + if (struct.isSetMaxMapTasks()) { + optionals.set(3); + } + if (struct.isSetMaxReduceTasks()) { + optionals.set(4); + } + if (struct.isSetState()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetTaskTrackers()) { + oprot.writeI32(struct.taskTrackers); + } + if (struct.isSetMapTasks()) { + oprot.writeI32(struct.mapTasks); + } + if (struct.isSetReduceTasks()) { + oprot.writeI32(struct.reduceTasks); + } + if (struct.isSetMaxMapTasks()) { + oprot.writeI32(struct.maxMapTasks); + } + if (struct.isSetMaxReduceTasks()) { + oprot.writeI32(struct.maxReduceTasks); + } + if (struct.isSetState()) { + oprot.writeI32(struct.state.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, HiveClusterStatus struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.taskTrackers = iprot.readI32(); + struct.setTaskTrackersIsSet(true); + } + if (incoming.get(1)) { + struct.mapTasks = iprot.readI32(); + struct.setMapTasksIsSet(true); + } + if (incoming.get(2)) { + struct.reduceTasks = iprot.readI32(); + struct.setReduceTasksIsSet(true); + } + if (incoming.get(3)) { + struct.maxMapTasks = iprot.readI32(); + struct.setMaxMapTasksIsSet(true); + } + if (incoming.get(4)) { + struct.maxReduceTasks = iprot.readI32(); + struct.setMaxReduceTasksIsSet(true); + } + if (incoming.get(5)) { + struct.state = org.apache.hadoop.hive.service.JobTrackerState.findByValue(iprot.readI32()); + struct.setStateIsSet(true); + } + } + } + +} + diff --git a/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/HiveServerException.java b/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/HiveServerException.java new file mode 100644 index 0000000000000000000000000000000000000000..97b1219af669fa9e83ebef02787e704ea3a6bf69 --- /dev/null +++ b/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/HiveServerException.java @@ -0,0 +1,601 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.service; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +public class HiveServerException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HiveServerException"); + + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField SQLSTATE_FIELD_DESC = new org.apache.thrift.protocol.TField("SQLState", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new HiveServerExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new HiveServerExceptionTupleSchemeFactory()); + } + + private String message; // required + private int errorCode; // required + private String SQLState; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + MESSAGE((short)1, "message"), + ERROR_CODE((short)2, "errorCode"), + SQLSTATE((short)3, "SQLState"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // MESSAGE + return MESSAGE; + case 2: // ERROR_CODE + return ERROR_CODE; + case 3: // SQLSTATE + return SQLSTATE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ERRORCODE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.SQLSTATE, new org.apache.thrift.meta_data.FieldMetaData("SQLState", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HiveServerException.class, metaDataMap); + } + + public HiveServerException() { + } + + public HiveServerException( + String message, + int errorCode, + String SQLState) + { + this(); + this.message = message; + this.errorCode = errorCode; + setErrorCodeIsSet(true); + this.SQLState = SQLState; + } + + /** + * Performs a deep copy on other. + */ + public HiveServerException(HiveServerException other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetMessage()) { + this.message = other.message; + } + this.errorCode = other.errorCode; + if (other.isSetSQLState()) { + this.SQLState = other.SQLState; + } + } + + public HiveServerException deepCopy() { + return new HiveServerException(this); + } + + @Override + public void clear() { + this.message = null; + setErrorCodeIsSet(false); + this.errorCode = 0; + this.SQLState = null; + } + + public String getMessage() { + return this.message; + } + + public void setMessage(String message) { + this.message = message; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public int getErrorCode() { + return this.errorCode; + } + + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + setErrorCodeIsSet(true); + } + + public void unsetErrorCode() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorCode() { + return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + public void setErrorCodeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + } + + public String getSQLState() { + return this.SQLState; + } + + public void setSQLState(String SQLState) { + this.SQLState = SQLState; + } + + public void unsetSQLState() { + this.SQLState = null; + } + + /** Returns true if field SQLState is set (has been assigned a value) and false otherwise */ + public boolean isSetSQLState() { + return this.SQLState != null; + } + + public void setSQLStateIsSet(boolean value) { + if (!value) { + this.SQLState = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + case ERROR_CODE: + if (value == null) { + unsetErrorCode(); + } else { + setErrorCode((Integer)value); + } + break; + + case SQLSTATE: + if (value == null) { + unsetSQLState(); + } else { + setSQLState((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MESSAGE: + return getMessage(); + + case ERROR_CODE: + return getErrorCode(); + + case SQLSTATE: + return getSQLState(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case MESSAGE: + return isSetMessage(); + case ERROR_CODE: + return isSetErrorCode(); + case SQLSTATE: + return isSetSQLState(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof HiveServerException) + return this.equals((HiveServerException)that); + return false; + } + + public boolean equals(HiveServerException that) { + if (that == null) + return false; + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + boolean this_present_errorCode = true; + boolean that_present_errorCode = true; + if (this_present_errorCode || that_present_errorCode) { + if (!(this_present_errorCode && that_present_errorCode)) + return false; + if (this.errorCode != that.errorCode) + return false; + } + + boolean this_present_SQLState = true && this.isSetSQLState(); + boolean that_present_SQLState = true && that.isSetSQLState(); + if (this_present_SQLState || that_present_SQLState) { + if (!(this_present_SQLState && that_present_SQLState)) + return false; + if (!this.SQLState.equals(that.SQLState)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_message = true && (isSetMessage()); + list.add(present_message); + if (present_message) + list.add(message); + + boolean present_errorCode = true; + list.add(present_errorCode); + if (present_errorCode) + list.add(errorCode); + + boolean present_SQLState = true && (isSetSQLState()); + list.add(present_SQLState); + if (present_SQLState) + list.add(SQLState); + + return list.hashCode(); + } + + @Override + public int compareTo(HiveServerException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSQLState()).compareTo(other.isSetSQLState()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSQLState()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.SQLState, other.SQLState); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("HiveServerException("); + boolean first = true; + + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + if (!first) sb.append(", "); + sb.append("errorCode:"); + sb.append(this.errorCode); + first = false; + if (!first) sb.append(", "); + sb.append("SQLState:"); + if (this.SQLState == null) { + sb.append("null"); + } else { + sb.append(this.SQLState); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class HiveServerExceptionStandardSchemeFactory implements SchemeFactory { + public HiveServerExceptionStandardScheme getScheme() { + return new HiveServerExceptionStandardScheme(); + } + } + + private static class HiveServerExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, HiveServerException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ERROR_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SQLSTATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.SQLState = iprot.readString(); + struct.setSQLStateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, HiveServerException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); + oprot.writeI32(struct.errorCode); + oprot.writeFieldEnd(); + if (struct.SQLState != null) { + oprot.writeFieldBegin(SQLSTATE_FIELD_DESC); + oprot.writeString(struct.SQLState); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class HiveServerExceptionTupleSchemeFactory implements SchemeFactory { + public HiveServerExceptionTupleScheme getScheme() { + return new HiveServerExceptionTupleScheme(); + } + } + + private static class HiveServerExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, HiveServerException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + if (struct.isSetErrorCode()) { + optionals.set(1); + } + if (struct.isSetSQLState()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + if (struct.isSetErrorCode()) { + oprot.writeI32(struct.errorCode); + } + if (struct.isSetSQLState()) { + oprot.writeString(struct.SQLState); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, HiveServerException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + if (incoming.get(1)) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } + if (incoming.get(2)) { + struct.SQLState = iprot.readString(); + struct.setSQLStateIsSet(true); + } + } + } + +} + diff --git a/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/JobTrackerState.java b/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/JobTrackerState.java new file mode 100644 index 0000000000000000000000000000000000000000..46c71eea294f7c8ab13b3e88aad92794d0e3ffb3 --- /dev/null +++ b/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/JobTrackerState.java @@ -0,0 +1,45 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.service; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +public enum JobTrackerState implements org.apache.thrift.TEnum { + INITIALIZING(1), + RUNNING(2); + + private final int value; + + private JobTrackerState(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static JobTrackerState findByValue(int value) { + switch (value) { + case 1: + return INITIALIZING; + case 2: + return RUNNING; + default: + return null; + } + } +} diff --git a/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java b/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java new file mode 100644 index 0000000000000000000000000000000000000000..934a8a5e4acf4102e6d12e913e140e7de641dfed --- /dev/null +++ b/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java @@ -0,0 +1,7784 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.service; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +public class ThriftHive { + + public interface Iface extends org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface { + + public void execute(String query) throws HiveServerException, org.apache.thrift.TException; + + public String fetchOne() throws HiveServerException, org.apache.thrift.TException; + + public List fetchN(int numRows) throws HiveServerException, org.apache.thrift.TException; + + public List fetchAll() throws HiveServerException, org.apache.thrift.TException; + + public org.apache.hadoop.hive.metastore.api.Schema getSchema() throws HiveServerException, org.apache.thrift.TException; + + public org.apache.hadoop.hive.metastore.api.Schema getThriftSchema() throws HiveServerException, org.apache.thrift.TException; + + public HiveClusterStatus getClusterStatus() throws HiveServerException, org.apache.thrift.TException; + + public org.apache.hadoop.hive.ql.plan.api.QueryPlan getQueryPlan() throws HiveServerException, org.apache.thrift.TException; + + public void clean() throws org.apache.thrift.TException; + + } + + public interface AsyncIface extends org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore .AsyncIface { + + public void execute(String query, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void fetchOne(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void fetchN(int numRows, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void fetchAll(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getSchema(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getThriftSchema(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getClusterStatus(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getQueryPlan(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void clean(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Client implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public void execute(String query) throws HiveServerException, org.apache.thrift.TException + { + send_execute(query); + recv_execute(); + } + + public void send_execute(String query) throws org.apache.thrift.TException + { + execute_args args = new execute_args(); + args.setQuery(query); + sendBase("execute", args); + } + + public void recv_execute() throws HiveServerException, org.apache.thrift.TException + { + execute_result result = new execute_result(); + receiveBase(result, "execute"); + if (result.ex != null) { + throw result.ex; + } + return; + } + + public String fetchOne() throws HiveServerException, org.apache.thrift.TException + { + send_fetchOne(); + return recv_fetchOne(); + } + + public void send_fetchOne() throws org.apache.thrift.TException + { + fetchOne_args args = new fetchOne_args(); + sendBase("fetchOne", args); + } + + public String recv_fetchOne() throws HiveServerException, org.apache.thrift.TException + { + fetchOne_result result = new fetchOne_result(); + receiveBase(result, "fetchOne"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchOne failed: unknown result"); + } + + public List fetchN(int numRows) throws HiveServerException, org.apache.thrift.TException + { + send_fetchN(numRows); + return recv_fetchN(); + } + + public void send_fetchN(int numRows) throws org.apache.thrift.TException + { + fetchN_args args = new fetchN_args(); + args.setNumRows(numRows); + sendBase("fetchN", args); + } + + public List recv_fetchN() throws HiveServerException, org.apache.thrift.TException + { + fetchN_result result = new fetchN_result(); + receiveBase(result, "fetchN"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchN failed: unknown result"); + } + + public List fetchAll() throws HiveServerException, org.apache.thrift.TException + { + send_fetchAll(); + return recv_fetchAll(); + } + + public void send_fetchAll() throws org.apache.thrift.TException + { + fetchAll_args args = new fetchAll_args(); + sendBase("fetchAll", args); + } + + public List recv_fetchAll() throws HiveServerException, org.apache.thrift.TException + { + fetchAll_result result = new fetchAll_result(); + receiveBase(result, "fetchAll"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchAll failed: unknown result"); + } + + public org.apache.hadoop.hive.metastore.api.Schema getSchema() throws HiveServerException, org.apache.thrift.TException + { + send_getSchema(); + return recv_getSchema(); + } + + public void send_getSchema() throws org.apache.thrift.TException + { + getSchema_args args = new getSchema_args(); + sendBase("getSchema", args); + } + + public org.apache.hadoop.hive.metastore.api.Schema recv_getSchema() throws HiveServerException, org.apache.thrift.TException + { + getSchema_result result = new getSchema_result(); + receiveBase(result, "getSchema"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSchema failed: unknown result"); + } + + public org.apache.hadoop.hive.metastore.api.Schema getThriftSchema() throws HiveServerException, org.apache.thrift.TException + { + send_getThriftSchema(); + return recv_getThriftSchema(); + } + + public void send_getThriftSchema() throws org.apache.thrift.TException + { + getThriftSchema_args args = new getThriftSchema_args(); + sendBase("getThriftSchema", args); + } + + public org.apache.hadoop.hive.metastore.api.Schema recv_getThriftSchema() throws HiveServerException, org.apache.thrift.TException + { + getThriftSchema_result result = new getThriftSchema_result(); + receiveBase(result, "getThriftSchema"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getThriftSchema failed: unknown result"); + } + + public HiveClusterStatus getClusterStatus() throws HiveServerException, org.apache.thrift.TException + { + send_getClusterStatus(); + return recv_getClusterStatus(); + } + + public void send_getClusterStatus() throws org.apache.thrift.TException + { + getClusterStatus_args args = new getClusterStatus_args(); + sendBase("getClusterStatus", args); + } + + public HiveClusterStatus recv_getClusterStatus() throws HiveServerException, org.apache.thrift.TException + { + getClusterStatus_result result = new getClusterStatus_result(); + receiveBase(result, "getClusterStatus"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getClusterStatus failed: unknown result"); + } + + public org.apache.hadoop.hive.ql.plan.api.QueryPlan getQueryPlan() throws HiveServerException, org.apache.thrift.TException + { + send_getQueryPlan(); + return recv_getQueryPlan(); + } + + public void send_getQueryPlan() throws org.apache.thrift.TException + { + getQueryPlan_args args = new getQueryPlan_args(); + sendBase("getQueryPlan", args); + } + + public org.apache.hadoop.hive.ql.plan.api.QueryPlan recv_getQueryPlan() throws HiveServerException, org.apache.thrift.TException + { + getQueryPlan_result result = new getQueryPlan_result(); + receiveBase(result, "getQueryPlan"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getQueryPlan failed: unknown result"); + } + + public void clean() throws org.apache.thrift.TException + { + send_clean(); + recv_clean(); + } + + public void send_clean() throws org.apache.thrift.TException + { + clean_args args = new clean_args(); + sendBase("clean", args); + } + + public void recv_clean() throws org.apache.thrift.TException + { + clean_result result = new clean_result(); + receiveBase(result, "clean"); + return; + } + + } + public static class AsyncClient extends org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.AsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void execute(String query, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + execute_call method_call = new execute_call(query, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class execute_call extends org.apache.thrift.async.TAsyncMethodCall { + private String query; + public execute_call(String query, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.query = query; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("execute", org.apache.thrift.protocol.TMessageType.CALL, 0)); + execute_args args = new execute_args(); + args.setQuery(query); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws HiveServerException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_execute(); + } + } + + public void fetchOne(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + fetchOne_call method_call = new fetchOne_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class fetchOne_call extends org.apache.thrift.async.TAsyncMethodCall { + public fetchOne_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchOne", org.apache.thrift.protocol.TMessageType.CALL, 0)); + fetchOne_args args = new fetchOne_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws HiveServerException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_fetchOne(); + } + } + + public void fetchN(int numRows, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + fetchN_call method_call = new fetchN_call(numRows, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class fetchN_call extends org.apache.thrift.async.TAsyncMethodCall { + private int numRows; + public fetchN_call(int numRows, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.numRows = numRows; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchN", org.apache.thrift.protocol.TMessageType.CALL, 0)); + fetchN_args args = new fetchN_args(); + args.setNumRows(numRows); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws HiveServerException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_fetchN(); + } + } + + public void fetchAll(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + fetchAll_call method_call = new fetchAll_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class fetchAll_call extends org.apache.thrift.async.TAsyncMethodCall { + public fetchAll_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchAll", org.apache.thrift.protocol.TMessageType.CALL, 0)); + fetchAll_args args = new fetchAll_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List getResult() throws HiveServerException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_fetchAll(); + } + } + + public void getSchema(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getSchema_call method_call = new getSchema_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getSchema_call extends org.apache.thrift.async.TAsyncMethodCall { + public getSchema_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSchema", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getSchema_args args = new getSchema_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public org.apache.hadoop.hive.metastore.api.Schema getResult() throws HiveServerException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getSchema(); + } + } + + public void getThriftSchema(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getThriftSchema_call method_call = new getThriftSchema_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getThriftSchema_call extends org.apache.thrift.async.TAsyncMethodCall { + public getThriftSchema_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getThriftSchema", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getThriftSchema_args args = new getThriftSchema_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public org.apache.hadoop.hive.metastore.api.Schema getResult() throws HiveServerException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getThriftSchema(); + } + } + + public void getClusterStatus(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getClusterStatus_call method_call = new getClusterStatus_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getClusterStatus_call extends org.apache.thrift.async.TAsyncMethodCall { + public getClusterStatus_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getClusterStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getClusterStatus_args args = new getClusterStatus_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public HiveClusterStatus getResult() throws HiveServerException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getClusterStatus(); + } + } + + public void getQueryPlan(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getQueryPlan_call method_call = new getQueryPlan_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getQueryPlan_call extends org.apache.thrift.async.TAsyncMethodCall { + public getQueryPlan_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getQueryPlan", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getQueryPlan_args args = new getQueryPlan_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public org.apache.hadoop.hive.ql.plan.api.QueryPlan getResult() throws HiveServerException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getQueryPlan(); + } + } + + public void clean(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + clean_call method_call = new clean_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class clean_call extends org.apache.thrift.async.TAsyncMethodCall { + public clean_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("clean", org.apache.thrift.protocol.TMessageType.CALL, 0)); + clean_args args = new clean_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_clean(); + } + } + + } + + public static class Processor extends org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Processor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("execute", new execute()); + processMap.put("fetchOne", new fetchOne()); + processMap.put("fetchN", new fetchN()); + processMap.put("fetchAll", new fetchAll()); + processMap.put("getSchema", new getSchema()); + processMap.put("getThriftSchema", new getThriftSchema()); + processMap.put("getClusterStatus", new getClusterStatus()); + processMap.put("getQueryPlan", new getQueryPlan()); + processMap.put("clean", new clean()); + return processMap; + } + + public static class execute extends org.apache.thrift.ProcessFunction { + public execute() { + super("execute"); + } + + public execute_args getEmptyArgsInstance() { + return new execute_args(); + } + + protected boolean isOneway() { + return false; + } + + public execute_result getResult(I iface, execute_args args) throws org.apache.thrift.TException { + execute_result result = new execute_result(); + try { + iface.execute(args.query); + } catch (HiveServerException ex) { + result.ex = ex; + } + return result; + } + } + + public static class fetchOne extends org.apache.thrift.ProcessFunction { + public fetchOne() { + super("fetchOne"); + } + + public fetchOne_args getEmptyArgsInstance() { + return new fetchOne_args(); + } + + protected boolean isOneway() { + return false; + } + + public fetchOne_result getResult(I iface, fetchOne_args args) throws org.apache.thrift.TException { + fetchOne_result result = new fetchOne_result(); + try { + result.success = iface.fetchOne(); + } catch (HiveServerException ex) { + result.ex = ex; + } + return result; + } + } + + public static class fetchN extends org.apache.thrift.ProcessFunction { + public fetchN() { + super("fetchN"); + } + + public fetchN_args getEmptyArgsInstance() { + return new fetchN_args(); + } + + protected boolean isOneway() { + return false; + } + + public fetchN_result getResult(I iface, fetchN_args args) throws org.apache.thrift.TException { + fetchN_result result = new fetchN_result(); + try { + result.success = iface.fetchN(args.numRows); + } catch (HiveServerException ex) { + result.ex = ex; + } + return result; + } + } + + public static class fetchAll extends org.apache.thrift.ProcessFunction { + public fetchAll() { + super("fetchAll"); + } + + public fetchAll_args getEmptyArgsInstance() { + return new fetchAll_args(); + } + + protected boolean isOneway() { + return false; + } + + public fetchAll_result getResult(I iface, fetchAll_args args) throws org.apache.thrift.TException { + fetchAll_result result = new fetchAll_result(); + try { + result.success = iface.fetchAll(); + } catch (HiveServerException ex) { + result.ex = ex; + } + return result; + } + } + + public static class getSchema extends org.apache.thrift.ProcessFunction { + public getSchema() { + super("getSchema"); + } + + public getSchema_args getEmptyArgsInstance() { + return new getSchema_args(); + } + + protected boolean isOneway() { + return false; + } + + public getSchema_result getResult(I iface, getSchema_args args) throws org.apache.thrift.TException { + getSchema_result result = new getSchema_result(); + try { + result.success = iface.getSchema(); + } catch (HiveServerException ex) { + result.ex = ex; + } + return result; + } + } + + public static class getThriftSchema extends org.apache.thrift.ProcessFunction { + public getThriftSchema() { + super("getThriftSchema"); + } + + public getThriftSchema_args getEmptyArgsInstance() { + return new getThriftSchema_args(); + } + + protected boolean isOneway() { + return false; + } + + public getThriftSchema_result getResult(I iface, getThriftSchema_args args) throws org.apache.thrift.TException { + getThriftSchema_result result = new getThriftSchema_result(); + try { + result.success = iface.getThriftSchema(); + } catch (HiveServerException ex) { + result.ex = ex; + } + return result; + } + } + + public static class getClusterStatus extends org.apache.thrift.ProcessFunction { + public getClusterStatus() { + super("getClusterStatus"); + } + + public getClusterStatus_args getEmptyArgsInstance() { + return new getClusterStatus_args(); + } + + protected boolean isOneway() { + return false; + } + + public getClusterStatus_result getResult(I iface, getClusterStatus_args args) throws org.apache.thrift.TException { + getClusterStatus_result result = new getClusterStatus_result(); + try { + result.success = iface.getClusterStatus(); + } catch (HiveServerException ex) { + result.ex = ex; + } + return result; + } + } + + public static class getQueryPlan extends org.apache.thrift.ProcessFunction { + public getQueryPlan() { + super("getQueryPlan"); + } + + public getQueryPlan_args getEmptyArgsInstance() { + return new getQueryPlan_args(); + } + + protected boolean isOneway() { + return false; + } + + public getQueryPlan_result getResult(I iface, getQueryPlan_args args) throws org.apache.thrift.TException { + getQueryPlan_result result = new getQueryPlan_result(); + try { + result.success = iface.getQueryPlan(); + } catch (HiveServerException ex) { + result.ex = ex; + } + return result; + } + } + + public static class clean extends org.apache.thrift.ProcessFunction { + public clean() { + super("clean"); + } + + public clean_args getEmptyArgsInstance() { + return new clean_args(); + } + + protected boolean isOneway() { + return false; + } + + public clean_result getResult(I iface, clean_args args) throws org.apache.thrift.TException { + clean_result result = new clean_result(); + iface.clean(); + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.AsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("execute", new execute()); + processMap.put("fetchOne", new fetchOne()); + processMap.put("fetchN", new fetchN()); + processMap.put("fetchAll", new fetchAll()); + processMap.put("getSchema", new getSchema()); + processMap.put("getThriftSchema", new getThriftSchema()); + processMap.put("getClusterStatus", new getClusterStatus()); + processMap.put("getQueryPlan", new getQueryPlan()); + processMap.put("clean", new clean()); + return processMap; + } + + public static class execute extends org.apache.thrift.AsyncProcessFunction { + public execute() { + super("execute"); + } + + public execute_args getEmptyArgsInstance() { + return new execute_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + execute_result result = new execute_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + execute_result result = new execute_result(); + if (e instanceof HiveServerException) { + result.ex = (HiveServerException) e; + result.setExIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, execute_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.execute(args.query,resultHandler); + } + } + + public static class fetchOne extends org.apache.thrift.AsyncProcessFunction { + public fetchOne() { + super("fetchOne"); + } + + public fetchOne_args getEmptyArgsInstance() { + return new fetchOne_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(String o) { + fetchOne_result result = new fetchOne_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + fetchOne_result result = new fetchOne_result(); + if (e instanceof HiveServerException) { + result.ex = (HiveServerException) e; + result.setExIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, fetchOne_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.fetchOne(resultHandler); + } + } + + public static class fetchN extends org.apache.thrift.AsyncProcessFunction> { + public fetchN() { + super("fetchN"); + } + + public fetchN_args getEmptyArgsInstance() { + return new fetchN_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + fetchN_result result = new fetchN_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + fetchN_result result = new fetchN_result(); + if (e instanceof HiveServerException) { + result.ex = (HiveServerException) e; + result.setExIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, fetchN_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.fetchN(args.numRows,resultHandler); + } + } + + public static class fetchAll extends org.apache.thrift.AsyncProcessFunction> { + public fetchAll() { + super("fetchAll"); + } + + public fetchAll_args getEmptyArgsInstance() { + return new fetchAll_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + fetchAll_result result = new fetchAll_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + fetchAll_result result = new fetchAll_result(); + if (e instanceof HiveServerException) { + result.ex = (HiveServerException) e; + result.setExIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, fetchAll_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.fetchAll(resultHandler); + } + } + + public static class getSchema extends org.apache.thrift.AsyncProcessFunction { + public getSchema() { + super("getSchema"); + } + + public getSchema_args getEmptyArgsInstance() { + return new getSchema_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(org.apache.hadoop.hive.metastore.api.Schema o) { + getSchema_result result = new getSchema_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getSchema_result result = new getSchema_result(); + if (e instanceof HiveServerException) { + result.ex = (HiveServerException) e; + result.setExIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getSchema_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getSchema(resultHandler); + } + } + + public static class getThriftSchema extends org.apache.thrift.AsyncProcessFunction { + public getThriftSchema() { + super("getThriftSchema"); + } + + public getThriftSchema_args getEmptyArgsInstance() { + return new getThriftSchema_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(org.apache.hadoop.hive.metastore.api.Schema o) { + getThriftSchema_result result = new getThriftSchema_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getThriftSchema_result result = new getThriftSchema_result(); + if (e instanceof HiveServerException) { + result.ex = (HiveServerException) e; + result.setExIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getThriftSchema_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getThriftSchema(resultHandler); + } + } + + public static class getClusterStatus extends org.apache.thrift.AsyncProcessFunction { + public getClusterStatus() { + super("getClusterStatus"); + } + + public getClusterStatus_args getEmptyArgsInstance() { + return new getClusterStatus_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(HiveClusterStatus o) { + getClusterStatus_result result = new getClusterStatus_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getClusterStatus_result result = new getClusterStatus_result(); + if (e instanceof HiveServerException) { + result.ex = (HiveServerException) e; + result.setExIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getClusterStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getClusterStatus(resultHandler); + } + } + + public static class getQueryPlan extends org.apache.thrift.AsyncProcessFunction { + public getQueryPlan() { + super("getQueryPlan"); + } + + public getQueryPlan_args getEmptyArgsInstance() { + return new getQueryPlan_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(org.apache.hadoop.hive.ql.plan.api.QueryPlan o) { + getQueryPlan_result result = new getQueryPlan_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getQueryPlan_result result = new getQueryPlan_result(); + if (e instanceof HiveServerException) { + result.ex = (HiveServerException) e; + result.setExIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getQueryPlan_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getQueryPlan(resultHandler); + } + } + + public static class clean extends org.apache.thrift.AsyncProcessFunction { + public clean() { + super("clean"); + } + + public clean_args getEmptyArgsInstance() { + return new clean_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + clean_result result = new clean_result(); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + clean_result result = new clean_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, clean_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.clean(resultHandler); + } + } + + } + + public static class execute_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_args"); + + private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("query", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_argsTupleSchemeFactory()); + } + + private String query; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + QUERY((short)1, "query"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // QUERY + return QUERY; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.QUERY, new org.apache.thrift.meta_data.FieldMetaData("query", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_args.class, metaDataMap); + } + + public execute_args() { + } + + public execute_args( + String query) + { + this(); + this.query = query; + } + + /** + * Performs a deep copy on other. + */ + public execute_args(execute_args other) { + if (other.isSetQuery()) { + this.query = other.query; + } + } + + public execute_args deepCopy() { + return new execute_args(this); + } + + @Override + public void clear() { + this.query = null; + } + + public String getQuery() { + return this.query; + } + + public void setQuery(String query) { + this.query = query; + } + + public void unsetQuery() { + this.query = null; + } + + /** Returns true if field query is set (has been assigned a value) and false otherwise */ + public boolean isSetQuery() { + return this.query != null; + } + + public void setQueryIsSet(boolean value) { + if (!value) { + this.query = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case QUERY: + if (value == null) { + unsetQuery(); + } else { + setQuery((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case QUERY: + return getQuery(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case QUERY: + return isSetQuery(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof execute_args) + return this.equals((execute_args)that); + return false; + } + + public boolean equals(execute_args that) { + if (that == null) + return false; + + boolean this_present_query = true && this.isSetQuery(); + boolean that_present_query = true && that.isSetQuery(); + if (this_present_query || that_present_query) { + if (!(this_present_query && that_present_query)) + return false; + if (!this.query.equals(that.query)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_query = true && (isSetQuery()); + list.add(present_query); + if (present_query) + list.add(query); + + return list.hashCode(); + } + + @Override + public int compareTo(execute_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetQuery()).compareTo(other.isSetQuery()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQuery()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query, other.query); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("execute_args("); + boolean first = true; + + sb.append("query:"); + if (this.query == null) { + sb.append("null"); + } else { + sb.append(this.query); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class execute_argsStandardSchemeFactory implements SchemeFactory { + public execute_argsStandardScheme getScheme() { + return new execute_argsStandardScheme(); + } + } + + private static class execute_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // QUERY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.query = iprot.readString(); + struct.setQueryIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.query != null) { + oprot.writeFieldBegin(QUERY_FIELD_DESC); + oprot.writeString(struct.query); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_argsTupleSchemeFactory implements SchemeFactory { + public execute_argsTupleScheme getScheme() { + return new execute_argsTupleScheme(); + } + } + + private static class execute_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetQuery()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetQuery()) { + oprot.writeString(struct.query); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.query = iprot.readString(); + struct.setQueryIsSet(true); + } + } + } + + } + + public static class execute_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_result"); + + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_resultTupleSchemeFactory()); + } + + private HiveServerException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + EX((short)1, "ex"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // EX + return EX; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_result.class, metaDataMap); + } + + public execute_result() { + } + + public execute_result( + HiveServerException ex) + { + this(); + this.ex = ex; + } + + /** + * Performs a deep copy on other. + */ + public execute_result(execute_result other) { + if (other.isSetEx()) { + this.ex = new HiveServerException(other.ex); + } + } + + public execute_result deepCopy() { + return new execute_result(this); + } + + @Override + public void clear() { + this.ex = null; + } + + public HiveServerException getEx() { + return this.ex; + } + + public void setEx(HiveServerException ex) { + this.ex = ex; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((HiveServerException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case EX: + return getEx(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof execute_result) + return this.equals((execute_result)that); + return false; + } + + public boolean equals(execute_result that) { + if (that == null) + return false; + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_ex = true && (isSetEx()); + list.add(present_ex); + if (present_ex) + list.add(ex); + + return list.hashCode(); + } + + @Override + public int compareTo(execute_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetEx()).compareTo(other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("execute_result("); + boolean first = true; + + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class execute_resultStandardSchemeFactory implements SchemeFactory { + public execute_resultStandardScheme getScheme() { + return new execute_resultStandardScheme(); + } + } + + private static class execute_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_resultTupleSchemeFactory implements SchemeFactory { + public execute_resultTupleScheme getScheme() { + return new execute_resultTupleScheme(); + } + } + + private static class execute_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetEx()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + + public static class fetchOne_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchOne_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new fetchOne_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new fetchOne_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchOne_args.class, metaDataMap); + } + + public fetchOne_args() { + } + + /** + * Performs a deep copy on other. + */ + public fetchOne_args(fetchOne_args other) { + } + + public fetchOne_args deepCopy() { + return new fetchOne_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof fetchOne_args) + return this.equals((fetchOne_args)that); + return false; + } + + public boolean equals(fetchOne_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(fetchOne_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("fetchOne_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class fetchOne_argsStandardSchemeFactory implements SchemeFactory { + public fetchOne_argsStandardScheme getScheme() { + return new fetchOne_argsStandardScheme(); + } + } + + private static class fetchOne_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, fetchOne_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, fetchOne_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class fetchOne_argsTupleSchemeFactory implements SchemeFactory { + public fetchOne_argsTupleScheme getScheme() { + return new fetchOne_argsTupleScheme(); + } + } + + private static class fetchOne_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, fetchOne_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, fetchOne_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class fetchOne_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchOne_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new fetchOne_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new fetchOne_resultTupleSchemeFactory()); + } + + private String success; // required + private HiveServerException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + EX((short)1, "ex"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // EX + return EX; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchOne_result.class, metaDataMap); + } + + public fetchOne_result() { + } + + public fetchOne_result( + String success, + HiveServerException ex) + { + this(); + this.success = success; + this.ex = ex; + } + + /** + * Performs a deep copy on other. + */ + public fetchOne_result(fetchOne_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + if (other.isSetEx()) { + this.ex = new HiveServerException(other.ex); + } + } + + public fetchOne_result deepCopy() { + return new fetchOne_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + } + + public String getSuccess() { + return this.success; + } + + public void setSuccess(String success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public HiveServerException getEx() { + return this.ex; + } + + public void setEx(HiveServerException ex) { + this.ex = ex; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((String)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((HiveServerException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof fetchOne_result) + return this.equals((fetchOne_result)that); + return false; + } + + public boolean equals(fetchOne_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_ex = true && (isSetEx()); + list.add(present_ex); + if (present_ex) + list.add(ex); + + return list.hashCode(); + } + + @Override + public int compareTo(fetchOne_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEx()).compareTo(other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("fetchOne_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class fetchOne_resultStandardSchemeFactory implements SchemeFactory { + public fetchOne_resultStandardScheme getScheme() { + return new fetchOne_resultStandardScheme(); + } + } + + private static class fetchOne_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, fetchOne_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, fetchOne_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class fetchOne_resultTupleSchemeFactory implements SchemeFactory { + public fetchOne_resultTupleScheme getScheme() { + return new fetchOne_resultTupleScheme(); + } + } + + private static class fetchOne_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, fetchOne_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEx()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, fetchOne_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + + public static class fetchN_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchN_args"); + + private static final org.apache.thrift.protocol.TField NUM_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("numRows", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new fetchN_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new fetchN_argsTupleSchemeFactory()); + } + + private int numRows; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NUM_ROWS((short)1, "numRows"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NUM_ROWS + return NUM_ROWS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __NUMROWS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NUM_ROWS, new org.apache.thrift.meta_data.FieldMetaData("numRows", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchN_args.class, metaDataMap); + } + + public fetchN_args() { + } + + public fetchN_args( + int numRows) + { + this(); + this.numRows = numRows; + setNumRowsIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public fetchN_args(fetchN_args other) { + __isset_bitfield = other.__isset_bitfield; + this.numRows = other.numRows; + } + + public fetchN_args deepCopy() { + return new fetchN_args(this); + } + + @Override + public void clear() { + setNumRowsIsSet(false); + this.numRows = 0; + } + + public int getNumRows() { + return this.numRows; + } + + public void setNumRows(int numRows) { + this.numRows = numRows; + setNumRowsIsSet(true); + } + + public void unsetNumRows() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMROWS_ISSET_ID); + } + + /** Returns true if field numRows is set (has been assigned a value) and false otherwise */ + public boolean isSetNumRows() { + return EncodingUtils.testBit(__isset_bitfield, __NUMROWS_ISSET_ID); + } + + public void setNumRowsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMROWS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NUM_ROWS: + if (value == null) { + unsetNumRows(); + } else { + setNumRows((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NUM_ROWS: + return getNumRows(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case NUM_ROWS: + return isSetNumRows(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof fetchN_args) + return this.equals((fetchN_args)that); + return false; + } + + public boolean equals(fetchN_args that) { + if (that == null) + return false; + + boolean this_present_numRows = true; + boolean that_present_numRows = true; + if (this_present_numRows || that_present_numRows) { + if (!(this_present_numRows && that_present_numRows)) + return false; + if (this.numRows != that.numRows) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_numRows = true; + list.add(present_numRows); + if (present_numRows) + list.add(numRows); + + return list.hashCode(); + } + + @Override + public int compareTo(fetchN_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetNumRows()).compareTo(other.isSetNumRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNumRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numRows, other.numRows); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("fetchN_args("); + boolean first = true; + + sb.append("numRows:"); + sb.append(this.numRows); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class fetchN_argsStandardSchemeFactory implements SchemeFactory { + public fetchN_argsStandardScheme getScheme() { + return new fetchN_argsStandardScheme(); + } + } + + private static class fetchN_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, fetchN_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NUM_ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.numRows = iprot.readI32(); + struct.setNumRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, fetchN_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(NUM_ROWS_FIELD_DESC); + oprot.writeI32(struct.numRows); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class fetchN_argsTupleSchemeFactory implements SchemeFactory { + public fetchN_argsTupleScheme getScheme() { + return new fetchN_argsTupleScheme(); + } + } + + private static class fetchN_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, fetchN_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetNumRows()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetNumRows()) { + oprot.writeI32(struct.numRows); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, fetchN_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.numRows = iprot.readI32(); + struct.setNumRowsIsSet(true); + } + } + } + + } + + public static class fetchN_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchN_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new fetchN_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new fetchN_resultTupleSchemeFactory()); + } + + private List success; // required + private HiveServerException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + EX((short)1, "ex"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // EX + return EX; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchN_result.class, metaDataMap); + } + + public fetchN_result() { + } + + public fetchN_result( + List success, + HiveServerException ex) + { + this(); + this.success = success; + this.ex = ex; + } + + /** + * Performs a deep copy on other. + */ + public fetchN_result(fetchN_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success); + this.success = __this__success; + } + if (other.isSetEx()) { + this.ex = new HiveServerException(other.ex); + } + } + + public fetchN_result deepCopy() { + return new fetchN_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public HiveServerException getEx() { + return this.ex; + } + + public void setEx(HiveServerException ex) { + this.ex = ex; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((HiveServerException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof fetchN_result) + return this.equals((fetchN_result)that); + return false; + } + + public boolean equals(fetchN_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_ex = true && (isSetEx()); + list.add(present_ex); + if (present_ex) + list.add(ex); + + return list.hashCode(); + } + + @Override + public int compareTo(fetchN_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEx()).compareTo(other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("fetchN_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class fetchN_resultStandardSchemeFactory implements SchemeFactory { + public fetchN_resultStandardScheme getScheme() { + return new fetchN_resultStandardScheme(); + } + } + + private static class fetchN_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, fetchN_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.success = new ArrayList(_list0.size); + String _elem1; + for (int _i2 = 0; _i2 < _list0.size; ++_i2) + { + _elem1 = iprot.readString(); + struct.success.add(_elem1); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, fetchN_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (String _iter3 : struct.success) + { + oprot.writeString(_iter3); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class fetchN_resultTupleSchemeFactory implements SchemeFactory { + public fetchN_resultTupleScheme getScheme() { + return new fetchN_resultTupleScheme(); + } + } + + private static class fetchN_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, fetchN_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEx()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (String _iter4 : struct.success) + { + oprot.writeString(_iter4); + } + } + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, fetchN_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list5.size); + String _elem6; + for (int _i7 = 0; _i7 < _list5.size; ++_i7) + { + _elem6 = iprot.readString(); + struct.success.add(_elem6); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + + public static class fetchAll_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchAll_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new fetchAll_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new fetchAll_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchAll_args.class, metaDataMap); + } + + public fetchAll_args() { + } + + /** + * Performs a deep copy on other. + */ + public fetchAll_args(fetchAll_args other) { + } + + public fetchAll_args deepCopy() { + return new fetchAll_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof fetchAll_args) + return this.equals((fetchAll_args)that); + return false; + } + + public boolean equals(fetchAll_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(fetchAll_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("fetchAll_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class fetchAll_argsStandardSchemeFactory implements SchemeFactory { + public fetchAll_argsStandardScheme getScheme() { + return new fetchAll_argsStandardScheme(); + } + } + + private static class fetchAll_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, fetchAll_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, fetchAll_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class fetchAll_argsTupleSchemeFactory implements SchemeFactory { + public fetchAll_argsTupleScheme getScheme() { + return new fetchAll_argsTupleScheme(); + } + } + + private static class fetchAll_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, fetchAll_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, fetchAll_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class fetchAll_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchAll_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new fetchAll_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new fetchAll_resultTupleSchemeFactory()); + } + + private List success; // required + private HiveServerException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + EX((short)1, "ex"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // EX + return EX; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchAll_result.class, metaDataMap); + } + + public fetchAll_result() { + } + + public fetchAll_result( + List success, + HiveServerException ex) + { + this(); + this.success = success; + this.ex = ex; + } + + /** + * Performs a deep copy on other. + */ + public fetchAll_result(fetchAll_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success); + this.success = __this__success; + } + if (other.isSetEx()) { + this.ex = new HiveServerException(other.ex); + } + } + + public fetchAll_result deepCopy() { + return new fetchAll_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public HiveServerException getEx() { + return this.ex; + } + + public void setEx(HiveServerException ex) { + this.ex = ex; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((HiveServerException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof fetchAll_result) + return this.equals((fetchAll_result)that); + return false; + } + + public boolean equals(fetchAll_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_ex = true && (isSetEx()); + list.add(present_ex); + if (present_ex) + list.add(ex); + + return list.hashCode(); + } + + @Override + public int compareTo(fetchAll_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEx()).compareTo(other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("fetchAll_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class fetchAll_resultStandardSchemeFactory implements SchemeFactory { + public fetchAll_resultStandardScheme getScheme() { + return new fetchAll_resultStandardScheme(); + } + } + + private static class fetchAll_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, fetchAll_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); + struct.success = new ArrayList(_list8.size); + String _elem9; + for (int _i10 = 0; _i10 < _list8.size; ++_i10) + { + _elem9 = iprot.readString(); + struct.success.add(_elem9); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, fetchAll_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (String _iter11 : struct.success) + { + oprot.writeString(_iter11); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class fetchAll_resultTupleSchemeFactory implements SchemeFactory { + public fetchAll_resultTupleScheme getScheme() { + return new fetchAll_resultTupleScheme(); + } + } + + private static class fetchAll_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, fetchAll_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEx()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (String _iter12 : struct.success) + { + oprot.writeString(_iter12); + } + } + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, fetchAll_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list13.size); + String _elem14; + for (int _i15 = 0; _i15 < _list13.size; ++_i15) + { + _elem14 = iprot.readString(); + struct.success.add(_elem14); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + + public static class getSchema_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSchema_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getSchema_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getSchema_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSchema_args.class, metaDataMap); + } + + public getSchema_args() { + } + + /** + * Performs a deep copy on other. + */ + public getSchema_args(getSchema_args other) { + } + + public getSchema_args deepCopy() { + return new getSchema_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getSchema_args) + return this.equals((getSchema_args)that); + return false; + } + + public boolean equals(getSchema_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(getSchema_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getSchema_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getSchema_argsStandardSchemeFactory implements SchemeFactory { + public getSchema_argsStandardScheme getScheme() { + return new getSchema_argsStandardScheme(); + } + } + + private static class getSchema_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getSchema_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getSchema_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getSchema_argsTupleSchemeFactory implements SchemeFactory { + public getSchema_argsTupleScheme getScheme() { + return new getSchema_argsTupleScheme(); + } + } + + private static class getSchema_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getSchema_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getSchema_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getSchema_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSchema_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getSchema_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getSchema_resultTupleSchemeFactory()); + } + + private org.apache.hadoop.hive.metastore.api.Schema success; // required + private HiveServerException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + EX((short)1, "ex"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // EX + return EX; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.hadoop.hive.metastore.api.Schema.class))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSchema_result.class, metaDataMap); + } + + public getSchema_result() { + } + + public getSchema_result( + org.apache.hadoop.hive.metastore.api.Schema success, + HiveServerException ex) + { + this(); + this.success = success; + this.ex = ex; + } + + /** + * Performs a deep copy on other. + */ + public getSchema_result(getSchema_result other) { + if (other.isSetSuccess()) { + this.success = new org.apache.hadoop.hive.metastore.api.Schema(other.success); + } + if (other.isSetEx()) { + this.ex = new HiveServerException(other.ex); + } + } + + public getSchema_result deepCopy() { + return new getSchema_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + } + + public org.apache.hadoop.hive.metastore.api.Schema getSuccess() { + return this.success; + } + + public void setSuccess(org.apache.hadoop.hive.metastore.api.Schema success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public HiveServerException getEx() { + return this.ex; + } + + public void setEx(HiveServerException ex) { + this.ex = ex; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((org.apache.hadoop.hive.metastore.api.Schema)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((HiveServerException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getSchema_result) + return this.equals((getSchema_result)that); + return false; + } + + public boolean equals(getSchema_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_ex = true && (isSetEx()); + list.add(present_ex); + if (present_ex) + list.add(ex); + + return list.hashCode(); + } + + @Override + public int compareTo(getSchema_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEx()).compareTo(other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getSchema_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getSchema_resultStandardSchemeFactory implements SchemeFactory { + public getSchema_resultStandardScheme getScheme() { + return new getSchema_resultStandardScheme(); + } + } + + private static class getSchema_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getSchema_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new org.apache.hadoop.hive.metastore.api.Schema(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getSchema_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getSchema_resultTupleSchemeFactory implements SchemeFactory { + public getSchema_resultTupleScheme getScheme() { + return new getSchema_resultTupleScheme(); + } + } + + private static class getSchema_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getSchema_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEx()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getSchema_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new org.apache.hadoop.hive.metastore.api.Schema(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + + public static class getThriftSchema_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftSchema_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getThriftSchema_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getThriftSchema_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftSchema_args.class, metaDataMap); + } + + public getThriftSchema_args() { + } + + /** + * Performs a deep copy on other. + */ + public getThriftSchema_args(getThriftSchema_args other) { + } + + public getThriftSchema_args deepCopy() { + return new getThriftSchema_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getThriftSchema_args) + return this.equals((getThriftSchema_args)that); + return false; + } + + public boolean equals(getThriftSchema_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(getThriftSchema_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getThriftSchema_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getThriftSchema_argsStandardSchemeFactory implements SchemeFactory { + public getThriftSchema_argsStandardScheme getScheme() { + return new getThriftSchema_argsStandardScheme(); + } + } + + private static class getThriftSchema_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftSchema_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftSchema_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getThriftSchema_argsTupleSchemeFactory implements SchemeFactory { + public getThriftSchema_argsTupleScheme getScheme() { + return new getThriftSchema_argsTupleScheme(); + } + } + + private static class getThriftSchema_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getThriftSchema_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getThriftSchema_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getThriftSchema_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftSchema_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getThriftSchema_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getThriftSchema_resultTupleSchemeFactory()); + } + + private org.apache.hadoop.hive.metastore.api.Schema success; // required + private HiveServerException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + EX((short)1, "ex"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // EX + return EX; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.hadoop.hive.metastore.api.Schema.class))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftSchema_result.class, metaDataMap); + } + + public getThriftSchema_result() { + } + + public getThriftSchema_result( + org.apache.hadoop.hive.metastore.api.Schema success, + HiveServerException ex) + { + this(); + this.success = success; + this.ex = ex; + } + + /** + * Performs a deep copy on other. + */ + public getThriftSchema_result(getThriftSchema_result other) { + if (other.isSetSuccess()) { + this.success = new org.apache.hadoop.hive.metastore.api.Schema(other.success); + } + if (other.isSetEx()) { + this.ex = new HiveServerException(other.ex); + } + } + + public getThriftSchema_result deepCopy() { + return new getThriftSchema_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + } + + public org.apache.hadoop.hive.metastore.api.Schema getSuccess() { + return this.success; + } + + public void setSuccess(org.apache.hadoop.hive.metastore.api.Schema success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public HiveServerException getEx() { + return this.ex; + } + + public void setEx(HiveServerException ex) { + this.ex = ex; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((org.apache.hadoop.hive.metastore.api.Schema)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((HiveServerException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getThriftSchema_result) + return this.equals((getThriftSchema_result)that); + return false; + } + + public boolean equals(getThriftSchema_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_ex = true && (isSetEx()); + list.add(present_ex); + if (present_ex) + list.add(ex); + + return list.hashCode(); + } + + @Override + public int compareTo(getThriftSchema_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEx()).compareTo(other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getThriftSchema_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getThriftSchema_resultStandardSchemeFactory implements SchemeFactory { + public getThriftSchema_resultStandardScheme getScheme() { + return new getThriftSchema_resultStandardScheme(); + } + } + + private static class getThriftSchema_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftSchema_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new org.apache.hadoop.hive.metastore.api.Schema(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftSchema_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getThriftSchema_resultTupleSchemeFactory implements SchemeFactory { + public getThriftSchema_resultTupleScheme getScheme() { + return new getThriftSchema_resultTupleScheme(); + } + } + + private static class getThriftSchema_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getThriftSchema_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEx()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getThriftSchema_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new org.apache.hadoop.hive.metastore.api.Schema(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + + public static class getClusterStatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClusterStatus_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getClusterStatus_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getClusterStatus_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClusterStatus_args.class, metaDataMap); + } + + public getClusterStatus_args() { + } + + /** + * Performs a deep copy on other. + */ + public getClusterStatus_args(getClusterStatus_args other) { + } + + public getClusterStatus_args deepCopy() { + return new getClusterStatus_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getClusterStatus_args) + return this.equals((getClusterStatus_args)that); + return false; + } + + public boolean equals(getClusterStatus_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(getClusterStatus_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getClusterStatus_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getClusterStatus_argsStandardSchemeFactory implements SchemeFactory { + public getClusterStatus_argsStandardScheme getScheme() { + return new getClusterStatus_argsStandardScheme(); + } + } + + private static class getClusterStatus_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getClusterStatus_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getClusterStatus_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getClusterStatus_argsTupleSchemeFactory implements SchemeFactory { + public getClusterStatus_argsTupleScheme getScheme() { + return new getClusterStatus_argsTupleScheme(); + } + } + + private static class getClusterStatus_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getClusterStatus_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getClusterStatus_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getClusterStatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClusterStatus_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getClusterStatus_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getClusterStatus_resultTupleSchemeFactory()); + } + + private HiveClusterStatus success; // required + private HiveServerException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + EX((short)1, "ex"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // EX + return EX; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HiveClusterStatus.class))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClusterStatus_result.class, metaDataMap); + } + + public getClusterStatus_result() { + } + + public getClusterStatus_result( + HiveClusterStatus success, + HiveServerException ex) + { + this(); + this.success = success; + this.ex = ex; + } + + /** + * Performs a deep copy on other. + */ + public getClusterStatus_result(getClusterStatus_result other) { + if (other.isSetSuccess()) { + this.success = new HiveClusterStatus(other.success); + } + if (other.isSetEx()) { + this.ex = new HiveServerException(other.ex); + } + } + + public getClusterStatus_result deepCopy() { + return new getClusterStatus_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + } + + public HiveClusterStatus getSuccess() { + return this.success; + } + + public void setSuccess(HiveClusterStatus success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public HiveServerException getEx() { + return this.ex; + } + + public void setEx(HiveServerException ex) { + this.ex = ex; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((HiveClusterStatus)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((HiveServerException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getClusterStatus_result) + return this.equals((getClusterStatus_result)that); + return false; + } + + public boolean equals(getClusterStatus_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_ex = true && (isSetEx()); + list.add(present_ex); + if (present_ex) + list.add(ex); + + return list.hashCode(); + } + + @Override + public int compareTo(getClusterStatus_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEx()).compareTo(other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getClusterStatus_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getClusterStatus_resultStandardSchemeFactory implements SchemeFactory { + public getClusterStatus_resultStandardScheme getScheme() { + return new getClusterStatus_resultStandardScheme(); + } + } + + private static class getClusterStatus_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getClusterStatus_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new HiveClusterStatus(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getClusterStatus_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getClusterStatus_resultTupleSchemeFactory implements SchemeFactory { + public getClusterStatus_resultTupleScheme getScheme() { + return new getClusterStatus_resultTupleScheme(); + } + } + + private static class getClusterStatus_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getClusterStatus_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEx()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getClusterStatus_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new HiveClusterStatus(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + + public static class getQueryPlan_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getQueryPlan_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getQueryPlan_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getQueryPlan_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getQueryPlan_args.class, metaDataMap); + } + + public getQueryPlan_args() { + } + + /** + * Performs a deep copy on other. + */ + public getQueryPlan_args(getQueryPlan_args other) { + } + + public getQueryPlan_args deepCopy() { + return new getQueryPlan_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getQueryPlan_args) + return this.equals((getQueryPlan_args)that); + return false; + } + + public boolean equals(getQueryPlan_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(getQueryPlan_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getQueryPlan_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getQueryPlan_argsStandardSchemeFactory implements SchemeFactory { + public getQueryPlan_argsStandardScheme getScheme() { + return new getQueryPlan_argsStandardScheme(); + } + } + + private static class getQueryPlan_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getQueryPlan_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getQueryPlan_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getQueryPlan_argsTupleSchemeFactory implements SchemeFactory { + public getQueryPlan_argsTupleScheme getScheme() { + return new getQueryPlan_argsTupleScheme(); + } + } + + private static class getQueryPlan_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getQueryPlan_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getQueryPlan_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getQueryPlan_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getQueryPlan_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getQueryPlan_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getQueryPlan_resultTupleSchemeFactory()); + } + + private org.apache.hadoop.hive.ql.plan.api.QueryPlan success; // required + private HiveServerException ex; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + EX((short)1, "ex"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // EX + return EX; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.hadoop.hive.ql.plan.api.QueryPlan.class))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getQueryPlan_result.class, metaDataMap); + } + + public getQueryPlan_result() { + } + + public getQueryPlan_result( + org.apache.hadoop.hive.ql.plan.api.QueryPlan success, + HiveServerException ex) + { + this(); + this.success = success; + this.ex = ex; + } + + /** + * Performs a deep copy on other. + */ + public getQueryPlan_result(getQueryPlan_result other) { + if (other.isSetSuccess()) { + this.success = new org.apache.hadoop.hive.ql.plan.api.QueryPlan(other.success); + } + if (other.isSetEx()) { + this.ex = new HiveServerException(other.ex); + } + } + + public getQueryPlan_result deepCopy() { + return new getQueryPlan_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + } + + public org.apache.hadoop.hive.ql.plan.api.QueryPlan getSuccess() { + return this.success; + } + + public void setSuccess(org.apache.hadoop.hive.ql.plan.api.QueryPlan success) { + this.success = success; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public HiveServerException getEx() { + return this.ex; + } + + public void setEx(HiveServerException ex) { + this.ex = ex; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((org.apache.hadoop.hive.ql.plan.api.QueryPlan)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((HiveServerException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case EX: + return isSetEx(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getQueryPlan_result) + return this.equals((getQueryPlan_result)that); + return false; + } + + public boolean equals(getQueryPlan_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_ex = true && (isSetEx()); + list.add(present_ex); + if (present_ex) + list.add(ex); + + return list.hashCode(); + } + + @Override + public int compareTo(getQueryPlan_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEx()).compareTo(other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getQueryPlan_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getQueryPlan_resultStandardSchemeFactory implements SchemeFactory { + public getQueryPlan_resultStandardScheme getScheme() { + return new getQueryPlan_resultStandardScheme(); + } + } + + private static class getQueryPlan_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getQueryPlan_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new org.apache.hadoop.hive.ql.plan.api.QueryPlan(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getQueryPlan_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getQueryPlan_resultTupleSchemeFactory implements SchemeFactory { + public getQueryPlan_resultTupleScheme getScheme() { + return new getQueryPlan_resultTupleScheme(); + } + } + + private static class getQueryPlan_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getQueryPlan_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEx()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getQueryPlan_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new org.apache.hadoop.hive.ql.plan.api.QueryPlan(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new HiveServerException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + } + } + + } + + public static class clean_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("clean_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new clean_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new clean_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(clean_args.class, metaDataMap); + } + + public clean_args() { + } + + /** + * Performs a deep copy on other. + */ + public clean_args(clean_args other) { + } + + public clean_args deepCopy() { + return new clean_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof clean_args) + return this.equals((clean_args)that); + return false; + } + + public boolean equals(clean_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(clean_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("clean_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class clean_argsStandardSchemeFactory implements SchemeFactory { + public clean_argsStandardScheme getScheme() { + return new clean_argsStandardScheme(); + } + } + + private static class clean_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, clean_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, clean_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class clean_argsTupleSchemeFactory implements SchemeFactory { + public clean_argsTupleScheme getScheme() { + return new clean_argsTupleScheme(); + } + } + + private static class clean_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, clean_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, clean_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class clean_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("clean_result"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new clean_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new clean_resultTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(clean_result.class, metaDataMap); + } + + public clean_result() { + } + + /** + * Performs a deep copy on other. + */ + public clean_result(clean_result other) { + } + + public clean_result deepCopy() { + return new clean_result(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof clean_result) + return this.equals((clean_result)that); + return false; + } + + public boolean equals(clean_result that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(clean_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("clean_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class clean_resultStandardSchemeFactory implements SchemeFactory { + public clean_resultStandardScheme getScheme() { + return new clean_resultStandardScheme(); + } + } + + private static class clean_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, clean_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, clean_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class clean_resultTupleSchemeFactory implements SchemeFactory { + public clean_resultTupleScheme getScheme() { + return new clean_resultTupleScheme(); + } + } + + private static class clean_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, clean_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, clean_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + +} diff --git a/service/src/gen/thrift/gen-php/ThriftHive.php b/service/src/gen/thrift/gen-php/ThriftHive.php new file mode 100644 index 0000000000000000000000000000000000000000..23dc8fd4365aa17dad70e8949502db48c7ed0bad --- /dev/null +++ b/service/src/gen/thrift/gen-php/ThriftHive.php @@ -0,0 +1,1943 @@ +send_execute($query); + $this->recv_execute(); + } + + public function send_execute($query) + { + $args = new \ThriftHive_execute_args(); + $args->query = $query; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'execute', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('execute', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_execute() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\ThriftHive_execute_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \ThriftHive_execute_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->ex !== null) { + throw $result->ex; + } + return; + } + + public function fetchOne() + { + $this->send_fetchOne(); + return $this->recv_fetchOne(); + } + + public function send_fetchOne() + { + $args = new \ThriftHive_fetchOne_args(); + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'fetchOne', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('fetchOne', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_fetchOne() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\ThriftHive_fetchOne_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \ThriftHive_fetchOne_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->ex !== null) { + throw $result->ex; + } + throw new \Exception("fetchOne failed: unknown result"); + } + + public function fetchN($numRows) + { + $this->send_fetchN($numRows); + return $this->recv_fetchN(); + } + + public function send_fetchN($numRows) + { + $args = new \ThriftHive_fetchN_args(); + $args->numRows = $numRows; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'fetchN', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('fetchN', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_fetchN() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\ThriftHive_fetchN_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \ThriftHive_fetchN_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->ex !== null) { + throw $result->ex; + } + throw new \Exception("fetchN failed: unknown result"); + } + + public function fetchAll() + { + $this->send_fetchAll(); + return $this->recv_fetchAll(); + } + + public function send_fetchAll() + { + $args = new \ThriftHive_fetchAll_args(); + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'fetchAll', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('fetchAll', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_fetchAll() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\ThriftHive_fetchAll_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \ThriftHive_fetchAll_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->ex !== null) { + throw $result->ex; + } + throw new \Exception("fetchAll failed: unknown result"); + } + + public function getSchema() + { + $this->send_getSchema(); + return $this->recv_getSchema(); + } + + public function send_getSchema() + { + $args = new \ThriftHive_getSchema_args(); + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'getSchema', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('getSchema', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_getSchema() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\ThriftHive_getSchema_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \ThriftHive_getSchema_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->ex !== null) { + throw $result->ex; + } + throw new \Exception("getSchema failed: unknown result"); + } + + public function getThriftSchema() + { + $this->send_getThriftSchema(); + return $this->recv_getThriftSchema(); + } + + public function send_getThriftSchema() + { + $args = new \ThriftHive_getThriftSchema_args(); + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'getThriftSchema', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('getThriftSchema', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_getThriftSchema() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\ThriftHive_getThriftSchema_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \ThriftHive_getThriftSchema_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->ex !== null) { + throw $result->ex; + } + throw new \Exception("getThriftSchema failed: unknown result"); + } + + public function getClusterStatus() + { + $this->send_getClusterStatus(); + return $this->recv_getClusterStatus(); + } + + public function send_getClusterStatus() + { + $args = new \ThriftHive_getClusterStatus_args(); + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'getClusterStatus', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('getClusterStatus', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_getClusterStatus() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\ThriftHive_getClusterStatus_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \ThriftHive_getClusterStatus_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->ex !== null) { + throw $result->ex; + } + throw new \Exception("getClusterStatus failed: unknown result"); + } + + public function getQueryPlan() + { + $this->send_getQueryPlan(); + return $this->recv_getQueryPlan(); + } + + public function send_getQueryPlan() + { + $args = new \ThriftHive_getQueryPlan_args(); + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'getQueryPlan', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('getQueryPlan', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_getQueryPlan() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\ThriftHive_getQueryPlan_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \ThriftHive_getQueryPlan_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->ex !== null) { + throw $result->ex; + } + throw new \Exception("getQueryPlan failed: unknown result"); + } + + public function clean() + { + $this->send_clean(); + $this->recv_clean(); + } + + public function send_clean() + { + $args = new \ThriftHive_clean_args(); + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'clean', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('clean', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_clean() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\ThriftHive_clean_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \ThriftHive_clean_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + return; + } + +} + +// HELPER FUNCTIONS AND STRUCTURES + +class ThriftHive_execute_args { + static $_TSPEC; + + /** + * @var string + */ + public $query = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'query', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['query'])) { + $this->query = $vals['query']; + } + } + } + + public function getName() { + return 'ThriftHive_execute_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->query); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_execute_args'); + if ($this->query !== null) { + $xfer += $output->writeFieldBegin('query', TType::STRING, 1); + $xfer += $output->writeString($this->query); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_execute_result { + static $_TSPEC; + + /** + * @var \HiveServerException + */ + public $ex = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'ex', + 'type' => TType::STRUCT, + 'class' => '\HiveServerException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['ex'])) { + $this->ex = $vals['ex']; + } + } + } + + public function getName() { + return 'ThriftHive_execute_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRUCT) { + $this->ex = new \HiveServerException(); + $xfer += $this->ex->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_execute_result'); + if ($this->ex !== null) { + $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1); + $xfer += $this->ex->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_fetchOne_args { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHive_fetchOne_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_fetchOne_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_fetchOne_result { + static $_TSPEC; + + /** + * @var string + */ + public $success = null; + /** + * @var \HiveServerException + */ + public $ex = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRING, + ), + 1 => array( + 'var' => 'ex', + 'type' => TType::STRUCT, + 'class' => '\HiveServerException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ex'])) { + $this->ex = $vals['ex']; + } + } + } + + public function getName() { + return 'ThriftHive_fetchOne_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->ex = new \HiveServerException(); + $xfer += $this->ex->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_fetchOne_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::STRING, 0); + $xfer += $output->writeString($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->ex !== null) { + $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1); + $xfer += $this->ex->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_fetchN_args { + static $_TSPEC; + + /** + * @var int + */ + public $numRows = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'numRows', + 'type' => TType::I32, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['numRows'])) { + $this->numRows = $vals['numRows']; + } + } + } + + public function getName() { + return 'ThriftHive_fetchN_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->numRows); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_fetchN_args'); + if ($this->numRows !== null) { + $xfer += $output->writeFieldBegin('numRows', TType::I32, 1); + $xfer += $output->writeI32($this->numRows); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_fetchN_result { + static $_TSPEC; + + /** + * @var string[] + */ + public $success = null; + /** + * @var \HiveServerException + */ + public $ex = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'ex', + 'type' => TType::STRUCT, + 'class' => '\HiveServerException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ex'])) { + $this->ex = $vals['ex']; + } + } + } + + public function getName() { + return 'ThriftHive_fetchN_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size0 = 0; + $_etype3 = 0; + $xfer += $input->readListBegin($_etype3, $_size0); + for ($_i4 = 0; $_i4 < $_size0; ++$_i4) + { + $elem5 = null; + $xfer += $input->readString($elem5); + $this->success []= $elem5; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->ex = new \HiveServerException(); + $xfer += $this->ex->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_fetchN_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter6) + { + $xfer += $output->writeString($iter6); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->ex !== null) { + $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1); + $xfer += $this->ex->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_fetchAll_args { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHive_fetchAll_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_fetchAll_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_fetchAll_result { + static $_TSPEC; + + /** + * @var string[] + */ + public $success = null; + /** + * @var \HiveServerException + */ + public $ex = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 1 => array( + 'var' => 'ex', + 'type' => TType::STRUCT, + 'class' => '\HiveServerException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ex'])) { + $this->ex = $vals['ex']; + } + } + } + + public function getName() { + return 'ThriftHive_fetchAll_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size7 = 0; + $_etype10 = 0; + $xfer += $input->readListBegin($_etype10, $_size7); + for ($_i11 = 0; $_i11 < $_size7; ++$_i11) + { + $elem12 = null; + $xfer += $input->readString($elem12); + $this->success []= $elem12; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->ex = new \HiveServerException(); + $xfer += $this->ex->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_fetchAll_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRING, count($this->success)); + { + foreach ($this->success as $iter13) + { + $xfer += $output->writeString($iter13); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->ex !== null) { + $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1); + $xfer += $this->ex->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_getSchema_args { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHive_getSchema_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_getSchema_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_getSchema_result { + static $_TSPEC; + + /** + * @var \metastore\Schema + */ + public $success = null; + /** + * @var \HiveServerException + */ + public $ex = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => '\metastore\Schema', + ), + 1 => array( + 'var' => 'ex', + 'type' => TType::STRUCT, + 'class' => '\HiveServerException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ex'])) { + $this->ex = $vals['ex']; + } + } + } + + public function getName() { + return 'ThriftHive_getSchema_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new \metastore\Schema(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->ex = new \HiveServerException(); + $xfer += $this->ex->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_getSchema_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ex !== null) { + $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1); + $xfer += $this->ex->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_getThriftSchema_args { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHive_getThriftSchema_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_getThriftSchema_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_getThriftSchema_result { + static $_TSPEC; + + /** + * @var \metastore\Schema + */ + public $success = null; + /** + * @var \HiveServerException + */ + public $ex = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => '\metastore\Schema', + ), + 1 => array( + 'var' => 'ex', + 'type' => TType::STRUCT, + 'class' => '\HiveServerException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ex'])) { + $this->ex = $vals['ex']; + } + } + } + + public function getName() { + return 'ThriftHive_getThriftSchema_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new \metastore\Schema(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->ex = new \HiveServerException(); + $xfer += $this->ex->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_getThriftSchema_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ex !== null) { + $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1); + $xfer += $this->ex->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_getClusterStatus_args { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHive_getClusterStatus_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_getClusterStatus_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_getClusterStatus_result { + static $_TSPEC; + + /** + * @var \HiveClusterStatus + */ + public $success = null; + /** + * @var \HiveServerException + */ + public $ex = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => '\HiveClusterStatus', + ), + 1 => array( + 'var' => 'ex', + 'type' => TType::STRUCT, + 'class' => '\HiveServerException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ex'])) { + $this->ex = $vals['ex']; + } + } + } + + public function getName() { + return 'ThriftHive_getClusterStatus_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new \HiveClusterStatus(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->ex = new \HiveServerException(); + $xfer += $this->ex->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_getClusterStatus_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ex !== null) { + $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1); + $xfer += $this->ex->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_getQueryPlan_args { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHive_getQueryPlan_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_getQueryPlan_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_getQueryPlan_result { + static $_TSPEC; + + /** + * @var \QueryPlan + */ + public $success = null; + /** + * @var \HiveServerException + */ + public $ex = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::STRUCT, + 'class' => '\QueryPlan', + ), + 1 => array( + 'var' => 'ex', + 'type' => TType::STRUCT, + 'class' => '\HiveServerException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ex'])) { + $this->ex = $vals['ex']; + } + } + } + + public function getName() { + return 'ThriftHive_getQueryPlan_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::STRUCT) { + $this->success = new \QueryPlan(); + $xfer += $this->success->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->ex = new \HiveServerException(); + $xfer += $this->ex->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_getQueryPlan_result'); + if ($this->success !== null) { + if (!is_object($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0); + $xfer += $this->success->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ex !== null) { + $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1); + $xfer += $this->ex->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_clean_args { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHive_clean_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_clean_args'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHive_clean_result { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'ThriftHive_clean_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftHive_clean_result'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + + diff --git a/service/src/gen/thrift/gen-php/Types.php b/service/src/gen/thrift/gen-php/Types.php new file mode 100644 index 0000000000000000000000000000000000000000..cbf4c29ed9ce946c656ed05d68df9ff4ce9ceaa3 --- /dev/null +++ b/service/src/gen/thrift/gen-php/Types.php @@ -0,0 +1,338 @@ + 'INITIALIZING', + 2 => 'RUNNING', + ); +} + +class HiveClusterStatus { + static $_TSPEC; + + /** + * @var int + */ + public $taskTrackers = null; + /** + * @var int + */ + public $mapTasks = null; + /** + * @var int + */ + public $reduceTasks = null; + /** + * @var int + */ + public $maxMapTasks = null; + /** + * @var int + */ + public $maxReduceTasks = null; + /** + * @var int + */ + public $state = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'taskTrackers', + 'type' => TType::I32, + ), + 2 => array( + 'var' => 'mapTasks', + 'type' => TType::I32, + ), + 3 => array( + 'var' => 'reduceTasks', + 'type' => TType::I32, + ), + 4 => array( + 'var' => 'maxMapTasks', + 'type' => TType::I32, + ), + 5 => array( + 'var' => 'maxReduceTasks', + 'type' => TType::I32, + ), + 6 => array( + 'var' => 'state', + 'type' => TType::I32, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['taskTrackers'])) { + $this->taskTrackers = $vals['taskTrackers']; + } + if (isset($vals['mapTasks'])) { + $this->mapTasks = $vals['mapTasks']; + } + if (isset($vals['reduceTasks'])) { + $this->reduceTasks = $vals['reduceTasks']; + } + if (isset($vals['maxMapTasks'])) { + $this->maxMapTasks = $vals['maxMapTasks']; + } + if (isset($vals['maxReduceTasks'])) { + $this->maxReduceTasks = $vals['maxReduceTasks']; + } + if (isset($vals['state'])) { + $this->state = $vals['state']; + } + } + } + + public function getName() { + return 'HiveClusterStatus'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->taskTrackers); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->mapTasks); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->reduceTasks); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->maxMapTasks); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->maxReduceTasks); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->state); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('HiveClusterStatus'); + if ($this->taskTrackers !== null) { + $xfer += $output->writeFieldBegin('taskTrackers', TType::I32, 1); + $xfer += $output->writeI32($this->taskTrackers); + $xfer += $output->writeFieldEnd(); + } + if ($this->mapTasks !== null) { + $xfer += $output->writeFieldBegin('mapTasks', TType::I32, 2); + $xfer += $output->writeI32($this->mapTasks); + $xfer += $output->writeFieldEnd(); + } + if ($this->reduceTasks !== null) { + $xfer += $output->writeFieldBegin('reduceTasks', TType::I32, 3); + $xfer += $output->writeI32($this->reduceTasks); + $xfer += $output->writeFieldEnd(); + } + if ($this->maxMapTasks !== null) { + $xfer += $output->writeFieldBegin('maxMapTasks', TType::I32, 4); + $xfer += $output->writeI32($this->maxMapTasks); + $xfer += $output->writeFieldEnd(); + } + if ($this->maxReduceTasks !== null) { + $xfer += $output->writeFieldBegin('maxReduceTasks', TType::I32, 5); + $xfer += $output->writeI32($this->maxReduceTasks); + $xfer += $output->writeFieldEnd(); + } + if ($this->state !== null) { + $xfer += $output->writeFieldBegin('state', TType::I32, 6); + $xfer += $output->writeI32($this->state); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class HiveServerException extends TException { + static $_TSPEC; + + /** + * @var string + */ + public $message = null; + /** + * @var int + */ + public $errorCode = null; + /** + * @var string + */ + public $SQLState = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'message', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'errorCode', + 'type' => TType::I32, + ), + 3 => array( + 'var' => 'SQLState', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['message'])) { + $this->message = $vals['message']; + } + if (isset($vals['errorCode'])) { + $this->errorCode = $vals['errorCode']; + } + if (isset($vals['SQLState'])) { + $this->SQLState = $vals['SQLState']; + } + } + } + + public function getName() { + return 'HiveServerException'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->message); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->errorCode); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->SQLState); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('HiveServerException'); + if ($this->message !== null) { + $xfer += $output->writeFieldBegin('message', TType::STRING, 1); + $xfer += $output->writeString($this->message); + $xfer += $output->writeFieldEnd(); + } + if ($this->errorCode !== null) { + $xfer += $output->writeFieldBegin('errorCode', TType::I32, 2); + $xfer += $output->writeI32($this->errorCode); + $xfer += $output->writeFieldEnd(); + } + if ($this->SQLState !== null) { + $xfer += $output->writeFieldBegin('SQLState', TType::STRING, 3); + $xfer += $output->writeString($this->SQLState); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + + diff --git a/service/src/gen/thrift/gen-py/__init__.py b/service/src/gen/thrift/gen-py/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote b/service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote new file mode 100755 index 0000000000000000000000000000000000000000..ec21b6ceec232f92c99b2228a99b05d2cf58dbf0 --- /dev/null +++ b/service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote @@ -0,0 +1,1172 @@ +#!/usr/bin/env python +# +# Autogenerated by Thrift Compiler (0.9.3) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +import sys +import pprint +from urlparse import urlparse +from thrift.transport import TTransport +from thrift.transport import TSocket +from thrift.transport import TSSLSocket +from thrift.transport import THttpClient +from thrift.protocol import TBinaryProtocol + +from hive_service import ThriftHive +from hive_service.ttypes import * + +if len(sys.argv) <= 1 or sys.argv[1] == '--help': + print('') + print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] function [arg1 [arg2...]]') + print('') + print('Functions:') + print(' void execute(string query)') + print(' string fetchOne()') + print(' fetchN(i32 numRows)') + print(' fetchAll()') + print(' Schema getSchema()') + print(' Schema getThriftSchema()') + print(' HiveClusterStatus getClusterStatus()') + print(' QueryPlan getQueryPlan()') + print(' void clean()') + print(' string getMetaConf(string key)') + print(' void setMetaConf(string key, string value)') + print(' void create_database(Database database)') + print(' Database get_database(string name)') + print(' void drop_database(string name, bool deleteData, bool cascade)') + print(' get_databases(string pattern)') + print(' get_all_databases()') + print(' void alter_database(string dbname, Database db)') + print(' Type get_type(string name)') + print(' bool create_type(Type type)') + print(' bool drop_type(string type)') + print(' get_type_all(string name)') + print(' get_fields(string db_name, string table_name)') + print(' get_fields_with_environment_context(string db_name, string table_name, EnvironmentContext environment_context)') + print(' get_schema(string db_name, string table_name)') + print(' get_schema_with_environment_context(string db_name, string table_name, EnvironmentContext environment_context)') + print(' void create_table(Table tbl)') + print(' void create_table_with_environment_context(Table tbl, EnvironmentContext environment_context)') + print(' void drop_table(string dbname, string name, bool deleteData)') + print(' void drop_table_with_environment_context(string dbname, string name, bool deleteData, EnvironmentContext environment_context)') + print(' get_tables(string db_name, string pattern)') + print(' get_table_meta(string db_patterns, string tbl_patterns, tbl_types)') + print(' get_all_tables(string db_name)') + print(' Table get_table(string dbname, string tbl_name)') + print(' get_table_objects_by_name(string dbname, tbl_names)') + print(' get_table_names_by_filter(string dbname, string filter, i16 max_tables)') + print(' void alter_table(string dbname, string tbl_name, Table new_tbl)') + print(' void alter_table_with_environment_context(string dbname, string tbl_name, Table new_tbl, EnvironmentContext environment_context)') + print(' void alter_table_with_cascade(string dbname, string tbl_name, Table new_tbl, bool cascade)') + print(' Partition add_partition(Partition new_part)') + print(' Partition add_partition_with_environment_context(Partition new_part, EnvironmentContext environment_context)') + print(' i32 add_partitions( new_parts)') + print(' i32 add_partitions_pspec( new_parts)') + print(' Partition append_partition(string db_name, string tbl_name, part_vals)') + print(' AddPartitionsResult add_partitions_req(AddPartitionsRequest request)') + print(' Partition append_partition_with_environment_context(string db_name, string tbl_name, part_vals, EnvironmentContext environment_context)') + print(' Partition append_partition_by_name(string db_name, string tbl_name, string part_name)') + print(' Partition append_partition_by_name_with_environment_context(string db_name, string tbl_name, string part_name, EnvironmentContext environment_context)') + print(' bool drop_partition(string db_name, string tbl_name, part_vals, bool deleteData)') + print(' bool drop_partition_with_environment_context(string db_name, string tbl_name, part_vals, bool deleteData, EnvironmentContext environment_context)') + print(' bool drop_partition_by_name(string db_name, string tbl_name, string part_name, bool deleteData)') + print(' bool drop_partition_by_name_with_environment_context(string db_name, string tbl_name, string part_name, bool deleteData, EnvironmentContext environment_context)') + print(' DropPartitionsResult drop_partitions_req(DropPartitionsRequest req)') + print(' Partition get_partition(string db_name, string tbl_name, part_vals)') + print(' Partition exchange_partition( partitionSpecs, string source_db, string source_table_name, string dest_db, string dest_table_name)') + print(' exchange_partitions( partitionSpecs, string source_db, string source_table_name, string dest_db, string dest_table_name)') + print(' Partition get_partition_with_auth(string db_name, string tbl_name, part_vals, string user_name, group_names)') + print(' Partition get_partition_by_name(string db_name, string tbl_name, string part_name)') + print(' get_partitions(string db_name, string tbl_name, i16 max_parts)') + print(' get_partitions_with_auth(string db_name, string tbl_name, i16 max_parts, string user_name, group_names)') + print(' get_partitions_pspec(string db_name, string tbl_name, i32 max_parts)') + print(' get_partition_names(string db_name, string tbl_name, i16 max_parts)') + print(' get_partitions_ps(string db_name, string tbl_name, part_vals, i16 max_parts)') + print(' get_partitions_ps_with_auth(string db_name, string tbl_name, part_vals, i16 max_parts, string user_name, group_names)') + print(' get_partition_names_ps(string db_name, string tbl_name, part_vals, i16 max_parts)') + print(' get_partitions_by_filter(string db_name, string tbl_name, string filter, i16 max_parts)') + print(' get_part_specs_by_filter(string db_name, string tbl_name, string filter, i32 max_parts)') + print(' PartitionsByExprResult get_partitions_by_expr(PartitionsByExprRequest req)') + print(' i32 get_num_partitions_by_filter(string db_name, string tbl_name, string filter)') + print(' get_partitions_by_names(string db_name, string tbl_name, names)') + print(' void alter_partition(string db_name, string tbl_name, Partition new_part)') + print(' void alter_partitions(string db_name, string tbl_name, new_parts)') + print(' void alter_partition_with_environment_context(string db_name, string tbl_name, Partition new_part, EnvironmentContext environment_context)') + print(' void rename_partition(string db_name, string tbl_name, part_vals, Partition new_part)') + print(' bool partition_name_has_valid_characters( part_vals, bool throw_exception)') + print(' string get_config_value(string name, string defaultValue)') + print(' partition_name_to_vals(string part_name)') + print(' partition_name_to_spec(string part_name)') + print(' void markPartitionForEvent(string db_name, string tbl_name, part_vals, PartitionEventType eventType)') + print(' bool isPartitionMarkedForEvent(string db_name, string tbl_name, part_vals, PartitionEventType eventType)') + print(' Index add_index(Index new_index, Table index_table)') + print(' void alter_index(string dbname, string base_tbl_name, string idx_name, Index new_idx)') + print(' bool drop_index_by_name(string db_name, string tbl_name, string index_name, bool deleteData)') + print(' Index get_index_by_name(string db_name, string tbl_name, string index_name)') + print(' get_indexes(string db_name, string tbl_name, i16 max_indexes)') + print(' get_index_names(string db_name, string tbl_name, i16 max_indexes)') + print(' bool update_table_column_statistics(ColumnStatistics stats_obj)') + print(' bool update_partition_column_statistics(ColumnStatistics stats_obj)') + print(' ColumnStatistics get_table_column_statistics(string db_name, string tbl_name, string col_name)') + print(' ColumnStatistics get_partition_column_statistics(string db_name, string tbl_name, string part_name, string col_name)') + print(' TableStatsResult get_table_statistics_req(TableStatsRequest request)') + print(' PartitionsStatsResult get_partitions_statistics_req(PartitionsStatsRequest request)') + print(' AggrStats get_aggr_stats_for(PartitionsStatsRequest request)') + print(' bool set_aggr_stats_for(SetPartitionsStatsRequest request)') + print(' bool delete_partition_column_statistics(string db_name, string tbl_name, string part_name, string col_name)') + print(' bool delete_table_column_statistics(string db_name, string tbl_name, string col_name)') + print(' void create_function(Function func)') + print(' void drop_function(string dbName, string funcName)') + print(' void alter_function(string dbName, string funcName, Function newFunc)') + print(' get_functions(string dbName, string pattern)') + print(' Function get_function(string dbName, string funcName)') + print(' GetAllFunctionsResponse get_all_functions()') + print(' bool create_role(Role role)') + print(' bool drop_role(string role_name)') + print(' get_role_names()') + print(' bool grant_role(string role_name, string principal_name, PrincipalType principal_type, string grantor, PrincipalType grantorType, bool grant_option)') + print(' bool revoke_role(string role_name, string principal_name, PrincipalType principal_type)') + print(' list_roles(string principal_name, PrincipalType principal_type)') + print(' GrantRevokeRoleResponse grant_revoke_role(GrantRevokeRoleRequest request)') + print(' GetPrincipalsInRoleResponse get_principals_in_role(GetPrincipalsInRoleRequest request)') + print(' GetRoleGrantsForPrincipalResponse get_role_grants_for_principal(GetRoleGrantsForPrincipalRequest request)') + print(' PrincipalPrivilegeSet get_privilege_set(HiveObjectRef hiveObject, string user_name, group_names)') + print(' list_privileges(string principal_name, PrincipalType principal_type, HiveObjectRef hiveObject)') + print(' bool grant_privileges(PrivilegeBag privileges)') + print(' bool revoke_privileges(PrivilegeBag privileges)') + print(' GrantRevokePrivilegeResponse grant_revoke_privileges(GrantRevokePrivilegeRequest request)') + print(' set_ugi(string user_name, group_names)') + print(' string get_delegation_token(string token_owner, string renewer_kerberos_principal_name)') + print(' i64 renew_delegation_token(string token_str_form)') + print(' void cancel_delegation_token(string token_str_form)') + print(' GetOpenTxnsResponse get_open_txns()') + print(' GetOpenTxnsInfoResponse get_open_txns_info()') + print(' OpenTxnsResponse open_txns(OpenTxnRequest rqst)') + print(' void abort_txn(AbortTxnRequest rqst)') + print(' void commit_txn(CommitTxnRequest rqst)') + print(' LockResponse lock(LockRequest rqst)') + print(' LockResponse check_lock(CheckLockRequest rqst)') + print(' void unlock(UnlockRequest rqst)') + print(' ShowLocksResponse show_locks(ShowLocksRequest rqst)') + print(' void heartbeat(HeartbeatRequest ids)') + print(' HeartbeatTxnRangeResponse heartbeat_txn_range(HeartbeatTxnRangeRequest txns)') + print(' void compact(CompactionRequest rqst)') + print(' ShowCompactResponse show_compact(ShowCompactRequest rqst)') + print(' void add_dynamic_partitions(AddDynamicPartitions rqst)') + print(' NotificationEventResponse get_next_notification(NotificationEventRequest rqst)') + print(' CurrentNotificationEventId get_current_notificationEventId()') + print(' FireEventResponse fire_listener_event(FireEventRequest rqst)') + print(' void flushCache()') + print(' GetFileMetadataByExprResult get_file_metadata_by_expr(GetFileMetadataByExprRequest req)') + print(' GetFileMetadataResult get_file_metadata(GetFileMetadataRequest req)') + print(' PutFileMetadataResult put_file_metadata(PutFileMetadataRequest req)') + print(' ClearFileMetadataResult clear_file_metadata(ClearFileMetadataRequest req)') + print(' CacheFileMetadataResult cache_file_metadata(CacheFileMetadataRequest req)') + print(' string getName()') + print(' string getVersion()') + print(' fb_status getStatus()') + print(' string getStatusDetails()') + print(' getCounters()') + print(' i64 getCounter(string key)') + print(' void setOption(string key, string value)') + print(' string getOption(string key)') + print(' getOptions()') + print(' string getCpuProfile(i32 profileDurationInSec)') + print(' i64 aliveSince()') + print(' void reinitialize()') + print(' void shutdown()') + print('') + sys.exit(0) + +pp = pprint.PrettyPrinter(indent = 2) +host = 'localhost' +port = 9090 +uri = '' +framed = False +ssl = False +http = False +argi = 1 + +if sys.argv[argi] == '-h': + parts = sys.argv[argi+1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + argi += 2 + +if sys.argv[argi] == '-u': + url = urlparse(sys.argv[argi+1]) + parts = url[1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + else: + port = 80 + uri = url[2] + if url[4]: + uri += '?%s' % url[4] + http = True + argi += 2 + +if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': + framed = True + argi += 1 + +if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl': + ssl = True + argi += 1 + +cmd = sys.argv[argi] +args = sys.argv[argi+1:] + +if http: + transport = THttpClient.THttpClient(host, port, uri) +else: + socket = TSSLSocket.TSSLSocket(host, port, validate=False) if ssl else TSocket.TSocket(host, port) + if framed: + transport = TTransport.TFramedTransport(socket) + else: + transport = TTransport.TBufferedTransport(socket) +protocol = TBinaryProtocol.TBinaryProtocol(transport) +client = ThriftHive.Client(protocol) +transport.open() + +if cmd == 'execute': + if len(args) != 1: + print('execute requires 1 args') + sys.exit(1) + pp.pprint(client.execute(args[0],)) + +elif cmd == 'fetchOne': + if len(args) != 0: + print('fetchOne requires 0 args') + sys.exit(1) + pp.pprint(client.fetchOne()) + +elif cmd == 'fetchN': + if len(args) != 1: + print('fetchN requires 1 args') + sys.exit(1) + pp.pprint(client.fetchN(eval(args[0]),)) + +elif cmd == 'fetchAll': + if len(args) != 0: + print('fetchAll requires 0 args') + sys.exit(1) + pp.pprint(client.fetchAll()) + +elif cmd == 'getSchema': + if len(args) != 0: + print('getSchema requires 0 args') + sys.exit(1) + pp.pprint(client.getSchema()) + +elif cmd == 'getThriftSchema': + if len(args) != 0: + print('getThriftSchema requires 0 args') + sys.exit(1) + pp.pprint(client.getThriftSchema()) + +elif cmd == 'getClusterStatus': + if len(args) != 0: + print('getClusterStatus requires 0 args') + sys.exit(1) + pp.pprint(client.getClusterStatus()) + +elif cmd == 'getQueryPlan': + if len(args) != 0: + print('getQueryPlan requires 0 args') + sys.exit(1) + pp.pprint(client.getQueryPlan()) + +elif cmd == 'clean': + if len(args) != 0: + print('clean requires 0 args') + sys.exit(1) + pp.pprint(client.clean()) + +elif cmd == 'getMetaConf': + if len(args) != 1: + print('getMetaConf requires 1 args') + sys.exit(1) + pp.pprint(client.getMetaConf(args[0],)) + +elif cmd == 'setMetaConf': + if len(args) != 2: + print('setMetaConf requires 2 args') + sys.exit(1) + pp.pprint(client.setMetaConf(args[0],args[1],)) + +elif cmd == 'create_database': + if len(args) != 1: + print('create_database requires 1 args') + sys.exit(1) + pp.pprint(client.create_database(eval(args[0]),)) + +elif cmd == 'get_database': + if len(args) != 1: + print('get_database requires 1 args') + sys.exit(1) + pp.pprint(client.get_database(args[0],)) + +elif cmd == 'drop_database': + if len(args) != 3: + print('drop_database requires 3 args') + sys.exit(1) + pp.pprint(client.drop_database(args[0],eval(args[1]),eval(args[2]),)) + +elif cmd == 'get_databases': + if len(args) != 1: + print('get_databases requires 1 args') + sys.exit(1) + pp.pprint(client.get_databases(args[0],)) + +elif cmd == 'get_all_databases': + if len(args) != 0: + print('get_all_databases requires 0 args') + sys.exit(1) + pp.pprint(client.get_all_databases()) + +elif cmd == 'alter_database': + if len(args) != 2: + print('alter_database requires 2 args') + sys.exit(1) + pp.pprint(client.alter_database(args[0],eval(args[1]),)) + +elif cmd == 'get_type': + if len(args) != 1: + print('get_type requires 1 args') + sys.exit(1) + pp.pprint(client.get_type(args[0],)) + +elif cmd == 'create_type': + if len(args) != 1: + print('create_type requires 1 args') + sys.exit(1) + pp.pprint(client.create_type(eval(args[0]),)) + +elif cmd == 'drop_type': + if len(args) != 1: + print('drop_type requires 1 args') + sys.exit(1) + pp.pprint(client.drop_type(args[0],)) + +elif cmd == 'get_type_all': + if len(args) != 1: + print('get_type_all requires 1 args') + sys.exit(1) + pp.pprint(client.get_type_all(args[0],)) + +elif cmd == 'get_fields': + if len(args) != 2: + print('get_fields requires 2 args') + sys.exit(1) + pp.pprint(client.get_fields(args[0],args[1],)) + +elif cmd == 'get_fields_with_environment_context': + if len(args) != 3: + print('get_fields_with_environment_context requires 3 args') + sys.exit(1) + pp.pprint(client.get_fields_with_environment_context(args[0],args[1],eval(args[2]),)) + +elif cmd == 'get_schema': + if len(args) != 2: + print('get_schema requires 2 args') + sys.exit(1) + pp.pprint(client.get_schema(args[0],args[1],)) + +elif cmd == 'get_schema_with_environment_context': + if len(args) != 3: + print('get_schema_with_environment_context requires 3 args') + sys.exit(1) + pp.pprint(client.get_schema_with_environment_context(args[0],args[1],eval(args[2]),)) + +elif cmd == 'create_table': + if len(args) != 1: + print('create_table requires 1 args') + sys.exit(1) + pp.pprint(client.create_table(eval(args[0]),)) + +elif cmd == 'create_table_with_environment_context': + if len(args) != 2: + print('create_table_with_environment_context requires 2 args') + sys.exit(1) + pp.pprint(client.create_table_with_environment_context(eval(args[0]),eval(args[1]),)) + +elif cmd == 'drop_table': + if len(args) != 3: + print('drop_table requires 3 args') + sys.exit(1) + pp.pprint(client.drop_table(args[0],args[1],eval(args[2]),)) + +elif cmd == 'drop_table_with_environment_context': + if len(args) != 4: + print('drop_table_with_environment_context requires 4 args') + sys.exit(1) + pp.pprint(client.drop_table_with_environment_context(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'get_tables': + if len(args) != 2: + print('get_tables requires 2 args') + sys.exit(1) + pp.pprint(client.get_tables(args[0],args[1],)) + +elif cmd == 'get_table_meta': + if len(args) != 3: + print('get_table_meta requires 3 args') + sys.exit(1) + pp.pprint(client.get_table_meta(args[0],args[1],eval(args[2]),)) + +elif cmd == 'get_all_tables': + if len(args) != 1: + print('get_all_tables requires 1 args') + sys.exit(1) + pp.pprint(client.get_all_tables(args[0],)) + +elif cmd == 'get_table': + if len(args) != 2: + print('get_table requires 2 args') + sys.exit(1) + pp.pprint(client.get_table(args[0],args[1],)) + +elif cmd == 'get_table_objects_by_name': + if len(args) != 2: + print('get_table_objects_by_name requires 2 args') + sys.exit(1) + pp.pprint(client.get_table_objects_by_name(args[0],eval(args[1]),)) + +elif cmd == 'get_table_names_by_filter': + if len(args) != 3: + print('get_table_names_by_filter requires 3 args') + sys.exit(1) + pp.pprint(client.get_table_names_by_filter(args[0],args[1],eval(args[2]),)) + +elif cmd == 'alter_table': + if len(args) != 3: + print('alter_table requires 3 args') + sys.exit(1) + pp.pprint(client.alter_table(args[0],args[1],eval(args[2]),)) + +elif cmd == 'alter_table_with_environment_context': + if len(args) != 4: + print('alter_table_with_environment_context requires 4 args') + sys.exit(1) + pp.pprint(client.alter_table_with_environment_context(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'alter_table_with_cascade': + if len(args) != 4: + print('alter_table_with_cascade requires 4 args') + sys.exit(1) + pp.pprint(client.alter_table_with_cascade(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'add_partition': + if len(args) != 1: + print('add_partition requires 1 args') + sys.exit(1) + pp.pprint(client.add_partition(eval(args[0]),)) + +elif cmd == 'add_partition_with_environment_context': + if len(args) != 2: + print('add_partition_with_environment_context requires 2 args') + sys.exit(1) + pp.pprint(client.add_partition_with_environment_context(eval(args[0]),eval(args[1]),)) + +elif cmd == 'add_partitions': + if len(args) != 1: + print('add_partitions requires 1 args') + sys.exit(1) + pp.pprint(client.add_partitions(eval(args[0]),)) + +elif cmd == 'add_partitions_pspec': + if len(args) != 1: + print('add_partitions_pspec requires 1 args') + sys.exit(1) + pp.pprint(client.add_partitions_pspec(eval(args[0]),)) + +elif cmd == 'append_partition': + if len(args) != 3: + print('append_partition requires 3 args') + sys.exit(1) + pp.pprint(client.append_partition(args[0],args[1],eval(args[2]),)) + +elif cmd == 'add_partitions_req': + if len(args) != 1: + print('add_partitions_req requires 1 args') + sys.exit(1) + pp.pprint(client.add_partitions_req(eval(args[0]),)) + +elif cmd == 'append_partition_with_environment_context': + if len(args) != 4: + print('append_partition_with_environment_context requires 4 args') + sys.exit(1) + pp.pprint(client.append_partition_with_environment_context(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'append_partition_by_name': + if len(args) != 3: + print('append_partition_by_name requires 3 args') + sys.exit(1) + pp.pprint(client.append_partition_by_name(args[0],args[1],args[2],)) + +elif cmd == 'append_partition_by_name_with_environment_context': + if len(args) != 4: + print('append_partition_by_name_with_environment_context requires 4 args') + sys.exit(1) + pp.pprint(client.append_partition_by_name_with_environment_context(args[0],args[1],args[2],eval(args[3]),)) + +elif cmd == 'drop_partition': + if len(args) != 4: + print('drop_partition requires 4 args') + sys.exit(1) + pp.pprint(client.drop_partition(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'drop_partition_with_environment_context': + if len(args) != 5: + print('drop_partition_with_environment_context requires 5 args') + sys.exit(1) + pp.pprint(client.drop_partition_with_environment_context(args[0],args[1],eval(args[2]),eval(args[3]),eval(args[4]),)) + +elif cmd == 'drop_partition_by_name': + if len(args) != 4: + print('drop_partition_by_name requires 4 args') + sys.exit(1) + pp.pprint(client.drop_partition_by_name(args[0],args[1],args[2],eval(args[3]),)) + +elif cmd == 'drop_partition_by_name_with_environment_context': + if len(args) != 5: + print('drop_partition_by_name_with_environment_context requires 5 args') + sys.exit(1) + pp.pprint(client.drop_partition_by_name_with_environment_context(args[0],args[1],args[2],eval(args[3]),eval(args[4]),)) + +elif cmd == 'drop_partitions_req': + if len(args) != 1: + print('drop_partitions_req requires 1 args') + sys.exit(1) + pp.pprint(client.drop_partitions_req(eval(args[0]),)) + +elif cmd == 'get_partition': + if len(args) != 3: + print('get_partition requires 3 args') + sys.exit(1) + pp.pprint(client.get_partition(args[0],args[1],eval(args[2]),)) + +elif cmd == 'exchange_partition': + if len(args) != 5: + print('exchange_partition requires 5 args') + sys.exit(1) + pp.pprint(client.exchange_partition(eval(args[0]),args[1],args[2],args[3],args[4],)) + +elif cmd == 'exchange_partitions': + if len(args) != 5: + print('exchange_partitions requires 5 args') + sys.exit(1) + pp.pprint(client.exchange_partitions(eval(args[0]),args[1],args[2],args[3],args[4],)) + +elif cmd == 'get_partition_with_auth': + if len(args) != 5: + print('get_partition_with_auth requires 5 args') + sys.exit(1) + pp.pprint(client.get_partition_with_auth(args[0],args[1],eval(args[2]),args[3],eval(args[4]),)) + +elif cmd == 'get_partition_by_name': + if len(args) != 3: + print('get_partition_by_name requires 3 args') + sys.exit(1) + pp.pprint(client.get_partition_by_name(args[0],args[1],args[2],)) + +elif cmd == 'get_partitions': + if len(args) != 3: + print('get_partitions requires 3 args') + sys.exit(1) + pp.pprint(client.get_partitions(args[0],args[1],eval(args[2]),)) + +elif cmd == 'get_partitions_with_auth': + if len(args) != 5: + print('get_partitions_with_auth requires 5 args') + sys.exit(1) + pp.pprint(client.get_partitions_with_auth(args[0],args[1],eval(args[2]),args[3],eval(args[4]),)) + +elif cmd == 'get_partitions_pspec': + if len(args) != 3: + print('get_partitions_pspec requires 3 args') + sys.exit(1) + pp.pprint(client.get_partitions_pspec(args[0],args[1],eval(args[2]),)) + +elif cmd == 'get_partition_names': + if len(args) != 3: + print('get_partition_names requires 3 args') + sys.exit(1) + pp.pprint(client.get_partition_names(args[0],args[1],eval(args[2]),)) + +elif cmd == 'get_partitions_ps': + if len(args) != 4: + print('get_partitions_ps requires 4 args') + sys.exit(1) + pp.pprint(client.get_partitions_ps(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'get_partitions_ps_with_auth': + if len(args) != 6: + print('get_partitions_ps_with_auth requires 6 args') + sys.exit(1) + pp.pprint(client.get_partitions_ps_with_auth(args[0],args[1],eval(args[2]),eval(args[3]),args[4],eval(args[5]),)) + +elif cmd == 'get_partition_names_ps': + if len(args) != 4: + print('get_partition_names_ps requires 4 args') + sys.exit(1) + pp.pprint(client.get_partition_names_ps(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'get_partitions_by_filter': + if len(args) != 4: + print('get_partitions_by_filter requires 4 args') + sys.exit(1) + pp.pprint(client.get_partitions_by_filter(args[0],args[1],args[2],eval(args[3]),)) + +elif cmd == 'get_part_specs_by_filter': + if len(args) != 4: + print('get_part_specs_by_filter requires 4 args') + sys.exit(1) + pp.pprint(client.get_part_specs_by_filter(args[0],args[1],args[2],eval(args[3]),)) + +elif cmd == 'get_partitions_by_expr': + if len(args) != 1: + print('get_partitions_by_expr requires 1 args') + sys.exit(1) + pp.pprint(client.get_partitions_by_expr(eval(args[0]),)) + +elif cmd == 'get_num_partitions_by_filter': + if len(args) != 3: + print('get_num_partitions_by_filter requires 3 args') + sys.exit(1) + pp.pprint(client.get_num_partitions_by_filter(args[0],args[1],args[2],)) + +elif cmd == 'get_partitions_by_names': + if len(args) != 3: + print('get_partitions_by_names requires 3 args') + sys.exit(1) + pp.pprint(client.get_partitions_by_names(args[0],args[1],eval(args[2]),)) + +elif cmd == 'alter_partition': + if len(args) != 3: + print('alter_partition requires 3 args') + sys.exit(1) + pp.pprint(client.alter_partition(args[0],args[1],eval(args[2]),)) + +elif cmd == 'alter_partitions': + if len(args) != 3: + print('alter_partitions requires 3 args') + sys.exit(1) + pp.pprint(client.alter_partitions(args[0],args[1],eval(args[2]),)) + +elif cmd == 'alter_partition_with_environment_context': + if len(args) != 4: + print('alter_partition_with_environment_context requires 4 args') + sys.exit(1) + pp.pprint(client.alter_partition_with_environment_context(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'rename_partition': + if len(args) != 4: + print('rename_partition requires 4 args') + sys.exit(1) + pp.pprint(client.rename_partition(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'partition_name_has_valid_characters': + if len(args) != 2: + print('partition_name_has_valid_characters requires 2 args') + sys.exit(1) + pp.pprint(client.partition_name_has_valid_characters(eval(args[0]),eval(args[1]),)) + +elif cmd == 'get_config_value': + if len(args) != 2: + print('get_config_value requires 2 args') + sys.exit(1) + pp.pprint(client.get_config_value(args[0],args[1],)) + +elif cmd == 'partition_name_to_vals': + if len(args) != 1: + print('partition_name_to_vals requires 1 args') + sys.exit(1) + pp.pprint(client.partition_name_to_vals(args[0],)) + +elif cmd == 'partition_name_to_spec': + if len(args) != 1: + print('partition_name_to_spec requires 1 args') + sys.exit(1) + pp.pprint(client.partition_name_to_spec(args[0],)) + +elif cmd == 'markPartitionForEvent': + if len(args) != 4: + print('markPartitionForEvent requires 4 args') + sys.exit(1) + pp.pprint(client.markPartitionForEvent(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'isPartitionMarkedForEvent': + if len(args) != 4: + print('isPartitionMarkedForEvent requires 4 args') + sys.exit(1) + pp.pprint(client.isPartitionMarkedForEvent(args[0],args[1],eval(args[2]),eval(args[3]),)) + +elif cmd == 'add_index': + if len(args) != 2: + print('add_index requires 2 args') + sys.exit(1) + pp.pprint(client.add_index(eval(args[0]),eval(args[1]),)) + +elif cmd == 'alter_index': + if len(args) != 4: + print('alter_index requires 4 args') + sys.exit(1) + pp.pprint(client.alter_index(args[0],args[1],args[2],eval(args[3]),)) + +elif cmd == 'drop_index_by_name': + if len(args) != 4: + print('drop_index_by_name requires 4 args') + sys.exit(1) + pp.pprint(client.drop_index_by_name(args[0],args[1],args[2],eval(args[3]),)) + +elif cmd == 'get_index_by_name': + if len(args) != 3: + print('get_index_by_name requires 3 args') + sys.exit(1) + pp.pprint(client.get_index_by_name(args[0],args[1],args[2],)) + +elif cmd == 'get_indexes': + if len(args) != 3: + print('get_indexes requires 3 args') + sys.exit(1) + pp.pprint(client.get_indexes(args[0],args[1],eval(args[2]),)) + +elif cmd == 'get_index_names': + if len(args) != 3: + print('get_index_names requires 3 args') + sys.exit(1) + pp.pprint(client.get_index_names(args[0],args[1],eval(args[2]),)) + +elif cmd == 'update_table_column_statistics': + if len(args) != 1: + print('update_table_column_statistics requires 1 args') + sys.exit(1) + pp.pprint(client.update_table_column_statistics(eval(args[0]),)) + +elif cmd == 'update_partition_column_statistics': + if len(args) != 1: + print('update_partition_column_statistics requires 1 args') + sys.exit(1) + pp.pprint(client.update_partition_column_statistics(eval(args[0]),)) + +elif cmd == 'get_table_column_statistics': + if len(args) != 3: + print('get_table_column_statistics requires 3 args') + sys.exit(1) + pp.pprint(client.get_table_column_statistics(args[0],args[1],args[2],)) + +elif cmd == 'get_partition_column_statistics': + if len(args) != 4: + print('get_partition_column_statistics requires 4 args') + sys.exit(1) + pp.pprint(client.get_partition_column_statistics(args[0],args[1],args[2],args[3],)) + +elif cmd == 'get_table_statistics_req': + if len(args) != 1: + print('get_table_statistics_req requires 1 args') + sys.exit(1) + pp.pprint(client.get_table_statistics_req(eval(args[0]),)) + +elif cmd == 'get_partitions_statistics_req': + if len(args) != 1: + print('get_partitions_statistics_req requires 1 args') + sys.exit(1) + pp.pprint(client.get_partitions_statistics_req(eval(args[0]),)) + +elif cmd == 'get_aggr_stats_for': + if len(args) != 1: + print('get_aggr_stats_for requires 1 args') + sys.exit(1) + pp.pprint(client.get_aggr_stats_for(eval(args[0]),)) + +elif cmd == 'set_aggr_stats_for': + if len(args) != 1: + print('set_aggr_stats_for requires 1 args') + sys.exit(1) + pp.pprint(client.set_aggr_stats_for(eval(args[0]),)) + +elif cmd == 'delete_partition_column_statistics': + if len(args) != 4: + print('delete_partition_column_statistics requires 4 args') + sys.exit(1) + pp.pprint(client.delete_partition_column_statistics(args[0],args[1],args[2],args[3],)) + +elif cmd == 'delete_table_column_statistics': + if len(args) != 3: + print('delete_table_column_statistics requires 3 args') + sys.exit(1) + pp.pprint(client.delete_table_column_statistics(args[0],args[1],args[2],)) + +elif cmd == 'create_function': + if len(args) != 1: + print('create_function requires 1 args') + sys.exit(1) + pp.pprint(client.create_function(eval(args[0]),)) + +elif cmd == 'drop_function': + if len(args) != 2: + print('drop_function requires 2 args') + sys.exit(1) + pp.pprint(client.drop_function(args[0],args[1],)) + +elif cmd == 'alter_function': + if len(args) != 3: + print('alter_function requires 3 args') + sys.exit(1) + pp.pprint(client.alter_function(args[0],args[1],eval(args[2]),)) + +elif cmd == 'get_functions': + if len(args) != 2: + print('get_functions requires 2 args') + sys.exit(1) + pp.pprint(client.get_functions(args[0],args[1],)) + +elif cmd == 'get_function': + if len(args) != 2: + print('get_function requires 2 args') + sys.exit(1) + pp.pprint(client.get_function(args[0],args[1],)) + +elif cmd == 'get_all_functions': + if len(args) != 0: + print('get_all_functions requires 0 args') + sys.exit(1) + pp.pprint(client.get_all_functions()) + +elif cmd == 'create_role': + if len(args) != 1: + print('create_role requires 1 args') + sys.exit(1) + pp.pprint(client.create_role(eval(args[0]),)) + +elif cmd == 'drop_role': + if len(args) != 1: + print('drop_role requires 1 args') + sys.exit(1) + pp.pprint(client.drop_role(args[0],)) + +elif cmd == 'get_role_names': + if len(args) != 0: + print('get_role_names requires 0 args') + sys.exit(1) + pp.pprint(client.get_role_names()) + +elif cmd == 'grant_role': + if len(args) != 6: + print('grant_role requires 6 args') + sys.exit(1) + pp.pprint(client.grant_role(args[0],args[1],eval(args[2]),args[3],eval(args[4]),eval(args[5]),)) + +elif cmd == 'revoke_role': + if len(args) != 3: + print('revoke_role requires 3 args') + sys.exit(1) + pp.pprint(client.revoke_role(args[0],args[1],eval(args[2]),)) + +elif cmd == 'list_roles': + if len(args) != 2: + print('list_roles requires 2 args') + sys.exit(1) + pp.pprint(client.list_roles(args[0],eval(args[1]),)) + +elif cmd == 'grant_revoke_role': + if len(args) != 1: + print('grant_revoke_role requires 1 args') + sys.exit(1) + pp.pprint(client.grant_revoke_role(eval(args[0]),)) + +elif cmd == 'get_principals_in_role': + if len(args) != 1: + print('get_principals_in_role requires 1 args') + sys.exit(1) + pp.pprint(client.get_principals_in_role(eval(args[0]),)) + +elif cmd == 'get_role_grants_for_principal': + if len(args) != 1: + print('get_role_grants_for_principal requires 1 args') + sys.exit(1) + pp.pprint(client.get_role_grants_for_principal(eval(args[0]),)) + +elif cmd == 'get_privilege_set': + if len(args) != 3: + print('get_privilege_set requires 3 args') + sys.exit(1) + pp.pprint(client.get_privilege_set(eval(args[0]),args[1],eval(args[2]),)) + +elif cmd == 'list_privileges': + if len(args) != 3: + print('list_privileges requires 3 args') + sys.exit(1) + pp.pprint(client.list_privileges(args[0],eval(args[1]),eval(args[2]),)) + +elif cmd == 'grant_privileges': + if len(args) != 1: + print('grant_privileges requires 1 args') + sys.exit(1) + pp.pprint(client.grant_privileges(eval(args[0]),)) + +elif cmd == 'revoke_privileges': + if len(args) != 1: + print('revoke_privileges requires 1 args') + sys.exit(1) + pp.pprint(client.revoke_privileges(eval(args[0]),)) + +elif cmd == 'grant_revoke_privileges': + if len(args) != 1: + print('grant_revoke_privileges requires 1 args') + sys.exit(1) + pp.pprint(client.grant_revoke_privileges(eval(args[0]),)) + +elif cmd == 'set_ugi': + if len(args) != 2: + print('set_ugi requires 2 args') + sys.exit(1) + pp.pprint(client.set_ugi(args[0],eval(args[1]),)) + +elif cmd == 'get_delegation_token': + if len(args) != 2: + print('get_delegation_token requires 2 args') + sys.exit(1) + pp.pprint(client.get_delegation_token(args[0],args[1],)) + +elif cmd == 'renew_delegation_token': + if len(args) != 1: + print('renew_delegation_token requires 1 args') + sys.exit(1) + pp.pprint(client.renew_delegation_token(args[0],)) + +elif cmd == 'cancel_delegation_token': + if len(args) != 1: + print('cancel_delegation_token requires 1 args') + sys.exit(1) + pp.pprint(client.cancel_delegation_token(args[0],)) + +elif cmd == 'get_open_txns': + if len(args) != 0: + print('get_open_txns requires 0 args') + sys.exit(1) + pp.pprint(client.get_open_txns()) + +elif cmd == 'get_open_txns_info': + if len(args) != 0: + print('get_open_txns_info requires 0 args') + sys.exit(1) + pp.pprint(client.get_open_txns_info()) + +elif cmd == 'open_txns': + if len(args) != 1: + print('open_txns requires 1 args') + sys.exit(1) + pp.pprint(client.open_txns(eval(args[0]),)) + +elif cmd == 'abort_txn': + if len(args) != 1: + print('abort_txn requires 1 args') + sys.exit(1) + pp.pprint(client.abort_txn(eval(args[0]),)) + +elif cmd == 'commit_txn': + if len(args) != 1: + print('commit_txn requires 1 args') + sys.exit(1) + pp.pprint(client.commit_txn(eval(args[0]),)) + +elif cmd == 'lock': + if len(args) != 1: + print('lock requires 1 args') + sys.exit(1) + pp.pprint(client.lock(eval(args[0]),)) + +elif cmd == 'check_lock': + if len(args) != 1: + print('check_lock requires 1 args') + sys.exit(1) + pp.pprint(client.check_lock(eval(args[0]),)) + +elif cmd == 'unlock': + if len(args) != 1: + print('unlock requires 1 args') + sys.exit(1) + pp.pprint(client.unlock(eval(args[0]),)) + +elif cmd == 'show_locks': + if len(args) != 1: + print('show_locks requires 1 args') + sys.exit(1) + pp.pprint(client.show_locks(eval(args[0]),)) + +elif cmd == 'heartbeat': + if len(args) != 1: + print('heartbeat requires 1 args') + sys.exit(1) + pp.pprint(client.heartbeat(eval(args[0]),)) + +elif cmd == 'heartbeat_txn_range': + if len(args) != 1: + print('heartbeat_txn_range requires 1 args') + sys.exit(1) + pp.pprint(client.heartbeat_txn_range(eval(args[0]),)) + +elif cmd == 'compact': + if len(args) != 1: + print('compact requires 1 args') + sys.exit(1) + pp.pprint(client.compact(eval(args[0]),)) + +elif cmd == 'show_compact': + if len(args) != 1: + print('show_compact requires 1 args') + sys.exit(1) + pp.pprint(client.show_compact(eval(args[0]),)) + +elif cmd == 'add_dynamic_partitions': + if len(args) != 1: + print('add_dynamic_partitions requires 1 args') + sys.exit(1) + pp.pprint(client.add_dynamic_partitions(eval(args[0]),)) + +elif cmd == 'get_next_notification': + if len(args) != 1: + print('get_next_notification requires 1 args') + sys.exit(1) + pp.pprint(client.get_next_notification(eval(args[0]),)) + +elif cmd == 'get_current_notificationEventId': + if len(args) != 0: + print('get_current_notificationEventId requires 0 args') + sys.exit(1) + pp.pprint(client.get_current_notificationEventId()) + +elif cmd == 'fire_listener_event': + if len(args) != 1: + print('fire_listener_event requires 1 args') + sys.exit(1) + pp.pprint(client.fire_listener_event(eval(args[0]),)) + +elif cmd == 'flushCache': + if len(args) != 0: + print('flushCache requires 0 args') + sys.exit(1) + pp.pprint(client.flushCache()) + +elif cmd == 'get_file_metadata_by_expr': + if len(args) != 1: + print('get_file_metadata_by_expr requires 1 args') + sys.exit(1) + pp.pprint(client.get_file_metadata_by_expr(eval(args[0]),)) + +elif cmd == 'get_file_metadata': + if len(args) != 1: + print('get_file_metadata requires 1 args') + sys.exit(1) + pp.pprint(client.get_file_metadata(eval(args[0]),)) + +elif cmd == 'put_file_metadata': + if len(args) != 1: + print('put_file_metadata requires 1 args') + sys.exit(1) + pp.pprint(client.put_file_metadata(eval(args[0]),)) + +elif cmd == 'clear_file_metadata': + if len(args) != 1: + print('clear_file_metadata requires 1 args') + sys.exit(1) + pp.pprint(client.clear_file_metadata(eval(args[0]),)) + +elif cmd == 'cache_file_metadata': + if len(args) != 1: + print('cache_file_metadata requires 1 args') + sys.exit(1) + pp.pprint(client.cache_file_metadata(eval(args[0]),)) + +elif cmd == 'getName': + if len(args) != 0: + print('getName requires 0 args') + sys.exit(1) + pp.pprint(client.getName()) + +elif cmd == 'getVersion': + if len(args) != 0: + print('getVersion requires 0 args') + sys.exit(1) + pp.pprint(client.getVersion()) + +elif cmd == 'getStatus': + if len(args) != 0: + print('getStatus requires 0 args') + sys.exit(1) + pp.pprint(client.getStatus()) + +elif cmd == 'getStatusDetails': + if len(args) != 0: + print('getStatusDetails requires 0 args') + sys.exit(1) + pp.pprint(client.getStatusDetails()) + +elif cmd == 'getCounters': + if len(args) != 0: + print('getCounters requires 0 args') + sys.exit(1) + pp.pprint(client.getCounters()) + +elif cmd == 'getCounter': + if len(args) != 1: + print('getCounter requires 1 args') + sys.exit(1) + pp.pprint(client.getCounter(args[0],)) + +elif cmd == 'setOption': + if len(args) != 2: + print('setOption requires 2 args') + sys.exit(1) + pp.pprint(client.setOption(args[0],args[1],)) + +elif cmd == 'getOption': + if len(args) != 1: + print('getOption requires 1 args') + sys.exit(1) + pp.pprint(client.getOption(args[0],)) + +elif cmd == 'getOptions': + if len(args) != 0: + print('getOptions requires 0 args') + sys.exit(1) + pp.pprint(client.getOptions()) + +elif cmd == 'getCpuProfile': + if len(args) != 1: + print('getCpuProfile requires 1 args') + sys.exit(1) + pp.pprint(client.getCpuProfile(eval(args[0]),)) + +elif cmd == 'aliveSince': + if len(args) != 0: + print('aliveSince requires 0 args') + sys.exit(1) + pp.pprint(client.aliveSince()) + +elif cmd == 'reinitialize': + if len(args) != 0: + print('reinitialize requires 0 args') + sys.exit(1) + pp.pprint(client.reinitialize()) + +elif cmd == 'shutdown': + if len(args) != 0: + print('shutdown requires 0 args') + sys.exit(1) + pp.pprint(client.shutdown()) + +else: + print('Unrecognized method %s' % cmd) + sys.exit(1) + +transport.close() diff --git a/service/src/gen/thrift/gen-py/hive_service/ThriftHive.py b/service/src/gen/thrift/gen-py/hive_service/ThriftHive.py new file mode 100644 index 0000000000000000000000000000000000000000..978c2a3d149827659fab2074f1c9ebba1318612f --- /dev/null +++ b/service/src/gen/thrift/gen-py/hive_service/ThriftHive.py @@ -0,0 +1,1674 @@ +# +# Autogenerated by Thrift Compiler (0.9.3) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException +import hive_metastore.ThriftHiveMetastore +import logging +from ttypes import * +from thrift.Thrift import TProcessor +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + +class Iface(hive_metastore.ThriftHiveMetastore.Iface): + def execute(self, query): + """ + Parameters: + - query + """ + pass + + def fetchOne(self): + pass + + def fetchN(self, numRows): + """ + Parameters: + - numRows + """ + pass + + def fetchAll(self): + pass + + def getSchema(self): + pass + + def getThriftSchema(self): + pass + + def getClusterStatus(self): + pass + + def getQueryPlan(self): + pass + + def clean(self): + pass + + +class Client(hive_metastore.ThriftHiveMetastore.Client, Iface): + def __init__(self, iprot, oprot=None): + hive_metastore.ThriftHiveMetastore.Client.__init__(self, iprot, oprot) + + def execute(self, query): + """ + Parameters: + - query + """ + self.send_execute(query) + self.recv_execute() + + def send_execute(self, query): + self._oprot.writeMessageBegin('execute', TMessageType.CALL, self._seqid) + args = execute_args() + args.query = query + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_execute(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = execute_result() + result.read(iprot) + iprot.readMessageEnd() + if result.ex is not None: + raise result.ex + return + + def fetchOne(self): + self.send_fetchOne() + return self.recv_fetchOne() + + def send_fetchOne(self): + self._oprot.writeMessageBegin('fetchOne', TMessageType.CALL, self._seqid) + args = fetchOne_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_fetchOne(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = fetchOne_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ex is not None: + raise result.ex + raise TApplicationException(TApplicationException.MISSING_RESULT, "fetchOne failed: unknown result") + + def fetchN(self, numRows): + """ + Parameters: + - numRows + """ + self.send_fetchN(numRows) + return self.recv_fetchN() + + def send_fetchN(self, numRows): + self._oprot.writeMessageBegin('fetchN', TMessageType.CALL, self._seqid) + args = fetchN_args() + args.numRows = numRows + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_fetchN(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = fetchN_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ex is not None: + raise result.ex + raise TApplicationException(TApplicationException.MISSING_RESULT, "fetchN failed: unknown result") + + def fetchAll(self): + self.send_fetchAll() + return self.recv_fetchAll() + + def send_fetchAll(self): + self._oprot.writeMessageBegin('fetchAll', TMessageType.CALL, self._seqid) + args = fetchAll_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_fetchAll(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = fetchAll_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ex is not None: + raise result.ex + raise TApplicationException(TApplicationException.MISSING_RESULT, "fetchAll failed: unknown result") + + def getSchema(self): + self.send_getSchema() + return self.recv_getSchema() + + def send_getSchema(self): + self._oprot.writeMessageBegin('getSchema', TMessageType.CALL, self._seqid) + args = getSchema_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getSchema(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getSchema_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ex is not None: + raise result.ex + raise TApplicationException(TApplicationException.MISSING_RESULT, "getSchema failed: unknown result") + + def getThriftSchema(self): + self.send_getThriftSchema() + return self.recv_getThriftSchema() + + def send_getThriftSchema(self): + self._oprot.writeMessageBegin('getThriftSchema', TMessageType.CALL, self._seqid) + args = getThriftSchema_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getThriftSchema(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getThriftSchema_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ex is not None: + raise result.ex + raise TApplicationException(TApplicationException.MISSING_RESULT, "getThriftSchema failed: unknown result") + + def getClusterStatus(self): + self.send_getClusterStatus() + return self.recv_getClusterStatus() + + def send_getClusterStatus(self): + self._oprot.writeMessageBegin('getClusterStatus', TMessageType.CALL, self._seqid) + args = getClusterStatus_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getClusterStatus(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getClusterStatus_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ex is not None: + raise result.ex + raise TApplicationException(TApplicationException.MISSING_RESULT, "getClusterStatus failed: unknown result") + + def getQueryPlan(self): + self.send_getQueryPlan() + return self.recv_getQueryPlan() + + def send_getQueryPlan(self): + self._oprot.writeMessageBegin('getQueryPlan', TMessageType.CALL, self._seqid) + args = getQueryPlan_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getQueryPlan(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getQueryPlan_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ex is not None: + raise result.ex + raise TApplicationException(TApplicationException.MISSING_RESULT, "getQueryPlan failed: unknown result") + + def clean(self): + self.send_clean() + self.recv_clean() + + def send_clean(self): + self._oprot.writeMessageBegin('clean', TMessageType.CALL, self._seqid) + args = clean_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_clean(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = clean_result() + result.read(iprot) + iprot.readMessageEnd() + return + + +class Processor(hive_metastore.ThriftHiveMetastore.Processor, Iface, TProcessor): + def __init__(self, handler): + hive_metastore.ThriftHiveMetastore.Processor.__init__(self, handler) + self._processMap["execute"] = Processor.process_execute + self._processMap["fetchOne"] = Processor.process_fetchOne + self._processMap["fetchN"] = Processor.process_fetchN + self._processMap["fetchAll"] = Processor.process_fetchAll + self._processMap["getSchema"] = Processor.process_getSchema + self._processMap["getThriftSchema"] = Processor.process_getThriftSchema + self._processMap["getClusterStatus"] = Processor.process_getClusterStatus + self._processMap["getQueryPlan"] = Processor.process_getQueryPlan + self._processMap["clean"] = Processor.process_clean + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return + else: + self._processMap[name](self, seqid, iprot, oprot) + return True + + def process_execute(self, seqid, iprot, oprot): + args = execute_args() + args.read(iprot) + iprot.readMessageEnd() + result = execute_result() + try: + self._handler.execute(args.query) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except HiveServerException as ex: + msg_type = TMessageType.REPLY + result.ex = ex + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("execute", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_fetchOne(self, seqid, iprot, oprot): + args = fetchOne_args() + args.read(iprot) + iprot.readMessageEnd() + result = fetchOne_result() + try: + result.success = self._handler.fetchOne() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except HiveServerException as ex: + msg_type = TMessageType.REPLY + result.ex = ex + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("fetchOne", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_fetchN(self, seqid, iprot, oprot): + args = fetchN_args() + args.read(iprot) + iprot.readMessageEnd() + result = fetchN_result() + try: + result.success = self._handler.fetchN(args.numRows) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except HiveServerException as ex: + msg_type = TMessageType.REPLY + result.ex = ex + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("fetchN", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_fetchAll(self, seqid, iprot, oprot): + args = fetchAll_args() + args.read(iprot) + iprot.readMessageEnd() + result = fetchAll_result() + try: + result.success = self._handler.fetchAll() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except HiveServerException as ex: + msg_type = TMessageType.REPLY + result.ex = ex + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("fetchAll", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getSchema(self, seqid, iprot, oprot): + args = getSchema_args() + args.read(iprot) + iprot.readMessageEnd() + result = getSchema_result() + try: + result.success = self._handler.getSchema() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except HiveServerException as ex: + msg_type = TMessageType.REPLY + result.ex = ex + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getSchema", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getThriftSchema(self, seqid, iprot, oprot): + args = getThriftSchema_args() + args.read(iprot) + iprot.readMessageEnd() + result = getThriftSchema_result() + try: + result.success = self._handler.getThriftSchema() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except HiveServerException as ex: + msg_type = TMessageType.REPLY + result.ex = ex + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getThriftSchema", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getClusterStatus(self, seqid, iprot, oprot): + args = getClusterStatus_args() + args.read(iprot) + iprot.readMessageEnd() + result = getClusterStatus_result() + try: + result.success = self._handler.getClusterStatus() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except HiveServerException as ex: + msg_type = TMessageType.REPLY + result.ex = ex + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getClusterStatus", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getQueryPlan(self, seqid, iprot, oprot): + args = getQueryPlan_args() + args.read(iprot) + iprot.readMessageEnd() + result = getQueryPlan_result() + try: + result.success = self._handler.getQueryPlan() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except HiveServerException as ex: + msg_type = TMessageType.REPLY + result.ex = ex + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getQueryPlan", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_clean(self, seqid, iprot, oprot): + args = clean_args() + args.read(iprot) + iprot.readMessageEnd() + result = clean_result() + try: + self._handler.clean() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("clean", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + +# HELPER FUNCTIONS AND STRUCTURES + +class execute_args: + """ + Attributes: + - query + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'query', None, None, ), # 1 + ) + + def __init__(self, query=None,): + self.query = query + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.query = iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('execute_args') + if self.query is not None: + oprot.writeFieldBegin('query', TType.STRING, 1) + oprot.writeString(self.query) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.query) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class execute_result: + """ + Attributes: + - ex + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'ex', (HiveServerException, HiveServerException.thrift_spec), None, ), # 1 + ) + + def __init__(self, ex=None,): + self.ex = ex + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.ex = HiveServerException() + self.ex.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('execute_result') + if self.ex is not None: + oprot.writeFieldBegin('ex', TType.STRUCT, 1) + self.ex.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.ex) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class fetchOne_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('fetchOne_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class fetchOne_result: + """ + Attributes: + - success + - ex + """ + + thrift_spec = ( + (0, TType.STRING, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'ex', (HiveServerException, HiveServerException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, ex=None,): + self.success = success + self.ex = ex + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ex = HiveServerException() + self.ex.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('fetchOne_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success) + oprot.writeFieldEnd() + if self.ex is not None: + oprot.writeFieldBegin('ex', TType.STRUCT, 1) + self.ex.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.ex) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class fetchN_args: + """ + Attributes: + - numRows + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'numRows', None, None, ), # 1 + ) + + def __init__(self, numRows=None,): + self.numRows = numRows + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.numRows = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('fetchN_args') + if self.numRows is not None: + oprot.writeFieldBegin('numRows', TType.I32, 1) + oprot.writeI32(self.numRows) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.numRows) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class fetchN_result: + """ + Attributes: + - success + - ex + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0 + (1, TType.STRUCT, 'ex', (HiveServerException, HiveServerException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, ex=None,): + self.success = success + self.ex = ex + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype3, _size0) = iprot.readListBegin() + for _i4 in xrange(_size0): + _elem5 = iprot.readString() + self.success.append(_elem5) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ex = HiveServerException() + self.ex.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('fetchN_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRING, len(self.success)) + for iter6 in self.success: + oprot.writeString(iter6) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.ex is not None: + oprot.writeFieldBegin('ex', TType.STRUCT, 1) + self.ex.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.ex) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class fetchAll_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('fetchAll_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class fetchAll_result: + """ + Attributes: + - success + - ex + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0 + (1, TType.STRUCT, 'ex', (HiveServerException, HiveServerException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, ex=None,): + self.success = success + self.ex = ex + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype10, _size7) = iprot.readListBegin() + for _i11 in xrange(_size7): + _elem12 = iprot.readString() + self.success.append(_elem12) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ex = HiveServerException() + self.ex.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('fetchAll_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRING, len(self.success)) + for iter13 in self.success: + oprot.writeString(iter13) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.ex is not None: + oprot.writeFieldBegin('ex', TType.STRUCT, 1) + self.ex.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.ex) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getSchema_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getSchema_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getSchema_result: + """ + Attributes: + - success + - ex + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (hive_metastore.ttypes.Schema, hive_metastore.ttypes.Schema.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'ex', (HiveServerException, HiveServerException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, ex=None,): + self.success = success + self.ex = ex + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = hive_metastore.ttypes.Schema() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ex = HiveServerException() + self.ex.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getSchema_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ex is not None: + oprot.writeFieldBegin('ex', TType.STRUCT, 1) + self.ex.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.ex) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getThriftSchema_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getThriftSchema_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getThriftSchema_result: + """ + Attributes: + - success + - ex + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (hive_metastore.ttypes.Schema, hive_metastore.ttypes.Schema.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'ex', (HiveServerException, HiveServerException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, ex=None,): + self.success = success + self.ex = ex + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = hive_metastore.ttypes.Schema() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ex = HiveServerException() + self.ex.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getThriftSchema_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ex is not None: + oprot.writeFieldBegin('ex', TType.STRUCT, 1) + self.ex.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.ex) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getClusterStatus_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getClusterStatus_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getClusterStatus_result: + """ + Attributes: + - success + - ex + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (HiveClusterStatus, HiveClusterStatus.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'ex', (HiveServerException, HiveServerException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, ex=None,): + self.success = success + self.ex = ex + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = HiveClusterStatus() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ex = HiveServerException() + self.ex.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getClusterStatus_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ex is not None: + oprot.writeFieldBegin('ex', TType.STRUCT, 1) + self.ex.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.ex) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getQueryPlan_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getQueryPlan_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getQueryPlan_result: + """ + Attributes: + - success + - ex + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (queryplan.ttypes.QueryPlan, queryplan.ttypes.QueryPlan.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'ex', (HiveServerException, HiveServerException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, ex=None,): + self.success = success + self.ex = ex + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = queryplan.ttypes.QueryPlan() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ex = HiveServerException() + self.ex.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getQueryPlan_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ex is not None: + oprot.writeFieldBegin('ex', TType.STRUCT, 1) + self.ex.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.ex) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class clean_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('clean_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class clean_result: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('clean_result') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) diff --git a/service/src/gen/thrift/gen-py/hive_service/__init__.py b/service/src/gen/thrift/gen-py/hive_service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6a0dcc9db2ca5b9d871019dd1d7579a352608e53 --- /dev/null +++ b/service/src/gen/thrift/gen-py/hive_service/__init__.py @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants', 'ThriftHive'] diff --git a/service/src/gen/thrift/gen-py/hive_service/constants.py b/service/src/gen/thrift/gen-py/hive_service/constants.py new file mode 100644 index 0000000000000000000000000000000000000000..4a6492b86920b8617cc59731812ac289c4e159ee --- /dev/null +++ b/service/src/gen/thrift/gen-py/hive_service/constants.py @@ -0,0 +1,11 @@ +# +# Autogenerated by Thrift Compiler (0.9.3) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException +from ttypes import * + diff --git a/service/src/gen/thrift/gen-py/hive_service/ttypes.py b/service/src/gen/thrift/gen-py/hive_service/ttypes.py new file mode 100644 index 0000000000000000000000000000000000000000..e19fe2aa7c44a9b7f4a56514152a2a4ce786e50b --- /dev/null +++ b/service/src/gen/thrift/gen-py/hive_service/ttypes.py @@ -0,0 +1,260 @@ +# +# Autogenerated by Thrift Compiler (0.9.3) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException +import fb303.ttypes +import hive_metastore.ttypes +import queryplan.ttypes + + +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + +class JobTrackerState: + INITIALIZING = 1 + RUNNING = 2 + + _VALUES_TO_NAMES = { + 1: "INITIALIZING", + 2: "RUNNING", + } + + _NAMES_TO_VALUES = { + "INITIALIZING": 1, + "RUNNING": 2, + } + + +class HiveClusterStatus: + """ + Attributes: + - taskTrackers + - mapTasks + - reduceTasks + - maxMapTasks + - maxReduceTasks + - state + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'taskTrackers', None, None, ), # 1 + (2, TType.I32, 'mapTasks', None, None, ), # 2 + (3, TType.I32, 'reduceTasks', None, None, ), # 3 + (4, TType.I32, 'maxMapTasks', None, None, ), # 4 + (5, TType.I32, 'maxReduceTasks', None, None, ), # 5 + (6, TType.I32, 'state', None, None, ), # 6 + ) + + def __init__(self, taskTrackers=None, mapTasks=None, reduceTasks=None, maxMapTasks=None, maxReduceTasks=None, state=None,): + self.taskTrackers = taskTrackers + self.mapTasks = mapTasks + self.reduceTasks = reduceTasks + self.maxMapTasks = maxMapTasks + self.maxReduceTasks = maxReduceTasks + self.state = state + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.taskTrackers = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.mapTasks = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.reduceTasks = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.maxMapTasks = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.maxReduceTasks = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.I32: + self.state = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('HiveClusterStatus') + if self.taskTrackers is not None: + oprot.writeFieldBegin('taskTrackers', TType.I32, 1) + oprot.writeI32(self.taskTrackers) + oprot.writeFieldEnd() + if self.mapTasks is not None: + oprot.writeFieldBegin('mapTasks', TType.I32, 2) + oprot.writeI32(self.mapTasks) + oprot.writeFieldEnd() + if self.reduceTasks is not None: + oprot.writeFieldBegin('reduceTasks', TType.I32, 3) + oprot.writeI32(self.reduceTasks) + oprot.writeFieldEnd() + if self.maxMapTasks is not None: + oprot.writeFieldBegin('maxMapTasks', TType.I32, 4) + oprot.writeI32(self.maxMapTasks) + oprot.writeFieldEnd() + if self.maxReduceTasks is not None: + oprot.writeFieldBegin('maxReduceTasks', TType.I32, 5) + oprot.writeI32(self.maxReduceTasks) + oprot.writeFieldEnd() + if self.state is not None: + oprot.writeFieldBegin('state', TType.I32, 6) + oprot.writeI32(self.state) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.taskTrackers) + value = (value * 31) ^ hash(self.mapTasks) + value = (value * 31) ^ hash(self.reduceTasks) + value = (value * 31) ^ hash(self.maxMapTasks) + value = (value * 31) ^ hash(self.maxReduceTasks) + value = (value * 31) ^ hash(self.state) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class HiveServerException(TException): + """ + Attributes: + - message + - errorCode + - SQLState + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'message', None, None, ), # 1 + (2, TType.I32, 'errorCode', None, None, ), # 2 + (3, TType.STRING, 'SQLState', None, None, ), # 3 + ) + + def __init__(self, message=None, errorCode=None, SQLState=None,): + self.message = message + self.errorCode = errorCode + self.SQLState = SQLState + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.message = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.errorCode = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.SQLState = iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('HiveServerException') + if self.message is not None: + oprot.writeFieldBegin('message', TType.STRING, 1) + oprot.writeString(self.message) + oprot.writeFieldEnd() + if self.errorCode is not None: + oprot.writeFieldBegin('errorCode', TType.I32, 2) + oprot.writeI32(self.errorCode) + oprot.writeFieldEnd() + if self.SQLState is not None: + oprot.writeFieldBegin('SQLState', TType.STRING, 3) + oprot.writeString(self.SQLState) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __str__(self): + return repr(self) + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.message) + value = (value * 31) ^ hash(self.errorCode) + value = (value * 31) ^ hash(self.SQLState) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) diff --git a/service/src/gen/thrift/gen-rb/hive_service_constants.rb b/service/src/gen/thrift/gen-rb/hive_service_constants.rb new file mode 100644 index 0000000000000000000000000000000000000000..ed7d2d7633da050e44f7b6baa630d2e4823e8609 --- /dev/null +++ b/service/src/gen/thrift/gen-rb/hive_service_constants.rb @@ -0,0 +1,9 @@ +# +# Autogenerated by Thrift Compiler (0.9.3) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 'hive_service_types' + diff --git a/service/src/gen/thrift/gen-rb/hive_service_types.rb b/service/src/gen/thrift/gen-rb/hive_service_types.rb new file mode 100644 index 0000000000000000000000000000000000000000..919176704776d22cb59136c624956f73c57dbdc8 --- /dev/null +++ b/service/src/gen/thrift/gen-rb/hive_service_types.rb @@ -0,0 +1,68 @@ +# +# Autogenerated by Thrift Compiler (0.9.3) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 'fb303_types' +require 'hive_metastore_types' +require 'queryplan_types' + + +module JobTrackerState + INITIALIZING = 1 + RUNNING = 2 + VALUE_MAP = {1 => "INITIALIZING", 2 => "RUNNING"} + VALID_VALUES = Set.new([INITIALIZING, RUNNING]).freeze +end + +class HiveClusterStatus + include ::Thrift::Struct, ::Thrift::Struct_Union + TASKTRACKERS = 1 + MAPTASKS = 2 + REDUCETASKS = 3 + MAXMAPTASKS = 4 + MAXREDUCETASKS = 5 + STATE = 6 + + FIELDS = { + TASKTRACKERS => {:type => ::Thrift::Types::I32, :name => 'taskTrackers'}, + MAPTASKS => {:type => ::Thrift::Types::I32, :name => 'mapTasks'}, + REDUCETASKS => {:type => ::Thrift::Types::I32, :name => 'reduceTasks'}, + MAXMAPTASKS => {:type => ::Thrift::Types::I32, :name => 'maxMapTasks'}, + MAXREDUCETASKS => {:type => ::Thrift::Types::I32, :name => 'maxReduceTasks'}, + STATE => {:type => ::Thrift::Types::I32, :name => 'state', :enum_class => ::JobTrackerState} + } + + def struct_fields; FIELDS; end + + def validate + unless @state.nil? || ::JobTrackerState::VALID_VALUES.include?(@state) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field state!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class HiveServerException < ::Thrift::Exception + include ::Thrift::Struct, ::Thrift::Struct_Union + MESSAGE = 1 + ERRORCODE = 2 + SQLSTATE = 3 + + FIELDS = { + MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}, + ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode'}, + SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'SQLState'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + diff --git a/service/src/gen/thrift/gen-rb/thrift_hive.rb b/service/src/gen/thrift/gen-rb/thrift_hive.rb new file mode 100644 index 0000000000000000000000000000000000000000..2b57cd9264b86850570b369dbaa765a9d3c803c4 --- /dev/null +++ b/service/src/gen/thrift/gen-rb/thrift_hive.rb @@ -0,0 +1,555 @@ +# +# Autogenerated by Thrift Compiler (0.9.3) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 'thrift_hive_metastore' +require 'hive_service_types' + +module ThriftHive + class Client < ::ThriftHiveMetastore::Client + include ::Thrift::Client + + def execute(query) + send_execute(query) + recv_execute() + end + + def send_execute(query) + send_message('execute', Execute_args, :query => query) + end + + def recv_execute() + result = receive_message(Execute_result) + raise result.ex unless result.ex.nil? + return + end + + def fetchOne() + send_fetchOne() + return recv_fetchOne() + end + + def send_fetchOne() + send_message('fetchOne', FetchOne_args) + end + + def recv_fetchOne() + result = receive_message(FetchOne_result) + return result.success unless result.success.nil? + raise result.ex unless result.ex.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fetchOne failed: unknown result') + end + + def fetchN(numRows) + send_fetchN(numRows) + return recv_fetchN() + end + + def send_fetchN(numRows) + send_message('fetchN', FetchN_args, :numRows => numRows) + end + + def recv_fetchN() + result = receive_message(FetchN_result) + return result.success unless result.success.nil? + raise result.ex unless result.ex.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fetchN failed: unknown result') + end + + def fetchAll() + send_fetchAll() + return recv_fetchAll() + end + + def send_fetchAll() + send_message('fetchAll', FetchAll_args) + end + + def recv_fetchAll() + result = receive_message(FetchAll_result) + return result.success unless result.success.nil? + raise result.ex unless result.ex.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fetchAll failed: unknown result') + end + + def getSchema() + send_getSchema() + return recv_getSchema() + end + + def send_getSchema() + send_message('getSchema', GetSchema_args) + end + + def recv_getSchema() + result = receive_message(GetSchema_result) + return result.success unless result.success.nil? + raise result.ex unless result.ex.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getSchema failed: unknown result') + end + + def getThriftSchema() + send_getThriftSchema() + return recv_getThriftSchema() + end + + def send_getThriftSchema() + send_message('getThriftSchema', GetThriftSchema_args) + end + + def recv_getThriftSchema() + result = receive_message(GetThriftSchema_result) + return result.success unless result.success.nil? + raise result.ex unless result.ex.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getThriftSchema failed: unknown result') + end + + def getClusterStatus() + send_getClusterStatus() + return recv_getClusterStatus() + end + + def send_getClusterStatus() + send_message('getClusterStatus', GetClusterStatus_args) + end + + def recv_getClusterStatus() + result = receive_message(GetClusterStatus_result) + return result.success unless result.success.nil? + raise result.ex unless result.ex.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getClusterStatus failed: unknown result') + end + + def getQueryPlan() + send_getQueryPlan() + return recv_getQueryPlan() + end + + def send_getQueryPlan() + send_message('getQueryPlan', GetQueryPlan_args) + end + + def recv_getQueryPlan() + result = receive_message(GetQueryPlan_result) + return result.success unless result.success.nil? + raise result.ex unless result.ex.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getQueryPlan failed: unknown result') + end + + def clean() + send_clean() + recv_clean() + end + + def send_clean() + send_message('clean', Clean_args) + end + + def recv_clean() + result = receive_message(Clean_result) + return + end + + end + + class Processor < ::ThriftHiveMetastore::Processor + include ::Thrift::Processor + + def process_execute(seqid, iprot, oprot) + args = read_args(iprot, Execute_args) + result = Execute_result.new() + begin + @handler.execute(args.query) + rescue ::HiveServerException => ex + result.ex = ex + end + write_result(result, oprot, 'execute', seqid) + end + + def process_fetchOne(seqid, iprot, oprot) + args = read_args(iprot, FetchOne_args) + result = FetchOne_result.new() + begin + result.success = @handler.fetchOne() + rescue ::HiveServerException => ex + result.ex = ex + end + write_result(result, oprot, 'fetchOne', seqid) + end + + def process_fetchN(seqid, iprot, oprot) + args = read_args(iprot, FetchN_args) + result = FetchN_result.new() + begin + result.success = @handler.fetchN(args.numRows) + rescue ::HiveServerException => ex + result.ex = ex + end + write_result(result, oprot, 'fetchN', seqid) + end + + def process_fetchAll(seqid, iprot, oprot) + args = read_args(iprot, FetchAll_args) + result = FetchAll_result.new() + begin + result.success = @handler.fetchAll() + rescue ::HiveServerException => ex + result.ex = ex + end + write_result(result, oprot, 'fetchAll', seqid) + end + + def process_getSchema(seqid, iprot, oprot) + args = read_args(iprot, GetSchema_args) + result = GetSchema_result.new() + begin + result.success = @handler.getSchema() + rescue ::HiveServerException => ex + result.ex = ex + end + write_result(result, oprot, 'getSchema', seqid) + end + + def process_getThriftSchema(seqid, iprot, oprot) + args = read_args(iprot, GetThriftSchema_args) + result = GetThriftSchema_result.new() + begin + result.success = @handler.getThriftSchema() + rescue ::HiveServerException => ex + result.ex = ex + end + write_result(result, oprot, 'getThriftSchema', seqid) + end + + def process_getClusterStatus(seqid, iprot, oprot) + args = read_args(iprot, GetClusterStatus_args) + result = GetClusterStatus_result.new() + begin + result.success = @handler.getClusterStatus() + rescue ::HiveServerException => ex + result.ex = ex + end + write_result(result, oprot, 'getClusterStatus', seqid) + end + + def process_getQueryPlan(seqid, iprot, oprot) + args = read_args(iprot, GetQueryPlan_args) + result = GetQueryPlan_result.new() + begin + result.success = @handler.getQueryPlan() + rescue ::HiveServerException => ex + result.ex = ex + end + write_result(result, oprot, 'getQueryPlan', seqid) + end + + def process_clean(seqid, iprot, oprot) + args = read_args(iprot, Clean_args) + result = Clean_result.new() + @handler.clean() + write_result(result, oprot, 'clean', seqid) + end + + end + + # HELPER FUNCTIONS AND STRUCTURES + + class Execute_args + include ::Thrift::Struct, ::Thrift::Struct_Union + QUERY = 1 + + FIELDS = { + QUERY => {:type => ::Thrift::Types::STRING, :name => 'query'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Execute_result + include ::Thrift::Struct, ::Thrift::Struct_Union + EX = 1 + + FIELDS = { + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::HiveServerException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class FetchOne_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class FetchOne_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + EX = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}, + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::HiveServerException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class FetchN_args + include ::Thrift::Struct, ::Thrift::Struct_Union + NUMROWS = 1 + + FIELDS = { + NUMROWS => {:type => ::Thrift::Types::I32, :name => 'numRows'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class FetchN_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + EX = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}}, + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::HiveServerException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class FetchAll_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class FetchAll_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + EX = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRING}}, + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::HiveServerException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetSchema_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetSchema_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + EX = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Schema}, + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::HiveServerException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetThriftSchema_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetThriftSchema_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + EX = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Schema}, + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::HiveServerException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetClusterStatus_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetClusterStatus_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + EX = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::HiveClusterStatus}, + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::HiveServerException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetQueryPlan_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetQueryPlan_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + EX = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::QueryPlan}, + EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::HiveServerException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Clean_args + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Clean_result + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + +end + diff --git a/service/src/java/org/apache/hive/service/cli/CLIService.java b/service/src/java/org/apache/hive/service/cli/CLIService.java index 0d5ae1e491bdcf98a12f5eef7b35f23c7b9dfc00..49be13bd05db1307d21d33f3fafa8bcb44fcbe5a 100644 --- a/service/src/java/org/apache/hive/service/cli/CLIService.java +++ b/service/src/java/org/apache/hive/service/cli/CLIService.java @@ -201,6 +201,18 @@ public SessionHandle openSession(String username, String password, Map configuration) + throws HiveSQLException { + SessionHandle result = sessionManager.restoreSession(sessionHandle, SERVER_VERSION, username, password, + configuration, false, null); + LOG.debug(sessionHandle + ": restoreSession()"); + return result; + } + /* (non-Javadoc) * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) */ diff --git a/service/src/java/org/apache/hive/service/cli/CLIServiceClient.java b/service/src/java/org/apache/hive/service/cli/CLIServiceClient.java index 3155c238ff688bfea16b0aaeea950599bb659b5b..0ed6d5ab8e2dc5cfa275a1831e7d06c87a02b275 100644 --- a/service/src/java/org/apache/hive/service/cli/CLIServiceClient.java +++ b/service/src/java/org/apache/hive/service/cli/CLIServiceClient.java @@ -35,6 +35,11 @@ public SessionHandle openSession(String username, String password) return openSession(username, password, Collections.emptyMap()); } + public SessionHandle restoreSession(SessionHandle handle, String username, String password) + throws HiveSQLException { + return restoreSession(handle, username, password, Collections.emptyMap()); + } + @Override public RowSet fetchResults(OperationHandle opHandle) throws HiveSQLException { // TODO: provide STATIC default value diff --git a/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java b/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java index 9cad5be198c063115a8e90c67b1c2fd910ca8bc6..bd9a60820360f33f2160807b459f25ef7b0e4c3c 100644 --- a/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java +++ b/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java @@ -44,6 +44,15 @@ public SessionHandle openSession(String username, String password, return cliService.openSession(username, password, configuration); } + /* (non-Javadoc) + * @see org.apache.hive.service.cli.CLIServiceClient#restoreSession(SessionHandle, java.lang.String, java.lang.String, java.util.Map) + */ + @Override + public SessionHandle restoreSession(SessionHandle handle, String username, String password, + Map configuration) throws HiveSQLException { + return cliService.restoreSession(handle, username, password, configuration); + } + @Override public SessionHandle openSessionWithImpersonation(String username, String password, Map configuration, String delegationToken) throws HiveSQLException { diff --git a/service/src/java/org/apache/hive/service/cli/ICLIService.java b/service/src/java/org/apache/hive/service/cli/ICLIService.java index 0a54bdda8067330ea358683054aa987a6c22317f..56628c6e4065a8982740fe1ea9361e4ee240e1d9 100644 --- a/service/src/java/org/apache/hive/service/cli/ICLIService.java +++ b/service/src/java/org/apache/hive/service/cli/ICLIService.java @@ -28,6 +28,9 @@ SessionHandle openSession(String username, String password, Map configuration) throws HiveSQLException; + SessionHandle restoreSession(SessionHandle sessionHandle, String username, String password, + Map configuration) throws HiveSQLException; + SessionHandle openSessionWithImpersonation(String username, String password, Map configuration, String delegationToken) throws HiveSQLException; diff --git a/service/src/java/org/apache/hive/service/cli/SessionHandle.java b/service/src/java/org/apache/hive/service/cli/SessionHandle.java index 4e4f0211de09408168c8da669626fb49f3db364c..9fc30c6b49a4f01c906fead5a569035d6b79706e 100644 --- a/service/src/java/org/apache/hive/service/cli/SessionHandle.java +++ b/service/src/java/org/apache/hive/service/cli/SessionHandle.java @@ -45,7 +45,10 @@ public SessionHandle(TSessionHandle tSessionHandle, TProtocolVersion protocol) { super(tSessionHandle.getSessionId()); this.protocol = protocol; } - + public SessionHandle(HandleIdentifier handleId, TProtocolVersion protocol) { + super(handleId); + this.protocol = protocol; + } public UUID getSessionId() { return getHandleIdentifier().getPublicId(); } diff --git a/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java b/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java index 3c5700bd114f6b792df10df23e57dad9b9e689f6..eb63c95ef0b186b521e6a14a73bea0728664c8d8 100644 --- a/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java +++ b/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java @@ -111,12 +111,12 @@ private volatile long lastAccessTime; private volatile long lastIdleTime; - public HiveSessionImpl(TProtocolVersion protocol, String username, String password, + public HiveSessionImpl(SessionHandle sessionHandle, TProtocolVersion protocol, String username, String password, HiveConf serverhiveConf, String ipAddress) { this.username = username; this.password = password; creationTime = System.currentTimeMillis(); - this.sessionHandle = new SessionHandle(protocol); + this.sessionHandle = sessionHandle; this.hiveConf = new HiveConf(serverhiveConf); this.ipAddress = ipAddress; @@ -139,6 +139,12 @@ public HiveSessionImpl(TProtocolVersion protocol, String username, String passwo hiveConf.setInt(ListSinkOperator.OUTPUT_PROTOCOL, protocol.getValue()); } + public HiveSessionImpl(TProtocolVersion protocol, String username, String password, + HiveConf serverhiveConf, String ipAddress) { + this(new SessionHandle(protocol), protocol, username, password, serverhiveConf, ipAddress); + } + + @Override /** * Opens a new HiveServer2 session for the client connection. diff --git a/service/src/java/org/apache/hive/service/cli/session/SessionManager.java b/service/src/java/org/apache/hive/service/cli/session/SessionManager.java index de18f1d93502704e7a8fbb8d31d93bd770c4d232..6b89a350ea0aefd13954b86c8bbd5c47d0843df1 100644 --- a/service/src/java/org/apache/hive/service/cli/session/SessionManager.java +++ b/service/src/java/org/apache/hive/service/cli/session/SessionManager.java @@ -43,6 +43,7 @@ import org.apache.hadoop.hive.conf.HiveConf.ConfVars; import org.apache.hadoop.hive.ql.hooks.HookUtils; import org.apache.hive.service.CompositeService; +import org.apache.hive.service.auth.TSetIpAddressProcessor; import org.apache.hive.service.cli.HiveSQLException; import org.apache.hive.service.cli.SessionHandle; import org.apache.hive.service.cli.operation.Operation; @@ -275,6 +276,13 @@ public SessionHandle openSession(TProtocolVersion protocol, String username, Str public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, Map sessionConf, boolean withImpersonation, String delegationToken) throws HiveSQLException { + return createSession(null, protocol, username, password, ipAddress, sessionConf, + withImpersonation, delegationToken).getSessionHandle(); + } + public HiveSession createSession(SessionHandle sessionHandle, TProtocolVersion protocol, String username, String password, String ipAddress, + Map sessionConf, boolean withImpersonation, String delegationToken) + throws HiveSQLException { + HiveSession session; // If doAs is set to true for HiveServer2, we will create a proxy object for the session impl. // Within the proxy object, we wrap the method call in a UserGroupInformation#doAs @@ -286,9 +294,10 @@ public SessionHandle openSession(TProtocolVersion protocol, String username, Str } else { try { Class clazz = Class.forName(sessionImplWithUGIclassName); - Constructor constructor = clazz.getConstructor(String.class, String.class, Map.class, String.class); - hiveSessionUgi = (HiveSessionImplwithUGI) constructor.newInstance(new Object[] - {protocol, username, password, hiveConf, ipAddress, delegationToken}); + Constructor constructor = clazz.getConstructor(TProtocolVersion.class, String.class, String.class, + HiveConf.class, Map.class, String.class); + hiveSessionUgi = (HiveSessionImplwithUGI) constructor.newInstance( + protocol, username, password, hiveConf, ipAddress, delegationToken); } catch (Exception e) { throw new HiveSQLException("Cannot initilize session class:" + sessionImplWithUGIclassName); } @@ -300,12 +309,21 @@ public SessionHandle openSession(TProtocolVersion protocol, String username, Str session = new HiveSessionImpl(protocol, username, password, hiveConf, ipAddress); } else { try { - Class clazz = Class.forName(sessionImplclassName); - Constructor constructor = clazz.getConstructor(String.class, String.class, Map.class); - session = (HiveSession) constructor.newInstance(new Object[] - {protocol, username, password, hiveConf, ipAddress}); + if (sessionHandle != null) { + Class clazz = Class.forName(sessionImplclassName); + Constructor constructor = clazz.getConstructor(SessionHandle.class, TProtocolVersion.class, + String.class, String.class, HiveConf.class, Map.class, String.class); + session = (HiveSession) constructor.newInstance(sessionHandle, protocol, username, password, + hiveConf, sessionConf, TSetIpAddressProcessor.getUserIpAddress()); + } else { + Class clazz = Class.forName(sessionImplclassName); + Constructor constructor = clazz.getConstructor(TProtocolVersion.class, + String.class, String.class, HiveConf.class, Map.class, String.class); + session = (HiveSession) constructor.newInstance(protocol, username, password, + hiveConf, sessionConf, TSetIpAddressProcessor.getUserIpAddress()); + } } catch (Exception e) { - throw new HiveSQLException("Cannot initilize session class:" + sessionImplclassName); + throw new HiveSQLException("Cannot initilize session class:" + sessionImplclassName, e); } } } @@ -339,9 +357,15 @@ public SessionHandle openSession(TProtocolVersion protocol, String username, Str throw new HiveSQLException("Failed to execute session hooks: " + e.getMessage(), e); } handleToSession.put(session.getSessionHandle(), session); + return session; + } + public SessionHandle restoreSession(SessionHandle sessionHandle, TProtocolVersion protocol, String username, String password, + Map sessionConf, boolean withImpersonation, String delegationToken) + throws HiveSQLException { + HiveSession session = createSession(sessionHandle, protocol, username, password, null, sessionConf, + withImpersonation, delegationToken); return session.getSessionHandle(); } - public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { HiveSession session = handleToSession.remove(sessionHandle); if (session == null) { diff --git a/service/src/java/org/apache/hive/service/cli/thrift/RetryingThriftCLIServiceClient.java b/service/src/java/org/apache/hive/service/cli/thrift/RetryingThriftCLIServiceClient.java index a81c600236e6e0f53a484806e559303279244616..5face1ac90169d90504027a0d4b960c7b1c1d388 100644 --- a/service/src/java/org/apache/hive/service/cli/thrift/RetryingThriftCLIServiceClient.java +++ b/service/src/java/org/apache/hive/service/cli/thrift/RetryingThriftCLIServiceClient.java @@ -57,6 +57,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; + /** * RetryingThriftCLIServiceClient. Creates a proxy for a CLIServiceClient * implementation and retries calls to it on failure. @@ -106,6 +107,12 @@ public SessionHandle openSession(String username, String password, Map configuration) throws HiveSQLException{ + return cliService.restoreSession(sessionHandle, username, password, configuration); + } + + @Override public SessionHandle openSessionWithImpersonation(String username, String password, Map configuration, diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java index 78b4b3177213bc60331c1b71fb08470841e9a7a3..0f50e0ef88f04386bba998a61e4709194a0b117c 100644 --- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java @@ -90,6 +90,8 @@ import org.apache.hive.service.rpc.thrift.TProtocolVersion; import org.apache.hive.service.rpc.thrift.TRenewDelegationTokenReq; import org.apache.hive.service.rpc.thrift.TRenewDelegationTokenResp; +import org.apache.hive.service.rpc.thrift.TRestoreSessionReq; +import org.apache.hive.service.rpc.thrift.TRestoreSessionResp; import org.apache.hive.service.rpc.thrift.TStatus; import org.apache.hive.service.rpc.thrift.TStatusCode; import org.apache.hive.service.server.HiveServer2; @@ -376,6 +378,29 @@ public TOpenSessionResp OpenSession(TOpenSessionReq req) throws TException { return resp; } + @Override + public TRestoreSessionResp RestoreSession(TRestoreSessionReq req) throws TException { + LOG.info("Client protocol version: " + req.getClient_protocol()); + TRestoreSessionResp resp = new TRestoreSessionResp(); + try { + SessionHandle sessionHandle = getSessionHandle(req, resp); + resp.setSessionHandle(sessionHandle.toTSessionHandle()); + // TODO: set real configuration map + resp.setConfiguration(new HashMap()); + resp.setStatus(OK_STATUS); + ThriftCLIServerContext context = + (ThriftCLIServerContext)currentServerContext.get(); + if (context != null) { + context.setSessionHandle(sessionHandle); + } + LOG.info("Restored a session, current sessions: " + sessionCount.incrementAndGet()); + } catch (Exception e) { + LOG.warn("Error restoring session: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + private String getIpAddress() { String clientIpAddress; // Http transport mode. @@ -474,6 +499,24 @@ SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res) return sessionHandle; } + /** + * restores a session handle + * @param req + * @param res + * @return + * @throws HiveSQLException + * @throws LoginException + * @throws IOException + */ + SessionHandle getSessionHandle(TRestoreSessionReq req, TRestoreSessionResp res) + throws HiveSQLException, LoginException, IOException { + TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION, + req.getClient_protocol()); + SessionHandle sessionHandle = cliService.restoreSession(new SessionHandle(res.getSessionHandle()), + req.getUsername(), req.getPassword(), req.getConfiguration()); + res.setServerProtocolVersion(protocol); + return sessionHandle; + } private String getDelegationToken(String userName) throws HiveSQLException, LoginException, IOException { diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java index 5f01165d0dfd131a2599b90a8e1c4d4970650b7a..1e9d66b4d8b32429998c09ec834c80ff19c56491 100644 --- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java +++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java @@ -75,6 +75,8 @@ import org.apache.hive.service.rpc.thrift.TProtocolVersion; import org.apache.hive.service.rpc.thrift.TRenewDelegationTokenReq; import org.apache.hive.service.rpc.thrift.TRenewDelegationTokenResp; +import org.apache.hive.service.rpc.thrift.TRestoreSessionReq; +import org.apache.hive.service.rpc.thrift.TRestoreSessionResp; import org.apache.hive.service.rpc.thrift.TStatus; import org.apache.hive.service.rpc.thrift.TStatusCode; import org.apache.thrift.TException; @@ -119,6 +121,29 @@ public SessionHandle openSession(String username, String password, } /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#restoreSession(SessionHandle, java.lang.String, java.lang.String, java.util.Map) + */ + @Override + public SessionHandle restoreSession(SessionHandle handle, String username, String password, + Map configuration) + throws HiveSQLException { + try { + TRestoreSessionReq req = new TRestoreSessionReq(); + req.setSessionHandle(handle.toTSessionHandle()); + req.setUsername(username); + req.setPassword(password); + req.setConfiguration(configuration); + TRestoreSessionResp resp = cliService.RestoreSession(req); + checkStatus(resp.getStatus()); + return new SessionHandle(resp.getSessionHandle(), resp.getServerProtocolVersion()); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) */ @Override diff --git a/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java b/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java index e78181a15993d99f1cab5a061c08bb21823d2171..aaf97b6e8b26f1c06d925f686afcf910b4c09008 100644 --- a/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java +++ b/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java @@ -72,6 +72,8 @@ public void setUp() throws Exception { public void tearDown() throws Exception { } + abstract void restartService() throws Exception; + @Test public void testOpenSession() throws Exception { SessionHandle sessionHandle = client.openSession( @@ -85,6 +87,19 @@ public void testOpenSession() throws Exception { } @Test + public void testRestoreSession() throws Exception { + SessionHandle handle = openSession(new HashMap()); + restartService(); + SessionHandle restoredHandle = client.restoreSession(handle, "tom", "password"); + assertEquals(handle, restoredHandle); + // Random operation + OperationHandle opHandle = client.executeStatement(handle, "CREATE TABLE TEST_EXEC(ID STRING)", null); + client.closeOperation(opHandle); + // close session + client.closeSession(restoredHandle); + } + + @Test public void testGetFunctions() throws Exception { SessionHandle sessionHandle = client.openSession("tom", "password"); assertNotNull(sessionHandle);