commit ebd73c154a6ec26cb6297da14c16c9d10d71db81 Author: Alan Gates Date: Fri Jan 8 17:23:32 2016 -0800 HIVE-12822 Thrift and RDBMS changes for HIVE-11495 diff --git metastore/if/hive_metastore.thrift metastore/if/hive_metastore.thrift index cc93471..7d1fe88 100755 --- metastore/if/hive_metastore.thrift +++ metastore/if/hive_metastore.thrift @@ -545,6 +545,7 @@ struct TxnInfo { 4: required string hostname, // used in 'show transactions' to help admins find who has open transactions 5: optional string agentInfo = "Unknown", 6: optional i32 heartbeatCount=0, + 7: optional string metaInfo, } struct GetOpenTxnsInfoResponse { diff --git metastore/scripts/upgrade/derby/029-HIVE-12822.derby.sql metastore/scripts/upgrade/derby/029-HIVE-12822.derby.sql new file mode 100644 index 0000000..9f9423e --- /dev/null +++ metastore/scripts/upgrade/derby/029-HIVE-12822.derby.sql @@ -0,0 +1 @@ +ALTER TABLE "TXNS" ADD "TXN_META_INFO" varchar(128); diff --git metastore/scripts/upgrade/derby/hive-txn-schema-1.3.0.derby.sql metastore/scripts/upgrade/derby/hive-txn-schema-1.3.0.derby.sql index addbf05..60e7eb0 100644 --- metastore/scripts/upgrade/derby/hive-txn-schema-1.3.0.derby.sql +++ metastore/scripts/upgrade/derby/hive-txn-schema-1.3.0.derby.sql @@ -24,6 +24,7 @@ CREATE TABLE TXNS ( TXN_USER varchar(128) NOT NULL, TXN_HOST varchar(128) NOT NULL, TXN_AGENT_INFO varchar(128), + TXN_META_INFO varchar(128), TXN_HEARTBEAT_COUNT integer ); diff --git metastore/scripts/upgrade/derby/hive-txn-schema-2.0.0.derby.sql metastore/scripts/upgrade/derby/hive-txn-schema-2.0.0.derby.sql index 7d1ac0a..f58a8ee 100644 --- metastore/scripts/upgrade/derby/hive-txn-schema-2.0.0.derby.sql +++ metastore/scripts/upgrade/derby/hive-txn-schema-2.0.0.derby.sql @@ -24,6 +24,7 @@ CREATE TABLE TXNS ( TXN_USER varchar(128) NOT NULL, TXN_HOST varchar(128) NOT NULL, TXN_AGENT_INFO varchar(128), + TXN_META_INFO varchar(128), TXN_HEARTBEAT_COUNT integer ); diff --git metastore/scripts/upgrade/derby/upgrade-1.2.0-to-1.3.0.derby.sql metastore/scripts/upgrade/derby/upgrade-1.2.0-to-1.3.0.derby.sql index f1fe41f..f1b4b33 100644 --- metastore/scripts/upgrade/derby/upgrade-1.2.0-to-1.3.0.derby.sql +++ metastore/scripts/upgrade/derby/upgrade-1.2.0-to-1.3.0.derby.sql @@ -6,5 +6,6 @@ RUN '025-HIVE-12816.derby.sql'; RUN '026-HIVE-12818.derby.sql'; RUN '027-HIVE-12819.derby.sql'; RUN '028-HIVE-12821.derby.sql'; +RUN '029-HIVE-12822.derby.sql'; UPDATE "APP".VERSION SET SCHEMA_VERSION='1.3.0', VERSION_COMMENT='Hive release version 1.3.0' where VER_ID=1; diff --git metastore/scripts/upgrade/derby/upgrade-1.2.0-to-2.0.0.derby.sql metastore/scripts/upgrade/derby/upgrade-1.2.0-to-2.0.0.derby.sql index 92a03df..0f26c15 100644 --- metastore/scripts/upgrade/derby/upgrade-1.2.0-to-2.0.0.derby.sql +++ metastore/scripts/upgrade/derby/upgrade-1.2.0-to-2.0.0.derby.sql @@ -6,5 +6,6 @@ RUN '025-HIVE-12816.derby.sql'; RUN '026-HIVE-12818.derby.sql'; RUN '027-HIVE-12819.derby.sql'; RUN '028-HIVE-12821.derby.sql'; +RUN '029-HIVE-12822.derby.sql'; UPDATE "APP".VERSION SET SCHEMA_VERSION='2.0.0', VERSION_COMMENT='Hive release version 2.0.0' where VER_ID=1; diff --git metastore/scripts/upgrade/mssql/014-HIVE-12822.mssql.sql metastore/scripts/upgrade/mssql/014-HIVE-12822.mssql.sql new file mode 100644 index 0000000..b82d0ec --- /dev/null +++ metastore/scripts/upgrade/mssql/014-HIVE-12822.mssql.sql @@ -0,0 +1 @@ +ALTER TABLE TXNS ADD TXN_META_INFO nvarchar(128) NULL; diff --git metastore/scripts/upgrade/mssql/hive-schema-1.3.0.mssql.sql metastore/scripts/upgrade/mssql/hive-schema-1.3.0.mssql.sql index b63c8fb..48886c9 100644 --- metastore/scripts/upgrade/mssql/hive-schema-1.3.0.mssql.sql +++ metastore/scripts/upgrade/mssql/hive-schema-1.3.0.mssql.sql @@ -949,6 +949,7 @@ CREATE TABLE TXNS( TXN_USER nvarchar(128) NOT NULL, TXN_HOST nvarchar(128) NOT NULL, TXN_AGENT_INFO nvarchar(128) NULL, + TXN_META_INFO nvarchar(128) NULL, TXN_HEARTBEAT_COUNT int NULL, PRIMARY KEY CLUSTERED ( diff --git metastore/scripts/upgrade/mssql/hive-schema-2.0.0.mssql.sql metastore/scripts/upgrade/mssql/hive-schema-2.0.0.mssql.sql index 8dd8081..00b302e 100644 --- metastore/scripts/upgrade/mssql/hive-schema-2.0.0.mssql.sql +++ metastore/scripts/upgrade/mssql/hive-schema-2.0.0.mssql.sql @@ -949,6 +949,7 @@ CREATE TABLE TXNS( TXN_USER nvarchar(128) NOT NULL, TXN_HOST nvarchar(128) NOT NULL, TXN_AGENT_INFO nvarchar(128) NULL, + TXN_META_INFO nvarchar(128) NULL, TXN_HEARTBEAT_COUNT int NULL, PRIMARY KEY CLUSTERED ( diff --git metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql index 6b87952..7996b44 100644 --- metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql +++ metastore/scripts/upgrade/mssql/hive-schema-2.1.0.mssql.sql @@ -949,6 +949,7 @@ CREATE TABLE TXNS( TXN_USER nvarchar(128) NOT NULL, TXN_HOST nvarchar(128) NOT NULL, TXN_AGENT_INFO nvarchar(128) NULL, + TXN_META_INFO nvarchar(128) NULL, TXN_HEARTBEAT_COUNT int NULL, PRIMARY KEY CLUSTERED ( diff --git metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-1.3.0.mssql.sql metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-1.3.0.mssql.sql index ea8b279..e6a1683 100644 --- metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-1.3.0.mssql.sql +++ metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-1.3.0.mssql.sql @@ -7,6 +7,7 @@ SELECT 'Upgrading MetaStore schema from 1.2.0 to 1.3.0' AS MESSAGE; :r 011-HIVE-12818.mssql.sql; :r 012-HIVE-12819.mssql.sql; :r 013-HIVE-12821.mssql.sql; +:r 014-HIVE-12822.mssql.sql; UPDATE VERSION SET SCHEMA_VERSION='1.3.0', VERSION_COMMENT='Hive release version 1.3.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 1.3.0' AS MESSAGE; diff --git metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-2.0.0.mssql.sql metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-2.0.0.mssql.sql index 7ef17a8..268604e 100644 --- metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-2.0.0.mssql.sql +++ metastore/scripts/upgrade/mssql/upgrade-1.2.0-to-2.0.0.mssql.sql @@ -7,6 +7,7 @@ SELECT 'Upgrading MetaStore schema from 1.2.0 to 2.0.0' AS MESSAGE; :r 011-HIVE-12818.mssql.sql; :r 012-HIVE-12819.mssql.sql; :r 013-HIVE-12821.mssql.sql; +:r 014-HIVE-12822.mssql.sql; UPDATE VERSION SET SCHEMA_VERSION='2.0.0', VERSION_COMMENT='Hive release version 2.0.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 2.0.0' AS MESSAGE; diff --git metastore/scripts/upgrade/mysql/029-HIVE-12822.mysql.sql metastore/scripts/upgrade/mysql/029-HIVE-12822.mysql.sql new file mode 100644 index 0000000..ffd0bab --- /dev/null +++ metastore/scripts/upgrade/mysql/029-HIVE-12822.mysql.sql @@ -0,0 +1 @@ +ALTER TABLE `TXNS` ADD `TXN_META_INFO` varchar(128); diff --git metastore/scripts/upgrade/mysql/hive-txn-schema-1.3.0.mysql.sql metastore/scripts/upgrade/mysql/hive-txn-schema-1.3.0.mysql.sql index 99b3a66..f5797f3 100644 --- metastore/scripts/upgrade/mysql/hive-txn-schema-1.3.0.mysql.sql +++ metastore/scripts/upgrade/mysql/hive-txn-schema-1.3.0.mysql.sql @@ -25,6 +25,7 @@ CREATE TABLE TXNS ( TXN_USER varchar(128) NOT NULL, TXN_HOST varchar(128) NOT NULL, TXN_AGENT_INFO varchar(128), + TXN_META_INFO varchar(128), TXN_HEARTBEAT_COUNT int ) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git metastore/scripts/upgrade/mysql/hive-txn-schema-2.0.0.mysql.sql metastore/scripts/upgrade/mysql/hive-txn-schema-2.0.0.mysql.sql index 99b3a66..f5797f3 100644 --- metastore/scripts/upgrade/mysql/hive-txn-schema-2.0.0.mysql.sql +++ metastore/scripts/upgrade/mysql/hive-txn-schema-2.0.0.mysql.sql @@ -25,6 +25,7 @@ CREATE TABLE TXNS ( TXN_USER varchar(128) NOT NULL, TXN_HOST varchar(128) NOT NULL, TXN_AGENT_INFO varchar(128), + TXN_META_INFO varchar(128), TXN_HEARTBEAT_COUNT int ) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-1.3.0.mysql.sql metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-1.3.0.mysql.sql index 7aeab34..1b823a1 100644 --- metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-1.3.0.mysql.sql +++ metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-1.3.0.mysql.sql @@ -7,6 +7,7 @@ SOURCE 025-HIVE-12816.mysql.sql; SOURCE 026-HIVE-12818.mysql.sql; SOURCE 027-HIVE-12819.mysql.sql; SOURCE 028-HIVE-12821.mysql.sql; +SOURCE 029-HIVE-12822.mysql.sql; UPDATE VERSION SET SCHEMA_VERSION='1.3.0', VERSION_COMMENT='Hive release version 1.3.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 1.3.0' AS ' '; diff --git metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-2.0.0.mysql.sql metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-2.0.0.mysql.sql index 86c0d4e..bc3f3a4 100644 --- metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-2.0.0.mysql.sql +++ metastore/scripts/upgrade/mysql/upgrade-1.2.0-to-2.0.0.mysql.sql @@ -7,6 +7,7 @@ SOURCE 025-HIVE-12816.mysql.sql; SOURCE 026-HIVE-12818.mysql.sql; SOURCE 027-HIVE-12819.mysql.sql; SOURCE 028-HIVE-12821.mysql.sql; +SOURCE 029-HIVE-12822.mysql.sql; UPDATE VERSION SET SCHEMA_VERSION='2.0.0', VERSION_COMMENT='Hive release version 2.0.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 2.0.0' AS ' '; diff --git metastore/scripts/upgrade/oracle/029-HIVE-12822.oracle.sql metastore/scripts/upgrade/oracle/029-HIVE-12822.oracle.sql new file mode 100644 index 0000000..63c0d77 --- /dev/null +++ metastore/scripts/upgrade/oracle/029-HIVE-12822.oracle.sql @@ -0,0 +1 @@ +ALTER TABLE TXNS ADD TXN_META_INFO varchar2(128); diff --git metastore/scripts/upgrade/oracle/hive-txn-schema-1.3.0.oracle.sql metastore/scripts/upgrade/oracle/hive-txn-schema-1.3.0.oracle.sql index 76ffc9e..f9983c6 100644 --- metastore/scripts/upgrade/oracle/hive-txn-schema-1.3.0.oracle.sql +++ metastore/scripts/upgrade/oracle/hive-txn-schema-1.3.0.oracle.sql @@ -25,6 +25,7 @@ CREATE TABLE TXNS ( TXN_USER varchar(128) NOT NULL, TXN_HOST varchar(128) NOT NULL, TXN_AGENT_INFO varchar2(128), + TXN_META_INFO varchar2(128), TXN_HEARTBEAT_COUNT number(10) ) ROWDEPENDENCIES; diff --git metastore/scripts/upgrade/oracle/hive-txn-schema-2.0.0.oracle.sql metastore/scripts/upgrade/oracle/hive-txn-schema-2.0.0.oracle.sql index 76ffc9e..f9983c6 100644 --- metastore/scripts/upgrade/oracle/hive-txn-schema-2.0.0.oracle.sql +++ metastore/scripts/upgrade/oracle/hive-txn-schema-2.0.0.oracle.sql @@ -25,6 +25,7 @@ CREATE TABLE TXNS ( TXN_USER varchar(128) NOT NULL, TXN_HOST varchar(128) NOT NULL, TXN_AGENT_INFO varchar2(128), + TXN_META_INFO varchar2(128), TXN_HEARTBEAT_COUNT number(10) ) ROWDEPENDENCIES; diff --git metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-1.3.0.oracle.sql metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-1.3.0.oracle.sql index b35145c..7bb86c1 100644 --- metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-1.3.0.oracle.sql +++ metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-1.3.0.oracle.sql @@ -7,6 +7,7 @@ SELECT 'Upgrading MetaStore schema from 1.2.0 to 1.3.0' AS Status from dual; @026-HIVE-12818.oracle.sql; @027-HIVE-12819.oracle.sql; @028-HIVE-12821.oracle.sql; +@029-HIVE-12822.oracle.sql; UPDATE VERSION SET SCHEMA_VERSION='1.3.0', VERSION_COMMENT='Hive release version 1.3.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 1.3.0' AS Status from dual; diff --git metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-2.0.0.oracle.sql metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-2.0.0.oracle.sql index 02b8d75..e2e310a 100644 --- metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-2.0.0.oracle.sql +++ metastore/scripts/upgrade/oracle/upgrade-1.2.0-to-2.0.0.oracle.sql @@ -7,6 +7,7 @@ SELECT 'Upgrading MetaStore schema from 1.2.0 to 2.0.0' AS Status from dual; @026-HIVE-12818.oracle.sql; @027-HIVE-12819.oracle.sql; @028-HIVE-12821.oracle.sql; +@029-HIVE-12822.oracle.sql; UPDATE VERSION SET SCHEMA_VERSION='2.0.0', VERSION_COMMENT='Hive release version 2.0.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 2.0.0' AS Status from dual; diff --git metastore/scripts/upgrade/postgres/028-HIVE-12822.postgres.sql metastore/scripts/upgrade/postgres/028-HIVE-12822.postgres.sql new file mode 100644 index 0000000..4cce84b --- /dev/null +++ metastore/scripts/upgrade/postgres/028-HIVE-12822.postgres.sql @@ -0,0 +1 @@ +ALTER TABLE "TXNS" ADD COLUMN "TXN_META_INFO" varchar(128); diff --git metastore/scripts/upgrade/postgres/hive-txn-schema-1.3.0.postgres.sql metastore/scripts/upgrade/postgres/hive-txn-schema-1.3.0.postgres.sql index 2dfd49a..823ec82 100644 --- metastore/scripts/upgrade/postgres/hive-txn-schema-1.3.0.postgres.sql +++ metastore/scripts/upgrade/postgres/hive-txn-schema-1.3.0.postgres.sql @@ -25,6 +25,7 @@ CREATE TABLE TXNS ( TXN_USER varchar(128) NOT NULL, TXN_HOST varchar(128) NOT NULL, TXN_AGENT_INFO varchar(128), + TXN_META_INFO varchar(128), TXN_HEARTBEAT_COUNT integer ); diff --git metastore/scripts/upgrade/postgres/hive-txn-schema-2.0.0.postgres.sql metastore/scripts/upgrade/postgres/hive-txn-schema-2.0.0.postgres.sql index 2dfd49a..823ec82 100644 --- metastore/scripts/upgrade/postgres/hive-txn-schema-2.0.0.postgres.sql +++ metastore/scripts/upgrade/postgres/hive-txn-schema-2.0.0.postgres.sql @@ -25,6 +25,7 @@ CREATE TABLE TXNS ( TXN_USER varchar(128) NOT NULL, TXN_HOST varchar(128) NOT NULL, TXN_AGENT_INFO varchar(128), + TXN_META_INFO varchar(128), TXN_HEARTBEAT_COUNT integer ); diff --git metastore/scripts/upgrade/postgres/upgrade-1.2.0-to-1.3.0.postgres.sql metastore/scripts/upgrade/postgres/upgrade-1.2.0-to-1.3.0.postgres.sql index 032c3bd..2235a49 100644 --- metastore/scripts/upgrade/postgres/upgrade-1.2.0-to-1.3.0.postgres.sql +++ metastore/scripts/upgrade/postgres/upgrade-1.2.0-to-1.3.0.postgres.sql @@ -7,6 +7,7 @@ SELECT 'Upgrading MetaStore schema from 1.2.0 to 1.3.0'; \i 025-HIVE-12818.postgres.sql; \i 026-HIVE-12819.postgres.sql; \i 027-HIVE-12821.postgres.sql; +\i 028-HIVE-12822.postgres.sql; UPDATE "VERSION" SET "SCHEMA_VERSION"='1.3.0', "VERSION_COMMENT"='Hive release version 1.3.0' where "VER_ID"=1; SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 1.3.0'; diff --git metastore/scripts/upgrade/postgres/upgrade-1.2.0-to-2.0.0.postgres.sql metastore/scripts/upgrade/postgres/upgrade-1.2.0-to-2.0.0.postgres.sql index 9d7f3cf..4166e2f 100644 --- metastore/scripts/upgrade/postgres/upgrade-1.2.0-to-2.0.0.postgres.sql +++ metastore/scripts/upgrade/postgres/upgrade-1.2.0-to-2.0.0.postgres.sql @@ -7,6 +7,7 @@ SELECT 'Upgrading MetaStore schema from 1.2.0 to 2.0.0'; \i 025-HIVE-12818.postgres.sql; \i 026-HIVE-12819.postgres.sql; \i 027-HIVE-12821.postgres.sql; +\i 028-HIVE-12822.postgres.sql; UPDATE "VERSION" SET "SCHEMA_VERSION"='2.0.0', "VERSION_COMMENT"='Hive release version 2.0.0' where "VER_ID"=1; SELECT 'Finished upgrading MetaStore schema from 1.2.0 to 2.0.0'; diff --git metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp index 8a01a18..5c96259 100644 --- metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp +++ metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp @@ -9985,6 +9985,11 @@ void TxnInfo::__set_heartbeatCount(const int32_t val) { __isset.heartbeatCount = true; } +void TxnInfo::__set_metaInfo(const std::string& val) { + this->metaInfo = val; +__isset.metaInfo = true; +} + uint32_t TxnInfo::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -10060,6 +10065,14 @@ uint32_t TxnInfo::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->metaInfo); + this->__isset.metaInfo = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -10111,6 +10124,11 @@ uint32_t TxnInfo::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeI32(this->heartbeatCount); xfer += oprot->writeFieldEnd(); } + if (this->__isset.metaInfo) { + xfer += oprot->writeFieldBegin("metaInfo", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->metaInfo); + xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -10124,6 +10142,7 @@ void swap(TxnInfo &a, TxnInfo &b) { swap(a.hostname, b.hostname); swap(a.agentInfo, b.agentInfo); swap(a.heartbeatCount, b.heartbeatCount); + swap(a.metaInfo, b.metaInfo); swap(a.__isset, b.__isset); } @@ -10134,6 +10153,7 @@ TxnInfo::TxnInfo(const TxnInfo& other465) { hostname = other465.hostname; agentInfo = other465.agentInfo; heartbeatCount = other465.heartbeatCount; + metaInfo = other465.metaInfo; __isset = other465.__isset; } TxnInfo& TxnInfo::operator=(const TxnInfo& other466) { @@ -10143,6 +10163,7 @@ TxnInfo& TxnInfo::operator=(const TxnInfo& other466) { hostname = other466.hostname; agentInfo = other466.agentInfo; heartbeatCount = other466.heartbeatCount; + metaInfo = other466.metaInfo; __isset = other466.__isset; return *this; } @@ -10155,6 +10176,7 @@ void TxnInfo::printTo(std::ostream& out) const { out << ", " << "hostname=" << to_string(hostname); out << ", " << "agentInfo="; (__isset.agentInfo ? (out << to_string(agentInfo)) : (out << "")); out << ", " << "heartbeatCount="; (__isset.heartbeatCount ? (out << to_string(heartbeatCount)) : (out << "")); + out << ", " << "metaInfo="; (__isset.metaInfo ? (out << to_string(metaInfo)) : (out << "")); out << ")"; } diff --git metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h index 85178c7..4c6e338 100644 --- metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h +++ metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h @@ -4105,9 +4105,10 @@ inline std::ostream& operator<<(std::ostream& out, const Function& obj) } typedef struct _TxnInfo__isset { - _TxnInfo__isset() : agentInfo(true), heartbeatCount(true) {} + _TxnInfo__isset() : agentInfo(true), heartbeatCount(true), metaInfo(false) {} bool agentInfo :1; bool heartbeatCount :1; + bool metaInfo :1; } _TxnInfo__isset; class TxnInfo { @@ -4115,7 +4116,7 @@ class TxnInfo { TxnInfo(const TxnInfo&); TxnInfo& operator=(const TxnInfo&); - TxnInfo() : id(0), state((TxnState::type)0), user(), hostname(), agentInfo("Unknown"), heartbeatCount(0) { + TxnInfo() : id(0), state((TxnState::type)0), user(), hostname(), agentInfo("Unknown"), heartbeatCount(0), metaInfo() { } virtual ~TxnInfo() throw(); @@ -4125,6 +4126,7 @@ class TxnInfo { std::string hostname; std::string agentInfo; int32_t heartbeatCount; + std::string metaInfo; _TxnInfo__isset __isset; @@ -4140,6 +4142,8 @@ class TxnInfo { void __set_heartbeatCount(const int32_t val); + void __set_metaInfo(const std::string& val); + bool operator == (const TxnInfo & rhs) const { if (!(id == rhs.id)) @@ -4158,6 +4162,10 @@ class TxnInfo { return false; else if (__isset.heartbeatCount && !(heartbeatCount == rhs.heartbeatCount)) return false; + if (__isset.metaInfo != rhs.__isset.metaInfo) + return false; + else if (__isset.metaInfo && !(metaInfo == rhs.metaInfo)) + return false; return true; } bool operator != (const TxnInfo &rhs) const { diff --git metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/TxnInfo.java metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/TxnInfo.java index ca1ef86..9c56ee3 100644 --- metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/TxnInfo.java +++ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/TxnInfo.java @@ -44,6 +44,7 @@ private static final org.apache.thrift.protocol.TField HOSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("hostname", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField AGENT_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("agentInfo", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField HEARTBEAT_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("heartbeatCount", org.apache.thrift.protocol.TType.I32, (short)6); + private static final org.apache.thrift.protocol.TField META_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("metaInfo", org.apache.thrift.protocol.TType.STRING, (short)7); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -57,6 +58,7 @@ private String hostname; // required private String agentInfo; // optional private int heartbeatCount; // optional + private String metaInfo; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -69,7 +71,8 @@ USER((short)3, "user"), HOSTNAME((short)4, "hostname"), AGENT_INFO((short)5, "agentInfo"), - HEARTBEAT_COUNT((short)6, "heartbeatCount"); + HEARTBEAT_COUNT((short)6, "heartbeatCount"), + META_INFO((short)7, "metaInfo"); private static final Map byName = new HashMap(); @@ -96,6 +99,8 @@ public static _Fields findByThriftId(int fieldId) { return AGENT_INFO; case 6: // HEARTBEAT_COUNT return HEARTBEAT_COUNT; + case 7: // META_INFO + return META_INFO; default: return null; } @@ -139,7 +144,7 @@ public String getFieldName() { private static final int __ID_ISSET_ID = 0; private static final int __HEARTBEATCOUNT_ISSET_ID = 1; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.AGENT_INFO,_Fields.HEARTBEAT_COUNT}; + private static final _Fields optionals[] = {_Fields.AGENT_INFO,_Fields.HEARTBEAT_COUNT,_Fields.META_INFO}; 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); @@ -155,6 +160,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.HEARTBEAT_COUNT, new org.apache.thrift.meta_data.FieldMetaData("heartbeatCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.META_INFO, new org.apache.thrift.meta_data.FieldMetaData("metaInfo", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TxnInfo.class, metaDataMap); } @@ -199,6 +206,9 @@ public TxnInfo(TxnInfo other) { this.agentInfo = other.agentInfo; } this.heartbeatCount = other.heartbeatCount; + if (other.isSetMetaInfo()) { + this.metaInfo = other.metaInfo; + } } public TxnInfo deepCopy() { @@ -216,6 +226,7 @@ public void clear() { this.heartbeatCount = 0; + this.metaInfo = null; } public long getId() { @@ -362,6 +373,29 @@ public void setHeartbeatCountIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HEARTBEATCOUNT_ISSET_ID, value); } + public String getMetaInfo() { + return this.metaInfo; + } + + public void setMetaInfo(String metaInfo) { + this.metaInfo = metaInfo; + } + + public void unsetMetaInfo() { + this.metaInfo = null; + } + + /** Returns true if field metaInfo is set (has been assigned a value) and false otherwise */ + public boolean isSetMetaInfo() { + return this.metaInfo != null; + } + + public void setMetaInfoIsSet(boolean value) { + if (!value) { + this.metaInfo = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case ID: @@ -412,6 +446,14 @@ public void setFieldValue(_Fields field, Object value) { } break; + case META_INFO: + if (value == null) { + unsetMetaInfo(); + } else { + setMetaInfo((String)value); + } + break; + } } @@ -435,6 +477,9 @@ public Object getFieldValue(_Fields field) { case HEARTBEAT_COUNT: return getHeartbeatCount(); + case META_INFO: + return getMetaInfo(); + } throw new IllegalStateException(); } @@ -458,6 +503,8 @@ public boolean isSet(_Fields field) { return isSetAgentInfo(); case HEARTBEAT_COUNT: return isSetHeartbeatCount(); + case META_INFO: + return isSetMetaInfo(); } throw new IllegalStateException(); } @@ -529,6 +576,15 @@ public boolean equals(TxnInfo that) { return false; } + boolean this_present_metaInfo = true && this.isSetMetaInfo(); + boolean that_present_metaInfo = true && that.isSetMetaInfo(); + if (this_present_metaInfo || that_present_metaInfo) { + if (!(this_present_metaInfo && that_present_metaInfo)) + return false; + if (!this.metaInfo.equals(that.metaInfo)) + return false; + } + return true; } @@ -566,6 +622,11 @@ public int hashCode() { if (present_heartbeatCount) list.add(heartbeatCount); + boolean present_metaInfo = true && (isSetMetaInfo()); + list.add(present_metaInfo); + if (present_metaInfo) + list.add(metaInfo); + return list.hashCode(); } @@ -637,6 +698,16 @@ public int compareTo(TxnInfo other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetMetaInfo()).compareTo(other.isSetMetaInfo()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMetaInfo()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metaInfo, other.metaInfo); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -700,6 +771,16 @@ public String toString() { sb.append(this.heartbeatCount); first = false; } + if (isSetMetaInfo()) { + if (!first) sb.append(", "); + sb.append("metaInfo:"); + if (this.metaInfo == null) { + sb.append("null"); + } else { + sb.append(this.metaInfo); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -809,6 +890,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TxnInfo struct) thr org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 7: // META_INFO + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.metaInfo = iprot.readString(); + struct.setMetaInfoIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -852,6 +941,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TxnInfo struct) th oprot.writeI32(struct.heartbeatCount); oprot.writeFieldEnd(); } + if (struct.metaInfo != null) { + if (struct.isSetMetaInfo()) { + oprot.writeFieldBegin(META_INFO_FIELD_DESC); + oprot.writeString(struct.metaInfo); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -880,13 +976,19 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TxnInfo struct) thr if (struct.isSetHeartbeatCount()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetMetaInfo()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetAgentInfo()) { oprot.writeString(struct.agentInfo); } if (struct.isSetHeartbeatCount()) { oprot.writeI32(struct.heartbeatCount); } + if (struct.isSetMetaInfo()) { + oprot.writeString(struct.metaInfo); + } } @Override @@ -900,7 +1002,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TxnInfo struct) thro struct.setUserIsSet(true); struct.hostname = iprot.readString(); struct.setHostnameIsSet(true); - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.agentInfo = iprot.readString(); struct.setAgentInfoIsSet(true); @@ -909,6 +1011,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TxnInfo struct) thro struct.heartbeatCount = iprot.readI32(); struct.setHeartbeatCountIsSet(true); } + if (incoming.get(2)) { + struct.metaInfo = iprot.readString(); + struct.setMetaInfoIsSet(true); + } } } diff --git metastore/src/gen/thrift/gen-php/metastore/Types.php metastore/src/gen/thrift/gen-php/metastore/Types.php index 2a109ed..e91c59a 100644 --- metastore/src/gen/thrift/gen-php/metastore/Types.php +++ metastore/src/gen/thrift/gen-php/metastore/Types.php @@ -10093,6 +10093,10 @@ class TxnInfo { * @var int */ public $heartbeatCount = 0; + /** + * @var string + */ + public $metaInfo = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -10121,6 +10125,10 @@ class TxnInfo { 'var' => 'heartbeatCount', 'type' => TType::I32, ), + 7 => array( + 'var' => 'metaInfo', + 'type' => TType::STRING, + ), ); } if (is_array($vals)) { @@ -10142,6 +10150,9 @@ class TxnInfo { if (isset($vals['heartbeatCount'])) { $this->heartbeatCount = $vals['heartbeatCount']; } + if (isset($vals['metaInfo'])) { + $this->metaInfo = $vals['metaInfo']; + } } } @@ -10206,6 +10217,13 @@ class TxnInfo { $xfer += $input->skip($ftype); } break; + case 7: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->metaInfo); + } else { + $xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -10249,6 +10267,11 @@ class TxnInfo { $xfer += $output->writeI32($this->heartbeatCount); $xfer += $output->writeFieldEnd(); } + if ($this->metaInfo !== null) { + $xfer += $output->writeFieldBegin('metaInfo', TType::STRING, 7); + $xfer += $output->writeString($this->metaInfo); + $xfer += $output->writeFieldEnd(); + } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; diff --git metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py index cc7c675..f2e7f3c 100644 --- metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py +++ metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py @@ -6919,6 +6919,7 @@ class TxnInfo: - hostname - agentInfo - heartbeatCount + - metaInfo """ thrift_spec = ( @@ -6929,15 +6930,17 @@ class TxnInfo: (4, TType.STRING, 'hostname', None, None, ), # 4 (5, TType.STRING, 'agentInfo', None, "Unknown", ), # 5 (6, TType.I32, 'heartbeatCount', None, 0, ), # 6 + (7, TType.STRING, 'metaInfo', None, None, ), # 7 ) - def __init__(self, id=None, state=None, user=None, hostname=None, agentInfo=thrift_spec[5][4], heartbeatCount=thrift_spec[6][4],): + def __init__(self, id=None, state=None, user=None, hostname=None, agentInfo=thrift_spec[5][4], heartbeatCount=thrift_spec[6][4], metaInfo=None,): self.id = id self.state = state self.user = user self.hostname = hostname self.agentInfo = agentInfo self.heartbeatCount = heartbeatCount + self.metaInfo = metaInfo 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: @@ -6978,6 +6981,11 @@ def read(self, iprot): self.heartbeatCount = iprot.readI32() else: iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + self.metaInfo = iprot.readString() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -7012,6 +7020,10 @@ def write(self, oprot): oprot.writeFieldBegin('heartbeatCount', TType.I32, 6) oprot.writeI32(self.heartbeatCount) oprot.writeFieldEnd() + if self.metaInfo is not None: + oprot.writeFieldBegin('metaInfo', TType.STRING, 7) + oprot.writeString(self.metaInfo) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -7035,6 +7047,7 @@ def __hash__(self): value = (value * 31) ^ hash(self.hostname) value = (value * 31) ^ hash(self.agentInfo) value = (value * 31) ^ hash(self.heartbeatCount) + value = (value * 31) ^ hash(self.metaInfo) return value def __repr__(self): diff --git metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb index d55d77c..f4e360b 100644 --- metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb +++ metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb @@ -1560,6 +1560,7 @@ class TxnInfo HOSTNAME = 4 AGENTINFO = 5 HEARTBEATCOUNT = 6 + METAINFO = 7 FIELDS = { ID => {:type => ::Thrift::Types::I64, :name => 'id'}, @@ -1567,7 +1568,8 @@ class TxnInfo USER => {:type => ::Thrift::Types::STRING, :name => 'user'}, HOSTNAME => {:type => ::Thrift::Types::STRING, :name => 'hostname'}, AGENTINFO => {:type => ::Thrift::Types::STRING, :name => 'agentInfo', :default => %q"Unknown", :optional => true}, - HEARTBEATCOUNT => {:type => ::Thrift::Types::I32, :name => 'heartbeatCount', :default => 0, :optional => true} + HEARTBEATCOUNT => {:type => ::Thrift::Types::I32, :name => 'heartbeatCount', :default => 0, :optional => true}, + METAINFO => {:type => ::Thrift::Types::STRING, :name => 'metaInfo', :optional => true} } def struct_fields; FIELDS; end