diff --git metastore/if/hive_metastore.thrift metastore/if/hive_metastore.thrift index e6403ed..56ec9aa 100755 --- metastore/if/hive_metastore.thrift +++ metastore/if/hive_metastore.thrift @@ -1067,6 +1067,10 @@ service ThriftHiveMetastore extends fb303.FacebookService PartitionsByExprResult get_partitions_by_expr(1:PartitionsByExprRequest req) throws(1:MetaException o1, 2:NoSuchObjectException o2) + // get the partitions matching the given partition filter + i32 get_num_partitions_by_filter(1:string db_name 2:string tbl_name 3:string filter) + throws(1:MetaException o1, 2:NoSuchObjectException o2) + // get partitions give a list of partition names list get_partitions_by_names(1:string db_name 2:string tbl_name 3:list names) throws(1:MetaException o1, 2:NoSuchObjectException o2) diff --git metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp index 22bea87..7c530b2 100644 --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp @@ -16083,6 +16083,265 @@ uint32_t ThriftHiveMetastore_get_partitions_by_expr_presult::read(::apache::thri } +ThriftHiveMetastore_get_num_partitions_by_filter_args::~ThriftHiveMetastore_get_num_partitions_by_filter_args() throw() { +} + + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_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->db_name); + this->__isset.db_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tbl_name); + this->__isset.tbl_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->filter); + this->__isset.filter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_num_partitions_by_filter_args"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->db_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->tbl_name); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->filter); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_num_partitions_by_filter_pargs::~ThriftHiveMetastore_get_num_partitions_by_filter_pargs() throw() { +} + + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_num_partitions_by_filter_pargs"); + + xfer += oprot->writeFieldBegin("db_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->db_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("tbl_name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->tbl_name))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("filter", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->filter))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_num_partitions_by_filter_result::~ThriftHiveMetastore_get_num_partitions_by_filter_result() throw() { +} + + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_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_I32) { + xfer += iprot->readI32(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("ThriftHiveMetastore_get_num_partitions_by_filter_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0); + xfer += oprot->writeI32(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o1) { + xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->o1.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.o2) { + xfer += oprot->writeFieldBegin("o2", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->o2.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + + +ThriftHiveMetastore_get_num_partitions_by_filter_presult::~ThriftHiveMetastore_get_num_partitions_by_filter_presult() throw() { +} + + +uint32_t ThriftHiveMetastore_get_num_partitions_by_filter_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_I32) { + xfer += iprot->readI32((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o1.read(iprot); + this->__isset.o1 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->o2.read(iprot); + this->__isset.o2 = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + + ThriftHiveMetastore_get_partitions_by_names_args::~ThriftHiveMetastore_get_partitions_by_names_args() throw() { } @@ -37145,6 +37404,72 @@ void ThriftHiveMetastoreClient::recv_get_partitions_by_expr(PartitionsByExprResu throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_partitions_by_expr failed: unknown result"); } +int32_t ThriftHiveMetastoreClient::get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) +{ + send_get_num_partitions_by_filter(db_name, tbl_name, filter); + return recv_get_num_partitions_by_filter(); +} + +void ThriftHiveMetastoreClient::send_get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_num_partitions_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_num_partitions_by_filter_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.filter = &filter; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int32_t ThriftHiveMetastoreClient::recv_get_num_partitions_by_filter() +{ + + 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("get_num_partitions_by_filter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int32_t _return; + ThriftHiveMetastore_get_num_partitions_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.o1) { + throw result.o1; + } + if (result.__isset.o2) { + throw result.o2; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_num_partitions_by_filter failed: unknown result"); +} + void ThriftHiveMetastoreClient::get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) { send_get_partitions_by_names(db_name, tbl_name, names); @@ -45289,6 +45614,66 @@ void ThriftHiveMetastoreProcessor::process_get_partitions_by_expr(int32_t seqid, } } +void ThriftHiveMetastoreProcessor::process_get_num_partitions_by_filter(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("ThriftHiveMetastore.get_num_partitions_by_filter", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.get_num_partitions_by_filter"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.get_num_partitions_by_filter"); + } + + ThriftHiveMetastore_get_num_partitions_by_filter_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.get_num_partitions_by_filter", bytes); + } + + ThriftHiveMetastore_get_num_partitions_by_filter_result result; + try { + result.success = iface_->get_num_partitions_by_filter(args.db_name, args.tbl_name, args.filter); + result.__isset.success = true; + } catch (MetaException &o1) { + result.o1 = o1; + result.__isset.o1 = true; + } catch (NoSuchObjectException &o2) { + result.o2 = o2; + result.__isset.o2 = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.get_num_partitions_by_filter"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_num_partitions_by_filter", ::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, "ThriftHiveMetastore.get_num_partitions_by_filter"); + } + + oprot->writeMessageBegin("get_num_partitions_by_filter", ::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, "ThriftHiveMetastore.get_num_partitions_by_filter", bytes); + } +} + void ThriftHiveMetastoreProcessor::process_get_partitions_by_names(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { void* ctx = NULL; @@ -55062,6 +55447,100 @@ void ThriftHiveMetastoreConcurrentClient::recv_get_partitions_by_expr(Partitions } // end while(true) } +int32_t ThriftHiveMetastoreConcurrentClient::get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) +{ + int32_t seqid = send_get_num_partitions_by_filter(db_name, tbl_name, filter); + return recv_get_num_partitions_by_filter(seqid); +} + +int32_t ThriftHiveMetastoreConcurrentClient::send_get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("get_num_partitions_by_filter", ::apache::thrift::protocol::T_CALL, cseqid); + + ThriftHiveMetastore_get_num_partitions_by_filter_pargs args; + args.db_name = &db_name; + args.tbl_name = &tbl_name; + args.filter = &filter; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +int32_t ThriftHiveMetastoreConcurrentClient::recv_get_num_partitions_by_filter(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("get_num_partitions_by_filter") != 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); + } + int32_t _return; + ThriftHiveMetastore_get_num_partitions_by_filter_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + sentry.commit(); + return _return; + } + if (result.__isset.o1) { + sentry.commit(); + throw result.o1; + } + if (result.__isset.o2) { + sentry.commit(); + throw result.o2; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_num_partitions_by_filter 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 ThriftHiveMetastoreConcurrentClient::get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) { int32_t seqid = send_get_partitions_by_names(db_name, tbl_name, names); diff --git metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h index 62a2007..01b332e 100644 --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h @@ -80,6 +80,7 @@ class ThriftHiveMetastoreIf : virtual public ::facebook::fb303::FacebookService virtual void get_partitions_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int16_t max_parts) = 0; virtual void get_part_specs_by_filter(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::string& filter, const int32_t max_parts) = 0; virtual void get_partitions_by_expr(PartitionsByExprResult& _return, const PartitionsByExprRequest& req) = 0; + virtual int32_t get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) = 0; virtual void get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) = 0; virtual void alter_partition(const std::string& db_name, const std::string& tbl_name, const Partition& new_part) = 0; virtual void alter_partitions(const std::string& db_name, const std::string& tbl_name, const std::vector & new_parts) = 0; @@ -365,6 +366,10 @@ class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual p void get_partitions_by_expr(PartitionsByExprResult& /* _return */, const PartitionsByExprRequest& /* req */) { return; } + int32_t get_num_partitions_by_filter(const std::string& /* db_name */, const std::string& /* tbl_name */, const std::string& /* filter */) { + int32_t _return = 0; + return _return; + } void get_partitions_by_names(std::vector & /* _return */, const std::string& /* db_name */, const std::string& /* tbl_name */, const std::vector & /* names */) { return; } @@ -8293,6 +8298,140 @@ class ThriftHiveMetastore_get_partitions_by_expr_presult { }; +typedef struct _ThriftHiveMetastore_get_num_partitions_by_filter_args__isset { + _ThriftHiveMetastore_get_num_partitions_by_filter_args__isset() : db_name(false), tbl_name(false), filter(false) {} + bool db_name :1; + bool tbl_name :1; + bool filter :1; +} _ThriftHiveMetastore_get_num_partitions_by_filter_args__isset; + +class ThriftHiveMetastore_get_num_partitions_by_filter_args { + public: + + ThriftHiveMetastore_get_num_partitions_by_filter_args(const ThriftHiveMetastore_get_num_partitions_by_filter_args&); + ThriftHiveMetastore_get_num_partitions_by_filter_args& operator=(const ThriftHiveMetastore_get_num_partitions_by_filter_args&); + ThriftHiveMetastore_get_num_partitions_by_filter_args() : db_name(), tbl_name(), filter() { + } + + virtual ~ThriftHiveMetastore_get_num_partitions_by_filter_args() throw(); + std::string db_name; + std::string tbl_name; + std::string filter; + + _ThriftHiveMetastore_get_num_partitions_by_filter_args__isset __isset; + + void __set_db_name(const std::string& val); + + void __set_tbl_name(const std::string& val); + + void __set_filter(const std::string& val); + + bool operator == (const ThriftHiveMetastore_get_num_partitions_by_filter_args & rhs) const + { + if (!(db_name == rhs.db_name)) + return false; + if (!(tbl_name == rhs.tbl_name)) + return false; + if (!(filter == rhs.filter)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_get_num_partitions_by_filter_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_num_partitions_by_filter_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_get_num_partitions_by_filter_pargs { + public: + + + virtual ~ThriftHiveMetastore_get_num_partitions_by_filter_pargs() throw(); + const std::string* db_name; + const std::string* tbl_name; + const std::string* filter; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_num_partitions_by_filter_result__isset { + _ThriftHiveMetastore_get_num_partitions_by_filter_result__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_num_partitions_by_filter_result__isset; + +class ThriftHiveMetastore_get_num_partitions_by_filter_result { + public: + + ThriftHiveMetastore_get_num_partitions_by_filter_result(const ThriftHiveMetastore_get_num_partitions_by_filter_result&); + ThriftHiveMetastore_get_num_partitions_by_filter_result& operator=(const ThriftHiveMetastore_get_num_partitions_by_filter_result&); + ThriftHiveMetastore_get_num_partitions_by_filter_result() : success(0) { + } + + virtual ~ThriftHiveMetastore_get_num_partitions_by_filter_result() throw(); + int32_t success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_num_partitions_by_filter_result__isset __isset; + + void __set_success(const int32_t val); + + void __set_o1(const MetaException& val); + + void __set_o2(const NoSuchObjectException& val); + + bool operator == (const ThriftHiveMetastore_get_num_partitions_by_filter_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(o1 == rhs.o1)) + return false; + if (!(o2 == rhs.o2)) + return false; + return true; + } + bool operator != (const ThriftHiveMetastore_get_num_partitions_by_filter_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_get_num_partitions_by_filter_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_get_num_partitions_by_filter_presult__isset { + _ThriftHiveMetastore_get_num_partitions_by_filter_presult__isset() : success(false), o1(false), o2(false) {} + bool success :1; + bool o1 :1; + bool o2 :1; +} _ThriftHiveMetastore_get_num_partitions_by_filter_presult__isset; + +class ThriftHiveMetastore_get_num_partitions_by_filter_presult { + public: + + + virtual ~ThriftHiveMetastore_get_num_partitions_by_filter_presult() throw(); + int32_t* success; + MetaException o1; + NoSuchObjectException o2; + + _ThriftHiveMetastore_get_num_partitions_by_filter_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + typedef struct _ThriftHiveMetastore_get_partitions_by_names_args__isset { _ThriftHiveMetastore_get_partitions_by_names_args__isset() : db_name(false), tbl_name(false), names(false) {} bool db_name :1; @@ -17316,6 +17455,9 @@ class ThriftHiveMetastoreClient : virtual public ThriftHiveMetastoreIf, public void get_partitions_by_expr(PartitionsByExprResult& _return, const PartitionsByExprRequest& req); void send_get_partitions_by_expr(const PartitionsByExprRequest& req); void recv_get_partitions_by_expr(PartitionsByExprResult& _return); + int32_t get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter); + void send_get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter); + int32_t recv_get_num_partitions_by_filter(); void get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names); void send_get_partitions_by_names(const std::string& db_name, const std::string& tbl_name, const std::vector & names); void recv_get_partitions_by_names(std::vector & _return); @@ -17606,6 +17748,7 @@ class ThriftHiveMetastoreProcessor : public ::facebook::fb303::FacebookServiceP void process_get_partitions_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_get_part_specs_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_get_partitions_by_expr(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_num_partitions_by_filter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_get_partitions_by_names(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_alter_partition(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_alter_partitions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); @@ -17742,6 +17885,7 @@ class ThriftHiveMetastoreProcessor : public ::facebook::fb303::FacebookServiceP processMap_["get_partitions_by_filter"] = &ThriftHiveMetastoreProcessor::process_get_partitions_by_filter; processMap_["get_part_specs_by_filter"] = &ThriftHiveMetastoreProcessor::process_get_part_specs_by_filter; processMap_["get_partitions_by_expr"] = &ThriftHiveMetastoreProcessor::process_get_partitions_by_expr; + processMap_["get_num_partitions_by_filter"] = &ThriftHiveMetastoreProcessor::process_get_num_partitions_by_filter; processMap_["get_partitions_by_names"] = &ThriftHiveMetastoreProcessor::process_get_partitions_by_names; processMap_["alter_partition"] = &ThriftHiveMetastoreProcessor::process_alter_partition; processMap_["alter_partitions"] = &ThriftHiveMetastoreProcessor::process_alter_partitions; @@ -18410,6 +18554,15 @@ class ThriftHiveMetastoreMultiface : virtual public ThriftHiveMetastoreIf, publi return; } + int32_t get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->get_num_partitions_by_filter(db_name, tbl_name, filter); + } + return ifaces_[i]->get_num_partitions_by_filter(db_name, tbl_name, filter); + } + void get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) { size_t sz = ifaces_.size(); size_t i = 0; @@ -19308,6 +19461,9 @@ class ThriftHiveMetastoreConcurrentClient : virtual public ThriftHiveMetastoreIf void get_partitions_by_expr(PartitionsByExprResult& _return, const PartitionsByExprRequest& req); int32_t send_get_partitions_by_expr(const PartitionsByExprRequest& req); void recv_get_partitions_by_expr(PartitionsByExprResult& _return, const int32_t seqid); + int32_t get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter); + int32_t send_get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter); + int32_t recv_get_num_partitions_by_filter(const int32_t seqid); void get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names); int32_t send_get_partitions_by_names(const std::string& db_name, const std::string& tbl_name, const std::vector & names); void recv_get_partitions_by_names(std::vector & _return, const int32_t seqid); diff --git metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp index 383a0d2..0fee77b 100644 --- metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp +++ metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp @@ -312,6 +312,11 @@ class ThriftHiveMetastoreHandler : virtual public ThriftHiveMetastoreIf { printf("get_partitions_by_expr\n"); } + int32_t get_num_partitions_by_filter(const std::string& db_name, const std::string& tbl_name, const std::string& filter) { + // Your implementation goes here + printf("get_num_partitions_by_filter\n"); + } + void get_partitions_by_names(std::vector & _return, const std::string& db_name, const std::string& tbl_name, const std::vector & names) { // Your implementation goes here printf("get_partitions_by_names\n"); diff --git metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CacheFileMetadataRequest.java metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CacheFileMetadataRequest.java index 6b8ab11..a008acc 100644 --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CacheFileMetadataRequest.java +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CacheFileMetadataRequest.java @@ -128,13 +128,13 @@ public String getFieldName() { 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.DB_NAME, new org.apache.thrift.meta_data.FieldMetaData("dbName", org.apache.thrift.TFieldRequirementType.REQUIRED, + tmpMap.put(_Fields.DB_NAME, new org.apache.thrift.meta_data.FieldMetaData("dbName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tblName", org.apache.thrift.TFieldRequirementType.REQUIRED, + tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tblName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PART_NAME, new org.apache.thrift.meta_data.FieldMetaData("partName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.PART_NAME, new org.apache.thrift.meta_data.FieldMetaData("partName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IS_ALL_PARTS, new org.apache.thrift.meta_data.FieldMetaData("isAllParts", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.IS_ALL_PARTS, new org.apache.thrift.meta_data.FieldMetaData("isAllParts", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CacheFileMetadataRequest.class, metaDataMap); @@ -574,7 +574,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, CacheFileMetadataRe while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -582,7 +582,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, CacheFileMetadataRe if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dbName = iprot.readString(); struct.setDbNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -590,7 +590,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, CacheFileMetadataRe if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.tblName = iprot.readString(); struct.setTblNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -598,7 +598,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, CacheFileMetadataRe if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.partName = iprot.readString(); struct.setPartNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -606,7 +606,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, CacheFileMetadataRe if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.isAllParts = iprot.readBool(); struct.setIsAllPartsIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -700,3 +700,4 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CacheFileMetadataReq } } + diff --git metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CacheFileMetadataResult.java metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CacheFileMetadataResult.java index 4336f96..a1466ae 100644 --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CacheFileMetadataResult.java +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CacheFileMetadataResult.java @@ -112,7 +112,7 @@ public String getFieldName() { 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.IS_SUPPORTED, new org.apache.thrift.meta_data.FieldMetaData("isSupported", org.apache.thrift.TFieldRequirementType.REQUIRED, + tmpMap.put(_Fields.IS_SUPPORTED, new org.apache.thrift.meta_data.FieldMetaData("isSupported", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CacheFileMetadataResult.class, metaDataMap); @@ -327,7 +327,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, CacheFileMetadataRe while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -335,7 +335,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, CacheFileMetadataRe if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.isSupported = iprot.readBool(); struct.setIsSupportedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -384,3 +384,4 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CacheFileMetadataRes } } + diff --git metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/FileMetadataExprType.java metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/FileMetadataExprType.java index 8ffaa89..4e393e2 100644 --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/FileMetadataExprType.java +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/FileMetadataExprType.java @@ -7,6 +7,10 @@ package org.apache.hadoop.hive.metastore.api; +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + public enum FileMetadataExprType implements org.apache.thrift.TEnum { ORC_SARG(1); diff --git metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PutFileMetadataRequest.java metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PutFileMetadataRequest.java index 1b7bbf0..ab151b1 100644 --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PutFileMetadataRequest.java +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PutFileMetadataRequest.java @@ -57,7 +57,7 @@ FILE_IDS((short)1, "fileIds"), METADATA((short)2, "metadata"), /** - * + * * @see FileMetadataExprType */ TYPE((short)3, "type"); @@ -131,7 +131,7 @@ public String getFieldName() { tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.REQUIRED, 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 , true)))); - tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, FileMetadataExprType.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PutFileMetadataRequest.class, metaDataMap); @@ -254,7 +254,7 @@ public void setMetadataIsSet(boolean value) { } /** - * + * * @see FileMetadataExprType */ public FileMetadataExprType getType() { @@ -262,7 +262,7 @@ public FileMetadataExprType getType() { } /** - * + * * @see FileMetadataExprType */ public void setType(FileMetadataExprType type) { @@ -584,7 +584,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, PutFileMetadataRequ if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = org.apache.hadoop.hive.metastore.api.FileMetadataExprType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; diff --git metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java index 47b7afa..7ae18a1 100644 --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java @@ -158,6 +158,8 @@ public PartitionsByExprResult get_partitions_by_expr(PartitionsByExprRequest req) throws MetaException, NoSuchObjectException, org.apache.thrift.TException; + public int get_num_partitions_by_filter(String db_name, String tbl_name, String filter) throws MetaException, NoSuchObjectException, org.apache.thrift.TException; + public List get_partitions_by_names(String db_name, String tbl_name, List names) throws MetaException, NoSuchObjectException, org.apache.thrift.TException; public void alter_partition(String db_name, String tbl_name, Partition new_part) throws InvalidOperationException, MetaException, org.apache.thrift.TException; @@ -426,6 +428,8 @@ public void get_partitions_by_expr(PartitionsByExprRequest req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void get_num_partitions_by_filter(String db_name, String tbl_name, String filter, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void get_partitions_by_names(String db_name, String tbl_name, List names, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void alter_partition(String db_name, String tbl_name, Partition new_part, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -2394,6 +2398,37 @@ public PartitionsByExprResult recv_get_partitions_by_expr() throws MetaException throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get_partitions_by_expr failed: unknown result"); } + public int get_num_partitions_by_filter(String db_name, String tbl_name, String filter) throws MetaException, NoSuchObjectException, org.apache.thrift.TException + { + send_get_num_partitions_by_filter(db_name, tbl_name, filter); + return recv_get_num_partitions_by_filter(); + } + + public void send_get_num_partitions_by_filter(String db_name, String tbl_name, String filter) throws org.apache.thrift.TException + { + get_num_partitions_by_filter_args args = new get_num_partitions_by_filter_args(); + args.setDb_name(db_name); + args.setTbl_name(tbl_name); + args.setFilter(filter); + sendBase("get_num_partitions_by_filter", args); + } + + public int recv_get_num_partitions_by_filter() throws MetaException, NoSuchObjectException, org.apache.thrift.TException + { + get_num_partitions_by_filter_result result = new get_num_partitions_by_filter_result(); + receiveBase(result, "get_num_partitions_by_filter"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.o1 != null) { + throw result.o1; + } + if (result.o2 != null) { + throw result.o2; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get_num_partitions_by_filter failed: unknown result"); + } + public List get_partitions_by_names(String db_name, String tbl_name, List names) throws MetaException, NoSuchObjectException, org.apache.thrift.TException { send_get_partitions_by_names(db_name, tbl_name, names); @@ -6620,6 +6655,44 @@ public PartitionsByExprResult getResult() throws MetaException, NoSuchObjectExce } } + public void get_num_partitions_by_filter(String db_name, String tbl_name, String filter, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + get_num_partitions_by_filter_call method_call = new get_num_partitions_by_filter_call(db_name, tbl_name, filter, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class get_num_partitions_by_filter_call extends org.apache.thrift.async.TAsyncMethodCall { + private String db_name; + private String tbl_name; + private String filter; + public get_num_partitions_by_filter_call(String db_name, String tbl_name, String filter, 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.db_name = db_name; + this.tbl_name = tbl_name; + this.filter = filter; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_num_partitions_by_filter", org.apache.thrift.protocol.TMessageType.CALL, 0)); + get_num_partitions_by_filter_args args = new get_num_partitions_by_filter_args(); + args.setDb_name(db_name); + args.setTbl_name(tbl_name); + args.setFilter(filter); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws MetaException, NoSuchObjectException, 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_get_num_partitions_by_filter(); + } + } + public void get_partitions_by_names(String db_name, String tbl_name, List names, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); get_partitions_by_names_call method_call = new get_partitions_by_names_call(db_name, tbl_name, names, resultHandler, this, ___protocolFactory, ___transport); @@ -9227,6 +9300,7 @@ protected Processor(I iface, Map extends org.apache.thrift.ProcessFunction { + public get_num_partitions_by_filter() { + super("get_num_partitions_by_filter"); + } + + public get_num_partitions_by_filter_args getEmptyArgsInstance() { + return new get_num_partitions_by_filter_args(); + } + + protected boolean isOneway() { + return false; + } + + public get_num_partitions_by_filter_result getResult(I iface, get_num_partitions_by_filter_args args) throws org.apache.thrift.TException { + get_num_partitions_by_filter_result result = new get_num_partitions_by_filter_result(); + try { + result.success = iface.get_num_partitions_by_filter(args.db_name, args.tbl_name, args.filter); + result.setSuccessIsSet(true); + } catch (MetaException o1) { + result.o1 = o1; + } catch (NoSuchObjectException o2) { + result.o2 = o2; + } + return result; + } + } + public static class get_partitions_by_names extends org.apache.thrift.ProcessFunction { public get_partitions_by_names() { super("get_partitions_by_names"); @@ -12770,6 +12871,7 @@ protected AsyncProcessor(I iface, Map extends org.apache.thrift.AsyncProcessFunction { + public get_num_partitions_by_filter() { + super("get_num_partitions_by_filter"); + } + + public get_num_partitions_by_filter_args getEmptyArgsInstance() { + return new get_num_partitions_by_filter_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Integer o) { + get_num_partitions_by_filter_result result = new get_num_partitions_by_filter_result(); + result.success = o; + result.setSuccessIsSet(true); + 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; + get_num_partitions_by_filter_result result = new get_num_partitions_by_filter_result(); + if (e instanceof MetaException) { + result.o1 = (MetaException) e; + result.setO1IsSet(true); + msg = result; + } + else if (e instanceof NoSuchObjectException) { + result.o2 = (NoSuchObjectException) e; + result.setO2IsSet(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, get_num_partitions_by_filter_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.get_num_partitions_by_filter(args.db_name, args.tbl_name, args.filter,resultHandler); + } + } + public static class get_partitions_by_names extends org.apache.thrift.AsyncProcessFunction> { public get_partitions_by_names() { super("get_partitions_by_names"); @@ -20900,7 +21065,7 @@ public cache_file_metadata_args getEmptyArgsInstance() { public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(CacheFileMetadataResult o) { cache_file_metadata_result result = new cache_file_metadata_result(); result.success = o; @@ -87843,28 +88008,28 @@ public void read(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_ex } - public static class get_partitions_by_names_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("get_partitions_by_names_args"); + public static class get_num_partitions_by_filter_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("get_num_partitions_by_filter_args"); private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tbl_name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("names", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField FILTER_FIELD_DESC = new org.apache.thrift.protocol.TField("filter", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new get_partitions_by_names_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new get_partitions_by_names_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new get_num_partitions_by_filter_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_num_partitions_by_filter_argsTupleSchemeFactory()); } private String db_name; // required private String tbl_name; // required - private List names; // required + private String filter; // 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 { DB_NAME((short)1, "db_name"), TBL_NAME((short)2, "tbl_name"), - NAMES((short)3, "names"); + FILTER((short)3, "filter"); private static final Map byName = new HashMap(); @@ -87883,8 +88048,8 @@ public static _Fields findByThriftId(int fieldId) { return DB_NAME; case 2: // TBL_NAME return TBL_NAME; - case 3: // NAMES - return NAMES; + case 3: // FILTER + return FILTER; default: return null; } @@ -87932,52 +88097,50 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tbl_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NAMES, new org.apache.thrift.meta_data.FieldMetaData("names", 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.FILTER, new org.apache.thrift.meta_data.FieldMetaData("filter", 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(get_partitions_by_names_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_num_partitions_by_filter_args.class, metaDataMap); } - public get_partitions_by_names_args() { + public get_num_partitions_by_filter_args() { } - public get_partitions_by_names_args( + public get_num_partitions_by_filter_args( String db_name, String tbl_name, - List names) + String filter) { this(); this.db_name = db_name; this.tbl_name = tbl_name; - this.names = names; + this.filter = filter; } /** * Performs a deep copy on other. */ - public get_partitions_by_names_args(get_partitions_by_names_args other) { + public get_num_partitions_by_filter_args(get_num_partitions_by_filter_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } if (other.isSetTbl_name()) { this.tbl_name = other.tbl_name; } - if (other.isSetNames()) { - List __this__names = new ArrayList(other.names); - this.names = __this__names; + if (other.isSetFilter()) { + this.filter = other.filter; } } - public get_partitions_by_names_args deepCopy() { - return new get_partitions_by_names_args(this); + public get_num_partitions_by_filter_args deepCopy() { + return new get_num_partitions_by_filter_args(this); } @Override public void clear() { this.db_name = null; this.tbl_name = null; - this.names = null; + this.filter = null; } public String getDb_name() { @@ -88026,41 +88189,26 @@ public void setTbl_nameIsSet(boolean value) { } } - public int getNamesSize() { - return (this.names == null) ? 0 : this.names.size(); - } - - public java.util.Iterator getNamesIterator() { - return (this.names == null) ? null : this.names.iterator(); - } - - public void addToNames(String elem) { - if (this.names == null) { - this.names = new ArrayList(); - } - this.names.add(elem); - } - - public List getNames() { - return this.names; + public String getFilter() { + return this.filter; } - public void setNames(List names) { - this.names = names; + public void setFilter(String filter) { + this.filter = filter; } - public void unsetNames() { - this.names = null; + public void unsetFilter() { + this.filter = null; } - /** Returns true if field names is set (has been assigned a value) and false otherwise */ - public boolean isSetNames() { - return this.names != null; + /** Returns true if field filter is set (has been assigned a value) and false otherwise */ + public boolean isSetFilter() { + return this.filter != null; } - public void setNamesIsSet(boolean value) { + public void setFilterIsSet(boolean value) { if (!value) { - this.names = null; + this.filter = null; } } @@ -88082,11 +88230,11 @@ public void setFieldValue(_Fields field, Object value) { } break; - case NAMES: + case FILTER: if (value == null) { - unsetNames(); + unsetFilter(); } else { - setNames((List)value); + setFilter((String)value); } break; @@ -88101,8 +88249,8 @@ public Object getFieldValue(_Fields field) { case TBL_NAME: return getTbl_name(); - case NAMES: - return getNames(); + case FILTER: + return getFilter(); } throw new IllegalStateException(); @@ -88119,8 +88267,8 @@ public boolean isSet(_Fields field) { return isSetDb_name(); case TBL_NAME: return isSetTbl_name(); - case NAMES: - return isSetNames(); + case FILTER: + return isSetFilter(); } throw new IllegalStateException(); } @@ -88129,12 +88277,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partitions_by_names_args) - return this.equals((get_partitions_by_names_args)that); + if (that instanceof get_num_partitions_by_filter_args) + return this.equals((get_num_partitions_by_filter_args)that); return false; } - public boolean equals(get_partitions_by_names_args that) { + public boolean equals(get_num_partitions_by_filter_args that) { if (that == null) return false; @@ -88156,12 +88304,12 @@ public boolean equals(get_partitions_by_names_args that) { return false; } - boolean this_present_names = true && this.isSetNames(); - boolean that_present_names = true && that.isSetNames(); - if (this_present_names || that_present_names) { - if (!(this_present_names && that_present_names)) + boolean this_present_filter = true && this.isSetFilter(); + boolean that_present_filter = true && that.isSetFilter(); + if (this_present_filter || that_present_filter) { + if (!(this_present_filter && that_present_filter)) return false; - if (!this.names.equals(that.names)) + if (!this.filter.equals(that.filter)) return false; } @@ -88182,16 +88330,16 @@ public int hashCode() { if (present_tbl_name) list.add(tbl_name); - boolean present_names = true && (isSetNames()); - list.add(present_names); - if (present_names) - list.add(names); + boolean present_filter = true && (isSetFilter()); + list.add(present_filter); + if (present_filter) + list.add(filter); return list.hashCode(); } @Override - public int compareTo(get_partitions_by_names_args other) { + public int compareTo(get_num_partitions_by_filter_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -88218,12 +88366,12 @@ public int compareTo(get_partitions_by_names_args other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNames()).compareTo(other.isSetNames()); + lastComparison = Boolean.valueOf(isSetFilter()).compareTo(other.isSetFilter()); if (lastComparison != 0) { return lastComparison; } - if (isSetNames()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.names, other.names); + if (isSetFilter()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filter, other.filter); if (lastComparison != 0) { return lastComparison; } @@ -88245,7 +88393,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partitions_by_names_args("); + StringBuilder sb = new StringBuilder("get_num_partitions_by_filter_args("); boolean first = true; sb.append("db_name:"); @@ -88264,11 +88412,11 @@ public String toString() { } first = false; if (!first) sb.append(", "); - sb.append("names:"); - if (this.names == null) { + sb.append("filter:"); + if (this.filter == null) { sb.append("null"); } else { - sb.append(this.names); + sb.append(this.filter); } first = false; sb.append(")"); @@ -88296,15 +88444,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class get_partitions_by_names_argsStandardSchemeFactory implements SchemeFactory { - public get_partitions_by_names_argsStandardScheme getScheme() { - return new get_partitions_by_names_argsStandardScheme(); + private static class get_num_partitions_by_filter_argsStandardSchemeFactory implements SchemeFactory { + public get_num_partitions_by_filter_argsStandardScheme getScheme() { + return new get_num_partitions_by_filter_argsStandardScheme(); } } - private static class get_partitions_by_names_argsStandardScheme extends StandardScheme { + private static class get_num_partitions_by_filter_argsStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, get_partitions_by_names_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, get_num_partitions_by_filter_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -88330,20 +88478,10 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, get_partitions_by_n org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // NAMES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list918 = iprot.readListBegin(); - struct.names = new ArrayList(_list918.size); - String _elem919; - for (int _i920 = 0; _i920 < _list918.size; ++_i920) - { - _elem919 = iprot.readString(); - struct.names.add(_elem919); - } - iprot.readListEnd(); - } - struct.setNamesIsSet(true); + case 3: // FILTER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.filter = iprot.readString(); + struct.setFilterIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -88357,7 +88495,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, get_partitions_by_n struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, get_partitions_by_names_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, get_num_partitions_by_filter_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -88371,16 +88509,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, get_partitions_by_ oprot.writeString(struct.tbl_name); oprot.writeFieldEnd(); } - if (struct.names != null) { - oprot.writeFieldBegin(NAMES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.names.size())); - for (String _iter921 : struct.names) - { - oprot.writeString(_iter921); - } - oprot.writeListEnd(); - } + if (struct.filter != null) { + oprot.writeFieldBegin(FILTER_FIELD_DESC); + oprot.writeString(struct.filter); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -88389,16 +88520,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, get_partitions_by_ } - private static class get_partitions_by_names_argsTupleSchemeFactory implements SchemeFactory { - public get_partitions_by_names_argsTupleScheme getScheme() { - return new get_partitions_by_names_argsTupleScheme(); + private static class get_num_partitions_by_filter_argsTupleSchemeFactory implements SchemeFactory { + public get_num_partitions_by_filter_argsTupleScheme getScheme() { + return new get_num_partitions_by_filter_argsTupleScheme(); } } - private static class get_partitions_by_names_argsTupleScheme extends TupleScheme { + private static class get_num_partitions_by_filter_argsTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, get_num_partitions_by_filter_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDb_name()) { @@ -88407,7 +88538,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_n if (struct.isSetTbl_name()) { optionals.set(1); } - if (struct.isSetNames()) { + if (struct.isSetFilter()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); @@ -88417,19 +88548,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_n if (struct.isSetTbl_name()) { oprot.writeString(struct.tbl_name); } - if (struct.isSetNames()) { - { - oprot.writeI32(struct.names.size()); - for (String _iter922 : struct.names) - { - oprot.writeString(_iter922); - } - } + if (struct.isSetFilter()) { + oprot.writeString(struct.filter); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, get_num_partitions_by_filter_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { @@ -88441,37 +88566,28 @@ public void read(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_na struct.setTbl_nameIsSet(true); } if (incoming.get(2)) { - { - org.apache.thrift.protocol.TList _list923 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.names = new ArrayList(_list923.size); - String _elem924; - for (int _i925 = 0; _i925 < _list923.size; ++_i925) - { - _elem924 = iprot.readString(); - struct.names.add(_elem924); - } - } - struct.setNamesIsSet(true); + struct.filter = iprot.readString(); + struct.setFilterIsSet(true); } } } } - public static class get_partitions_by_names_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("get_partitions_by_names_result"); + public static class get_num_partitions_by_filter_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("get_num_partitions_by_filter_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 SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new get_partitions_by_names_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new get_partitions_by_names_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new get_num_partitions_by_filter_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_num_partitions_by_filter_resultTupleSchemeFactory()); } - private List success; // required + private int success; // required private MetaException o1; // required private NoSuchObjectException o2; // required @@ -88540,30 +88656,32 @@ public String getFieldName() { } // isset id assignments + private static final int __SUCCESS_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.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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Partition.class)))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.O1, new org.apache.thrift.meta_data.FieldMetaData("o1", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.O2, new org.apache.thrift.meta_data.FieldMetaData("o2", 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(get_partitions_by_names_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_num_partitions_by_filter_result.class, metaDataMap); } - public get_partitions_by_names_result() { + public get_num_partitions_by_filter_result() { } - public get_partitions_by_names_result( - List success, + public get_num_partitions_by_filter_result( + int success, MetaException o1, NoSuchObjectException o2) { this(); this.success = success; + setSuccessIsSet(true); this.o1 = o1; this.o2 = o2; } @@ -88571,14 +88689,9 @@ public get_partitions_by_names_result( /** * Performs a deep copy on other. */ - public get_partitions_by_names_result(get_partitions_by_names_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(other.success.size()); - for (Partition other_element : other.success) { - __this__success.add(new Partition(other_element)); - } - this.success = __this__success; - } + public get_num_partitions_by_filter_result(get_num_partitions_by_filter_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; if (other.isSetO1()) { this.o1 = new MetaException(other.o1); } @@ -88587,53 +88700,38 @@ public get_partitions_by_names_result(get_partitions_by_names_result other) { } } - public get_partitions_by_names_result deepCopy() { - return new get_partitions_by_names_result(this); + public get_num_partitions_by_filter_result deepCopy() { + return new get_num_partitions_by_filter_result(this); } @Override public void clear() { - this.success = null; + setSuccessIsSet(false); + this.success = 0; this.o1 = null; this.o2 = 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(Partition elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { + public int getSuccess() { return this.success; } - public void setSuccess(List success) { + public void setSuccess(int success) { this.success = success; + setSuccessIsSet(true); } public void unsetSuccess() { - this.success = null; + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return this.success != null; + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public MetaException getO1() { @@ -88688,7 +88786,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSuccess(); } else { - setSuccess((List)value); + setSuccess((Integer)value); } break; @@ -88747,21 +88845,21 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof get_partitions_by_names_result) - return this.equals((get_partitions_by_names_result)that); + if (that instanceof get_num_partitions_by_filter_result) + return this.equals((get_num_partitions_by_filter_result)that); return false; } - public boolean equals(get_partitions_by_names_result that) { + public boolean equals(get_num_partitions_by_filter_result that) { if (that == null) return false; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) return false; } @@ -88790,7 +88888,7 @@ public boolean equals(get_partitions_by_names_result that) { public int hashCode() { List list = new ArrayList(); - boolean present_success = true && (isSetSuccess()); + boolean present_success = true; list.add(present_success); if (present_success) list.add(success); @@ -88809,7 +88907,7 @@ public int hashCode() { } @Override - public int compareTo(get_partitions_by_names_result other) { + public int compareTo(get_num_partitions_by_filter_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -88863,15 +88961,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("get_partitions_by_names_result("); + StringBuilder sb = new StringBuilder("get_num_partitions_by_filter_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("o1:"); @@ -88908,21 +89002,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept 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 get_partitions_by_names_resultStandardSchemeFactory implements SchemeFactory { - public get_partitions_by_names_resultStandardScheme getScheme() { - return new get_partitions_by_names_resultStandardScheme(); + private static class get_num_partitions_by_filter_resultStandardSchemeFactory implements SchemeFactory { + public get_num_partitions_by_filter_resultStandardScheme getScheme() { + return new get_num_partitions_by_filter_resultStandardScheme(); } } - private static class get_partitions_by_names_resultStandardScheme extends StandardScheme { + private static class get_num_partitions_by_filter_resultStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, get_partitions_by_names_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, get_num_partitions_by_filter_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -88933,19 +89029,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, get_partitions_by_n } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list926 = iprot.readListBegin(); - struct.success = new ArrayList(_list926.size); - Partition _elem927; - for (int _i928 = 0; _i928 < _list926.size; ++_i928) - { - _elem927 = new Partition(); - _elem927.read(iprot); - struct.success.add(_elem927); - } - iprot.readListEnd(); - } + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -88978,20 +89063,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, get_partitions_by_n struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, get_partitions_by_names_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, get_num_partitions_by_filter_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { + if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Partition _iter929 : struct.success) - { - _iter929.write(oprot); - } - oprot.writeListEnd(); - } + oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.o1 != null) { @@ -89010,16 +89088,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, get_partitions_by_ } - private static class get_partitions_by_names_resultTupleSchemeFactory implements SchemeFactory { - public get_partitions_by_names_resultTupleScheme getScheme() { - return new get_partitions_by_names_resultTupleScheme(); + private static class get_num_partitions_by_filter_resultTupleSchemeFactory implements SchemeFactory { + public get_num_partitions_by_filter_resultTupleScheme getScheme() { + return new get_num_partitions_by_filter_resultTupleScheme(); } } - private static class get_partitions_by_names_resultTupleScheme extends TupleScheme { + private static class get_num_partitions_by_filter_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, get_num_partitions_by_filter_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { @@ -89033,13 +89111,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_n } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (Partition _iter930 : struct.success) - { - _iter930.write(oprot); - } - } + oprot.writeI32(struct.success); } if (struct.isSetO1()) { struct.o1.write(oprot); @@ -89050,21 +89122,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_n } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, get_num_partitions_by_filter_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list931 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list931.size); - Partition _elem932; - for (int _i933 = 0; _i933 < _list931.size; ++_i933) - { - _elem932 = new Partition(); - _elem932.read(iprot); - struct.success.add(_elem932); - } - } + struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -89082,28 +89144,28 @@ public void read(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_na } - public static class alter_partition_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("alter_partition_args"); + public static class get_partitions_by_names_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("get_partitions_by_names_args"); private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tbl_name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField NEW_PART_FIELD_DESC = new org.apache.thrift.protocol.TField("new_part", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("names", org.apache.thrift.protocol.TType.LIST, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new alter_partition_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new alter_partition_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new get_partitions_by_names_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_partitions_by_names_argsTupleSchemeFactory()); } private String db_name; // required private String tbl_name; // required - private Partition new_part; // required + private List names; // 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 { DB_NAME((short)1, "db_name"), TBL_NAME((short)2, "tbl_name"), - NEW_PART((short)3, "new_part"); + NAMES((short)3, "names"); private static final Map byName = new HashMap(); @@ -89122,8 +89184,8 @@ public static _Fields findByThriftId(int fieldId) { return DB_NAME; case 2: // TBL_NAME return TBL_NAME; - case 3: // NEW_PART - return NEW_PART; + case 3: // NAMES + return NAMES; default: return null; } @@ -89171,50 +89233,52 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tbl_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NEW_PART, new org.apache.thrift.meta_data.FieldMetaData("new_part", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Partition.class))); + tmpMap.put(_Fields.NAMES, new org.apache.thrift.meta_data.FieldMetaData("names", 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)))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alter_partition_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_partitions_by_names_args.class, metaDataMap); } - public alter_partition_args() { + public get_partitions_by_names_args() { } - public alter_partition_args( + public get_partitions_by_names_args( String db_name, String tbl_name, - Partition new_part) + List names) { this(); this.db_name = db_name; this.tbl_name = tbl_name; - this.new_part = new_part; + this.names = names; } /** * Performs a deep copy on other. */ - public alter_partition_args(alter_partition_args other) { + public get_partitions_by_names_args(get_partitions_by_names_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } if (other.isSetTbl_name()) { this.tbl_name = other.tbl_name; } - if (other.isSetNew_part()) { - this.new_part = new Partition(other.new_part); + if (other.isSetNames()) { + List __this__names = new ArrayList(other.names); + this.names = __this__names; } } - public alter_partition_args deepCopy() { - return new alter_partition_args(this); + public get_partitions_by_names_args deepCopy() { + return new get_partitions_by_names_args(this); } @Override public void clear() { this.db_name = null; this.tbl_name = null; - this.new_part = null; + this.names = null; } public String getDb_name() { @@ -89263,26 +89327,41 @@ public void setTbl_nameIsSet(boolean value) { } } - public Partition getNew_part() { - return this.new_part; + public int getNamesSize() { + return (this.names == null) ? 0 : this.names.size(); } - public void setNew_part(Partition new_part) { - this.new_part = new_part; + public java.util.Iterator getNamesIterator() { + return (this.names == null) ? null : this.names.iterator(); } - public void unsetNew_part() { - this.new_part = null; + public void addToNames(String elem) { + if (this.names == null) { + this.names = new ArrayList(); + } + this.names.add(elem); } - /** Returns true if field new_part is set (has been assigned a value) and false otherwise */ - public boolean isSetNew_part() { - return this.new_part != null; + public List getNames() { + return this.names; } - public void setNew_partIsSet(boolean value) { + public void setNames(List names) { + this.names = names; + } + + public void unsetNames() { + this.names = null; + } + + /** Returns true if field names is set (has been assigned a value) and false otherwise */ + public boolean isSetNames() { + return this.names != null; + } + + public void setNamesIsSet(boolean value) { if (!value) { - this.new_part = null; + this.names = null; } } @@ -89304,11 +89383,11 @@ public void setFieldValue(_Fields field, Object value) { } break; - case NEW_PART: + case NAMES: if (value == null) { - unsetNew_part(); + unsetNames(); } else { - setNew_part((Partition)value); + setNames((List)value); } break; @@ -89323,8 +89402,8 @@ public Object getFieldValue(_Fields field) { case TBL_NAME: return getTbl_name(); - case NEW_PART: - return getNew_part(); + case NAMES: + return getNames(); } throw new IllegalStateException(); @@ -89341,8 +89420,8 @@ public boolean isSet(_Fields field) { return isSetDb_name(); case TBL_NAME: return isSetTbl_name(); - case NEW_PART: - return isSetNew_part(); + case NAMES: + return isSetNames(); } throw new IllegalStateException(); } @@ -89351,12 +89430,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_partition_args) - return this.equals((alter_partition_args)that); + if (that instanceof get_partitions_by_names_args) + return this.equals((get_partitions_by_names_args)that); return false; } - public boolean equals(alter_partition_args that) { + public boolean equals(get_partitions_by_names_args that) { if (that == null) return false; @@ -89378,12 +89457,12 @@ public boolean equals(alter_partition_args that) { return false; } - boolean this_present_new_part = true && this.isSetNew_part(); - boolean that_present_new_part = true && that.isSetNew_part(); - if (this_present_new_part || that_present_new_part) { - if (!(this_present_new_part && that_present_new_part)) + boolean this_present_names = true && this.isSetNames(); + boolean that_present_names = true && that.isSetNames(); + if (this_present_names || that_present_names) { + if (!(this_present_names && that_present_names)) return false; - if (!this.new_part.equals(that.new_part)) + if (!this.names.equals(that.names)) return false; } @@ -89404,16 +89483,16 @@ public int hashCode() { if (present_tbl_name) list.add(tbl_name); - boolean present_new_part = true && (isSetNew_part()); - list.add(present_new_part); - if (present_new_part) - list.add(new_part); + boolean present_names = true && (isSetNames()); + list.add(present_names); + if (present_names) + list.add(names); return list.hashCode(); } @Override - public int compareTo(alter_partition_args other) { + public int compareTo(get_partitions_by_names_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -89440,12 +89519,12 @@ public int compareTo(alter_partition_args other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNew_part()).compareTo(other.isSetNew_part()); + lastComparison = Boolean.valueOf(isSetNames()).compareTo(other.isSetNames()); if (lastComparison != 0) { return lastComparison; } - if (isSetNew_part()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.new_part, other.new_part); + if (isSetNames()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.names, other.names); if (lastComparison != 0) { return lastComparison; } @@ -89467,7 +89546,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_partition_args("); + StringBuilder sb = new StringBuilder("get_partitions_by_names_args("); boolean first = true; sb.append("db_name:"); @@ -89486,11 +89565,11 @@ public String toString() { } first = false; if (!first) sb.append(", "); - sb.append("new_part:"); - if (this.new_part == null) { + sb.append("names:"); + if (this.names == null) { sb.append("null"); } else { - sb.append(this.new_part); + sb.append(this.names); } first = false; sb.append(")"); @@ -89500,9 +89579,6 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity - if (new_part != null) { - new_part.validate(); - } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -89521,15 +89597,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class alter_partition_argsStandardSchemeFactory implements SchemeFactory { - public alter_partition_argsStandardScheme getScheme() { - return new alter_partition_argsStandardScheme(); + private static class get_partitions_by_names_argsStandardSchemeFactory implements SchemeFactory { + public get_partitions_by_names_argsStandardScheme getScheme() { + return new get_partitions_by_names_argsStandardScheme(); } } - private static class alter_partition_argsStandardScheme extends StandardScheme { + private static class get_partitions_by_names_argsStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, get_partitions_by_names_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -89555,11 +89631,20 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_arg org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // NEW_PART - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.new_part = new Partition(); - struct.new_part.read(iprot); - struct.setNew_partIsSet(true); + case 3: // NAMES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list918 = iprot.readListBegin(); + struct.names = new ArrayList(_list918.size); + String _elem919; + for (int _i920 = 0; _i920 < _list918.size; ++_i920) + { + _elem919 = iprot.readString(); + struct.names.add(_elem919); + } + iprot.readListEnd(); + } + struct.setNamesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -89573,7 +89658,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_arg struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, get_partitions_by_names_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -89587,9 +89672,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_ar oprot.writeString(struct.tbl_name); oprot.writeFieldEnd(); } - if (struct.new_part != null) { - oprot.writeFieldBegin(NEW_PART_FIELD_DESC); - struct.new_part.write(oprot); + if (struct.names != null) { + oprot.writeFieldBegin(NAMES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.names.size())); + for (String _iter921 : struct.names) + { + oprot.writeString(_iter921); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -89598,16 +89690,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_ar } - private static class alter_partition_argsTupleSchemeFactory implements SchemeFactory { - public alter_partition_argsTupleScheme getScheme() { - return new alter_partition_argsTupleScheme(); + private static class get_partitions_by_names_argsTupleSchemeFactory implements SchemeFactory { + public get_partitions_by_names_argsTupleScheme getScheme() { + return new get_partitions_by_names_argsTupleScheme(); } } - private static class alter_partition_argsTupleScheme extends TupleScheme { + private static class get_partitions_by_names_argsTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDb_name()) { @@ -89616,7 +89708,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_arg if (struct.isSetTbl_name()) { optionals.set(1); } - if (struct.isSetNew_part()) { + if (struct.isSetNames()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); @@ -89626,13 +89718,19 @@ public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_arg if (struct.isSetTbl_name()) { oprot.writeString(struct.tbl_name); } - if (struct.isSetNew_part()) { - struct.new_part.write(oprot); + if (struct.isSetNames()) { + { + oprot.writeI32(struct.names.size()); + for (String _iter922 : struct.names) + { + oprot.writeString(_iter922); + } + } } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { @@ -89644,32 +89742,43 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_args struct.setTbl_nameIsSet(true); } if (incoming.get(2)) { - struct.new_part = new Partition(); - struct.new_part.read(iprot); - struct.setNew_partIsSet(true); + { + org.apache.thrift.protocol.TList _list923 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.names = new ArrayList(_list923.size); + String _elem924; + for (int _i925 = 0; _i925 < _list923.size; ++_i925) + { + _elem924 = iprot.readString(); + struct.names.add(_elem924); + } + } + struct.setNamesIsSet(true); } } } } - public static class alter_partition_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("alter_partition_result"); + public static class get_partitions_by_names_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("get_partitions_by_names_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 O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new alter_partition_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new alter_partition_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new get_partitions_by_names_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_partitions_by_names_resultTupleSchemeFactory()); } - private InvalidOperationException o1; // required - private MetaException o2; // required + private List success; // required + private MetaException o1; // required + private NoSuchObjectException o2; // 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"), O1((short)1, "o1"), O2((short)2, "o2"); @@ -89686,6 +89795,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_args */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; case 1: // O1 return O1; case 2: // O2 @@ -89733,22 +89844,27 @@ public String getFieldName() { 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Partition.class)))); tmpMap.put(_Fields.O1, new org.apache.thrift.meta_data.FieldMetaData("o1", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.O2, new org.apache.thrift.meta_data.FieldMetaData("o2", 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(alter_partition_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_partitions_by_names_result.class, metaDataMap); } - public alter_partition_result() { + public get_partitions_by_names_result() { } - public alter_partition_result( - InvalidOperationException o1, - MetaException o2) + public get_partitions_by_names_result( + List success, + MetaException o1, + NoSuchObjectException o2) { this(); + this.success = success; this.o1 = o1; this.o2 = o2; } @@ -89756,30 +89872,76 @@ public alter_partition_result( /** * Performs a deep copy on other. */ - public alter_partition_result(alter_partition_result other) { + public get_partitions_by_names_result(get_partitions_by_names_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (Partition other_element : other.success) { + __this__success.add(new Partition(other_element)); + } + this.success = __this__success; + } if (other.isSetO1()) { - this.o1 = new InvalidOperationException(other.o1); + this.o1 = new MetaException(other.o1); } if (other.isSetO2()) { - this.o2 = new MetaException(other.o2); + this.o2 = new NoSuchObjectException(other.o2); } } - public alter_partition_result deepCopy() { - return new alter_partition_result(this); + public get_partitions_by_names_result deepCopy() { + return new get_partitions_by_names_result(this); } @Override public void clear() { + this.success = null; this.o1 = null; this.o2 = null; } - public InvalidOperationException getO1() { + 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(Partition 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 MetaException getO1() { return this.o1; } - public void setO1(InvalidOperationException o1) { + public void setO1(MetaException o1) { this.o1 = o1; } @@ -89798,11 +89960,11 @@ public void setO1IsSet(boolean value) { } } - public MetaException getO2() { + public NoSuchObjectException getO2() { return this.o2; } - public void setO2(MetaException o2) { + public void setO2(NoSuchObjectException o2) { this.o2 = o2; } @@ -89823,11 +89985,19 @@ public void setO2IsSet(boolean value) { public void setFieldValue(_Fields field, Object value) { switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + case O1: if (value == null) { unsetO1(); } else { - setO1((InvalidOperationException)value); + setO1((MetaException)value); } break; @@ -89835,7 +90005,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetO2(); } else { - setO2((MetaException)value); + setO2((NoSuchObjectException)value); } break; @@ -89844,6 +90014,9 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { + case SUCCESS: + return getSuccess(); + case O1: return getO1(); @@ -89861,6 +90034,8 @@ public boolean isSet(_Fields field) { } switch (field) { + case SUCCESS: + return isSetSuccess(); case O1: return isSetO1(); case O2: @@ -89873,15 +90048,24 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_partition_result) - return this.equals((alter_partition_result)that); + if (that instanceof get_partitions_by_names_result) + return this.equals((get_partitions_by_names_result)that); return false; } - public boolean equals(alter_partition_result that) { + public boolean equals(get_partitions_by_names_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_o1 = true && this.isSetO1(); boolean that_present_o1 = true && that.isSetO1(); if (this_present_o1 || that_present_o1) { @@ -89907,6 +90091,11 @@ public boolean equals(alter_partition_result that) { public int hashCode() { List list = new ArrayList(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + boolean present_o1 = true && (isSetO1()); list.add(present_o1); if (present_o1) @@ -89921,13 +90110,23 @@ public int hashCode() { } @Override - public int compareTo(alter_partition_result other) { + public int compareTo(get_partitions_by_names_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(isSetO1()).compareTo(other.isSetO1()); if (lastComparison != 0) { return lastComparison; @@ -89965,9 +90164,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_partition_result("); + StringBuilder sb = new StringBuilder("get_partitions_by_names_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("o1:"); if (this.o1 == null) { sb.append("null"); @@ -90008,15 +90215,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class alter_partition_resultStandardSchemeFactory implements SchemeFactory { - public alter_partition_resultStandardScheme getScheme() { - return new alter_partition_resultStandardScheme(); + private static class get_partitions_by_names_resultStandardSchemeFactory implements SchemeFactory { + public get_partitions_by_names_resultStandardScheme getScheme() { + return new get_partitions_by_names_resultStandardScheme(); } } - private static class alter_partition_resultStandardScheme extends StandardScheme { + private static class get_partitions_by_names_resultStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, get_partitions_by_names_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -90026,9 +90233,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_res break; } switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list926 = iprot.readListBegin(); + struct.success = new ArrayList(_list926.size); + Partition _elem927; + for (int _i928 = 0; _i928 < _list926.size; ++_i928) + { + _elem927 = new Partition(); + _elem927.read(iprot); + struct.success.add(_elem927); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; case 1: // O1 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.o1 = new InvalidOperationException(); + struct.o1 = new MetaException(); struct.o1.read(iprot); struct.setO1IsSet(true); } else { @@ -90037,7 +90263,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_res break; case 2: // O2 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.o2 = new MetaException(); + struct.o2 = new NoSuchObjectException(); struct.o2.read(iprot); struct.setO2IsSet(true); } else { @@ -90053,10 +90279,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_res struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, get_partitions_by_names_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.STRUCT, struct.success.size())); + for (Partition _iter929 : struct.success) + { + _iter929.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } if (struct.o1 != null) { oprot.writeFieldBegin(O1_FIELD_DESC); struct.o1.write(oprot); @@ -90073,25 +90311,37 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_re } - private static class alter_partition_resultTupleSchemeFactory implements SchemeFactory { - public alter_partition_resultTupleScheme getScheme() { - return new alter_partition_resultTupleScheme(); + private static class get_partitions_by_names_resultTupleSchemeFactory implements SchemeFactory { + public get_partitions_by_names_resultTupleScheme getScheme() { + return new get_partitions_by_names_resultTupleScheme(); } } - private static class alter_partition_resultTupleScheme extends TupleScheme { + private static class get_partitions_by_names_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); - if (struct.isSetO1()) { + if (struct.isSetSuccess()) { optionals.set(0); } - if (struct.isSetO2()) { + if (struct.isSetO1()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetO2()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Partition _iter930 : struct.success) + { + _iter930.write(oprot); + } + } + } if (struct.isSetO1()) { struct.o1.write(oprot); } @@ -90101,16 +90351,30 @@ public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_res } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, get_partitions_by_names_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { - struct.o1 = new InvalidOperationException(); + { + org.apache.thrift.protocol.TList _list931 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list931.size); + Partition _elem932; + for (int _i933 = 0; _i933 < _list931.size; ++_i933) + { + _elem932 = new Partition(); + _elem932.read(iprot); + struct.success.add(_elem932); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.o1 = new MetaException(); struct.o1.read(iprot); struct.setO1IsSet(true); } - if (incoming.get(1)) { - struct.o2 = new MetaException(); + if (incoming.get(2)) { + struct.o2 = new NoSuchObjectException(); struct.o2.read(iprot); struct.setO2IsSet(true); } @@ -90119,28 +90383,28 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_resu } - public static class alter_partitions_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("alter_partitions_args"); + public static class alter_partition_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("alter_partition_args"); private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tbl_name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField NEW_PARTS_FIELD_DESC = new org.apache.thrift.protocol.TField("new_parts", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField NEW_PART_FIELD_DESC = new org.apache.thrift.protocol.TField("new_part", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new alter_partitions_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new alter_partitions_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new alter_partition_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new alter_partition_argsTupleSchemeFactory()); } private String db_name; // required private String tbl_name; // required - private List new_parts; // required + private Partition new_part; // 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 { DB_NAME((short)1, "db_name"), TBL_NAME((short)2, "tbl_name"), - NEW_PARTS((short)3, "new_parts"); + NEW_PART((short)3, "new_part"); private static final Map byName = new HashMap(); @@ -90159,8 +90423,8 @@ public static _Fields findByThriftId(int fieldId) { return DB_NAME; case 2: // TBL_NAME return TBL_NAME; - case 3: // NEW_PARTS - return NEW_PARTS; + case 3: // NEW_PART + return NEW_PART; default: return null; } @@ -90208,55 +90472,50 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tbl_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NEW_PARTS, new org.apache.thrift.meta_data.FieldMetaData("new_parts", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Partition.class)))); + tmpMap.put(_Fields.NEW_PART, new org.apache.thrift.meta_data.FieldMetaData("new_part", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Partition.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alter_partitions_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alter_partition_args.class, metaDataMap); } - public alter_partitions_args() { + public alter_partition_args() { } - public alter_partitions_args( + public alter_partition_args( String db_name, String tbl_name, - List new_parts) + Partition new_part) { this(); this.db_name = db_name; this.tbl_name = tbl_name; - this.new_parts = new_parts; + this.new_part = new_part; } /** * Performs a deep copy on other. */ - public alter_partitions_args(alter_partitions_args other) { + public alter_partition_args(alter_partition_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } if (other.isSetTbl_name()) { this.tbl_name = other.tbl_name; } - if (other.isSetNew_parts()) { - List __this__new_parts = new ArrayList(other.new_parts.size()); - for (Partition other_element : other.new_parts) { - __this__new_parts.add(new Partition(other_element)); - } - this.new_parts = __this__new_parts; + if (other.isSetNew_part()) { + this.new_part = new Partition(other.new_part); } } - public alter_partitions_args deepCopy() { - return new alter_partitions_args(this); + public alter_partition_args deepCopy() { + return new alter_partition_args(this); } @Override public void clear() { this.db_name = null; this.tbl_name = null; - this.new_parts = null; + this.new_part = null; } public String getDb_name() { @@ -90305,41 +90564,26 @@ public void setTbl_nameIsSet(boolean value) { } } - public int getNew_partsSize() { - return (this.new_parts == null) ? 0 : this.new_parts.size(); - } - - public java.util.Iterator getNew_partsIterator() { - return (this.new_parts == null) ? null : this.new_parts.iterator(); - } - - public void addToNew_parts(Partition elem) { - if (this.new_parts == null) { - this.new_parts = new ArrayList(); - } - this.new_parts.add(elem); - } - - public List getNew_parts() { - return this.new_parts; + public Partition getNew_part() { + return this.new_part; } - public void setNew_parts(List new_parts) { - this.new_parts = new_parts; + public void setNew_part(Partition new_part) { + this.new_part = new_part; } - public void unsetNew_parts() { - this.new_parts = null; + public void unsetNew_part() { + this.new_part = null; } - /** Returns true if field new_parts is set (has been assigned a value) and false otherwise */ - public boolean isSetNew_parts() { - return this.new_parts != null; + /** Returns true if field new_part is set (has been assigned a value) and false otherwise */ + public boolean isSetNew_part() { + return this.new_part != null; } - public void setNew_partsIsSet(boolean value) { + public void setNew_partIsSet(boolean value) { if (!value) { - this.new_parts = null; + this.new_part = null; } } @@ -90361,11 +90605,11 @@ public void setFieldValue(_Fields field, Object value) { } break; - case NEW_PARTS: + case NEW_PART: if (value == null) { - unsetNew_parts(); + unsetNew_part(); } else { - setNew_parts((List)value); + setNew_part((Partition)value); } break; @@ -90380,8 +90624,8 @@ public Object getFieldValue(_Fields field) { case TBL_NAME: return getTbl_name(); - case NEW_PARTS: - return getNew_parts(); + case NEW_PART: + return getNew_part(); } throw new IllegalStateException(); @@ -90398,8 +90642,8 @@ public boolean isSet(_Fields field) { return isSetDb_name(); case TBL_NAME: return isSetTbl_name(); - case NEW_PARTS: - return isSetNew_parts(); + case NEW_PART: + return isSetNew_part(); } throw new IllegalStateException(); } @@ -90408,12 +90652,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_partitions_args) - return this.equals((alter_partitions_args)that); + if (that instanceof alter_partition_args) + return this.equals((alter_partition_args)that); return false; } - public boolean equals(alter_partitions_args that) { + public boolean equals(alter_partition_args that) { if (that == null) return false; @@ -90435,12 +90679,12 @@ public boolean equals(alter_partitions_args that) { return false; } - boolean this_present_new_parts = true && this.isSetNew_parts(); - boolean that_present_new_parts = true && that.isSetNew_parts(); - if (this_present_new_parts || that_present_new_parts) { - if (!(this_present_new_parts && that_present_new_parts)) + boolean this_present_new_part = true && this.isSetNew_part(); + boolean that_present_new_part = true && that.isSetNew_part(); + if (this_present_new_part || that_present_new_part) { + if (!(this_present_new_part && that_present_new_part)) return false; - if (!this.new_parts.equals(that.new_parts)) + if (!this.new_part.equals(that.new_part)) return false; } @@ -90461,16 +90705,16 @@ public int hashCode() { if (present_tbl_name) list.add(tbl_name); - boolean present_new_parts = true && (isSetNew_parts()); - list.add(present_new_parts); - if (present_new_parts) - list.add(new_parts); + boolean present_new_part = true && (isSetNew_part()); + list.add(present_new_part); + if (present_new_part) + list.add(new_part); return list.hashCode(); } @Override - public int compareTo(alter_partitions_args other) { + public int compareTo(alter_partition_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -90497,12 +90741,12 @@ public int compareTo(alter_partitions_args other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNew_parts()).compareTo(other.isSetNew_parts()); + lastComparison = Boolean.valueOf(isSetNew_part()).compareTo(other.isSetNew_part()); if (lastComparison != 0) { return lastComparison; } - if (isSetNew_parts()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.new_parts, other.new_parts); + if (isSetNew_part()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.new_part, other.new_part); if (lastComparison != 0) { return lastComparison; } @@ -90524,7 +90768,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_partitions_args("); + StringBuilder sb = new StringBuilder("alter_partition_args("); boolean first = true; sb.append("db_name:"); @@ -90543,11 +90787,11 @@ public String toString() { } first = false; if (!first) sb.append(", "); - sb.append("new_parts:"); - if (this.new_parts == null) { + sb.append("new_part:"); + if (this.new_part == null) { sb.append("null"); } else { - sb.append(this.new_parts); + sb.append(this.new_part); } first = false; sb.append(")"); @@ -90557,6 +90801,9 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity + if (new_part != null) { + new_part.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -90575,15 +90822,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class alter_partitions_argsStandardSchemeFactory implements SchemeFactory { - public alter_partitions_argsStandardScheme getScheme() { - return new alter_partitions_argsStandardScheme(); + private static class alter_partition_argsStandardSchemeFactory implements SchemeFactory { + public alter_partition_argsStandardScheme getScheme() { + return new alter_partition_argsStandardScheme(); } } - private static class alter_partitions_argsStandardScheme extends StandardScheme { + private static class alter_partition_argsStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partitions_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -90609,21 +90856,11 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partitions_ar org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // NEW_PARTS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list934 = iprot.readListBegin(); - struct.new_parts = new ArrayList(_list934.size); - Partition _elem935; - for (int _i936 = 0; _i936 < _list934.size; ++_i936) - { - _elem935 = new Partition(); - _elem935.read(iprot); - struct.new_parts.add(_elem935); - } - iprot.readListEnd(); - } - struct.setNew_partsIsSet(true); + case 3: // NEW_PART + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.new_part = new Partition(); + struct.new_part.read(iprot); + struct.setNew_partIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -90637,7 +90874,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partitions_ar struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partitions_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -90651,16 +90888,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partitions_a oprot.writeString(struct.tbl_name); oprot.writeFieldEnd(); } - if (struct.new_parts != null) { - oprot.writeFieldBegin(NEW_PARTS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.new_parts.size())); - for (Partition _iter937 : struct.new_parts) - { - _iter937.write(oprot); - } - oprot.writeListEnd(); - } + if (struct.new_part != null) { + oprot.writeFieldBegin(NEW_PART_FIELD_DESC); + struct.new_part.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -90669,16 +90899,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partitions_a } - private static class alter_partitions_argsTupleSchemeFactory implements SchemeFactory { - public alter_partitions_argsTupleScheme getScheme() { - return new alter_partitions_argsTupleScheme(); + private static class alter_partition_argsTupleSchemeFactory implements SchemeFactory { + public alter_partition_argsTupleScheme getScheme() { + return new alter_partition_argsTupleScheme(); } } - private static class alter_partitions_argsTupleScheme extends TupleScheme { + private static class alter_partition_argsTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, alter_partitions_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDb_name()) { @@ -90687,7 +90917,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, alter_partitions_ar if (struct.isSetTbl_name()) { optionals.set(1); } - if (struct.isSetNew_parts()) { + if (struct.isSetNew_part()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); @@ -90697,19 +90927,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, alter_partitions_ar if (struct.isSetTbl_name()) { oprot.writeString(struct.tbl_name); } - if (struct.isSetNew_parts()) { - { - oprot.writeI32(struct.new_parts.size()); - for (Partition _iter938 : struct.new_parts) - { - _iter938.write(oprot); - } - } + if (struct.isSetNew_part()) { + struct.new_part.write(oprot); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, alter_partitions_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { @@ -90721,34 +90945,25 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alter_partitions_arg struct.setTbl_nameIsSet(true); } if (incoming.get(2)) { - { - org.apache.thrift.protocol.TList _list939 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.new_parts = new ArrayList(_list939.size); - Partition _elem940; - for (int _i941 = 0; _i941 < _list939.size; ++_i941) - { - _elem940 = new Partition(); - _elem940.read(iprot); - struct.new_parts.add(_elem940); - } - } - struct.setNew_partsIsSet(true); + struct.new_part = new Partition(); + struct.new_part.read(iprot); + struct.setNew_partIsSet(true); } } } } - public static class alter_partitions_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("alter_partitions_result"); + public static class alter_partition_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("alter_partition_result"); private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new alter_partitions_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new alter_partitions_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new alter_partition_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new alter_partition_resultTupleSchemeFactory()); } private InvalidOperationException o1; // required @@ -90824,13 +91039,13 @@ public String getFieldName() { tmpMap.put(_Fields.O2, new org.apache.thrift.meta_data.FieldMetaData("o2", 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(alter_partitions_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alter_partition_result.class, metaDataMap); } - public alter_partitions_result() { + public alter_partition_result() { } - public alter_partitions_result( + public alter_partition_result( InvalidOperationException o1, MetaException o2) { @@ -90842,7 +91057,7 @@ public alter_partitions_result( /** * Performs a deep copy on other. */ - public alter_partitions_result(alter_partitions_result other) { + public alter_partition_result(alter_partition_result other) { if (other.isSetO1()) { this.o1 = new InvalidOperationException(other.o1); } @@ -90851,8 +91066,8 @@ public alter_partitions_result(alter_partitions_result other) { } } - public alter_partitions_result deepCopy() { - return new alter_partitions_result(this); + public alter_partition_result deepCopy() { + return new alter_partition_result(this); } @Override @@ -90959,12 +91174,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_partitions_result) - return this.equals((alter_partitions_result)that); + if (that instanceof alter_partition_result) + return this.equals((alter_partition_result)that); return false; } - public boolean equals(alter_partitions_result that) { + public boolean equals(alter_partition_result that) { if (that == null) return false; @@ -91007,7 +91222,7 @@ public int hashCode() { } @Override - public int compareTo(alter_partitions_result other) { + public int compareTo(alter_partition_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -91051,7 +91266,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_partitions_result("); + StringBuilder sb = new StringBuilder("alter_partition_result("); boolean first = true; sb.append("o1:"); @@ -91094,15 +91309,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class alter_partitions_resultStandardSchemeFactory implements SchemeFactory { - public alter_partitions_resultStandardScheme getScheme() { - return new alter_partitions_resultStandardScheme(); + private static class alter_partition_resultStandardSchemeFactory implements SchemeFactory { + public alter_partition_resultStandardScheme getScheme() { + return new alter_partition_resultStandardScheme(); } } - private static class alter_partitions_resultStandardScheme extends StandardScheme { + private static class alter_partition_resultStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partitions_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -91139,7 +91354,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partitions_re struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partitions_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -91159,16 +91374,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partitions_r } - private static class alter_partitions_resultTupleSchemeFactory implements SchemeFactory { - public alter_partitions_resultTupleScheme getScheme() { - return new alter_partitions_resultTupleScheme(); + private static class alter_partition_resultTupleSchemeFactory implements SchemeFactory { + public alter_partition_resultTupleScheme getScheme() { + return new alter_partition_resultTupleScheme(); } } - private static class alter_partitions_resultTupleScheme extends TupleScheme { + private static class alter_partition_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, alter_partitions_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetO1()) { @@ -91187,7 +91402,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, alter_partitions_re } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, alter_partitions_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { @@ -91205,31 +91420,28 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alter_partitions_res } - public static class alter_partition_with_environment_context_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("alter_partition_with_environment_context_args"); + public static class alter_partitions_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("alter_partitions_args"); private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tbl_name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField NEW_PART_FIELD_DESC = new org.apache.thrift.protocol.TField("new_part", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment_context", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField NEW_PARTS_FIELD_DESC = new org.apache.thrift.protocol.TField("new_parts", org.apache.thrift.protocol.TType.LIST, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new alter_partition_with_environment_context_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new alter_partition_with_environment_context_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new alter_partitions_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new alter_partitions_argsTupleSchemeFactory()); } private String db_name; // required private String tbl_name; // required - private Partition new_part; // required - private EnvironmentContext environment_context; // required + private List new_parts; // 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 { DB_NAME((short)1, "db_name"), TBL_NAME((short)2, "tbl_name"), - NEW_PART((short)3, "new_part"), - ENVIRONMENT_CONTEXT((short)4, "environment_context"); + NEW_PARTS((short)3, "new_parts"); private static final Map byName = new HashMap(); @@ -91248,10 +91460,8 @@ public static _Fields findByThriftId(int fieldId) { return DB_NAME; case 2: // TBL_NAME return TBL_NAME; - case 3: // NEW_PART - return NEW_PART; - case 4: // ENVIRONMENT_CONTEXT - return ENVIRONMENT_CONTEXT; + case 3: // NEW_PARTS + return NEW_PARTS; default: return null; } @@ -91299,58 +91509,55 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tbl_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NEW_PART, new org.apache.thrift.meta_data.FieldMetaData("new_part", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Partition.class))); - tmpMap.put(_Fields.ENVIRONMENT_CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("environment_context", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EnvironmentContext.class))); + tmpMap.put(_Fields.NEW_PARTS, new org.apache.thrift.meta_data.FieldMetaData("new_parts", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Partition.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alter_partition_with_environment_context_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alter_partitions_args.class, metaDataMap); } - public alter_partition_with_environment_context_args() { + public alter_partitions_args() { } - public alter_partition_with_environment_context_args( + public alter_partitions_args( String db_name, String tbl_name, - Partition new_part, - EnvironmentContext environment_context) + List new_parts) { this(); this.db_name = db_name; this.tbl_name = tbl_name; - this.new_part = new_part; - this.environment_context = environment_context; + this.new_parts = new_parts; } /** * Performs a deep copy on other. */ - public alter_partition_with_environment_context_args(alter_partition_with_environment_context_args other) { + public alter_partitions_args(alter_partitions_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } if (other.isSetTbl_name()) { this.tbl_name = other.tbl_name; } - if (other.isSetNew_part()) { - this.new_part = new Partition(other.new_part); - } - if (other.isSetEnvironment_context()) { - this.environment_context = new EnvironmentContext(other.environment_context); + if (other.isSetNew_parts()) { + List __this__new_parts = new ArrayList(other.new_parts.size()); + for (Partition other_element : other.new_parts) { + __this__new_parts.add(new Partition(other_element)); + } + this.new_parts = __this__new_parts; } } - public alter_partition_with_environment_context_args deepCopy() { - return new alter_partition_with_environment_context_args(this); + public alter_partitions_args deepCopy() { + return new alter_partitions_args(this); } @Override public void clear() { this.db_name = null; this.tbl_name = null; - this.new_part = null; - this.environment_context = null; + this.new_parts = null; } public String getDb_name() { @@ -91399,49 +91606,41 @@ public void setTbl_nameIsSet(boolean value) { } } - public Partition getNew_part() { - return this.new_part; - } - - public void setNew_part(Partition new_part) { - this.new_part = new_part; - } - - public void unsetNew_part() { - this.new_part = null; + public int getNew_partsSize() { + return (this.new_parts == null) ? 0 : this.new_parts.size(); } - /** Returns true if field new_part is set (has been assigned a value) and false otherwise */ - public boolean isSetNew_part() { - return this.new_part != null; + public java.util.Iterator getNew_partsIterator() { + return (this.new_parts == null) ? null : this.new_parts.iterator(); } - public void setNew_partIsSet(boolean value) { - if (!value) { - this.new_part = null; + public void addToNew_parts(Partition elem) { + if (this.new_parts == null) { + this.new_parts = new ArrayList(); } + this.new_parts.add(elem); } - public EnvironmentContext getEnvironment_context() { - return this.environment_context; + public List getNew_parts() { + return this.new_parts; } - public void setEnvironment_context(EnvironmentContext environment_context) { - this.environment_context = environment_context; + public void setNew_parts(List new_parts) { + this.new_parts = new_parts; } - public void unsetEnvironment_context() { - this.environment_context = null; + public void unsetNew_parts() { + this.new_parts = null; } - /** Returns true if field environment_context is set (has been assigned a value) and false otherwise */ - public boolean isSetEnvironment_context() { - return this.environment_context != null; + /** Returns true if field new_parts is set (has been assigned a value) and false otherwise */ + public boolean isSetNew_parts() { + return this.new_parts != null; } - public void setEnvironment_contextIsSet(boolean value) { + public void setNew_partsIsSet(boolean value) { if (!value) { - this.environment_context = null; + this.new_parts = null; } } @@ -91463,19 +91662,11 @@ public void setFieldValue(_Fields field, Object value) { } break; - case NEW_PART: - if (value == null) { - unsetNew_part(); - } else { - setNew_part((Partition)value); - } - break; - - case ENVIRONMENT_CONTEXT: + case NEW_PARTS: if (value == null) { - unsetEnvironment_context(); + unsetNew_parts(); } else { - setEnvironment_context((EnvironmentContext)value); + setNew_parts((List)value); } break; @@ -91490,11 +91681,8 @@ public Object getFieldValue(_Fields field) { case TBL_NAME: return getTbl_name(); - case NEW_PART: - return getNew_part(); - - case ENVIRONMENT_CONTEXT: - return getEnvironment_context(); + case NEW_PARTS: + return getNew_parts(); } throw new IllegalStateException(); @@ -91511,10 +91699,8 @@ public boolean isSet(_Fields field) { return isSetDb_name(); case TBL_NAME: return isSetTbl_name(); - case NEW_PART: - return isSetNew_part(); - case ENVIRONMENT_CONTEXT: - return isSetEnvironment_context(); + case NEW_PARTS: + return isSetNew_parts(); } throw new IllegalStateException(); } @@ -91523,12 +91709,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_partition_with_environment_context_args) - return this.equals((alter_partition_with_environment_context_args)that); + if (that instanceof alter_partitions_args) + return this.equals((alter_partitions_args)that); return false; } - public boolean equals(alter_partition_with_environment_context_args that) { + public boolean equals(alter_partitions_args that) { if (that == null) return false; @@ -91550,21 +91736,12 @@ public boolean equals(alter_partition_with_environment_context_args that) { return false; } - boolean this_present_new_part = true && this.isSetNew_part(); - boolean that_present_new_part = true && that.isSetNew_part(); - if (this_present_new_part || that_present_new_part) { - if (!(this_present_new_part && that_present_new_part)) - return false; - if (!this.new_part.equals(that.new_part)) - return false; - } - - boolean this_present_environment_context = true && this.isSetEnvironment_context(); - boolean that_present_environment_context = true && that.isSetEnvironment_context(); - if (this_present_environment_context || that_present_environment_context) { - if (!(this_present_environment_context && that_present_environment_context)) + boolean this_present_new_parts = true && this.isSetNew_parts(); + boolean that_present_new_parts = true && that.isSetNew_parts(); + if (this_present_new_parts || that_present_new_parts) { + if (!(this_present_new_parts && that_present_new_parts)) return false; - if (!this.environment_context.equals(that.environment_context)) + if (!this.new_parts.equals(that.new_parts)) return false; } @@ -91585,21 +91762,16 @@ public int hashCode() { if (present_tbl_name) list.add(tbl_name); - boolean present_new_part = true && (isSetNew_part()); - list.add(present_new_part); - if (present_new_part) - list.add(new_part); - - boolean present_environment_context = true && (isSetEnvironment_context()); - list.add(present_environment_context); - if (present_environment_context) - list.add(environment_context); + boolean present_new_parts = true && (isSetNew_parts()); + list.add(present_new_parts); + if (present_new_parts) + list.add(new_parts); return list.hashCode(); } @Override - public int compareTo(alter_partition_with_environment_context_args other) { + public int compareTo(alter_partitions_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -91626,22 +91798,12 @@ public int compareTo(alter_partition_with_environment_context_args other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNew_part()).compareTo(other.isSetNew_part()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNew_part()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.new_part, other.new_part); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetEnvironment_context()).compareTo(other.isSetEnvironment_context()); + lastComparison = Boolean.valueOf(isSetNew_parts()).compareTo(other.isSetNew_parts()); if (lastComparison != 0) { return lastComparison; } - if (isSetEnvironment_context()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.environment_context, other.environment_context); + if (isSetNew_parts()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.new_parts, other.new_parts); if (lastComparison != 0) { return lastComparison; } @@ -91663,7 +91825,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_partition_with_environment_context_args("); + StringBuilder sb = new StringBuilder("alter_partitions_args("); boolean first = true; sb.append("db_name:"); @@ -91682,19 +91844,11 @@ public String toString() { } first = false; if (!first) sb.append(", "); - sb.append("new_part:"); - if (this.new_part == null) { - sb.append("null"); - } else { - sb.append(this.new_part); - } - first = false; - if (!first) sb.append(", "); - sb.append("environment_context:"); - if (this.environment_context == null) { + sb.append("new_parts:"); + if (this.new_parts == null) { sb.append("null"); } else { - sb.append(this.environment_context); + sb.append(this.new_parts); } first = false; sb.append(")"); @@ -91704,12 +91858,6 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity - if (new_part != null) { - new_part.validate(); - } - if (environment_context != null) { - environment_context.validate(); - } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -91728,15 +91876,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class alter_partition_with_environment_context_argsStandardSchemeFactory implements SchemeFactory { - public alter_partition_with_environment_context_argsStandardScheme getScheme() { - return new alter_partition_with_environment_context_argsStandardScheme(); + private static class alter_partitions_argsStandardSchemeFactory implements SchemeFactory { + public alter_partitions_argsStandardScheme getScheme() { + return new alter_partitions_argsStandardScheme(); } } - private static class alter_partition_with_environment_context_argsStandardScheme extends StandardScheme { + private static class alter_partitions_argsStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_with_environment_context_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partitions_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -91762,20 +91910,21 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_wit org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // NEW_PART - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.new_part = new Partition(); - struct.new_part.read(iprot); - struct.setNew_partIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // ENVIRONMENT_CONTEXT - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.environment_context = new EnvironmentContext(); - struct.environment_context.read(iprot); - struct.setEnvironment_contextIsSet(true); + case 3: // NEW_PARTS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list934 = iprot.readListBegin(); + struct.new_parts = new ArrayList(_list934.size); + Partition _elem935; + for (int _i936 = 0; _i936 < _list934.size; ++_i936) + { + _elem935 = new Partition(); + _elem935.read(iprot); + struct.new_parts.add(_elem935); + } + iprot.readListEnd(); + } + struct.setNew_partsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -91789,7 +91938,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_wit struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_with_environment_context_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partitions_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -91803,14 +91952,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_wi oprot.writeString(struct.tbl_name); oprot.writeFieldEnd(); } - if (struct.new_part != null) { - oprot.writeFieldBegin(NEW_PART_FIELD_DESC); - struct.new_part.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.environment_context != null) { - oprot.writeFieldBegin(ENVIRONMENT_CONTEXT_FIELD_DESC); - struct.environment_context.write(oprot); + if (struct.new_parts != null) { + oprot.writeFieldBegin(NEW_PARTS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.new_parts.size())); + for (Partition _iter937 : struct.new_parts) + { + _iter937.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -91819,16 +91970,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_wi } - private static class alter_partition_with_environment_context_argsTupleSchemeFactory implements SchemeFactory { - public alter_partition_with_environment_context_argsTupleScheme getScheme() { - return new alter_partition_with_environment_context_argsTupleScheme(); + private static class alter_partitions_argsTupleSchemeFactory implements SchemeFactory { + public alter_partitions_argsTupleScheme getScheme() { + return new alter_partitions_argsTupleScheme(); } } - private static class alter_partition_with_environment_context_argsTupleScheme extends TupleScheme { + private static class alter_partitions_argsTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_with_environment_context_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, alter_partitions_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDb_name()) { @@ -91837,31 +91988,31 @@ public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_wit if (struct.isSetTbl_name()) { optionals.set(1); } - if (struct.isSetNew_part()) { + if (struct.isSetNew_parts()) { optionals.set(2); } - if (struct.isSetEnvironment_context()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); + oprot.writeBitSet(optionals, 3); if (struct.isSetDb_name()) { oprot.writeString(struct.db_name); } if (struct.isSetTbl_name()) { oprot.writeString(struct.tbl_name); } - if (struct.isSetNew_part()) { - struct.new_part.write(oprot); - } - if (struct.isSetEnvironment_context()) { - struct.environment_context.write(oprot); + if (struct.isSetNew_parts()) { + { + oprot.writeI32(struct.new_parts.size()); + for (Partition _iter938 : struct.new_parts) + { + _iter938.write(oprot); + } + } } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_with_environment_context_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, alter_partitions_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.db_name = iprot.readString(); struct.setDb_nameIsSet(true); @@ -91871,30 +92022,34 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_with struct.setTbl_nameIsSet(true); } if (incoming.get(2)) { - struct.new_part = new Partition(); - struct.new_part.read(iprot); - struct.setNew_partIsSet(true); - } - if (incoming.get(3)) { - struct.environment_context = new EnvironmentContext(); - struct.environment_context.read(iprot); - struct.setEnvironment_contextIsSet(true); + { + org.apache.thrift.protocol.TList _list939 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.new_parts = new ArrayList(_list939.size); + Partition _elem940; + for (int _i941 = 0; _i941 < _list939.size; ++_i941) + { + _elem940 = new Partition(); + _elem940.read(iprot); + struct.new_parts.add(_elem940); + } + } + struct.setNew_partsIsSet(true); } } } } - public static class alter_partition_with_environment_context_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("alter_partition_with_environment_context_result"); + public static class alter_partitions_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("alter_partitions_result"); private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new alter_partition_with_environment_context_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new alter_partition_with_environment_context_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new alter_partitions_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new alter_partitions_resultTupleSchemeFactory()); } private InvalidOperationException o1; // required @@ -91970,13 +92125,13 @@ public String getFieldName() { tmpMap.put(_Fields.O2, new org.apache.thrift.meta_data.FieldMetaData("o2", 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(alter_partition_with_environment_context_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alter_partitions_result.class, metaDataMap); } - public alter_partition_with_environment_context_result() { + public alter_partitions_result() { } - public alter_partition_with_environment_context_result( + public alter_partitions_result( InvalidOperationException o1, MetaException o2) { @@ -91988,7 +92143,7 @@ public alter_partition_with_environment_context_result( /** * Performs a deep copy on other. */ - public alter_partition_with_environment_context_result(alter_partition_with_environment_context_result other) { + public alter_partitions_result(alter_partitions_result other) { if (other.isSetO1()) { this.o1 = new InvalidOperationException(other.o1); } @@ -91997,8 +92152,8 @@ public alter_partition_with_environment_context_result(alter_partition_with_envi } } - public alter_partition_with_environment_context_result deepCopy() { - return new alter_partition_with_environment_context_result(this); + public alter_partitions_result deepCopy() { + return new alter_partitions_result(this); } @Override @@ -92105,12 +92260,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof alter_partition_with_environment_context_result) - return this.equals((alter_partition_with_environment_context_result)that); + if (that instanceof alter_partitions_result) + return this.equals((alter_partitions_result)that); return false; } - public boolean equals(alter_partition_with_environment_context_result that) { + public boolean equals(alter_partitions_result that) { if (that == null) return false; @@ -92153,7 +92308,7 @@ public int hashCode() { } @Override - public int compareTo(alter_partition_with_environment_context_result other) { + public int compareTo(alter_partitions_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -92197,7 +92352,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("alter_partition_with_environment_context_result("); + StringBuilder sb = new StringBuilder("alter_partitions_result("); boolean first = true; sb.append("o1:"); @@ -92240,15 +92395,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class alter_partition_with_environment_context_resultStandardSchemeFactory implements SchemeFactory { - public alter_partition_with_environment_context_resultStandardScheme getScheme() { - return new alter_partition_with_environment_context_resultStandardScheme(); + private static class alter_partitions_resultStandardSchemeFactory implements SchemeFactory { + public alter_partitions_resultStandardScheme getScheme() { + return new alter_partitions_resultStandardScheme(); } } - private static class alter_partition_with_environment_context_resultStandardScheme extends StandardScheme { + private static class alter_partitions_resultStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_with_environment_context_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partitions_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -92285,7 +92440,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_wit struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_with_environment_context_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partitions_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -92305,16 +92460,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_wi } - private static class alter_partition_with_environment_context_resultTupleSchemeFactory implements SchemeFactory { - public alter_partition_with_environment_context_resultTupleScheme getScheme() { - return new alter_partition_with_environment_context_resultTupleScheme(); + private static class alter_partitions_resultTupleSchemeFactory implements SchemeFactory { + public alter_partitions_resultTupleScheme getScheme() { + return new alter_partitions_resultTupleScheme(); } } - private static class alter_partition_with_environment_context_resultTupleScheme extends TupleScheme { + private static class alter_partitions_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_with_environment_context_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, alter_partitions_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetO1()) { @@ -92333,7 +92488,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_wit } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_with_environment_context_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, alter_partitions_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { @@ -92351,31 +92506,31 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_with } - public static class rename_partition_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("rename_partition_args"); + public static class alter_partition_with_environment_context_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("alter_partition_with_environment_context_args"); private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tbl_name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PART_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("part_vals", org.apache.thrift.protocol.TType.LIST, (short)3); - private static final org.apache.thrift.protocol.TField NEW_PART_FIELD_DESC = new org.apache.thrift.protocol.TField("new_part", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField NEW_PART_FIELD_DESC = new org.apache.thrift.protocol.TField("new_part", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment_context", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new rename_partition_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new rename_partition_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new alter_partition_with_environment_context_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new alter_partition_with_environment_context_argsTupleSchemeFactory()); } private String db_name; // required private String tbl_name; // required - private List part_vals; // required private Partition new_part; // required + private EnvironmentContext environment_context; // 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 { DB_NAME((short)1, "db_name"), TBL_NAME((short)2, "tbl_name"), - PART_VALS((short)3, "part_vals"), - NEW_PART((short)4, "new_part"); + NEW_PART((short)3, "new_part"), + ENVIRONMENT_CONTEXT((short)4, "environment_context"); private static final Map byName = new HashMap(); @@ -92394,10 +92549,10 @@ public static _Fields findByThriftId(int fieldId) { return DB_NAME; case 2: // TBL_NAME return TBL_NAME; - case 3: // PART_VALS - return PART_VALS; - case 4: // NEW_PART + case 3: // NEW_PART return NEW_PART; + case 4: // ENVIRONMENT_CONTEXT + return ENVIRONMENT_CONTEXT; default: return null; } @@ -92445,60 +92600,58 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tbl_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PART_VALS, new org.apache.thrift.meta_data.FieldMetaData("part_vals", 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.NEW_PART, new org.apache.thrift.meta_data.FieldMetaData("new_part", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Partition.class))); + tmpMap.put(_Fields.ENVIRONMENT_CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("environment_context", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EnvironmentContext.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rename_partition_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alter_partition_with_environment_context_args.class, metaDataMap); } - public rename_partition_args() { + public alter_partition_with_environment_context_args() { } - public rename_partition_args( + public alter_partition_with_environment_context_args( String db_name, String tbl_name, - List part_vals, - Partition new_part) + Partition new_part, + EnvironmentContext environment_context) { this(); this.db_name = db_name; this.tbl_name = tbl_name; - this.part_vals = part_vals; this.new_part = new_part; + this.environment_context = environment_context; } /** * Performs a deep copy on other. */ - public rename_partition_args(rename_partition_args other) { + public alter_partition_with_environment_context_args(alter_partition_with_environment_context_args other) { if (other.isSetDb_name()) { this.db_name = other.db_name; } if (other.isSetTbl_name()) { this.tbl_name = other.tbl_name; } - if (other.isSetPart_vals()) { - List __this__part_vals = new ArrayList(other.part_vals); - this.part_vals = __this__part_vals; - } if (other.isSetNew_part()) { this.new_part = new Partition(other.new_part); } + if (other.isSetEnvironment_context()) { + this.environment_context = new EnvironmentContext(other.environment_context); + } } - public rename_partition_args deepCopy() { - return new rename_partition_args(this); + public alter_partition_with_environment_context_args deepCopy() { + return new alter_partition_with_environment_context_args(this); } @Override public void clear() { this.db_name = null; this.tbl_name = null; - this.part_vals = null; this.new_part = null; + this.environment_context = null; } public String getDb_name() { @@ -92547,64 +92700,49 @@ public void setTbl_nameIsSet(boolean value) { } } - public int getPart_valsSize() { - return (this.part_vals == null) ? 0 : this.part_vals.size(); - } - - public java.util.Iterator getPart_valsIterator() { - return (this.part_vals == null) ? null : this.part_vals.iterator(); - } - - public void addToPart_vals(String elem) { - if (this.part_vals == null) { - this.part_vals = new ArrayList(); - } - this.part_vals.add(elem); - } - - public List getPart_vals() { - return this.part_vals; + public Partition getNew_part() { + return this.new_part; } - public void setPart_vals(List part_vals) { - this.part_vals = part_vals; + public void setNew_part(Partition new_part) { + this.new_part = new_part; } - public void unsetPart_vals() { - this.part_vals = null; + public void unsetNew_part() { + this.new_part = null; } - /** Returns true if field part_vals is set (has been assigned a value) and false otherwise */ - public boolean isSetPart_vals() { - return this.part_vals != null; + /** Returns true if field new_part is set (has been assigned a value) and false otherwise */ + public boolean isSetNew_part() { + return this.new_part != null; } - public void setPart_valsIsSet(boolean value) { + public void setNew_partIsSet(boolean value) { if (!value) { - this.part_vals = null; + this.new_part = null; } } - public Partition getNew_part() { - return this.new_part; + public EnvironmentContext getEnvironment_context() { + return this.environment_context; } - public void setNew_part(Partition new_part) { - this.new_part = new_part; + public void setEnvironment_context(EnvironmentContext environment_context) { + this.environment_context = environment_context; } - public void unsetNew_part() { - this.new_part = null; + public void unsetEnvironment_context() { + this.environment_context = null; } - /** Returns true if field new_part is set (has been assigned a value) and false otherwise */ - public boolean isSetNew_part() { - return this.new_part != null; + /** Returns true if field environment_context is set (has been assigned a value) and false otherwise */ + public boolean isSetEnvironment_context() { + return this.environment_context != null; } - public void setNew_partIsSet(boolean value) { + public void setEnvironment_contextIsSet(boolean value) { if (!value) { - this.new_part = null; + this.environment_context = null; } } @@ -92626,19 +92764,19 @@ public void setFieldValue(_Fields field, Object value) { } break; - case PART_VALS: + case NEW_PART: if (value == null) { - unsetPart_vals(); + unsetNew_part(); } else { - setPart_vals((List)value); + setNew_part((Partition)value); } break; - case NEW_PART: + case ENVIRONMENT_CONTEXT: if (value == null) { - unsetNew_part(); + unsetEnvironment_context(); } else { - setNew_part((Partition)value); + setEnvironment_context((EnvironmentContext)value); } break; @@ -92653,12 +92791,12 @@ public Object getFieldValue(_Fields field) { case TBL_NAME: return getTbl_name(); - case PART_VALS: - return getPart_vals(); - case NEW_PART: return getNew_part(); + case ENVIRONMENT_CONTEXT: + return getEnvironment_context(); + } throw new IllegalStateException(); } @@ -92674,10 +92812,10 @@ public boolean isSet(_Fields field) { return isSetDb_name(); case TBL_NAME: return isSetTbl_name(); - case PART_VALS: - return isSetPart_vals(); case NEW_PART: return isSetNew_part(); + case ENVIRONMENT_CONTEXT: + return isSetEnvironment_context(); } throw new IllegalStateException(); } @@ -92686,12 +92824,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof rename_partition_args) - return this.equals((rename_partition_args)that); + if (that instanceof alter_partition_with_environment_context_args) + return this.equals((alter_partition_with_environment_context_args)that); return false; } - public boolean equals(rename_partition_args that) { + public boolean equals(alter_partition_with_environment_context_args that) { if (that == null) return false; @@ -92713,15 +92851,6 @@ public boolean equals(rename_partition_args that) { return false; } - boolean this_present_part_vals = true && this.isSetPart_vals(); - boolean that_present_part_vals = true && that.isSetPart_vals(); - if (this_present_part_vals || that_present_part_vals) { - if (!(this_present_part_vals && that_present_part_vals)) - return false; - if (!this.part_vals.equals(that.part_vals)) - return false; - } - boolean this_present_new_part = true && this.isSetNew_part(); boolean that_present_new_part = true && that.isSetNew_part(); if (this_present_new_part || that_present_new_part) { @@ -92731,6 +92860,15 @@ public boolean equals(rename_partition_args that) { return false; } + boolean this_present_environment_context = true && this.isSetEnvironment_context(); + boolean that_present_environment_context = true && that.isSetEnvironment_context(); + if (this_present_environment_context || that_present_environment_context) { + if (!(this_present_environment_context && that_present_environment_context)) + return false; + if (!this.environment_context.equals(that.environment_context)) + return false; + } + return true; } @@ -92748,21 +92886,21 @@ public int hashCode() { if (present_tbl_name) list.add(tbl_name); - boolean present_part_vals = true && (isSetPart_vals()); - list.add(present_part_vals); - if (present_part_vals) - list.add(part_vals); - boolean present_new_part = true && (isSetNew_part()); list.add(present_new_part); if (present_new_part) list.add(new_part); + boolean present_environment_context = true && (isSetEnvironment_context()); + list.add(present_environment_context); + if (present_environment_context) + list.add(environment_context); + return list.hashCode(); } @Override - public int compareTo(rename_partition_args other) { + public int compareTo(alter_partition_with_environment_context_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -92789,22 +92927,22 @@ public int compareTo(rename_partition_args other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetPart_vals()).compareTo(other.isSetPart_vals()); + lastComparison = Boolean.valueOf(isSetNew_part()).compareTo(other.isSetNew_part()); if (lastComparison != 0) { return lastComparison; } - if (isSetPart_vals()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.part_vals, other.part_vals); + if (isSetNew_part()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.new_part, other.new_part); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNew_part()).compareTo(other.isSetNew_part()); + lastComparison = Boolean.valueOf(isSetEnvironment_context()).compareTo(other.isSetEnvironment_context()); if (lastComparison != 0) { return lastComparison; } - if (isSetNew_part()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.new_part, other.new_part); + if (isSetEnvironment_context()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.environment_context, other.environment_context); if (lastComparison != 0) { return lastComparison; } @@ -92826,7 +92964,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("rename_partition_args("); + StringBuilder sb = new StringBuilder("alter_partition_with_environment_context_args("); boolean first = true; sb.append("db_name:"); @@ -92845,19 +92983,19 @@ public String toString() { } first = false; if (!first) sb.append(", "); - sb.append("part_vals:"); - if (this.part_vals == null) { + sb.append("new_part:"); + if (this.new_part == null) { sb.append("null"); } else { - sb.append(this.part_vals); + sb.append(this.new_part); } first = false; if (!first) sb.append(", "); - sb.append("new_part:"); - if (this.new_part == null) { + sb.append("environment_context:"); + if (this.environment_context == null) { sb.append("null"); } else { - sb.append(this.new_part); + sb.append(this.environment_context); } first = false; sb.append(")"); @@ -92870,6 +93008,9 @@ public void validate() throws org.apache.thrift.TException { if (new_part != null) { new_part.validate(); } + if (environment_context != null) { + environment_context.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -92888,15 +93029,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class rename_partition_argsStandardSchemeFactory implements SchemeFactory { - public rename_partition_argsStandardScheme getScheme() { - return new rename_partition_argsStandardScheme(); + private static class alter_partition_with_environment_context_argsStandardSchemeFactory implements SchemeFactory { + public alter_partition_with_environment_context_argsStandardScheme getScheme() { + return new alter_partition_with_environment_context_argsStandardScheme(); } } - private static class rename_partition_argsStandardScheme extends StandardScheme { + private static class alter_partition_with_environment_context_argsStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, rename_partition_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_with_environment_context_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -92922,29 +93063,20 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, rename_partition_ar org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // PART_VALS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list942 = iprot.readListBegin(); - struct.part_vals = new ArrayList(_list942.size); - String _elem943; - for (int _i944 = 0; _i944 < _list942.size; ++_i944) - { - _elem943 = iprot.readString(); - struct.part_vals.add(_elem943); - } - iprot.readListEnd(); - } - struct.setPart_valsIsSet(true); + case 3: // NEW_PART + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.new_part = new Partition(); + struct.new_part.read(iprot); + struct.setNew_partIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // NEW_PART + case 4: // ENVIRONMENT_CONTEXT if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.new_part = new Partition(); - struct.new_part.read(iprot); - struct.setNew_partIsSet(true); + struct.environment_context = new EnvironmentContext(); + struct.environment_context.read(iprot); + struct.setEnvironment_contextIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -92958,7 +93090,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, rename_partition_ar struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, rename_partition_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_with_environment_context_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -92972,39 +93104,32 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, rename_partition_a oprot.writeString(struct.tbl_name); oprot.writeFieldEnd(); } - if (struct.part_vals != null) { - oprot.writeFieldBegin(PART_VALS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.part_vals.size())); - for (String _iter945 : struct.part_vals) - { - oprot.writeString(_iter945); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } if (struct.new_part != null) { oprot.writeFieldBegin(NEW_PART_FIELD_DESC); struct.new_part.write(oprot); oprot.writeFieldEnd(); } + if (struct.environment_context != null) { + oprot.writeFieldBegin(ENVIRONMENT_CONTEXT_FIELD_DESC); + struct.environment_context.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class rename_partition_argsTupleSchemeFactory implements SchemeFactory { - public rename_partition_argsTupleScheme getScheme() { - return new rename_partition_argsTupleScheme(); + private static class alter_partition_with_environment_context_argsTupleSchemeFactory implements SchemeFactory { + public alter_partition_with_environment_context_argsTupleScheme getScheme() { + return new alter_partition_with_environment_context_argsTupleScheme(); } } - private static class rename_partition_argsTupleScheme extends TupleScheme { + private static class alter_partition_with_environment_context_argsTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, rename_partition_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_with_environment_context_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDb_name()) { @@ -93013,10 +93138,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, rename_partition_ar if (struct.isSetTbl_name()) { optionals.set(1); } - if (struct.isSetPart_vals()) { + if (struct.isSetNew_part()) { optionals.set(2); } - if (struct.isSetNew_part()) { + if (struct.isSetEnvironment_context()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); @@ -93026,22 +93151,16 @@ public void write(org.apache.thrift.protocol.TProtocol prot, rename_partition_ar if (struct.isSetTbl_name()) { oprot.writeString(struct.tbl_name); } - if (struct.isSetPart_vals()) { - { - oprot.writeI32(struct.part_vals.size()); - for (String _iter946 : struct.part_vals) - { - oprot.writeString(_iter946); - } - } - } if (struct.isSetNew_part()) { struct.new_part.write(oprot); } + if (struct.isSetEnvironment_context()) { + struct.environment_context.write(oprot); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, rename_partition_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_with_environment_context_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { @@ -93053,38 +93172,30 @@ public void read(org.apache.thrift.protocol.TProtocol prot, rename_partition_arg struct.setTbl_nameIsSet(true); } if (incoming.get(2)) { - { - org.apache.thrift.protocol.TList _list947 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.part_vals = new ArrayList(_list947.size); - String _elem948; - for (int _i949 = 0; _i949 < _list947.size; ++_i949) - { - _elem948 = iprot.readString(); - struct.part_vals.add(_elem948); - } - } - struct.setPart_valsIsSet(true); - } - if (incoming.get(3)) { struct.new_part = new Partition(); struct.new_part.read(iprot); struct.setNew_partIsSet(true); } + if (incoming.get(3)) { + struct.environment_context = new EnvironmentContext(); + struct.environment_context.read(iprot); + struct.setEnvironment_contextIsSet(true); + } } } } - public static class rename_partition_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("rename_partition_result"); + public static class alter_partition_with_environment_context_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("alter_partition_with_environment_context_result"); private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new rename_partition_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new rename_partition_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new alter_partition_with_environment_context_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new alter_partition_with_environment_context_resultTupleSchemeFactory()); } private InvalidOperationException o1; // required @@ -93160,13 +93271,13 @@ public String getFieldName() { tmpMap.put(_Fields.O2, new org.apache.thrift.meta_data.FieldMetaData("o2", 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(rename_partition_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(alter_partition_with_environment_context_result.class, metaDataMap); } - public rename_partition_result() { + public alter_partition_with_environment_context_result() { } - public rename_partition_result( + public alter_partition_with_environment_context_result( InvalidOperationException o1, MetaException o2) { @@ -93178,7 +93289,7 @@ public rename_partition_result( /** * Performs a deep copy on other. */ - public rename_partition_result(rename_partition_result other) { + public alter_partition_with_environment_context_result(alter_partition_with_environment_context_result other) { if (other.isSetO1()) { this.o1 = new InvalidOperationException(other.o1); } @@ -93187,8 +93298,8 @@ public rename_partition_result(rename_partition_result other) { } } - public rename_partition_result deepCopy() { - return new rename_partition_result(this); + public alter_partition_with_environment_context_result deepCopy() { + return new alter_partition_with_environment_context_result(this); } @Override @@ -93295,12 +93406,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof rename_partition_result) - return this.equals((rename_partition_result)that); + if (that instanceof alter_partition_with_environment_context_result) + return this.equals((alter_partition_with_environment_context_result)that); return false; } - public boolean equals(rename_partition_result that) { + public boolean equals(alter_partition_with_environment_context_result that) { if (that == null) return false; @@ -93343,7 +93454,7 @@ public int hashCode() { } @Override - public int compareTo(rename_partition_result other) { + public int compareTo(alter_partition_with_environment_context_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -93387,7 +93498,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public String toString() { - StringBuilder sb = new StringBuilder("rename_partition_result("); + StringBuilder sb = new StringBuilder("alter_partition_with_environment_context_result("); boolean first = true; sb.append("o1:"); @@ -93430,15 +93541,15 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class rename_partition_resultStandardSchemeFactory implements SchemeFactory { - public rename_partition_resultStandardScheme getScheme() { - return new rename_partition_resultStandardScheme(); + private static class alter_partition_with_environment_context_resultStandardSchemeFactory implements SchemeFactory { + public alter_partition_with_environment_context_resultStandardScheme getScheme() { + return new alter_partition_with_environment_context_resultStandardScheme(); } } - private static class rename_partition_resultStandardScheme extends StandardScheme { + private static class alter_partition_with_environment_context_resultStandardScheme extends StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, rename_partition_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, alter_partition_with_environment_context_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -93475,7 +93586,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, rename_partition_re struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, rename_partition_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, alter_partition_with_environment_context_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -93495,16 +93606,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, rename_partition_r } - private static class rename_partition_resultTupleSchemeFactory implements SchemeFactory { - public rename_partition_resultTupleScheme getScheme() { - return new rename_partition_resultTupleScheme(); + private static class alter_partition_with_environment_context_resultTupleSchemeFactory implements SchemeFactory { + public alter_partition_with_environment_context_resultTupleScheme getScheme() { + return new alter_partition_with_environment_context_resultTupleScheme(); } } - private static class rename_partition_resultTupleScheme extends TupleScheme { + private static class alter_partition_with_environment_context_resultTupleScheme extends TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, rename_partition_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, alter_partition_with_environment_context_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetO1()) { @@ -93523,7 +93634,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, rename_partition_re } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, rename_partition_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, alter_partition_with_environment_context_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { @@ -93541,25 +93652,31 @@ public void read(org.apache.thrift.protocol.TProtocol prot, rename_partition_res } - public static class partition_name_has_valid_characters_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("partition_name_has_valid_characters_args"); + public static class rename_partition_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("rename_partition_args"); - private static final org.apache.thrift.protocol.TField PART_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("part_vals", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField THROW_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("throw_exception", org.apache.thrift.protocol.TType.BOOL, (short)2); + private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tbl_name", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField PART_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("part_vals", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField NEW_PART_FIELD_DESC = new org.apache.thrift.protocol.TField("new_part", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new partition_name_has_valid_characters_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new partition_name_has_valid_characters_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new rename_partition_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new rename_partition_argsTupleSchemeFactory()); } + private String db_name; // required + private String tbl_name; // required private List part_vals; // required - private boolean throw_exception; // required + private Partition new_part; // 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 { - PART_VALS((short)1, "part_vals"), - THROW_EXCEPTION((short)2, "throw_exception"); + DB_NAME((short)1, "db_name"), + TBL_NAME((short)2, "tbl_name"), + PART_VALS((short)3, "part_vals"), + NEW_PART((short)4, "new_part"); private static final Map byName = new HashMap(); @@ -93574,10 +93691,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, rename_partition_res */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // PART_VALS + case 1: // DB_NAME + return DB_NAME; + case 2: // TBL_NAME + return TBL_NAME; + case 3: // PART_VALS return PART_VALS; - case 2: // THROW_EXCEPTION - return THROW_EXCEPTION; + case 4: // NEW_PART + return NEW_PART; default: return null; } @@ -93618,54 +93739,113 @@ public String getFieldName() { } // isset id assignments - private static final int __THROW_EXCEPTION_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.DB_NAME, new org.apache.thrift.meta_data.FieldMetaData("db_name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tbl_name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PART_VALS, new org.apache.thrift.meta_data.FieldMetaData("part_vals", 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.THROW_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("throw_exception", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.NEW_PART, new org.apache.thrift.meta_data.FieldMetaData("new_part", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Partition.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(partition_name_has_valid_characters_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rename_partition_args.class, metaDataMap); } - public partition_name_has_valid_characters_args() { + public rename_partition_args() { } - public partition_name_has_valid_characters_args( + public rename_partition_args( + String db_name, + String tbl_name, List part_vals, - boolean throw_exception) + Partition new_part) { this(); + this.db_name = db_name; + this.tbl_name = tbl_name; this.part_vals = part_vals; - this.throw_exception = throw_exception; - setThrow_exceptionIsSet(true); + this.new_part = new_part; } /** * Performs a deep copy on other. */ - public partition_name_has_valid_characters_args(partition_name_has_valid_characters_args other) { - __isset_bitfield = other.__isset_bitfield; + public rename_partition_args(rename_partition_args other) { + if (other.isSetDb_name()) { + this.db_name = other.db_name; + } + if (other.isSetTbl_name()) { + this.tbl_name = other.tbl_name; + } if (other.isSetPart_vals()) { List __this__part_vals = new ArrayList(other.part_vals); this.part_vals = __this__part_vals; } - this.throw_exception = other.throw_exception; + if (other.isSetNew_part()) { + this.new_part = new Partition(other.new_part); + } } - public partition_name_has_valid_characters_args deepCopy() { - return new partition_name_has_valid_characters_args(this); + public rename_partition_args deepCopy() { + return new rename_partition_args(this); } @Override public void clear() { + this.db_name = null; + this.tbl_name = null; this.part_vals = null; - setThrow_exceptionIsSet(false); - this.throw_exception = false; + this.new_part = null; + } + + public String getDb_name() { + return this.db_name; + } + + public void setDb_name(String db_name) { + this.db_name = db_name; + } + + public void unsetDb_name() { + this.db_name = null; + } + + /** Returns true if field db_name is set (has been assigned a value) and false otherwise */ + public boolean isSetDb_name() { + return this.db_name != null; + } + + public void setDb_nameIsSet(boolean value) { + if (!value) { + this.db_name = null; + } + } + + public String getTbl_name() { + return this.tbl_name; + } + + public void setTbl_name(String tbl_name) { + this.tbl_name = tbl_name; + } + + public void unsetTbl_name() { + this.tbl_name = null; + } + + /** Returns true if field tbl_name is set (has been assigned a value) and false otherwise */ + public boolean isSetTbl_name() { + return this.tbl_name != null; + } + + public void setTbl_nameIsSet(boolean value) { + if (!value) { + this.tbl_name = null; + } } public int getPart_valsSize() { @@ -93706,30 +93886,47 @@ public void setPart_valsIsSet(boolean value) { } } - public boolean isThrow_exception() { - return this.throw_exception; + public Partition getNew_part() { + return this.new_part; } - public void setThrow_exception(boolean throw_exception) { - this.throw_exception = throw_exception; - setThrow_exceptionIsSet(true); + public void setNew_part(Partition new_part) { + this.new_part = new_part; } - public void unsetThrow_exception() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __THROW_EXCEPTION_ISSET_ID); + public void unsetNew_part() { + this.new_part = null; } - /** Returns true if field throw_exception is set (has been assigned a value) and false otherwise */ - public boolean isSetThrow_exception() { - return EncodingUtils.testBit(__isset_bitfield, __THROW_EXCEPTION_ISSET_ID); + /** Returns true if field new_part is set (has been assigned a value) and false otherwise */ + public boolean isSetNew_part() { + return this.new_part != null; } - public void setThrow_exceptionIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __THROW_EXCEPTION_ISSET_ID, value); + public void setNew_partIsSet(boolean value) { + if (!value) { + this.new_part = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { + case DB_NAME: + if (value == null) { + unsetDb_name(); + } else { + setDb_name((String)value); + } + break; + + case TBL_NAME: + if (value == null) { + unsetTbl_name(); + } else { + setTbl_name((String)value); + } + break; + case PART_VALS: if (value == null) { unsetPart_vals(); @@ -93738,11 +93935,11 @@ public void setFieldValue(_Fields field, Object value) { } break; - case THROW_EXCEPTION: + case NEW_PART: if (value == null) { - unsetThrow_exception(); + unsetNew_part(); } else { - setThrow_exception((Boolean)value); + setNew_part((Partition)value); } break; @@ -93751,11 +93948,17 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { + case DB_NAME: + return getDb_name(); + + case TBL_NAME: + return getTbl_name(); + case PART_VALS: return getPart_vals(); - case THROW_EXCEPTION: - return isThrow_exception(); + case NEW_PART: + return getNew_part(); } throw new IllegalStateException(); @@ -93768,10 +93971,14 @@ public boolean isSet(_Fields field) { } switch (field) { + case DB_NAME: + return isSetDb_name(); + case TBL_NAME: + return isSetTbl_name(); case PART_VALS: return isSetPart_vals(); - case THROW_EXCEPTION: - return isSetThrow_exception(); + case NEW_PART: + return isSetNew_part(); } throw new IllegalStateException(); } @@ -93780,15 +93987,33 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof partition_name_has_valid_characters_args) - return this.equals((partition_name_has_valid_characters_args)that); + if (that instanceof rename_partition_args) + return this.equals((rename_partition_args)that); return false; } - public boolean equals(partition_name_has_valid_characters_args that) { + public boolean equals(rename_partition_args that) { if (that == null) return false; + boolean this_present_db_name = true && this.isSetDb_name(); + boolean that_present_db_name = true && that.isSetDb_name(); + if (this_present_db_name || that_present_db_name) { + if (!(this_present_db_name && that_present_db_name)) + return false; + if (!this.db_name.equals(that.db_name)) + return false; + } + + boolean this_present_tbl_name = true && this.isSetTbl_name(); + boolean that_present_tbl_name = true && that.isSetTbl_name(); + if (this_present_tbl_name || that_present_tbl_name) { + if (!(this_present_tbl_name && that_present_tbl_name)) + return false; + if (!this.tbl_name.equals(that.tbl_name)) + return false; + } + boolean this_present_part_vals = true && this.isSetPart_vals(); boolean that_present_part_vals = true && that.isSetPart_vals(); if (this_present_part_vals || that_present_part_vals) { @@ -93798,12 +94023,12 @@ public boolean equals(partition_name_has_valid_characters_args that) { return false; } - boolean this_present_throw_exception = true; - boolean that_present_throw_exception = true; - if (this_present_throw_exception || that_present_throw_exception) { - if (!(this_present_throw_exception && that_present_throw_exception)) + boolean this_present_new_part = true && this.isSetNew_part(); + boolean that_present_new_part = true && that.isSetNew_part(); + if (this_present_new_part || that_present_new_part) { + if (!(this_present_new_part && that_present_new_part)) return false; - if (this.throw_exception != that.throw_exception) + if (!this.new_part.equals(that.new_part)) return false; } @@ -93814,27 +94039,57 @@ public boolean equals(partition_name_has_valid_characters_args that) { public int hashCode() { List list = new ArrayList(); + boolean present_db_name = true && (isSetDb_name()); + list.add(present_db_name); + if (present_db_name) + list.add(db_name); + + boolean present_tbl_name = true && (isSetTbl_name()); + list.add(present_tbl_name); + if (present_tbl_name) + list.add(tbl_name); + boolean present_part_vals = true && (isSetPart_vals()); list.add(present_part_vals); if (present_part_vals) list.add(part_vals); - boolean present_throw_exception = true; - list.add(present_throw_exception); - if (present_throw_exception) - list.add(throw_exception); + boolean present_new_part = true && (isSetNew_part()); + list.add(present_new_part); + if (present_new_part) + list.add(new_part); return list.hashCode(); } @Override - public int compareTo(partition_name_has_valid_characters_args other) { + public int compareTo(rename_partition_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetDb_name()).compareTo(other.isSetDb_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDb_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db_name, other.db_name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTbl_name()).compareTo(other.isSetTbl_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTbl_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tbl_name, other.tbl_name); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetPart_vals()).compareTo(other.isSetPart_vals()); if (lastComparison != 0) { return lastComparison; @@ -93845,12 +94100,1058 @@ public int compareTo(partition_name_has_valid_characters_args other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetThrow_exception()).compareTo(other.isSetThrow_exception()); + lastComparison = Boolean.valueOf(isSetNew_part()).compareTo(other.isSetNew_part()); if (lastComparison != 0) { return lastComparison; } - if (isSetThrow_exception()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.throw_exception, other.throw_exception); + if (isSetNew_part()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.new_part, other.new_part); + 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("rename_partition_args("); + boolean first = true; + + sb.append("db_name:"); + if (this.db_name == null) { + sb.append("null"); + } else { + sb.append(this.db_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("tbl_name:"); + if (this.tbl_name == null) { + sb.append("null"); + } else { + sb.append(this.tbl_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("part_vals:"); + if (this.part_vals == null) { + sb.append("null"); + } else { + sb.append(this.part_vals); + } + first = false; + if (!first) sb.append(", "); + sb.append("new_part:"); + if (this.new_part == null) { + sb.append("null"); + } else { + sb.append(this.new_part); + } + 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 (new_part != null) { + new_part.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 rename_partition_argsStandardSchemeFactory implements SchemeFactory { + public rename_partition_argsStandardScheme getScheme() { + return new rename_partition_argsStandardScheme(); + } + } + + private static class rename_partition_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, rename_partition_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: // DB_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.db_name = iprot.readString(); + struct.setDb_nameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TBL_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tbl_name = iprot.readString(); + struct.setTbl_nameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PART_VALS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list942 = iprot.readListBegin(); + struct.part_vals = new ArrayList(_list942.size); + String _elem943; + for (int _i944 = 0; _i944 < _list942.size; ++_i944) + { + _elem943 = iprot.readString(); + struct.part_vals.add(_elem943); + } + iprot.readListEnd(); + } + struct.setPart_valsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // NEW_PART + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.new_part = new Partition(); + struct.new_part.read(iprot); + struct.setNew_partIsSet(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, rename_partition_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.db_name != null) { + oprot.writeFieldBegin(DB_NAME_FIELD_DESC); + oprot.writeString(struct.db_name); + oprot.writeFieldEnd(); + } + if (struct.tbl_name != null) { + oprot.writeFieldBegin(TBL_NAME_FIELD_DESC); + oprot.writeString(struct.tbl_name); + oprot.writeFieldEnd(); + } + if (struct.part_vals != null) { + oprot.writeFieldBegin(PART_VALS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.part_vals.size())); + for (String _iter945 : struct.part_vals) + { + oprot.writeString(_iter945); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.new_part != null) { + oprot.writeFieldBegin(NEW_PART_FIELD_DESC); + struct.new_part.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class rename_partition_argsTupleSchemeFactory implements SchemeFactory { + public rename_partition_argsTupleScheme getScheme() { + return new rename_partition_argsTupleScheme(); + } + } + + private static class rename_partition_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, rename_partition_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetDb_name()) { + optionals.set(0); + } + if (struct.isSetTbl_name()) { + optionals.set(1); + } + if (struct.isSetPart_vals()) { + optionals.set(2); + } + if (struct.isSetNew_part()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetDb_name()) { + oprot.writeString(struct.db_name); + } + if (struct.isSetTbl_name()) { + oprot.writeString(struct.tbl_name); + } + if (struct.isSetPart_vals()) { + { + oprot.writeI32(struct.part_vals.size()); + for (String _iter946 : struct.part_vals) + { + oprot.writeString(_iter946); + } + } + } + if (struct.isSetNew_part()) { + struct.new_part.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, rename_partition_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.db_name = iprot.readString(); + struct.setDb_nameIsSet(true); + } + if (incoming.get(1)) { + struct.tbl_name = iprot.readString(); + struct.setTbl_nameIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list947 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.part_vals = new ArrayList(_list947.size); + String _elem948; + for (int _i949 = 0; _i949 < _list947.size; ++_i949) + { + _elem948 = iprot.readString(); + struct.part_vals.add(_elem948); + } + } + struct.setPart_valsIsSet(true); + } + if (incoming.get(3)) { + struct.new_part = new Partition(); + struct.new_part.read(iprot); + struct.setNew_partIsSet(true); + } + } + } + + } + + public static class rename_partition_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("rename_partition_result"); + + private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new rename_partition_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new rename_partition_resultTupleSchemeFactory()); + } + + private InvalidOperationException o1; // required + private MetaException o2; // 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 { + O1((short)1, "o1"), + O2((short)2, "o2"); + + 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: // O1 + return O1; + case 2: // O2 + return O2; + 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.O1, new org.apache.thrift.meta_data.FieldMetaData("o1", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.O2, new org.apache.thrift.meta_data.FieldMetaData("o2", 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(rename_partition_result.class, metaDataMap); + } + + public rename_partition_result() { + } + + public rename_partition_result( + InvalidOperationException o1, + MetaException o2) + { + this(); + this.o1 = o1; + this.o2 = o2; + } + + /** + * Performs a deep copy on other. + */ + public rename_partition_result(rename_partition_result other) { + if (other.isSetO1()) { + this.o1 = new InvalidOperationException(other.o1); + } + if (other.isSetO2()) { + this.o2 = new MetaException(other.o2); + } + } + + public rename_partition_result deepCopy() { + return new rename_partition_result(this); + } + + @Override + public void clear() { + this.o1 = null; + this.o2 = null; + } + + public InvalidOperationException getO1() { + return this.o1; + } + + public void setO1(InvalidOperationException o1) { + this.o1 = o1; + } + + public void unsetO1() { + this.o1 = null; + } + + /** Returns true if field o1 is set (has been assigned a value) and false otherwise */ + public boolean isSetO1() { + return this.o1 != null; + } + + public void setO1IsSet(boolean value) { + if (!value) { + this.o1 = null; + } + } + + public MetaException getO2() { + return this.o2; + } + + public void setO2(MetaException o2) { + this.o2 = o2; + } + + public void unsetO2() { + this.o2 = null; + } + + /** Returns true if field o2 is set (has been assigned a value) and false otherwise */ + public boolean isSetO2() { + return this.o2 != null; + } + + public void setO2IsSet(boolean value) { + if (!value) { + this.o2 = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case O1: + if (value == null) { + unsetO1(); + } else { + setO1((InvalidOperationException)value); + } + break; + + case O2: + if (value == null) { + unsetO2(); + } else { + setO2((MetaException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case O1: + return getO1(); + + case O2: + return getO2(); + + } + 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 O1: + return isSetO1(); + case O2: + return isSetO2(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof rename_partition_result) + return this.equals((rename_partition_result)that); + return false; + } + + public boolean equals(rename_partition_result that) { + if (that == null) + return false; + + boolean this_present_o1 = true && this.isSetO1(); + boolean that_present_o1 = true && that.isSetO1(); + if (this_present_o1 || that_present_o1) { + if (!(this_present_o1 && that_present_o1)) + return false; + if (!this.o1.equals(that.o1)) + return false; + } + + boolean this_present_o2 = true && this.isSetO2(); + boolean that_present_o2 = true && that.isSetO2(); + if (this_present_o2 || that_present_o2) { + if (!(this_present_o2 && that_present_o2)) + return false; + if (!this.o2.equals(that.o2)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_o1 = true && (isSetO1()); + list.add(present_o1); + if (present_o1) + list.add(o1); + + boolean present_o2 = true && (isSetO2()); + list.add(present_o2); + if (present_o2) + list.add(o2); + + return list.hashCode(); + } + + @Override + public int compareTo(rename_partition_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetO1()).compareTo(other.isSetO1()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO1()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.o1, other.o1); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetO2()).compareTo(other.isSetO2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetO2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.o2, other.o2); + 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("rename_partition_result("); + boolean first = true; + + sb.append("o1:"); + if (this.o1 == null) { + sb.append("null"); + } else { + sb.append(this.o1); + } + first = false; + if (!first) sb.append(", "); + sb.append("o2:"); + if (this.o2 == null) { + sb.append("null"); + } else { + sb.append(this.o2); + } + 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 rename_partition_resultStandardSchemeFactory implements SchemeFactory { + public rename_partition_resultStandardScheme getScheme() { + return new rename_partition_resultStandardScheme(); + } + } + + private static class rename_partition_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, rename_partition_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: // O1 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.o1 = new InvalidOperationException(); + struct.o1.read(iprot); + struct.setO1IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // O2 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.o2 = new MetaException(); + struct.o2.read(iprot); + struct.setO2IsSet(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, rename_partition_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.o1 != null) { + oprot.writeFieldBegin(O1_FIELD_DESC); + struct.o1.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.o2 != null) { + oprot.writeFieldBegin(O2_FIELD_DESC); + struct.o2.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class rename_partition_resultTupleSchemeFactory implements SchemeFactory { + public rename_partition_resultTupleScheme getScheme() { + return new rename_partition_resultTupleScheme(); + } + } + + private static class rename_partition_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, rename_partition_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetO1()) { + optionals.set(0); + } + if (struct.isSetO2()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetO1()) { + struct.o1.write(oprot); + } + if (struct.isSetO2()) { + struct.o2.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, rename_partition_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.o1 = new InvalidOperationException(); + struct.o1.read(iprot); + struct.setO1IsSet(true); + } + if (incoming.get(1)) { + struct.o2 = new MetaException(); + struct.o2.read(iprot); + struct.setO2IsSet(true); + } + } + } + + } + + public static class partition_name_has_valid_characters_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("partition_name_has_valid_characters_args"); + + private static final org.apache.thrift.protocol.TField PART_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("part_vals", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField THROW_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("throw_exception", org.apache.thrift.protocol.TType.BOOL, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new partition_name_has_valid_characters_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new partition_name_has_valid_characters_argsTupleSchemeFactory()); + } + + private List part_vals; // required + private boolean throw_exception; // 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 { + PART_VALS((short)1, "part_vals"), + THROW_EXCEPTION((short)2, "throw_exception"); + + 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: // PART_VALS + return PART_VALS; + case 2: // THROW_EXCEPTION + return THROW_EXCEPTION; + 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 __THROW_EXCEPTION_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.PART_VALS, new org.apache.thrift.meta_data.FieldMetaData("part_vals", 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.THROW_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("throw_exception", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(partition_name_has_valid_characters_args.class, metaDataMap); + } + + public partition_name_has_valid_characters_args() { + } + + public partition_name_has_valid_characters_args( + List part_vals, + boolean throw_exception) + { + this(); + this.part_vals = part_vals; + this.throw_exception = throw_exception; + setThrow_exceptionIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public partition_name_has_valid_characters_args(partition_name_has_valid_characters_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetPart_vals()) { + List __this__part_vals = new ArrayList(other.part_vals); + this.part_vals = __this__part_vals; + } + this.throw_exception = other.throw_exception; + } + + public partition_name_has_valid_characters_args deepCopy() { + return new partition_name_has_valid_characters_args(this); + } + + @Override + public void clear() { + this.part_vals = null; + setThrow_exceptionIsSet(false); + this.throw_exception = false; + } + + public int getPart_valsSize() { + return (this.part_vals == null) ? 0 : this.part_vals.size(); + } + + public java.util.Iterator getPart_valsIterator() { + return (this.part_vals == null) ? null : this.part_vals.iterator(); + } + + public void addToPart_vals(String elem) { + if (this.part_vals == null) { + this.part_vals = new ArrayList(); + } + this.part_vals.add(elem); + } + + public List getPart_vals() { + return this.part_vals; + } + + public void setPart_vals(List part_vals) { + this.part_vals = part_vals; + } + + public void unsetPart_vals() { + this.part_vals = null; + } + + /** Returns true if field part_vals is set (has been assigned a value) and false otherwise */ + public boolean isSetPart_vals() { + return this.part_vals != null; + } + + public void setPart_valsIsSet(boolean value) { + if (!value) { + this.part_vals = null; + } + } + + public boolean isThrow_exception() { + return this.throw_exception; + } + + public void setThrow_exception(boolean throw_exception) { + this.throw_exception = throw_exception; + setThrow_exceptionIsSet(true); + } + + public void unsetThrow_exception() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __THROW_EXCEPTION_ISSET_ID); + } + + /** Returns true if field throw_exception is set (has been assigned a value) and false otherwise */ + public boolean isSetThrow_exception() { + return EncodingUtils.testBit(__isset_bitfield, __THROW_EXCEPTION_ISSET_ID); + } + + public void setThrow_exceptionIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __THROW_EXCEPTION_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case PART_VALS: + if (value == null) { + unsetPart_vals(); + } else { + setPart_vals((List)value); + } + break; + + case THROW_EXCEPTION: + if (value == null) { + unsetThrow_exception(); + } else { + setThrow_exception((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case PART_VALS: + return getPart_vals(); + + case THROW_EXCEPTION: + return isThrow_exception(); + + } + 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 PART_VALS: + return isSetPart_vals(); + case THROW_EXCEPTION: + return isSetThrow_exception(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof partition_name_has_valid_characters_args) + return this.equals((partition_name_has_valid_characters_args)that); + return false; + } + + public boolean equals(partition_name_has_valid_characters_args that) { + if (that == null) + return false; + + boolean this_present_part_vals = true && this.isSetPart_vals(); + boolean that_present_part_vals = true && that.isSetPart_vals(); + if (this_present_part_vals || that_present_part_vals) { + if (!(this_present_part_vals && that_present_part_vals)) + return false; + if (!this.part_vals.equals(that.part_vals)) + return false; + } + + boolean this_present_throw_exception = true; + boolean that_present_throw_exception = true; + if (this_present_throw_exception || that_present_throw_exception) { + if (!(this_present_throw_exception && that_present_throw_exception)) + return false; + if (this.throw_exception != that.throw_exception) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_part_vals = true && (isSetPart_vals()); + list.add(present_part_vals); + if (present_part_vals) + list.add(part_vals); + + boolean present_throw_exception = true; + list.add(present_throw_exception); + if (present_throw_exception) + list.add(throw_exception); + + return list.hashCode(); + } + + @Override + public int compareTo(partition_name_has_valid_characters_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetPart_vals()).compareTo(other.isSetPart_vals()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPart_vals()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.part_vals, other.part_vals); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetThrow_exception()).compareTo(other.isSetThrow_exception()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetThrow_exception()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.throw_exception, other.throw_exception); if (lastComparison != 0) { return lastComparison; } @@ -154906,7 +156207,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, flushCache_result s while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -155025,7 +156326,7 @@ public String getFieldName() { 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, + 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, GetFileMetadataByExprRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_file_metadata_by_expr_args.class, metaDataMap); @@ -155241,7 +156542,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, get_file_metadata_b while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -155250,7 +156551,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, get_file_metadata_b struct.req = new GetFileMetadataByExprRequest(); struct.req.read(iprot); struct.setReqIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -155388,7 +156689,7 @@ public String getFieldName() { 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, + 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, GetFileMetadataByExprResult.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_file_metadata_by_expr_result.class, metaDataMap); @@ -155613,7 +156914,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, get_file_metadata_b struct.success = new GetFileMetadataByExprResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; diff --git metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php index 75f4a47..d0289fe 100644 --- metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php +++ metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php @@ -533,6 +533,15 @@ interface ThriftHiveMetastoreIf extends \FacebookServiceIf { /** * @param string $db_name * @param string $tbl_name + * @param string $filter + * @return int + * @throws \metastore\MetaException + * @throws \metastore\NoSuchObjectException + */ + public function get_num_partitions_by_filter($db_name, $tbl_name, $filter); + /** + * @param string $db_name + * @param string $tbl_name * @param string[] $names * @return \metastore\Partition[] * @throws \metastore\MetaException @@ -4485,6 +4494,65 @@ class ThriftHiveMetastoreClient extends \FacebookServiceClient implements \metas throw new \Exception("get_partitions_by_expr failed: unknown result"); } + public function get_num_partitions_by_filter($db_name, $tbl_name, $filter) + { + $this->send_get_num_partitions_by_filter($db_name, $tbl_name, $filter); + return $this->recv_get_num_partitions_by_filter(); + } + + public function send_get_num_partitions_by_filter($db_name, $tbl_name, $filter) + { + $args = new \metastore\ThriftHiveMetastore_get_num_partitions_by_filter_args(); + $args->db_name = $db_name; + $args->tbl_name = $tbl_name; + $args->filter = $filter; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_num_partitions_by_filter', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_num_partitions_by_filter', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_num_partitions_by_filter() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\metastore\ThriftHiveMetastore_get_num_partitions_by_filter_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 \metastore\ThriftHiveMetastore_get_num_partitions_by_filter_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + if ($result->o2 !== null) { + throw $result->o2; + } + throw new \Exception("get_num_partitions_by_filter failed: unknown result"); + } + public function get_partitions_by_names($db_name, $tbl_name, array $names) { $this->send_get_partitions_by_names($db_name, $tbl_name, $names); @@ -23936,6 +24004,252 @@ class ThriftHiveMetastore_get_partitions_by_expr_result { } +class ThriftHiveMetastore_get_num_partitions_by_filter_args { + static $_TSPEC; + + /** + * @var string + */ + public $db_name = null; + /** + * @var string + */ + public $tbl_name = null; + /** + * @var string + */ + public $filter = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'db_name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'tbl_name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'filter', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['db_name'])) { + $this->db_name = $vals['db_name']; + } + if (isset($vals['tbl_name'])) { + $this->tbl_name = $vals['tbl_name']; + } + if (isset($vals['filter'])) { + $this->filter = $vals['filter']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_num_partitions_by_filter_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->db_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->tbl_name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->filter); + } 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('ThriftHiveMetastore_get_num_partitions_by_filter_args'); + if ($this->db_name !== null) { + $xfer += $output->writeFieldBegin('db_name', TType::STRING, 1); + $xfer += $output->writeString($this->db_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->tbl_name !== null) { + $xfer += $output->writeFieldBegin('tbl_name', TType::STRING, 2); + $xfer += $output->writeString($this->tbl_name); + $xfer += $output->writeFieldEnd(); + } + if ($this->filter !== null) { + $xfer += $output->writeFieldBegin('filter', TType::STRING, 3); + $xfer += $output->writeString($this->filter); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHiveMetastore_get_num_partitions_by_filter_result { + static $_TSPEC; + + /** + * @var int + */ + public $success = null; + /** + * @var \metastore\MetaException + */ + public $o1 = null; + /** + * @var \metastore\NoSuchObjectException + */ + public $o2 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::I32, + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => '\metastore\MetaException', + ), + 2 => array( + 'var' => 'o2', + 'type' => TType::STRUCT, + 'class' => '\metastore\NoSuchObjectException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + if (isset($vals['o2'])) { + $this->o2 = $vals['o2']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_num_partitions_by_filter_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::I32) { + $xfer += $input->readI32($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new \metastore\MetaException(); + $xfer += $this->o1->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->o2 = new \metastore\NoSuchObjectException(); + $xfer += $this->o2->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('ThriftHiveMetastore_get_num_partitions_by_filter_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::I32, 0); + $xfer += $output->writeI32($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class ThriftHiveMetastore_get_partitions_by_names_args { static $_TSPEC; @@ -39709,3 +40023,4 @@ class ThriftHiveMetastore_cache_file_metadata_result { } + diff --git metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote index 9564ded..407f73c 100755 --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote @@ -82,6 +82,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': 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)') @@ -573,6 +574,12 @@ elif cmd == 'get_partitions_by_expr': 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') diff --git metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py index 97acb5d..26d8a02 100644 --- metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py +++ metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py @@ -524,6 +524,15 @@ def get_partitions_by_expr(self, req): """ pass + def get_num_partitions_by_filter(self, db_name, tbl_name, filter): + """ + Parameters: + - db_name + - tbl_name + - filter + """ + pass + def get_partitions_by_names(self, db_name, tbl_name, names): """ Parameters: @@ -3323,6 +3332,45 @@ def recv_get_partitions_by_expr(self): raise result.o2 raise TApplicationException(TApplicationException.MISSING_RESULT, "get_partitions_by_expr failed: unknown result") + def get_num_partitions_by_filter(self, db_name, tbl_name, filter): + """ + Parameters: + - db_name + - tbl_name + - filter + """ + self.send_get_num_partitions_by_filter(db_name, tbl_name, filter) + return self.recv_get_num_partitions_by_filter() + + def send_get_num_partitions_by_filter(self, db_name, tbl_name, filter): + self._oprot.writeMessageBegin('get_num_partitions_by_filter', TMessageType.CALL, self._seqid) + args = get_num_partitions_by_filter_args() + args.db_name = db_name + args.tbl_name = tbl_name + args.filter = filter + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_num_partitions_by_filter(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = get_num_partitions_by_filter_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.o1 is not None: + raise result.o1 + if result.o2 is not None: + raise result.o2 + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_num_partitions_by_filter failed: unknown result") + def get_partitions_by_names(self, db_name, tbl_name, names): """ Parameters: @@ -5973,6 +6021,7 @@ def __init__(self, handler): self._processMap["get_partitions_by_filter"] = Processor.process_get_partitions_by_filter self._processMap["get_part_specs_by_filter"] = Processor.process_get_part_specs_by_filter self._processMap["get_partitions_by_expr"] = Processor.process_get_partitions_by_expr + self._processMap["get_num_partitions_by_filter"] = Processor.process_get_num_partitions_by_filter self._processMap["get_partitions_by_names"] = Processor.process_get_partitions_by_names self._processMap["alter_partition"] = Processor.process_alter_partition self._processMap["alter_partitions"] = Processor.process_alter_partitions @@ -7564,6 +7613,31 @@ def process_get_partitions_by_expr(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() + def process_get_num_partitions_by_filter(self, seqid, iprot, oprot): + args = get_num_partitions_by_filter_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_num_partitions_by_filter_result() + try: + result.success = self._handler.get_num_partitions_by_filter(args.db_name, args.tbl_name, args.filter) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except MetaException as o1: + msg_type = TMessageType.REPLY + result.o1 = o1 + except NoSuchObjectException as o2: + msg_type = TMessageType.REPLY + result.o2 = o2 + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_num_partitions_by_filter", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_get_partitions_by_names(self, seqid, iprot, oprot): args = get_partitions_by_names_args() args.read(iprot) @@ -20186,6 +20260,189 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +class get_num_partitions_by_filter_args: + """ + Attributes: + - db_name + - tbl_name + - filter + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'db_name', None, None, ), # 1 + (2, TType.STRING, 'tbl_name', None, None, ), # 2 + (3, TType.STRING, 'filter', None, None, ), # 3 + ) + + def __init__(self, db_name=None, tbl_name=None, filter=None,): + self.db_name = db_name + self.tbl_name = tbl_name + self.filter = filter + + 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.db_name = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.tbl_name = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.filter = 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('get_num_partitions_by_filter_args') + if self.db_name is not None: + oprot.writeFieldBegin('db_name', TType.STRING, 1) + oprot.writeString(self.db_name) + oprot.writeFieldEnd() + if self.tbl_name is not None: + oprot.writeFieldBegin('tbl_name', TType.STRING, 2) + oprot.writeString(self.tbl_name) + oprot.writeFieldEnd() + if self.filter is not None: + oprot.writeFieldBegin('filter', TType.STRING, 3) + oprot.writeString(self.filter) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.db_name) + value = (value * 31) ^ hash(self.tbl_name) + value = (value * 31) ^ hash(self.filter) + 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 get_num_partitions_by_filter_result: + """ + Attributes: + - success + - o1 + - o2 + """ + + thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'o2', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 2 + ) + + def __init__(self, success=None, o1=None, o2=None,): + self.success = success + self.o1 = o1 + self.o2 = o2 + + 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.I32: + self.success = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.o2 = NoSuchObjectException() + self.o2.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('get_num_partitions_by_filter_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.o1 is not None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + if self.o2 is not None: + oprot.writeFieldBegin('o2', TType.STRUCT, 2) + self.o2.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.o1) + value = (value * 31) ^ hash(self.o2) + 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 get_partitions_by_names_args: """ Attributes: diff --git metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb index a90a180..9b9a27c 100644 --- metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb +++ metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb @@ -1004,6 +1004,23 @@ module ThriftHiveMetastore raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_partitions_by_expr failed: unknown result') end + def get_num_partitions_by_filter(db_name, tbl_name, filter) + send_get_num_partitions_by_filter(db_name, tbl_name, filter) + return recv_get_num_partitions_by_filter() + end + + def send_get_num_partitions_by_filter(db_name, tbl_name, filter) + send_message('get_num_partitions_by_filter', Get_num_partitions_by_filter_args, :db_name => db_name, :tbl_name => tbl_name, :filter => filter) + end + + def recv_get_num_partitions_by_filter() + result = receive_message(Get_num_partitions_by_filter_result) + return result.success unless result.success.nil? + raise result.o1 unless result.o1.nil? + raise result.o2 unless result.o2.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_num_partitions_by_filter failed: unknown result') + end + def get_partitions_by_names(db_name, tbl_name, names) send_get_partitions_by_names(db_name, tbl_name, names) return recv_get_partitions_by_names() @@ -3007,6 +3024,19 @@ module ThriftHiveMetastore write_result(result, oprot, 'get_partitions_by_expr', seqid) end + def process_get_num_partitions_by_filter(seqid, iprot, oprot) + args = read_args(iprot, Get_num_partitions_by_filter_args) + result = Get_num_partitions_by_filter_result.new() + begin + result.success = @handler.get_num_partitions_by_filter(args.db_name, args.tbl_name, args.filter) + rescue ::MetaException => o1 + result.o1 = o1 + rescue ::NoSuchObjectException => o2 + result.o2 = o2 + end + write_result(result, oprot, 'get_num_partitions_by_filter', seqid) + end + def process_get_partitions_by_names(seqid, iprot, oprot) args = read_args(iprot, Get_partitions_by_names_args) result = Get_partitions_by_names_result.new() @@ -6176,6 +6206,46 @@ module ThriftHiveMetastore ::Thrift::Struct.generate_accessors self end + class Get_num_partitions_by_filter_args + include ::Thrift::Struct, ::Thrift::Struct_Union + DB_NAME = 1 + TBL_NAME = 2 + FILTER = 3 + + FIELDS = { + DB_NAME => {:type => ::Thrift::Types::STRING, :name => 'db_name'}, + TBL_NAME => {:type => ::Thrift::Types::STRING, :name => 'tbl_name'}, + FILTER => {:type => ::Thrift::Types::STRING, :name => 'filter'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_num_partitions_by_filter_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + O1 = 1 + O2 = 2 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}, + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => ::MetaException}, + O2 => {:type => ::Thrift::Types::STRUCT, :name => 'o2', :class => ::NoSuchObjectException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + class Get_partitions_by_names_args include ::Thrift::Struct, ::Thrift::Struct_Union DB_NAME = 1 diff --git metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index 81d7128..ace644b 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -4559,6 +4559,25 @@ private void rethrowException(Exception e) } @Override + public int get_num_partitions_by_filter(final String dbName, + final String tblName, final String filter) + throws MetaException, NoSuchObjectException, TException { + startTableFunction("get_num_partitions_by_filter", dbName, tblName); + + int ret = -1; + Exception ex = null; + try { + ret = getMS().getNumPartitionsByFilter(dbName, tblName, filter); + } catch (Exception e) { + ex = e; + rethrowException(e); + } finally { + endFunction("get_num_partitions_by_filter", ret != -1, ex, tblName); + } + return ret; + } + + @Override public List get_partitions_by_names(final String dbName, final String tblName, final List partNames) throws MetaException, NoSuchObjectException, TException { diff --git metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index a17c6d8..09a6aea 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -1204,7 +1204,6 @@ public boolean listPartitionsByExpr(String db_name, String tbl_name, byte[] expr return !r.isSetHasUnknownPartitions() || r.isHasUnknownPartitions(); // Assume the worst. } - /** * @param name * @return the database @@ -1395,6 +1394,24 @@ public boolean tableExists(String tableName) throws MetaException, client.get_partition_names_ps(db_name, tbl_name, part_vals, max_parts)); } + /** + * Get number of partitions matching specified filter + * @param db_name the database name + * @param tbl_name the table name + * @param filter the filter string, + * for example "part1 = \"p1_abc\" and part2 <= "\p2_test\"". Filtering can + * be done only on string partition keys. + * @return number of partitions + * @throws MetaException + * @throws NoSuchObjectException + * @throws TException + */ + public int getNumPartitionsByFilter(String db_name, String tbl_name, + String filter) throws MetaException, + NoSuchObjectException, TException { + return client.get_num_partitions_by_filter(db_name, tbl_name, filter); + } + @Override public void alter_partition(String dbName, String tblName, Partition newPart) throws InvalidOperationException, MetaException, TException { diff --git metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java index 25e0d38..4284d54 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java @@ -530,6 +530,22 @@ public PartitionSpecProxy listPartitionSpecs(String dbName, String tableName, in throws MetaException, TException, NoSuchObjectException; /** + * Get number of partitions matching specified filter + * @param dbName the database name + * @param tableName the table name + * @param filter the filter string, + * for example "part1 = \"p1_abc\" and part2 <= "\p2_test\"". Filtering can + * be done only on string partition keys. + * @return number of partitions + * @throws MetaException + * @throws NoSuchObjectException + * @throws TException + */ + public int getNumPartitionsByFilter(String dbName, String tableName, + String filter) throws MetaException, NoSuchObjectException, TException; + + + /** * Get list of partitions matching specified filter * @param db_name the database name * @param tbl_name the table name diff --git metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java index 36b316a..be54b9c 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java @@ -385,6 +385,20 @@ public Database getDatabase(String dbName) throws MetaException{ isViewTable, sqlFilter, params, joins, max); } + public int getNumPartitionsViaSqlFilter(Table table, ExpressionTree tree) throws MetaException { + List params = new ArrayList(); + Listjoins = new ArrayList(); + // Derby and Oracle do not interpret filters ANSI-properly in some cases and need a workaround. + boolean dbHasJoinCastBug = (dbType == DB.DERBY || dbType == DB.ORACLE); + String sqlFilter = PartitionFilterGenerator.generateSqlFilter( + table, tree, params, joins, dbHasJoinCastBug, defaultPartName); + if (sqlFilter == null) { + return 0; // Cannot make SQL filter to push down. + } + return getNumPartitionsViaSqlFilterInternal(table.getDbName(), table.getTableName(), sqlFilter, params, joins); + } + + /** * Gets all partitions of a table by using direct SQL queries. * @param dbName Metastore db name. @@ -807,6 +821,39 @@ public void apply(SerDeInfo t, Object[] fields) { return orderedResult; } + private int getNumPartitionsViaSqlFilterInternal(String dbName, String tblName, + String sqlFilter, List paramsForFilter, + List joinsForFilter) throws MetaException { + boolean doTrace = LOG.isDebugEnabled(); + dbName = dbName.toLowerCase(); + tblName = tblName.toLowerCase(); + + // Get number of partitions by doing count on PART_ID. + String queryText = "select count(\"PARTITIONS\".\"PART_ID\") from \"PARTITIONS\"" + + " inner join \"TBLS\" on \"PARTITIONS\".\"TBL_ID\" = \"TBLS\".\"TBL_ID\" " + + " and \"TBLS\".\"TBL_NAME\" = ? " + + " inner join \"DBS\" on \"TBLS\".\"DB_ID\" = \"DBS\".\"DB_ID\" " + + " and \"DBS\".\"NAME\" = ? " + + join(joinsForFilter, ' ') + + (sqlFilter == null ? "" : (" where " + sqlFilter)); + + Object[] params = new Object[paramsForFilter.size() + 2]; + params[0] = tblName; + params[1] = dbName; + for (int i = 0; i < paramsForFilter.size(); ++i) { + params[i + 2] = paramsForFilter.get(i); + } + + long start = doTrace ? System.nanoTime() : 0; + Query query = pm.newQuery("javax.jdo.query.SQL", queryText); + @SuppressWarnings("unchecked") + int sqlResult = extractSqlInt(query.executeWithArray(params)); + long queryTime = doTrace ? System.nanoTime() : 0; + timingTrace(doTrace, queryText, start, queryTime); + return sqlResult; + } + + private void timingTrace(boolean doTrace, String queryText, long start, long queryTime) { if (!doTrace) return; LOG.debug("Direct SQL query in " + (queryTime - start) / 1000000.0 + "ms + " + diff --git metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java index 05d5b57..e1b8b6c 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java @@ -2279,6 +2279,7 @@ protected boolean getPartitionsByExprInternal(String dbName, String tblName, fin } return result; } + @Override protected List getJdoResult( GetHelper> ctx) throws MetaException, NoSuchObjectException { @@ -2365,6 +2366,12 @@ private boolean getPartitionNamesPrunedByExprNoTxn(Table table, byte[] expr, return results; } + + private Integer getNumPartitionsViaOrmFilter(Table table, ExpressionTree tree, boolean isValidatedFilter) + throws MetaException { + return getPartitionsViaOrmFilter(table, tree, (short) -1, isValidatedFilter).size(); + } + /** * Gets partition names from the table via ORM (JDOQL) name filter. * @param dbName Database name. @@ -2646,6 +2653,36 @@ protected String describeResult() { } } + @Override + public int getNumPartitionsByFilter(String dbName, String tblName, + String filter) throws MetaException, NoSuchObjectException { + return getNumPartitionsByFilterInternal(dbName, tblName, filter, + true, true); + } + + protected int getNumPartitionsByFilterInternal(String dbName, String tblName, + String filter, boolean allowSql, boolean allowJdo) + throws MetaException, NoSuchObjectException { + final ExpressionTree tree = (filter != null && !filter.isEmpty()) + ? PartFilterExprUtil.getFilterParser(filter).tree : ExpressionTree.EMPTY_TREE; + return new GetHelper(dbName, tblName, allowSql, allowJdo) { + @Override + protected String describeResult() { + return null; + } + + @Override + protected Integer getSqlResult(GetHelper ctx) throws MetaException { + return directSql.getNumPartitionsViaSqlFilter(ctx.getTable(), tree); + } + @Override + protected Integer getJdoResult( + GetHelper ctx) throws MetaException, NoSuchObjectException { + return getNumPartitionsViaOrmFilter(ctx.getTable(), tree, true); + } + }.run(true); + } + protected List getPartitionsByFilterInternal(String dbName, String tblName, String filter, final short maxParts, boolean allowSql, boolean allowJdo) throws MetaException, NoSuchObjectException { diff --git metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java index d228f24..cbd5957 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java @@ -223,6 +223,9 @@ public abstract boolean getPartitionsByExpr(String dbName, String tblName, byte[] expr, String defaultPartitionName, short maxParts, List result) throws TException; + public abstract int getNumPartitionsByFilter(String dbName, String tblName, String filter) + throws MetaException, NoSuchObjectException; + public abstract List getPartitionsByNames( String dbName, String tblName, List partNames) throws MetaException, NoSuchObjectException; diff --git metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseStore.java metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseStore.java index fcf983f..0ffdbe0 100644 --- metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseStore.java +++ metastore/src/java/org/apache/hadoop/hive/metastore/hbase/HBaseStore.java @@ -758,6 +758,21 @@ public boolean getPartitionsByExpr(String dbName, String tblName, byte[] expr, } } + @Override + public int getNumPartitionsByFilter(String dbName, String tblName, String filter) + throws MetaException, NoSuchObjectException { + final ExpressionTree exprTree = (filter != null && !filter.isEmpty()) ? PartFilterExprUtil + .getFilterParser(filter).tree : ExpressionTree.EMPTY_TREE; + List result = new ArrayList(); + boolean commit = false; + openTransaction(); + try { + return getPartitionsByFilter(dbName, tblName, filter, Short.MAX_VALUE).size(); + } finally { + commitOrRoleBack(commit); + } + } + /** * Gets the partition names from a table, pruned using an expression. * @param table Table. diff --git metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java index 477a3be..660dd4e 100644 --- metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java +++ metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java @@ -310,6 +310,12 @@ public void alterIndex(String dbName, String baseTblName, String name, Index new } @Override + public int getNumPartitionsByFilter(String dbName, String tblName, + String filter) throws MetaException, NoSuchObjectException { + return objectStore.getNumPartitionsByFilter(dbName, tblName, filter); + } + + @Override public List getPartitionsByNames(String dbName, String tblName, List partNames) throws MetaException, NoSuchObjectException { return objectStore.getPartitionsByNames(dbName, tblName, partNames); diff --git metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java index ecabd5d..9103102 100644 --- metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java +++ metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java @@ -341,6 +341,12 @@ public boolean getPartitionsByExpr(String dbName, String tblName, byte[] expr, } @Override + public int getNumPartitionsByFilter(String dbName, String tblName, String filter) + throws MetaException, NoSuchObjectException { + return -1; + } + + @Override public Table markPartitionForEvent(String dbName, String tblName, Map partVals, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException { diff --git metastore/src/test/org/apache/hadoop/hive/metastore/TestObjectStore.java metastore/src/test/org/apache/hadoop/hive/metastore/TestObjectStore.java index 1157033..2e1f5f4 100644 --- metastore/src/test/org/apache/hadoop/hive/metastore/TestObjectStore.java +++ metastore/src/test/org/apache/hadoop/hive/metastore/TestObjectStore.java @@ -37,6 +37,7 @@ import org.apache.hadoop.hive.metastore.api.StorageDescriptor; import org.apache.hadoop.hive.metastore.api.Table; import org.apache.hadoop.hive.ql.io.sarg.SearchArgument; +import org.apache.hadoop.hive.serde.serdeConstants; import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; import org.junit.After; import org.junit.Assert; @@ -163,8 +164,8 @@ public void testPartitionOps() throws MetaException, InvalidObjectException, NoS StorageDescriptor sd = new StorageDescriptor(null, "location", null, null, false, 0, new SerDeInfo("SerDeName", "serializationLib", null), null, null, null); HashMap tableParams = new HashMap(); tableParams.put("EXTERNAL", "false"); - FieldSchema partitionKey1 = new FieldSchema("Country", "String", ""); - FieldSchema partitionKey2 = new FieldSchema("State", "String", ""); + FieldSchema partitionKey1 = new FieldSchema("Country", serdeConstants.STRING_TYPE_NAME, ""); + FieldSchema partitionKey2 = new FieldSchema("State", serdeConstants.STRING_TYPE_NAME, ""); Table tbl1 = new Table(TABLE1, DB1, "owner", 1, 2, 3, sd, Arrays.asList(partitionKey1, partitionKey2), tableParams, "viewOriginalText", "viewExpandedText", "MANAGED_TABLE"); objectStore.createTable(tbl1); HashMap partitionParams = new HashMap(); @@ -182,6 +183,12 @@ public void testPartitionOps() throws MetaException, InvalidObjectException, NoS Assert.assertEquals(111, partitions.get(0).getCreateTime()); Assert.assertEquals(222, partitions.get(1).getCreateTime()); + int numPartitions = objectStore.getNumPartitionsByFilter(DB1, TABLE1, ""); + Assert.assertEquals(partitions.size(), numPartitions); + + numPartitions = objectStore.getNumPartitionsByFilter(DB1, TABLE1, "country = \"US\""); + Assert.assertEquals(2, numPartitions); + objectStore.dropPartition(DB1, TABLE1, value1); partitions = objectStore.getPartitions(DB1, TABLE1, 10); Assert.assertEquals(1, partitions.size()); diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index 29df4f9..dca1198 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -2373,6 +2373,30 @@ public boolean getPartitionsByExpr(Table tbl, ExprNodeGenericFuncDesc expr, Hive return hasUnknownParts; } + /** + * Get a number of Partitions by filter. + * @param tbl The table containing the partitions. + * @param filter A string represent partition predicates. + * @return the number of partitions satisfying the partition predicates. + * @throws HiveException + * @throws MetaException + * @throws NoSuchObjectException + * @throws TException + */ + public int getNumPartitionsByFilter(Table tbl, String filter) + throws HiveException, MetaException, NoSuchObjectException, TException { + + if (!tbl.isPartitioned()) { + throw new HiveException("Partition spec should only be supplied for a " + + "partitioned table"); + } + + int numParts = getMSC().getNumPartitionsByFilter( + tbl.getDbName(), tbl.getTableName(), filter); + + return numParts; + } + public void validatePartitionNameCharacters(List partVals) throws HiveException { try { getMSC().validatePartitionNameCharacters(partVals); diff --git service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote index 4bd7a5a..ec21b6c 100755 --- service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote +++ service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote @@ -91,6 +91,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': 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)') @@ -636,6 +637,12 @@ elif cmd == 'get_partitions_by_expr': 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')