You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by aw...@apache.org on 2018/11/21 16:42:53 UTC

[1/2] kudu git commit: build: don't instantiate const objects with no user-defined constructor

Repository: kudu
Updated Branches:
  refs/heads/master 66b06de7b -> b8e329974


build: don't instantiate const objects with no user-defined constructor

It seems that some compilers disallow instantiating const objects that
don't provide a user-provided constructor. This would surface as the
following error.

error: default initialization of an object of const type 'const ClusterInfo' requires a user-provided default constructor

Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7
Reviewed-on: http://gerrit.cloudera.org:8080/11971
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>


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

Branch: refs/heads/master
Commit: 307de65bd219bdad78dfc9f52e3638fbcd8cb730
Parents: 66b06de
Author: Andrew Wong <aw...@cloudera.com>
Authored: Tue Nov 20 16:37:53 2018 -0800
Committer: Andrew Wong <aw...@cloudera.com>
Committed: Wed Nov 21 05:12:52 2018 +0000

----------------------------------------------------------------------
 src/kudu/tools/rebalance_algo-test.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/307de65b/src/kudu/tools/rebalance_algo-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/rebalance_algo-test.cc b/src/kudu/tools/rebalance_algo-test.cc
index 092ac4d..c8ba5c7 100644
--- a/src/kudu/tools/rebalance_algo-test.cc
+++ b/src/kudu/tools/rebalance_algo-test.cc
@@ -291,7 +291,7 @@ string TestClusterConfigToDebugString(const TestClusterConfig& cfg) {
 // Test the behavior of the algorithm when no input information is given.
 TEST(RebalanceAlgoUnitTest, EmptyClusterInfoGetNextMoves) {
   vector<TableReplicaMove> moves;
-  const ClusterInfo info;
+  const ClusterInfo info = {};
   ASSERT_OK(TwoDimensionalGreedyAlgo().GetNextMoves(info, 0, &moves));
   EXPECT_TRUE(moves.empty());
 }
@@ -321,7 +321,7 @@ TEST(RebalanceAlgoUnitTest, NoTableSkewInClusterBalanceInfoGetNextMoves) {
 // GetNextMove() when no input information is given.
 TEST(RebalanceAlgoUnitTest, EmptyBalanceInfoGetNextMove) {
   boost::optional<TableReplicaMove> move;
-  const ClusterInfo info;
+  const ClusterInfo info = {};
   const auto s = TwoDimensionalGreedyAlgo().GetNextMove(info, &move);
   ASSERT_TRUE(s.IsInvalidArgument()) << s.ToString();
   EXPECT_EQ(boost::none, move);


[2/2] kudu git commit: [webui] fixed build and corrected a typo

Posted by aw...@apache.org.
[webui] fixed build and corrected a typo

Fixed build for TCMALLOC-enabled environments.
Fixed a typo in 'Memory usage by subsystem' WebUI page.
As additional tiny change, take advantage of the 'using' directive
for std::ostringstream.

This is a follow-up to 7437626f42b30811720d59e792bc905662efd2b3.

Change-Id: If1f0b3df0ac4178609914322741511d8fff87b24
Reviewed-on: http://gerrit.cloudera.org:8080/11973
Reviewed-by: Will Berkeley <wd...@gmail.com>
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <aw...@cloudera.com>


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

Branch: refs/heads/master
Commit: b8e3299746fa6571d660eef705d17c65ef55d16b
Parents: 307de65
Author: Alexey Serbin <al...@apache.org>
Authored: Tue Nov 20 20:22:56 2018 -0800
Committer: Andrew Wong <aw...@cloudera.com>
Committed: Wed Nov 21 16:40:16 2018 +0000

----------------------------------------------------------------------
 src/kudu/server/default_path_handlers.cc | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b8e32997/src/kudu/server/default_path_handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/default_path_handlers.cc b/src/kudu/server/default_path_handlers.cc
index 390630c..a4564c5 100644
--- a/src/kudu/server/default_path_handlers.cc
+++ b/src/kudu/server/default_path_handlers.cc
@@ -28,11 +28,14 @@
 #include <vector>
 
 #include <boost/algorithm/string/predicate.hpp>
-#include <boost/bind.hpp> // IWYU pragma: keep
+#include <boost/bind.hpp>
 #include <gflags/gflags.h>
 #include <gflags/gflags_declare.h>
 #include <glog/logging.h>
+
 #ifdef TCMALLOC_ENABLED
+#include <boost/algorithm/string/replace.hpp>
+#include <boost/iterator/iterator_traits.hpp>
 #include <gperftools/malloc_extension.h>
 #endif
 
@@ -59,7 +62,13 @@
 #include "kudu/util/status.h"
 #include "kudu/util/web_callback_registry.h"
 
+#ifdef TCMALLOC_ENABLED
+#include "kudu/util/faststring.h"
+#endif
+
 using std::ifstream;
+using std::ostringstream;
+using std::shared_ptr;
 using std::string;
 using std::vector;
 using strings::Substitute;
@@ -77,8 +86,6 @@ DECLARE_string(webserver_certificate_file);
 
 namespace kudu {
 
-using std::shared_ptr;
-
 namespace {
 // Html/Text formatting tags
 struct Tags {
@@ -122,7 +129,7 @@ static void LogsHandler(const Webserver::WebRequest& req, Webserver::WebResponse
     // practice.
     log.seekg(seekpos);
     (*output)["web_log_bytes"] = FLAGS_web_log_bytes;
-    std::ostringstream ss;
+    ostringstream ss;
     ss << log.rdbuf();
     (*output)["log"] = ss.str();
   }
@@ -134,7 +141,7 @@ static void LogsHandler(const Webserver::WebRequest& req, Webserver::WebResponse
 // escaped if in the raw text mode, e.g. "/varz?raw".
 static void FlagsHandler(const Webserver::WebRequest& req,
                          Webserver::PrerenderedWebResponse* resp) {
-  std::ostringstream* output = resp->output;
+  ostringstream* output = resp->output;
   bool as_text = (req.parsed_args.find("raw") != req.parsed_args.end());
   Tags tags(as_text);
 
@@ -149,7 +156,7 @@ static void FlagsHandler(const Webserver::WebRequest& req,
 // Prints out the current stack trace of all threads in the process.
 static void StacksHandler(const Webserver::WebRequest& /*req*/,
                           Webserver::PrerenderedWebResponse* resp) {
-  std::ostringstream* output = resp->output;
+  ostringstream* output = resp->output;
 
   StackTraceSnapshot snap;
   auto start = MonoTime::Now();
@@ -182,7 +189,7 @@ static void StacksHandler(const Webserver::WebRequest& /*req*/,
 // Registered to handle "/memz", and prints out memory allocation statistics.
 static void MemUsageHandler(const Webserver::WebRequest& req,
                             Webserver::PrerenderedWebResponse* resp) {
-  std::ostringstream* output = resp->output;
+  ostringstream* output = resp->output;
   bool as_text = (req.parsed_args.find("raw") != req.parsed_args.end());
   Tags tags(as_text);
 
@@ -203,7 +210,7 @@ static void MemUsageHandler(const Webserver::WebRequest& req,
 // Registered to handle "/mem-trackers", and prints out memory tracker information.
 static void MemTrackersHandler(const Webserver::WebRequest& /*req*/,
                                Webserver::PrerenderedWebResponse* resp) {
-  std::ostringstream* output = resp->output;
+  ostringstream* output = resp->output;
   int64_t current_consumption = process_memory::CurrentConsumption();
   int64_t hard_limit = process_memory::HardLimit();
   *output << "<h1>Process memory usage</h1>\n";
@@ -238,7 +245,7 @@ static void MemTrackersHandler(const Webserver::WebRequest& /*req*/,
              "<th>Limit</th>"
              "<th data-sorter='bytesSorter' "
              "    data-sortable='true' "
-             "'>Current Consumption</th>"
+             ">Current Consumption</th>"
              "<th data-sorter='bytesSorter' "
              "    data-sortable='true' "
              ">Peak Consumption</th>";
@@ -320,7 +327,7 @@ void AddDefaultPathHandlers(Webserver* webserver) {
 static void WriteMetricsAsJson(const MetricRegistry* const metrics,
                                const Webserver::WebRequest& req,
                                Webserver::PrerenderedWebResponse* resp) {
-  std::ostringstream* output = resp->output;
+  ostringstream* output = resp->output;
   const string* requested_metrics_param = FindOrNull(req.parsed_args, "metrics");
   vector<string> requested_metrics;
   MetricJsonOptions opts;