kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [1/2] kudu git commit: Re-enable IWYU checks on HMS module
Date Wed, 25 Apr 2018 03:44:06 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 72847ab56 -> fc47272c7


Re-enable IWYU checks on HMS module

IWYU previously had some issues with the HMS module[1], probably due to
the Thrift generated classes. Now that IWYU has been upgraded[2] this is
an attempt to re-enable the IWYU checks.  This commit also includes some
associated fixups.

[1]: https://github.com/apache/kudu/commit/c09a6296181ecbb7d91687536f70fdbaac9fff5e
[2]: https://github.com/apache/kudu/commit/bba339b11795d84da9c9d1473366ca561730c141

Change-Id: I63e5f1ca6a480f22ede83acde6baea8e2f563e8a
Reviewed-on: http://gerrit.cloudera.org:8080/10102
Tested-by: Alexey Serbin <aserbin@cloudera.com>
Reviewed-by: Alexey Serbin <aserbin@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/1f379d7a
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/1f379d7a
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/1f379d7a

Branch: refs/heads/master
Commit: 1f379d7af8aa833c54885f02a68b55eb0065c378
Parents: 72847ab
Author: Dan Burkert <danburkert@apache.org>
Authored: Wed Apr 18 12:39:45 2018 -0700
Committer: Alexey Serbin <aserbin@cloudera.com>
Committed: Wed Apr 25 02:29:26 2018 +0000

----------------------------------------------------------------------
 src/kudu/hms/hms_catalog-test.cc               | 12 +++++-------
 src/kudu/hms/hms_catalog.cc                    |  1 -
 src/kudu/hms/hms_client-test.cc                |  9 +++------
 src/kudu/hms/hms_client.cc                     | 12 +++++++++---
 src/kudu/hms/mini_hms.cc                       |  8 ++++++++
 src/kudu/hms/mini_hms.h                        | 13 +++++--------
 src/kudu/integration-tests/master_hms-itest.cc | 16 +++++++---------
 src/kudu/master/catalog_manager.h              |  9 ++++++---
 8 files changed, 43 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/1f379d7a/src/kudu/hms/hms_catalog-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/hms/hms_catalog-test.cc b/src/kudu/hms/hms_catalog-test.cc
index 7326f4c..cbfe528 100644
--- a/src/kudu/hms/hms_catalog-test.cc
+++ b/src/kudu/hms/hms_catalog-test.cc
@@ -17,7 +17,7 @@
 
 #include "kudu/hms/hms_catalog.h"
 
-#include <map> // IWYU pragma: keep
+#include <map>
 #include <memory>
 #include <string>
 #include <vector>
@@ -28,13 +28,12 @@
 #include "kudu/common/common.pb.h"
 #include "kudu/common/schema.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/hms/hive_metastore_constants.h"
 #include "kudu/hms/hive_metastore_types.h"
 #include "kudu/hms/hms_client.h"
-#include "kudu/hms/mini_hms.h" // IWYU pragma: keep
+#include "kudu/hms/mini_hms.h"
 #include "kudu/rpc/sasl_common.h"
-#include "kudu/security/test/mini_kdc.h" // IWYU pragma: keep
-#include "kudu/util/net/net_util.h" // IWYU pragma: keep
+#include "kudu/security/test/mini_kdc.h"
+#include "kudu/util/net/net_util.h"
 #include "kudu/util/status.h"
 #include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
