[1/2] hive git commit: HIVE-19033: Provide an option to purge LLAP IO cache (Prasanth Jayachandran reviewed by Sergey Shelukhin)
Repository: hive Updated Branches: refs/heads/master 59483bca2 -> 13f59a226 http://git-wip-us.apache.org/repos/asf/hive/blob/13f59a22/ql/src/java/org/apache/hadoop/hive/ql/processors/LlapClusterResourceProcessor.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/processors/LlapClusterResourceProcessor.java b/ql/src/java/org/apache/hadoop/hive/ql/processors/LlapClusterResourceProcessor.java new file mode 100644 index 000..0238727 --- /dev/null +++ b/ql/src/java/org/apache/hadoop/hive/ql/processors/LlapClusterResourceProcessor.java @@ -0,0 +1,134 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.processors; + +import static org.apache.hadoop.hive.serde.serdeConstants.SERIALIZATION_NULL_FORMAT; +import static org.apache.hadoop.hive.serde2.MetadataTypedColumnsetSerDe.defaultNullString; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.Arrays; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.GnuParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.apache.hadoop.hive.conf.VariableSubstitution; +import org.apache.hadoop.hive.llap.registry.LlapServiceInstance; +import org.apache.hadoop.hive.llap.registry.impl.LlapRegistryService; +import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.Schema; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Joiner; + +public class LlapClusterResourceProcessor implements CommandProcessor { + public static final Logger LOG = LoggerFactory.getLogger(LlapClusterResourceProcessor.class); + private Options CLUSTER_OPTIONS = new Options(); + private HelpFormatter helpFormatter = new HelpFormatter(); + + LlapClusterResourceProcessor() { +CLUSTER_OPTIONS.addOption("info", "info", false, "Information about LLAP cluster"); + } + + private CommandProcessorResponse returnErrorResponse(final String errmsg) { +return new CommandProcessorResponse(1, "LLAP Cluster Processor Helper Failed:" + errmsg, null); + } + + @Override + public CommandProcessorResponse run(String command) { +SessionState ss = SessionState.get(); +command = new VariableSubstitution(() -> SessionState.get().getHiveVariables()).substitute(ss.getConf(), command); +String[] tokens = command.split("\\s+"); +if (tokens.length < 1) { + return returnErrorResponse("Command arguments are empty."); +} + +String params[] = Arrays.copyOfRange(tokens, 1, tokens.length); +try { + return llapClusterCommandHandler(ss, params); +} catch (Exception e) { + return returnErrorResponse(e.getMessage()); +} + } + + private CommandProcessorResponse llapClusterCommandHandler(final SessionState ss, +final String[] params) throws ParseException { +CommandLine args = parseCommandArgs(CLUSTER_OPTIONS, params); + +// no auth check for "LLAP CLUSTER INFO" +boolean hasInfo = args.hasOption("info"); +if (hasInfo) { + try { +LlapRegistryService llapRegistryService = LlapRegistryService.getClient(ss.getConf()); +String appId = llapRegistryService.getApplicationId() == null ? "null" : + llapRegistryService.getApplicationId().toString(); +for (LlapServiceInstance instance : llapRegistryService.getInstances().getAll()) { + ss.out.println(Joiner.on("\t").join(appId, instance.getWorkerIdentity(), instance.getHost(), +instance.getRpcPort(), instance.getResource().getMemory() * 1024L * 1024L, +instance.getResource().getVirtualCores())); +} +return createProcessorSuccessResponse(); + } catch (Exception e) { +LOG.error("Unable to list LLAP instances. err: ", e); +return returnErrorResponse("Unable to list LLAP instances. err: " + e.getMessage()); + } +} else { + String usage = getUsageAsString(); + return
[2/2] hive git commit: HIVE-19033: Provide an option to purge LLAP IO cache (Prasanth Jayachandran reviewed by Sergey Shelukhin)
HIVE-19033: Provide an option to purge LLAP IO cache (Prasanth Jayachandran reviewed by Sergey Shelukhin) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/13f59a22 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/13f59a22 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/13f59a22 Branch: refs/heads/master Commit: 13f59a2267ed9c73ee729ba0f1925054e07d424b Parents: 59483bc Author: Prasanth JayachandranAuthored: Sun Apr 1 22:42:28 2018 -0700 Committer: Prasanth Jayachandran Committed: Sun Apr 1 22:42:28 2018 -0700 -- .../org/apache/hadoop/hive/conf/HiveConf.java | 3 +- .../apache/hive/jdbc/TestActivePassiveHA.java | 20 + .../TestJdbcWithSQLAuthorization.java | 26 + .../apache/hadoop/hive/llap/io/api/LlapIo.java | 6 + .../daemon/rpc/LlapDaemonProtocolProtos.java| 907 ++- .../impl/LlapManagementProtocolClientImpl.java | 11 + .../llap/protocol/LlapManagementProtocolPB.java | 2 + .../src/protobuf/LlapDaemonProtocol.proto | 8 + .../hive/llap/cache/CacheContentsTracker.java | 5 + .../hive/llap/cache/LowLevelCachePolicy.java| 1 + .../llap/cache/LowLevelFifoCachePolicy.java | 8 + .../llap/cache/LowLevelLrfuCachePolicy.java | 8 + .../daemon/impl/LlapProtocolServerImpl.java | 18 + .../services/impl/LlapIoMemoryServlet.java | 2 +- .../hive/llap/io/api/impl/LlapIoImpl.java | 16 +- .../hive/llap/cache/TestLowLevelCacheImpl.java | 5 + .../hive/llap/cache/TestOrcMetadataCache.java | 5 + .../ql/processors/CommandProcessorFactory.java | 4 + .../hadoop/hive/ql/processors/CommandUtil.java | 44 + .../hadoop/hive/ql/processors/HiveCommand.java | 14 + .../processors/LlapCacheResourceProcessor.java | 195 .../LlapClusterResourceProcessor.java | 134 +++ .../authorization/plugin/HiveOperationType.java | 2 + .../plugin/sqlstd/Operation2Privilege.java | 2 + .../SQLStdHiveAuthorizationValidator.java | 1 + .../cli/operation/HiveCommandOperation.java | 2 +- 26 files changed, 1424 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/13f59a22/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java -- diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 02367eb..ae2e7d6 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2820,7 +2820,8 @@ public class HiveConf extends Configuration { HIVE_SERVER2_XSRF_FILTER_ENABLED("hive.server2.xsrf.filter.enabled",false, "If enabled, HiveServer2 will block any requests made to it over http " + "if an X-XSRF-HEADER header is not present"), -HIVE_SECURITY_COMMAND_WHITELIST("hive.security.command.whitelist", "set,reset,dfs,add,list,delete,reload,compile", +HIVE_SECURITY_COMMAND_WHITELIST("hive.security.command.whitelist", + "set,reset,dfs,add,list,delete,reload,compile,llap", "Comma separated list of non-SQL Hive commands users are authorized to execute"), HIVE_SERVER2_JOB_CREDENTIAL_PROVIDER_PATH("hive.server2.job.credential.provider.path", "", "If set, this configuration property should provide a comma-separated list of URLs that indicates the type and " + http://git-wip-us.apache.org/repos/asf/hive/blob/13f59a22/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java -- diff --git a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java index d2d0bee..c94c0e1 100644 --- a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java +++ b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestActivePassiveHA.java @@ -567,4 +567,24 @@ public class TestActivePassiveHA { hiveConf.setBoolVar(ConfVars.HIVE_SERVER2_WEBUI_USE_PAM, false); hiveConf.setBoolVar(ConfVars.HIVE_IN_TEST, false); } + + // This is test for llap command AuthZ added in HIVE-19033 which require ZK access for it to pass + @Test(timeout = 6) + public void testNoAuthZLlapClusterInfo() throws Exception { +String instanceId1 = UUID.randomUUID().toString(); +miniHS2_1.start(getConfOverlay(instanceId1)); +Connection hs2Conn = getConnection(miniHS2_1.getJdbcURL(), "user1"); +boolean caughtException = false; +Statement stmt = hs2Conn.createStatement(); +try { + stmt.execute("set hive.llap.daemon.service.hosts=@localhost"); +
[11/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp -- diff --git a/standalone-metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp b/standalone-metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp index 5897fae..c24055a 100644 --- a/standalone-metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp +++ b/standalone-metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp @@ -2107,14 +2107,14 @@ uint32_t ThriftHiveMetastore_get_databases_result::read(::apache::thrift::protoc if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); -uint32_t _size1175; -::apache::thrift::protocol::TType _etype1178; -xfer += iprot->readListBegin(_etype1178, _size1175); -this->success.resize(_size1175); -uint32_t _i1179; -for (_i1179 = 0; _i1179 < _size1175; ++_i1179) +uint32_t _size1181; +::apache::thrift::protocol::TType _etype1184; +xfer += iprot->readListBegin(_etype1184, _size1181); +this->success.resize(_size1181); +uint32_t _i1185; +for (_i1185 = 0; _i1185 < _size1181; ++_i1185) { - xfer += iprot->readString(this->success[_i1179]); + xfer += iprot->readString(this->success[_i1185]); } xfer += iprot->readListEnd(); } @@ -2153,10 +2153,10 @@ uint32_t ThriftHiveMetastore_get_databases_result::write(::apache::thrift::proto xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); - std::vector ::const_iterator _iter1180; - for (_iter1180 = this->success.begin(); _iter1180 != this->success.end(); ++_iter1180) + std::vector ::const_iterator _iter1186; + for (_iter1186 = this->success.begin(); _iter1186 != this->success.end(); ++_iter1186) { -xfer += oprot->writeString((*_iter1180)); +xfer += oprot->writeString((*_iter1186)); } xfer += oprot->writeListEnd(); } @@ -2201,14 +2201,14 @@ uint32_t ThriftHiveMetastore_get_databases_presult::read(::apache::thrift::proto if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); -uint32_t _size1181; -::apache::thrift::protocol::TType _etype1184; -xfer += iprot->readListBegin(_etype1184, _size1181); -(*(this->success)).resize(_size1181); -uint32_t _i1185; -for (_i1185 = 0; _i1185 < _size1181; ++_i1185) +uint32_t _size1187; +::apache::thrift::protocol::TType _etype1190; +xfer += iprot->readListBegin(_etype1190, _size1187); +(*(this->success)).resize(_size1187); +uint32_t _i1191; +for (_i1191 = 0; _i1191 < _size1187; ++_i1191) { - xfer += iprot->readString((*(this->success))[_i1185]); + xfer += iprot->readString((*(this->success))[_i1191]); } xfer += iprot->readListEnd(); } @@ -2325,14 +2325,14 @@ uint32_t ThriftHiveMetastore_get_all_databases_result::read(::apache::thrift::pr if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); -uint32_t _size1186; -::apache::thrift::protocol::TType _etype1189; -xfer += iprot->readListBegin(_etype1189, _size1186); -this->success.resize(_size1186); -uint32_t _i1190; -for (_i1190 = 0; _i1190 < _size1186; ++_i1190) +uint32_t _size1192; +::apache::thrift::protocol::TType _etype1195; +xfer += iprot->readListBegin(_etype1195, _size1192); +this->success.resize(_size1192); +uint32_t _i1196; +for (_i1196 = 0; _i1196 < _size1192; ++_i1196) { - xfer += iprot->readString(this->success[_i1190]); + xfer += iprot->readString(this->success[_i1196]); } xfer += iprot->readListEnd(); } @@ -2371,10 +2371,10 @@ uint32_t ThriftHiveMetastore_get_all_databases_result::write(::apache::thrift::p xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); - std::vector ::const_iterator _iter1191; - for (_iter1191 = this->success.begin(); _iter1191 != this->success.end(); ++_iter1191) + std::vector ::const_iterator _iter1197; + for (_iter1197 = this->success.begin(); _iter1197 != this->success.end(); ++_iter1197) { -xfer +=
[12/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/59483bca Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/59483bca Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/59483bca Branch: refs/heads/master Commit: 59483bca262880d3e7ef1b873d3c21176e9294cb Parents: 9e98d59 Author: Sankar HariappanAuthored: Mon Apr 2 10:02:09 2018 +0530 Committer: Sankar Hariappan Committed: Mon Apr 2 10:02:09 2018 +0530 -- .../listener/DbNotificationListener.java| 152 +- .../listener/TestDbNotificationListener.java| 15 + .../TestReplicationScenariosAcidTables.java | 184 + .../hadoop/hive/ql/parse/WarehouseInstance.java | 21 +- .../compactor/TestCleanerWithReplication.java |1 + .../upgrade/derby/054-HIVE-18781.derby.sql |9 + .../upgrade/derby/hive-schema-3.0.0.derby.sql |2 + .../derby/hive-txn-schema-3.0.0.derby.sql |7 + .../derby/upgrade-2.3.0-to-3.0.0.derby.sql |1 + ql/if/queryplan.thrift |3 +- ql/src/gen/thrift/gen-cpp/queryplan_types.cpp |8 +- ql/src/gen/thrift/gen-cpp/queryplan_types.h |3 +- .../hadoop/hive/ql/plan/api/StageType.java |5 +- ql/src/gen/thrift/gen-php/Types.php |2 + ql/src/gen/thrift/gen-py/queryplan/ttypes.py|3 + ql/src/gen/thrift/gen-rb/queryplan_types.rb |5 +- .../apache/hadoop/hive/ql/exec/ReplTxnTask.java | 92 + .../apache/hadoop/hive/ql/exec/ReplTxnWork.java | 91 + .../apache/hadoop/hive/ql/exec/TaskFactory.java |1 + .../org/apache/hadoop/hive/ql/io/AcidUtils.java | 10 + .../hadoop/hive/ql/lockmgr/DbTxnManager.java| 40 + .../hadoop/hive/ql/lockmgr/DummyTxnManager.java | 15 + .../hadoop/hive/ql/lockmgr/HiveTxnManager.java | 27 +- .../hive/ql/parse/ImportSemanticAnalyzer.java |8 - .../ql/parse/ReplicationSemanticAnalyzer.java | 64 +- .../hadoop/hive/ql/parse/repl/DumpType.java | 21 + .../parse/repl/dump/events/AbortTxnHandler.java | 42 + .../repl/dump/events/CommitTxnHandler.java | 43 + .../repl/dump/events/EventHandlerFactory.java |3 + .../parse/repl/dump/events/OpenTxnHandler.java | 42 + .../repl/load/message/AbortTxnHandler.java | 53 + .../repl/load/message/CommitTxnHandler.java | 53 + .../parse/repl/load/message/OpenTxnHandler.java | 52 + .../hive/metastore/txn/TestTxnHandler.java | 21 + .../gen/thrift/gen-cpp/ThriftHiveMetastore.cpp | 2258 ++-- .../gen/thrift/gen-cpp/hive_metastore_types.cpp | 3222 +- .../gen/thrift/gen-cpp/hive_metastore_types.h | 50 +- .../hive/metastore/api/AbortTxnRequest.java | 112 +- .../hive/metastore/api/AbortTxnsRequest.java| 32 +- .../metastore/api/AddDynamicPartitions.java | 32 +- .../api/AllocateTableWriteIdsRequest.java | 32 +- .../api/AllocateTableWriteIdsResponse.java | 36 +- .../metastore/api/ClearFileMetadataRequest.java | 32 +- .../hive/metastore/api/ClientCapabilities.java | 32 +- .../hive/metastore/api/CommitTxnRequest.java| 112 +- .../hive/metastore/api/CompactionRequest.java | 44 +- .../hive/metastore/api/CreationMetadata.java| 32 +- .../metastore/api/FindSchemasByColsResp.java| 36 +- .../hive/metastore/api/FireEventRequest.java| 32 +- .../metastore/api/GetAllFunctionsResponse.java | 36 +- .../api/GetFileMetadataByExprRequest.java | 32 +- .../api/GetFileMetadataByExprResult.java| 48 +- .../metastore/api/GetFileMetadataRequest.java | 32 +- .../metastore/api/GetFileMetadataResult.java| 44 +- .../hive/metastore/api/GetTablesRequest.java| 32 +- .../hive/metastore/api/GetTablesResult.java | 36 +- .../metastore/api/GetValidWriteIdsRequest.java | 32 +- .../metastore/api/GetValidWriteIdsResponse.java | 36 +- .../api/HeartbeatTxnRangeResponse.java | 64 +- .../metastore/api/InsertEventRequestData.java | 64 +- .../hadoop/hive/metastore/api/LockRequest.java | 36 +- .../hive/metastore/api/Materialization.java | 32 +- .../api/NotificationEventResponse.java | 36 +- .../hive/metastore/api/OpenTxnRequest.java | 269 +- .../hive/metastore/api/OpenTxnsResponse.java| 32 +- .../metastore/api/PutFileMetadataRequest.java | 64 +- .../hive/metastore/api/SchemaVersion.java | 36 +- .../hive/metastore/api/ShowCompactResponse.java | 36 +- .../hive/metastore/api/ShowLocksResponse.java | 36 +- .../hive/metastore/api/TableValidWriteIds.java | 32 +- .../hive/metastore/api/ThriftHiveMetastore.java | 2476 +++--- .../hive/metastore/api/WMFullResourcePlan.java | 144 +-
[04/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php -- diff --git a/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php b/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php index 49f71b5..d4fcc88 100644 --- a/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php +++ b/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php @@ -15901,6 +15901,14 @@ class OpenTxnRequest { * @var string */ public $agentInfo = "Unknown"; + /** + * @var string + */ + public $replPolicy = null; + /** + * @var int[] + */ + public $replSrcTxnIds = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -15921,6 +15929,18 @@ class OpenTxnRequest { 'var' => 'agentInfo', 'type' => TType::STRING, ), +5 => array( + 'var' => 'replPolicy', + 'type' => TType::STRING, + ), +6 => array( + 'var' => 'replSrcTxnIds', + 'type' => TType::LST, + 'etype' => TType::I64, + 'elem' => array( +'type' => TType::I64, +), + ), ); } if (is_array($vals)) { @@ -15936,6 +15956,12 @@ class OpenTxnRequest { if (isset($vals['agentInfo'])) { $this->agentInfo = $vals['agentInfo']; } + if (isset($vals['replPolicy'])) { +$this->replPolicy = $vals['replPolicy']; + } + if (isset($vals['replSrcTxnIds'])) { +$this->replSrcTxnIds = $vals['replSrcTxnIds']; + } } } @@ -15986,6 +16012,30 @@ class OpenTxnRequest { $xfer += $input->skip($ftype); } break; +case 5: + if ($ftype == TType::STRING) { +$xfer += $input->readString($this->replPolicy); + } else { +$xfer += $input->skip($ftype); + } + break; +case 6: + if ($ftype == TType::LST) { +$this->replSrcTxnIds = array(); +$_size502 = 0; +$_etype505 = 0; +$xfer += $input->readListBegin($_etype505, $_size502); +for ($_i506 = 0; $_i506 < $_size502; ++$_i506) +{ + $elem507 = null; + $xfer += $input->readI64($elem507); + $this->replSrcTxnIds []= $elem507; +} +$xfer += $input->readListEnd(); + } else { +$xfer += $input->skip($ftype); + } + break; default: $xfer += $input->skip($ftype); break; @@ -16019,6 +16069,28 @@ class OpenTxnRequest { $xfer += $output->writeString($this->agentInfo); $xfer += $output->writeFieldEnd(); } +if ($this->replPolicy !== null) { + $xfer += $output->writeFieldBegin('replPolicy', TType::STRING, 5); + $xfer += $output->writeString($this->replPolicy); + $xfer += $output->writeFieldEnd(); +} +if ($this->replSrcTxnIds !== null) { + if (!is_array($this->replSrcTxnIds)) { +throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('replSrcTxnIds', TType::LST, 6); + { +$output->writeListBegin(TType::I64, count($this->replSrcTxnIds)); +{ + foreach ($this->replSrcTxnIds as $iter508) + { +$xfer += $output->writeI64($iter508); + } +} +$output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); +} $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; @@ -16076,14 +16148,14 @@ class OpenTxnsResponse { case 1: if ($ftype == TType::LST) { $this->txn_ids = array(); -$_size502 = 0; -$_etype505 = 0; -$xfer += $input->readListBegin($_etype505, $_size502); -for ($_i506 = 0; $_i506 < $_size502; ++$_i506) +$_size509 = 0; +$_etype512 = 0; +$xfer += $input->readListBegin($_etype512, $_size509); +for ($_i513 = 0; $_i513 < $_size509; ++$_i513) { - $elem507 = null; - $xfer += $input->readI64($elem507); - $this->txn_ids []= $elem507; + $elem514 = null; + $xfer += $input->readI64($elem514); + $this->txn_ids []= $elem514; } $xfer += $input->readListEnd(); } else { @@ -16111,9 +16183,9 @@ class OpenTxnsResponse { { $output->writeListBegin(TType::I64, count($this->txn_ids)); { - foreach ($this->txn_ids as $iter508) + foreach ($this->txn_ids as $iter515) { -$xfer += $output->writeI64($iter508); +$xfer += $output->writeI64($iter515); }
[03/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py -- diff --git a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py index bded16a..f8ffeac 100644 --- a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py +++ b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py @@ -15379,10 +15379,10 @@ class get_databases_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype798, _size795) = iprot.readListBegin() - for _i799 in xrange(_size795): -_elem800 = iprot.readString() -self.success.append(_elem800) + (_etype805, _size802) = iprot.readListBegin() + for _i806 in xrange(_size802): +_elem807 = iprot.readString() +self.success.append(_elem807) iprot.readListEnd() else: iprot.skip(ftype) @@ -15405,8 +15405,8 @@ class get_databases_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter801 in self.success: -oprot.writeString(iter801) + for iter808 in self.success: +oprot.writeString(iter808) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -15511,10 +15511,10 @@ class get_all_databases_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype805, _size802) = iprot.readListBegin() - for _i806 in xrange(_size802): -_elem807 = iprot.readString() -self.success.append(_elem807) + (_etype812, _size809) = iprot.readListBegin() + for _i813 in xrange(_size809): +_elem814 = iprot.readString() +self.success.append(_elem814) iprot.readListEnd() else: iprot.skip(ftype) @@ -15537,8 +15537,8 @@ class get_all_databases_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter808 in self.success: -oprot.writeString(iter808) + for iter815 in self.success: +oprot.writeString(iter815) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -16308,12 +16308,12 @@ class get_type_all_result: if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype810, _vtype811, _size809 ) = iprot.readMapBegin() - for _i813 in xrange(_size809): -_key814 = iprot.readString() -_val815 = Type() -_val815.read(iprot) -self.success[_key814] = _val815 + (_ktype817, _vtype818, _size816 ) = iprot.readMapBegin() + for _i820 in xrange(_size816): +_key821 = iprot.readString() +_val822 = Type() +_val822.read(iprot) +self.success[_key821] = _val822 iprot.readMapEnd() else: iprot.skip(ftype) @@ -16336,9 +16336,9 @@ class get_type_all_result: if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success)) - for kiter816,viter817 in self.success.items(): -oprot.writeString(kiter816) -viter817.write(oprot) + for kiter823,viter824 in self.success.items(): +oprot.writeString(kiter823) +viter824.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() if self.o2 is not None: @@ -16481,11 +16481,11 @@ class get_fields_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype821, _size818) = iprot.readListBegin() - for _i822 in xrange(_size818): -_elem823 = FieldSchema() -_elem823.read(iprot) -self.success.append(_elem823) + (_etype828, _size825) = iprot.readListBegin() + for _i829 in xrange(_size825): +_elem830 = FieldSchema() +_elem830.read(iprot) +self.success.append(_elem830) iprot.readListEnd() else: iprot.skip(ftype) @@ -16520,8 +16520,8 @@ class get_fields_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter824 in self.success: -iter824.write(oprot) + for iter831 in self.success: +iter831.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.o1 is not None: @@ -16688,11 +16688,11 @@ class
[10/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp -- diff --git a/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp b/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp index 987a4f3..383cb9b 100644 --- a/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp +++ b/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp @@ -15906,6 +15906,16 @@ void OpenTxnRequest::__set_agentInfo(const std::string& val) { __isset.agentInfo = true; } +void OpenTxnRequest::__set_replPolicy(const std::string& val) { + this->replPolicy = val; +__isset.replPolicy = true; +} + +void OpenTxnRequest::__set_replSrcTxnIds(const std::vector & val) { + this->replSrcTxnIds = val; +__isset.replSrcTxnIds = true; +} + uint32_t OpenTxnRequest::read(::apache::thrift::protocol::TProtocol* iprot) { apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); @@ -15962,6 +15972,34 @@ uint32_t OpenTxnRequest::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 5: +if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->replPolicy); + this->__isset.replPolicy = true; +} else { + xfer += iprot->skip(ftype); +} +break; + case 6: +if (ftype == ::apache::thrift::protocol::T_LIST) { + { +this->replSrcTxnIds.clear(); +uint32_t _size644; +::apache::thrift::protocol::TType _etype647; +xfer += iprot->readListBegin(_etype647, _size644); +this->replSrcTxnIds.resize(_size644); +uint32_t _i648; +for (_i648 = 0; _i648 < _size644; ++_i648) +{ + xfer += iprot->readI64(this->replSrcTxnIds[_i648]); +} +xfer += iprot->readListEnd(); + } + this->__isset.replSrcTxnIds = true; +} else { + xfer += iprot->skip(ftype); +} +break; default: xfer += iprot->skip(ftype); break; @@ -16002,6 +16040,24 @@ uint32_t OpenTxnRequest::write(::apache::thrift::protocol::TProtocol* oprot) con xfer += oprot->writeString(this->agentInfo); xfer += oprot->writeFieldEnd(); } + if (this->__isset.replPolicy) { +xfer += oprot->writeFieldBegin("replPolicy", ::apache::thrift::protocol::T_STRING, 5); +xfer += oprot->writeString(this->replPolicy); +xfer += oprot->writeFieldEnd(); + } + if (this->__isset.replSrcTxnIds) { +xfer += oprot->writeFieldBegin("replSrcTxnIds", ::apache::thrift::protocol::T_LIST, 6); +{ + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->replSrcTxnIds.size())); + std::vector ::const_iterator _iter649; + for (_iter649 = this->replSrcTxnIds.begin(); _iter649 != this->replSrcTxnIds.end(); ++_iter649) + { +xfer += oprot->writeI64((*_iter649)); + } + xfer += oprot->writeListEnd(); +} +xfer += oprot->writeFieldEnd(); + } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -16013,22 +16069,28 @@ void swap(OpenTxnRequest , OpenTxnRequest ) { swap(a.user, b.user); swap(a.hostname, b.hostname); swap(a.agentInfo, b.agentInfo); + swap(a.replPolicy, b.replPolicy); + swap(a.replSrcTxnIds, b.replSrcTxnIds); swap(a.__isset, b.__isset); } -OpenTxnRequest::OpenTxnRequest(const OpenTxnRequest& other644) { - num_txns = other644.num_txns; - user = other644.user; - hostname = other644.hostname; - agentInfo = other644.agentInfo; - __isset = other644.__isset; -} -OpenTxnRequest& OpenTxnRequest::operator=(const OpenTxnRequest& other645) { - num_txns = other645.num_txns; - user = other645.user; - hostname = other645.hostname; - agentInfo = other645.agentInfo; - __isset = other645.__isset; +OpenTxnRequest::OpenTxnRequest(const OpenTxnRequest& other650) { + num_txns = other650.num_txns; + user = other650.user; + hostname = other650.hostname; + agentInfo = other650.agentInfo; + replPolicy = other650.replPolicy; + replSrcTxnIds = other650.replSrcTxnIds; + __isset = other650.__isset; +} +OpenTxnRequest& OpenTxnRequest::operator=(const OpenTxnRequest& other651) { + num_txns = other651.num_txns; + user = other651.user; + hostname = other651.hostname; + agentInfo = other651.agentInfo; + replPolicy = other651.replPolicy; + replSrcTxnIds = other651.replSrcTxnIds; + __isset = other651.__isset; return *this; } void OpenTxnRequest::printTo(std::ostream& out) const { @@ -16038,6 +16100,8 @@ void OpenTxnRequest::printTo(std::ostream& out) const { out << ", " << "user=" << to_string(user); out << ", " << "hostname=" << to_string(hostname); out << ", " << "agentInfo=";
[01/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
Repository: hive Updated Branches: refs/heads/master 9e98d59d4 -> 59483bca2 http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/OpenTxnMessage.java -- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/OpenTxnMessage.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/OpenTxnMessage.java new file mode 100644 index 000..491344f --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/OpenTxnMessage.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.hadoop.hive.metastore.messaging; + +import java.util.List; + +/** + * HCat message sent when an open transaction is done. + */ +public abstract class OpenTxnMessage extends EventMessage { + + protected OpenTxnMessage() { +super(EventType.OPEN_TXN); + } + + /** + * Get the list of txns opened + * @return The lists of TxnIds + */ + public abstract List getTxnIds(); +} http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/event/filters/DatabaseAndTableFilter.java -- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/event/filters/DatabaseAndTableFilter.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/event/filters/DatabaseAndTableFilter.java index 50420c8..09292a3 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/event/filters/DatabaseAndTableFilter.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/event/filters/DatabaseAndTableFilter.java @@ -18,6 +18,7 @@ package org.apache.hadoop.hive.metastore.messaging.event.filters; import org.apache.hadoop.hive.metastore.api.NotificationEvent; +import org.apache.hadoop.hive.metastore.messaging.MessageFactory; import java.util.regex.Pattern; @@ -39,10 +40,17 @@ public class DatabaseAndTableFilter extends BasicFilter { this.tableName = tableName; } + private boolean isTxnRelatedEvent(final NotificationEvent event) { +return ((event.getEventType().equals(MessageFactory.OPEN_TXN_EVENT)) || +(event.getEventType().equals(MessageFactory.COMMIT_TXN_EVENT)) || +(event.getEventType().equals(MessageFactory.ABORT_TXN_EVENT)) + ); + } + @Override boolean shouldAccept(final NotificationEvent event) { -if (dbPattern == null) { - return true; // if our dbName is null, we're interested in all wh events +if ((dbPattern == null) || isTxnRelatedEvent(event)) { + return true; } if (dbPattern.matcher(event.getDbName()).matches()) { if ((tableName == null) http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/json/JSONAbortTxnMessage.java -- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/json/JSONAbortTxnMessage.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/json/JSONAbortTxnMessage.java new file mode 100644 index 000..f169fc0 --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/messaging/json/JSONAbortTxnMessage.java @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + *
[07/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java -- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java index 751eec4..0bca4eb 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java @@ -40307,13 +40307,13 @@ import org.slf4j.LoggerFactory; case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list904 = iprot.readListBegin(); - struct.success = new ArrayList(_list904.size); - String _elem905; - for (int _i906 = 0; _i906 < _list904.size; ++_i906) + org.apache.thrift.protocol.TList _list912 = iprot.readListBegin(); + struct.success = new ArrayList(_list912.size); + String _elem913; + for (int _i914 = 0; _i914 < _list912.size; ++_i914) { -_elem905 = iprot.readString(); -struct.success.add(_elem905); +_elem913 = iprot.readString(); +struct.success.add(_elem913); } iprot.readListEnd(); } @@ -40348,9 +40348,9 @@ import org.slf4j.LoggerFactory; oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); -for (String _iter907 : struct.success) +for (String _iter915 : struct.success) { - oprot.writeString(_iter907); + oprot.writeString(_iter915); } oprot.writeListEnd(); } @@ -40389,9 +40389,9 @@ import org.slf4j.LoggerFactory; if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); -for (String _iter908 : struct.success) +for (String _iter916 : struct.success) { - oprot.writeString(_iter908); + oprot.writeString(_iter916); } } } @@ -40406,13 +40406,13 @@ import org.slf4j.LoggerFactory; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { -org.apache.thrift.protocol.TList _list909 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); -struct.success = new ArrayList(_list909.size); -String _elem910; -for (int _i911 = 0; _i911 < _list909.size; ++_i911) +org.apache.thrift.protocol.TList _list917 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); +struct.success = new ArrayList(_list917.size); +String _elem918; +for (int _i919 = 0; _i919 < _list917.size; ++_i919) { - _elem910 = iprot.readString(); - struct.success.add(_elem910); + _elem918 = iprot.readString(); + struct.success.add(_elem918); } } struct.setSuccessIsSet(true); @@ -41066,13 +41066,13 @@ import org.slf4j.LoggerFactory; case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list912 = iprot.readListBegin(); - struct.success = new ArrayList(_list912.size); - String _elem913; - for (int _i914 = 0; _i914 < _list912.size; ++_i914) + org.apache.thrift.protocol.TList _list920 = iprot.readListBegin(); + struct.success = new ArrayList(_list920.size); + String _elem921; + for (int _i922 = 0; _i922 < _list920.size; ++_i922) { -_elem913 = iprot.readString(); -struct.success.add(_elem913); +_elem921 = iprot.readString(); +struct.success.add(_elem921); } iprot.readListEnd(); } @@ -41107,9 +41107,9 @@ import org.slf4j.LoggerFactory; oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING,
[09/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h -- diff --git a/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h b/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h index d4ee95b..086cfe9 100644 --- a/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h +++ b/standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h @@ -6697,8 +6697,10 @@ inline std::ostream& operator<<(std::ostream& out, const GetOpenTxnsResponse& ob } typedef struct _OpenTxnRequest__isset { - _OpenTxnRequest__isset() : agentInfo(true) {} + _OpenTxnRequest__isset() : agentInfo(true), replPolicy(false), replSrcTxnIds(false) {} bool agentInfo :1; + bool replPolicy :1; + bool replSrcTxnIds :1; } _OpenTxnRequest__isset; class OpenTxnRequest { @@ -6706,7 +6708,7 @@ class OpenTxnRequest { OpenTxnRequest(const OpenTxnRequest&); OpenTxnRequest& operator=(const OpenTxnRequest&); - OpenTxnRequest() : num_txns(0), user(), hostname(), agentInfo("Unknown") { + OpenTxnRequest() : num_txns(0), user(), hostname(), agentInfo("Unknown"), replPolicy() { } virtual ~OpenTxnRequest() throw(); @@ -6714,6 +6716,8 @@ class OpenTxnRequest { std::string user; std::string hostname; std::string agentInfo; + std::string replPolicy; + std::vector replSrcTxnIds; _OpenTxnRequest__isset __isset; @@ -6725,6 +6729,10 @@ class OpenTxnRequest { void __set_agentInfo(const std::string& val); + void __set_replPolicy(const std::string& val); + + void __set_replSrcTxnIds(const std::vector & val); + bool operator == (const OpenTxnRequest & rhs) const { if (!(num_txns == rhs.num_txns)) @@ -6737,6 +6745,14 @@ class OpenTxnRequest { return false; else if (__isset.agentInfo && !(agentInfo == rhs.agentInfo)) return false; +if (__isset.replPolicy != rhs.__isset.replPolicy) + return false; +else if (__isset.replPolicy && !(replPolicy == rhs.replPolicy)) + return false; +if (__isset.replSrcTxnIds != rhs.__isset.replSrcTxnIds) + return false; +else if (__isset.replSrcTxnIds && !(replSrcTxnIds == rhs.replSrcTxnIds)) + return false; return true; } bool operator != (const OpenTxnRequest ) const { @@ -6799,24 +6815,37 @@ inline std::ostream& operator<<(std::ostream& out, const OpenTxnsResponse& obj) return out; } +typedef struct _AbortTxnRequest__isset { + _AbortTxnRequest__isset() : replPolicy(false) {} + bool replPolicy :1; +} _AbortTxnRequest__isset; class AbortTxnRequest { public: AbortTxnRequest(const AbortTxnRequest&); AbortTxnRequest& operator=(const AbortTxnRequest&); - AbortTxnRequest() : txnid(0) { + AbortTxnRequest() : txnid(0), replPolicy() { } virtual ~AbortTxnRequest() throw(); int64_t txnid; + std::string replPolicy; + + _AbortTxnRequest__isset __isset; void __set_txnid(const int64_t val); + void __set_replPolicy(const std::string& val); + bool operator == (const AbortTxnRequest & rhs) const { if (!(txnid == rhs.txnid)) return false; +if (__isset.replPolicy != rhs.__isset.replPolicy) + return false; +else if (__isset.replPolicy && !(replPolicy == rhs.replPolicy)) + return false; return true; } bool operator != (const AbortTxnRequest ) const { @@ -6879,24 +6908,37 @@ inline std::ostream& operator<<(std::ostream& out, const AbortTxnsRequest& obj) return out; } +typedef struct _CommitTxnRequest__isset { + _CommitTxnRequest__isset() : replPolicy(false) {} + bool replPolicy :1; +} _CommitTxnRequest__isset; class CommitTxnRequest { public: CommitTxnRequest(const CommitTxnRequest&); CommitTxnRequest& operator=(const CommitTxnRequest&); - CommitTxnRequest() : txnid(0) { + CommitTxnRequest() : txnid(0), replPolicy() { } virtual ~CommitTxnRequest() throw(); int64_t txnid; + std::string replPolicy; + + _CommitTxnRequest__isset __isset; void __set_txnid(const int64_t val); + void __set_replPolicy(const std::string& val); + bool operator == (const CommitTxnRequest & rhs) const { if (!(txnid == rhs.txnid)) return false; +if (__isset.replPolicy != rhs.__isset.replPolicy) + return false; +else if (__isset.replPolicy && !(replPolicy == rhs.replPolicy)) + return false; return true; } bool operator != (const CommitTxnRequest ) const { http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/AbortTxnRequest.java -- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/AbortTxnRequest.java
[06/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMFullResourcePlan.java -- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMFullResourcePlan.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMFullResourcePlan.java index 3560567..ad2c0b6 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMFullResourcePlan.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/WMFullResourcePlan.java @@ -755,14 +755,14 @@ import org.slf4j.LoggerFactory; case 2: // POOLS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { -org.apache.thrift.protocol.TList _list824 = iprot.readListBegin(); -struct.pools = new ArrayList(_list824.size); -WMPool _elem825; -for (int _i826 = 0; _i826 < _list824.size; ++_i826) +org.apache.thrift.protocol.TList _list832 = iprot.readListBegin(); +struct.pools = new ArrayList(_list832.size); +WMPool _elem833; +for (int _i834 = 0; _i834 < _list832.size; ++_i834) { - _elem825 = new WMPool(); - _elem825.read(iprot); - struct.pools.add(_elem825); + _elem833 = new WMPool(); + _elem833.read(iprot); + struct.pools.add(_elem833); } iprot.readListEnd(); } @@ -774,14 +774,14 @@ import org.slf4j.LoggerFactory; case 3: // MAPPINGS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { -org.apache.thrift.protocol.TList _list827 = iprot.readListBegin(); -struct.mappings = new ArrayList(_list827.size); -WMMapping _elem828; -for (int _i829 = 0; _i829 < _list827.size; ++_i829) +org.apache.thrift.protocol.TList _list835 = iprot.readListBegin(); +struct.mappings = new ArrayList(_list835.size); +WMMapping _elem836; +for (int _i837 = 0; _i837 < _list835.size; ++_i837) { - _elem828 = new WMMapping(); - _elem828.read(iprot); - struct.mappings.add(_elem828); + _elem836 = new WMMapping(); + _elem836.read(iprot); + struct.mappings.add(_elem836); } iprot.readListEnd(); } @@ -793,14 +793,14 @@ import org.slf4j.LoggerFactory; case 4: // TRIGGERS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { -org.apache.thrift.protocol.TList _list830 = iprot.readListBegin(); -struct.triggers = new ArrayList(_list830.size); -WMTrigger _elem831; -for (int _i832 = 0; _i832 < _list830.size; ++_i832) +org.apache.thrift.protocol.TList _list838 = iprot.readListBegin(); +struct.triggers = new ArrayList(_list838.size); +WMTrigger _elem839; +for (int _i840 = 0; _i840 < _list838.size; ++_i840) { - _elem831 = new WMTrigger(); - _elem831.read(iprot); - struct.triggers.add(_elem831); + _elem839 = new WMTrigger(); + _elem839.read(iprot); + struct.triggers.add(_elem839); } iprot.readListEnd(); } @@ -812,14 +812,14 @@ import org.slf4j.LoggerFactory; case 5: // POOL_TRIGGERS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { -org.apache.thrift.protocol.TList _list833 = iprot.readListBegin(); -struct.poolTriggers = new ArrayList(_list833.size); -WMPoolTrigger _elem834; -for (int _i835 = 0; _i835 < _list833.size; ++_i835) +org.apache.thrift.protocol.TList _list841 = iprot.readListBegin(); +struct.poolTriggers = new ArrayList(_list841.size); +WMPoolTrigger _elem842; +for (int _i843 = 0; _i843 < _list841.size; ++_i843) { - _elem834 = new WMPoolTrigger(); - _elem834.read(iprot); - struct.poolTriggers.add(_elem834); + _elem842 = new WMPoolTrigger(); + _elem842.read(iprot); + struct.poolTriggers.add(_elem842); } iprot.readListEnd(); }
[02/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py -- diff --git a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py index faeeea0..972db1f 100644 --- a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py +++ b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py @@ -11085,6 +11085,8 @@ class OpenTxnRequest: - user - hostname - agentInfo + - replPolicy + - replSrcTxnIds """ thrift_spec = ( @@ -11093,13 +11095,17 @@ class OpenTxnRequest: (2, TType.STRING, 'user', None, None, ), # 2 (3, TType.STRING, 'hostname', None, None, ), # 3 (4, TType.STRING, 'agentInfo', None, "Unknown", ), # 4 +(5, TType.STRING, 'replPolicy', None, None, ), # 5 +(6, TType.LIST, 'replSrcTxnIds', (TType.I64,None), None, ), # 6 ) - def __init__(self, num_txns=None, user=None, hostname=None, agentInfo=thrift_spec[4][4],): + def __init__(self, num_txns=None, user=None, hostname=None, agentInfo=thrift_spec[4][4], replPolicy=None, replSrcTxnIds=None,): self.num_txns = num_txns self.user = user self.hostname = hostname self.agentInfo = agentInfo +self.replPolicy = replPolicy +self.replSrcTxnIds = replSrcTxnIds 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: @@ -11130,6 +11136,21 @@ class OpenTxnRequest: self.agentInfo = iprot.readString() else: iprot.skip(ftype) + elif fid == 5: +if ftype == TType.STRING: + self.replPolicy = iprot.readString() +else: + iprot.skip(ftype) + elif fid == 6: +if ftype == TType.LIST: + self.replSrcTxnIds = [] + (_etype505, _size502) = iprot.readListBegin() + for _i506 in xrange(_size502): +_elem507 = iprot.readI64() +self.replSrcTxnIds.append(_elem507) + iprot.readListEnd() +else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -11156,6 +11177,17 @@ class OpenTxnRequest: oprot.writeFieldBegin('agentInfo', TType.STRING, 4) oprot.writeString(self.agentInfo) oprot.writeFieldEnd() +if self.replPolicy is not None: + oprot.writeFieldBegin('replPolicy', TType.STRING, 5) + oprot.writeString(self.replPolicy) + oprot.writeFieldEnd() +if self.replSrcTxnIds is not None: + oprot.writeFieldBegin('replSrcTxnIds', TType.LIST, 6) + oprot.writeListBegin(TType.I64, len(self.replSrcTxnIds)) + for iter508 in self.replSrcTxnIds: +oprot.writeI64(iter508) + oprot.writeListEnd() + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -11175,6 +11207,8 @@ class OpenTxnRequest: value = (value * 31) ^ hash(self.user) value = (value * 31) ^ hash(self.hostname) value = (value * 31) ^ hash(self.agentInfo) +value = (value * 31) ^ hash(self.replPolicy) +value = (value * 31) ^ hash(self.replSrcTxnIds) return value def __repr__(self): @@ -11214,10 +11248,10 @@ class OpenTxnsResponse: if fid == 1: if ftype == TType.LIST: self.txn_ids = [] - (_etype505, _size502) = iprot.readListBegin() - for _i506 in xrange(_size502): -_elem507 = iprot.readI64() -self.txn_ids.append(_elem507) + (_etype512, _size509) = iprot.readListBegin() + for _i513 in xrange(_size509): +_elem514 = iprot.readI64() +self.txn_ids.append(_elem514) iprot.readListEnd() else: iprot.skip(ftype) @@ -11234,8 +11268,8 @@ class OpenTxnsResponse: if self.txn_ids is not None: oprot.writeFieldBegin('txn_ids', TType.LIST, 1) oprot.writeListBegin(TType.I64, len(self.txn_ids)) - for iter508 in self.txn_ids: -oprot.writeI64(iter508) + for iter515 in self.txn_ids: +oprot.writeI64(iter515) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -11267,15 +11301,18 @@ class AbortTxnRequest: """ Attributes: - txnid + - replPolicy """ thrift_spec = ( None, # 0 (1, TType.I64, 'txnid', None, None, ), # 1 +(2, TType.STRING, 'replPolicy', None, None, ), # 2 ) - def __init__(self, txnid=None,): + def __init__(self, txnid=None, replPolicy=None,): self.txnid = txnid +self.replPolicy = replPolicy def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary
[08/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsRequest.java -- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsRequest.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsRequest.java index 68256c7..58c608a 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsRequest.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsRequest.java @@ -436,13 +436,13 @@ import org.slf4j.LoggerFactory; case 1: // FULL_TABLE_NAMES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { -org.apache.thrift.protocol.TList _list586 = iprot.readListBegin(); -struct.fullTableNames = new ArrayList(_list586.size); -String _elem587; -for (int _i588 = 0; _i588 < _list586.size; ++_i588) +org.apache.thrift.protocol.TList _list594 = iprot.readListBegin(); +struct.fullTableNames = new ArrayList(_list594.size); +String _elem595; +for (int _i596 = 0; _i596 < _list594.size; ++_i596) { - _elem587 = iprot.readString(); - struct.fullTableNames.add(_elem587); + _elem595 = iprot.readString(); + struct.fullTableNames.add(_elem595); } iprot.readListEnd(); } @@ -476,9 +476,9 @@ import org.slf4j.LoggerFactory; oprot.writeFieldBegin(FULL_TABLE_NAMES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.fullTableNames.size())); - for (String _iter589 : struct.fullTableNames) + for (String _iter597 : struct.fullTableNames) { -oprot.writeString(_iter589); +oprot.writeString(_iter597); } oprot.writeListEnd(); } @@ -508,9 +508,9 @@ import org.slf4j.LoggerFactory; TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.fullTableNames.size()); -for (String _iter590 : struct.fullTableNames) +for (String _iter598 : struct.fullTableNames) { - oprot.writeString(_iter590); + oprot.writeString(_iter598); } } oprot.writeString(struct.validTxnList); @@ -520,13 +520,13 @@ import org.slf4j.LoggerFactory; public void read(org.apache.thrift.protocol.TProtocol prot, GetValidWriteIdsRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; { -org.apache.thrift.protocol.TList _list591 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); -struct.fullTableNames = new ArrayList(_list591.size); -String _elem592; -for (int _i593 = 0; _i593 < _list591.size; ++_i593) +org.apache.thrift.protocol.TList _list599 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); +struct.fullTableNames = new ArrayList(_list599.size); +String _elem600; +for (int _i601 = 0; _i601 < _list599.size; ++_i601) { - _elem592 = iprot.readString(); - struct.fullTableNames.add(_elem592); + _elem600 = iprot.readString(); + struct.fullTableNames.add(_elem600); } } struct.setFullTableNamesIsSet(true); http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsResponse.java -- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsResponse.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsResponse.java index 5512fb4..86bc346 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsResponse.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/GetValidWriteIdsResponse.java @@ -354,14 +354,14 @@ import org.slf4j.LoggerFactory; case 1: // TBL_VALID_WRITE_IDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { -org.apache.thrift.protocol.TList _list602 = iprot.readListBegin(); -struct.tblValidWriteIds = new ArrayList(_list602.size); -
[05/12] hive git commit: HIVE-18781: Create/Replicate Open, Commit (without writes) and Abort Txn events (Mahesh Kumar Behera, reviewed by Sankar Hariappan)
http://git-wip-us.apache.org/repos/asf/hive/blob/59483bca/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php -- diff --git a/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php b/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php index a15a387..5e3dff1 100644 --- a/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php +++ b/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php @@ -14817,14 +14817,14 @@ class ThriftHiveMetastore_get_databases_result { case 0: if ($ftype == TType::LST) { $this->success = array(); -$_size799 = 0; -$_etype802 = 0; -$xfer += $input->readListBegin($_etype802, $_size799); -for ($_i803 = 0; $_i803 < $_size799; ++$_i803) +$_size806 = 0; +$_etype809 = 0; +$xfer += $input->readListBegin($_etype809, $_size806); +for ($_i810 = 0; $_i810 < $_size806; ++$_i810) { - $elem804 = null; - $xfer += $input->readString($elem804); - $this->success []= $elem804; + $elem811 = null; + $xfer += $input->readString($elem811); + $this->success []= $elem811; } $xfer += $input->readListEnd(); } else { @@ -14860,9 +14860,9 @@ class ThriftHiveMetastore_get_databases_result { { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter805) + foreach ($this->success as $iter812) { -$xfer += $output->writeString($iter805); +$xfer += $output->writeString($iter812); } } $output->writeListEnd(); @@ -14993,14 +14993,14 @@ class ThriftHiveMetastore_get_all_databases_result { case 0: if ($ftype == TType::LST) { $this->success = array(); -$_size806 = 0; -$_etype809 = 0; -$xfer += $input->readListBegin($_etype809, $_size806); -for ($_i810 = 0; $_i810 < $_size806; ++$_i810) +$_size813 = 0; +$_etype816 = 0; +$xfer += $input->readListBegin($_etype816, $_size813); +for ($_i817 = 0; $_i817 < $_size813; ++$_i817) { - $elem811 = null; - $xfer += $input->readString($elem811); - $this->success []= $elem811; + $elem818 = null; + $xfer += $input->readString($elem818); + $this->success []= $elem818; } $xfer += $input->readListEnd(); } else { @@ -15036,9 +15036,9 @@ class ThriftHiveMetastore_get_all_databases_result { { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter812) + foreach ($this->success as $iter819) { -$xfer += $output->writeString($iter812); +$xfer += $output->writeString($iter819); } } $output->writeListEnd(); @@ -16039,18 +16039,18 @@ class ThriftHiveMetastore_get_type_all_result { case 0: if ($ftype == TType::MAP) { $this->success = array(); -$_size813 = 0; -$_ktype814 = 0; -$_vtype815 = 0; -$xfer += $input->readMapBegin($_ktype814, $_vtype815, $_size813); -for ($_i817 = 0; $_i817 < $_size813; ++$_i817) +$_size820 = 0; +$_ktype821 = 0; +$_vtype822 = 0; +$xfer += $input->readMapBegin($_ktype821, $_vtype822, $_size820); +for ($_i824 = 0; $_i824 < $_size820; ++$_i824) { - $key818 = ''; - $val819 = new \metastore\Type(); - $xfer += $input->readString($key818); - $val819 = new \metastore\Type(); - $xfer += $val819->read($input); - $this->success[$key818] = $val819; + $key825 = ''; + $val826 = new \metastore\Type(); + $xfer += $input->readString($key825); + $val826 = new \metastore\Type(); + $xfer += $val826->read($input); + $this->success[$key825] = $val826; } $xfer += $input->readMapEnd(); } else { @@ -16086,10 +16086,10 @@ class ThriftHiveMetastore_get_type_all_result { { $output->writeMapBegin(TType::STRING, TType::STRUCT, count($this->success)); { - foreach ($this->success as $kiter820 => $viter821) + foreach ($this->success as $kiter827 => $viter828) { -$xfer += $output->writeString($kiter820); -$xfer += $viter821->write($output); +$xfer += $output->writeString($kiter827);