@@ -209,8 +208,7 @@ class HmsCatalogTest : public KuduTest {
 
     EXPECT_EQ(table.parameters[HmsClient::kKuduTableIdKey], table_id);
     EXPECT_EQ(table.parameters[HmsClient::kKuduMasterAddrsKey], kMasterAddrs);
-    EXPECT_EQ(table.parameters[hive::g_hive_metastore_constants.META_TABLE_STORAGE],
-              HmsClient::kKuduStorageHandler);
+    EXPECT_EQ(table.parameters[HmsClient::kStorageHandlerKey], HmsClient::kKuduStorageHandler);
 
     for (int column_idx = 0; column_idx < schema.num_columns(); column_idx++) {
       EXPECT_EQ(table.sd.cols[column_idx].name, schema.columns()[column_idx].name());

http://git-wip-us.apache.org/repos/asf/kudu/blob/1f379d7a/src/kudu/hms/hms_catalog.cc
----------------------------------------------------------------------
diff --git a/src/kudu/hms/hms_catalog.cc b/src/kudu/hms/hms_catalog.cc
index 49048c7..6b01814 100644
--- a/src/kudu/hms/hms_catalog.cc
+++ b/src/kudu/hms/hms_catalog.cc
@@ -35,7 +35,6 @@
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/strings/split.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/hms/hive_metastore_constants.h"
 #include "kudu/hms/hive_metastore_types.h"
 #include "kudu/hms/hms_client.h"
 #include "kudu/util/async_util.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/1f379d7a/src/kudu/hms/hms_client-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/hms/hms_client-test.cc b/src/kudu/hms/hms_client-test.cc
index 708aeaa..edf8f34 100644
--- a/src/kudu/hms/hms_client-test.cc
+++ b/src/kudu/hms/hms_client-test.cc
@@ -31,7 +31,6 @@
 #include <glog/stl_logging.h>
 #include <gtest/gtest.h>
 
-#include "kudu/hms/hive_metastore_constants.h"
 #include "kudu/hms/hive_metastore_types.h"
 #include "kudu/hms/mini_hms.h"
 #include "kudu/rpc/sasl_common.h"
@@ -69,8 +68,7 @@ class HmsClientTest : public KuduTest,
     table.__set_parameters({
         make_pair(HmsClient::kKuduTableIdKey, table_id),
         make_pair(HmsClient::kKuduMasterAddrsKey, string("TODO")),
-        make_pair(hive::g_hive_metastore_constants.META_TABLE_STORAGE,
-                  HmsClient::kKuduStorageHandler),
+        make_pair(HmsClient::kStorageHandlerKey, HmsClient::kKuduStorageHandler),
     });
 
     return client->CreateTable(table);
@@ -166,8 +164,7 @@ TEST_P(HmsClientTest, TestHmsOperations) {
   EXPECT_EQ(database_name, my_table.dbName) << "my_table: " << my_table;
   EXPECT_EQ(table_name, my_table.tableName);
   EXPECT_EQ(table_id, my_table.parameters[HmsClient::kKuduTableIdKey]);
-  EXPECT_EQ(HmsClient::kKuduStorageHandler,
-            my_table.parameters[hive::g_hive_metastore_constants.META_TABLE_STORAGE]);
+  EXPECT_EQ(HmsClient::kKuduStorageHandler, my_table.parameters[HmsClient::kStorageHandlerKey]);
   EXPECT_EQ(HmsClient::kManagedTable, my_table.tableType);
 
   string new_table_name = "my_altered_table";
@@ -192,7 +189,7 @@ TEST_P(HmsClientTest, TestHmsOperations) {
   EXPECT_EQ(new_table_name, renamed_table.tableName);
   EXPECT_EQ(table_id, renamed_table.parameters[HmsClient::kKuduTableIdKey]);
   EXPECT_EQ(HmsClient::kKuduStorageHandler,
-            renamed_table.parameters[hive::g_hive_metastore_constants.META_TABLE_STORAGE]);
+            renamed_table.parameters[HmsClient::kStorageHandlerKey]);
   EXPECT_EQ(HmsClient::kManagedTable, renamed_table.tableType);
 
   // Create a table with an uppercase name.

http://git-wip-us.apache.org/repos/asf/kudu/blob/1f379d7a/src/kudu/hms/hms_client.cc
----------------------------------------------------------------------
diff --git a/src/kudu/hms/hms_client.cc b/src/kudu/hms/hms_client.cc
index aeb7c23..6fe5a46 100644
--- a/src/kudu/hms/hms_client.cc
+++ b/src/kudu/hms/hms_client.cc
@@ -18,26 +18,32 @@
 #include "kudu/hms/hms_client.h"
 
 #include <algorithm>
+#include <exception>
 #include <memory>
 #include <mutex>
+#include <ostream>
 #include <string>
-#include <type_traits>
-#include <utility>
 #include <vector>
 
 #include <boost/algorithm/string/predicate.hpp>
+#include <gflags/gflags.h>
 #include <glog/logging.h>
+#include <thrift/TOutput.h>
 #include <thrift/Thrift.h>
 #include <thrift/protocol/TBinaryProtocol.h>
 #include <thrift/protocol/TJSONProtocol.h>
+#include <thrift/protocol/TProtocol.h>
 #include <thrift/transport/TBufferTransports.h>
 #include <thrift/transport/TSocket.h>
+#include <thrift/transport/TTransport.h>
+#include <thrift/transport/TTransportException.h>
 
+#include "kudu/gutil/macros.h"
 #include "kudu/gutil/strings/split.h"
 #include "kudu/gutil/strings/strip.h"
 #include "kudu/gutil/strings/substitute.h"
 #include "kudu/hms/ThriftHiveMetastore.h"
-#include "kudu/hms/hive_metastore_constants.h"
+#include "kudu/hms/hive_metastore_types.h"
 #include "kudu/hms/sasl_client_transport.h"
 #include "kudu/util/flag_tags.h"
 #include "kudu/util/net/net_util.h"

http://git-wip-us.apache.org/repos/asf/kudu/blob/1f379d7a/src/kudu/hms/mini_hms.cc
----------------------------------------------------------------------
diff --git a/src/kudu/hms/mini_hms.cc b/src/kudu/hms/mini_hms.cc
index fa09c08..2618020 100644
--- a/src/kudu/hms/mini_hms.cc
+++ b/src/kudu/hms/mini_hms.cc
@@ -49,10 +49,18 @@ static constexpr int kHmsStartTimeoutMs = 60000;
 namespace kudu {
 namespace hms {
 
+MiniHms::MiniHms() {
+}
+
 MiniHms::~MiniHms() {
   WARN_NOT_OK(Stop(), "Failed to stop MiniHms");
 }
 
+void MiniHms::SetNotificationLogTtl(MonoDelta ttl) {
+  CHECK(hms_process_);
+  notification_log_ttl_ = ttl;
+}
+
 void MiniHms::EnableKerberos(string krb5_conf,
                              string service_principal,
                              string keytab_file,

http://git-wip-us.apache.org/repos/asf/kudu/blob/1f379d7a/src/kudu/hms/mini_hms.h
----------------------------------------------------------------------
diff --git a/src/kudu/hms/mini_hms.h b/src/kudu/hms/mini_hms.h
index aa0ef4e..a45d9de 100644
--- a/src/kudu/hms/mini_hms.h
+++ b/src/kudu/hms/mini_hms.h
@@ -21,30 +21,27 @@
 #include <memory>
 #include <string>
 
-#include <glog/logging.h>
-
 #include "kudu/gutil/port.h"
 #include "kudu/rpc/sasl_common.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/net/net_util.h"
 #include "kudu/util/status.h"
-#include "kudu/util/subprocess.h"
 
 namespace kudu {
+
+class Subprocess;
+
 namespace hms {
 
 class MiniHms {
  public:
 
-  MiniHms() = default;
+  MiniHms();
 
   ~MiniHms();
 
   // Configures the notification log TTL. Must be called before Start().
-  void SetNotificationLogTtl(MonoDelta ttl) {
-    CHECK(hms_process_);
-    notification_log_ttl_ = ttl;
-  }
+  void SetNotificationLogTtl(MonoDelta ttl);
 
   // Configures the mini HMS to use Kerberos.
   void EnableKerberos(std::string krb5_conf,

http://git-wip-us.apache.org/repos/asf/kudu/blob/1f379d7a/src/kudu/integration-tests/master_hms-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/master_hms-itest.cc b/src/kudu/integration-tests/master_hms-itest.cc
index a6428aa..14301f5 100644
--- a/src/kudu/integration-tests/master_hms-itest.cc
+++ b/src/kudu/integration-tests/master_hms-itest.cc
@@ -15,28 +15,26 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include <algorithm> // IWYU pragma: keep
-#include <map> // IWYU pragma: keep
+#include <algorithm>
+#include <map>
 #include <memory>
-#include <ostream> // IWYU pragma: keep
 #include <string>
 #include <vector>
 
-#include <glog/stl_logging.h> // IWYU pragma: keep
+#include <glog/stl_logging.h>
 #include <gtest/gtest.h>
 
-#include "kudu/client/client.h" // IWYU pragma: keep
+#include "kudu/client/client.h"
 #include "kudu/client/schema.h"
 #include "kudu/client/shared_ptr.h"
 #include "kudu/gutil/strings/substitute.h"
-#include "kudu/hms/hive_metastore_constants.h"
 #include "kudu/hms/hive_metastore_types.h"
 #include "kudu/hms/hms_client.h"
-#include "kudu/hms/mini_hms.h" // IWYU pragma: keep
+#include "kudu/hms/mini_hms.h"
 #include "kudu/integration-tests/external_mini_cluster-itest-base.h"
 #include "kudu/mini-cluster/external_mini_cluster.h"
 #include "kudu/util/decimal_util.h"
-#include "kudu/util/net/net_util.h" // IWYU pragma: keep
+#include "kudu/util/net/net_util.h"
 #include "kudu/util/status.h"
 #include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
@@ -151,7 +149,7 @@ class MasterHmsTest : public ExternalMiniClusterITestBase {
     ASSERT_EQ(HostPort::ToCommaSeparatedString(cluster_->master_rpc_addrs()),
               hms_table.parameters[hms::HmsClient::kKuduMasterAddrsKey]);
     ASSERT_EQ(hms::HmsClient::kKuduStorageHandler,
-              hms_table.parameters[hive::g_hive_metastore_constants.META_TABLE_STORAGE]);
+              hms_table.parameters[hms::HmsClient::kStorageHandlerKey]);
   }
 
   // Checks that a table does not exist in the Kudu and HMS catalogs.

http://git-wip-us.apache.org/repos/asf/kudu/blob/1f379d7a/src/kudu/master/catalog_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.h b/src/kudu/master/catalog_manager.h
index 997e355..60bff5f 100644
--- a/src/kudu/master/catalog_manager.h
+++ b/src/kudu/master/catalog_manager.h
@@ -38,7 +38,6 @@
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/port.h"
 #include "kudu/gutil/ref_counted.h"
-#include "kudu/hms/hms_catalog.h"
 #include "kudu/master/master.pb.h"
 #include "kudu/master/ts_manager.h"
 #include "kudu/tserver/tablet_replica_lookup.h"
@@ -80,11 +79,15 @@ class TokenSigningPublicKeyPB; // IWYU pragma: keep
 namespace consensus {
 class RaftConsensus;
 class StartTabletCopyRequestPB;
-}
+} // namespace consensus
 
 namespace tablet {
 class TabletReplica;
-}
+} // namespace tablet
+
+namespace hms {
+class HmsCatalog;
+} // namespace hms
 
 namespace master {
 


Mime
View raw message