You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2020/04/23 23:12:22 UTC

[kudu] branch master updated (b0d5852 -> 411c63f)

This is an automated email from the ASF dual-hosted git repository.

alexey pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git.


    from b0d5852  [test] fix TestCorruptKerberosCC scenario
     new 1bdfbac  tablet: set up RowSetKeyProbe fields in initialization list
     new 411c63f  [c++17] Corrected call of boost::make_optional()

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/kudu/master/placement_policy-test.cc | 3 +--
 src/kudu/tablet/rowset.h                 | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)


[kudu] 02/02: [c++17] Corrected call of boost::make_optional()

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 411c63f82805b442a1e14fe21cf5c438472578b2
Author: Volodymyr Verovkin <ve...@cloudera.com>
AuthorDate: Tue Apr 21 23:16:07 2020 -0700

    [c++17] Corrected call of boost::make_optional()
    
    Without specifying "boost" namespace C++17 compiler treats
    make_optional() as std::make_optional() and produces error:
    ./../src/kudu/master/placement_policy-test.cc:1014:49: error:
    no viable conversion
    from 'optional<decay_t<std::__cxx11::basic_string<char> > >'
    (aka 'optional<std::__cxx11::basic_string<char> >')
    to 'const boost::optional<std::string>'
    (aka 'const optional<basic_string<char> >')
            ASSERT_OK(policy.PlaceTabletReplicas(3,
            make_optional(string(label)), &result));
    
    Change-Id: I553ce8275508914cfa322a05fe2adfcd802372ad
    Reviewed-on: http://gerrit.cloudera.org:8080/15781
    Tested-by: Kudu Jenkins
    Reviewed-by: Bankim Bhavsar <ba...@cloudera.com>
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
 src/kudu/master/placement_policy-test.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/kudu/master/placement_policy-test.cc b/src/kudu/master/placement_policy-test.cc
index 7b076aa..90ea547 100644
--- a/src/kudu/master/placement_policy-test.cc
+++ b/src/kudu/master/placement_policy-test.cc
@@ -39,7 +39,6 @@
 #include "kudu/util/status.h"
 #include "kudu/util/test_macros.h"
 
-using boost::make_optional;
 using boost::none;
 using boost::optional;
 using std::initializer_list;
@@ -1011,7 +1010,7 @@ TEST_F(PlacementPolicyTest, PlaceTabletReplicasWithNewTabletServers) {
       map<string, int> placement_stats;
       for (auto i = 0; i < 1000; ++i) {
         TSDescriptorVector result;
-        ASSERT_OK(policy.PlaceTabletReplicas(3, make_optional(string(label)), &result));
+        ASSERT_OK(policy.PlaceTabletReplicas(3, boost::make_optional(string(label)), &result));
         ASSERT_EQ(3, result.size());
         for (const auto& ts : result) {
           const auto& ts_uuid = ts->permanent_uuid();


[kudu] 01/02: tablet: set up RowSetKeyProbe fields in initialization list

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 1bdfbac5737411ee2de5a557eb198eaa12cf4873
Author: Todd Lipcon <to...@apache.org>
AuthorDate: Wed Apr 22 22:50:18 2020 -0700

    tablet: set up RowSetKeyProbe fields in initialization list
    
    For some reason, setting these fields in the body of the constructor
    generated a lot more code than setting them in the constructor list.
    Namely, the setting of a unique_ptr<> generated a check whether the
    pointer was already set, and code to deallocate the old version if it
    was.
    
    I'm not sure why clang couldn't figure out that it couldn't possibly be
    set -- perhaps something to do with inheritance (eg maybe a subclass
    would have set the field in its constructor before chaining upwards?).
    Either way, this was taking 2-3% CPU and dropped after this change.
    
    Change-Id: Ibe46e00f5ca8c13c7366df4bee04e7c6e840b3a0
    Reviewed-on: http://gerrit.cloudera.org:8080/15790
    Reviewed-by: Bankim Bhavsar <ba...@cloudera.com>
    Tested-by: Kudu Jenkins
---
 src/kudu/tablet/rowset.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/kudu/tablet/rowset.h b/src/kudu/tablet/rowset.h
index 85c8c99..40e4e71 100644
--- a/src/kudu/tablet/rowset.h
+++ b/src/kudu/tablet/rowset.h
@@ -317,9 +317,9 @@ class RowSetKeyProbe {
   // NOTE: row_key is not copied and must be valid for the lifetime
   // of this object.
   explicit RowSetKeyProbe(ConstContiguousRow row_key)
-      : row_key_(row_key) {
-    encoded_key_ = EncodedKey::FromContiguousRow(row_key_);
-    bloom_probe_ = BloomKeyProbe(encoded_key_slice());
+      : row_key_(row_key),
+        encoded_key_(EncodedKey::FromContiguousRow(row_key_)),
+        bloom_probe_(BloomKeyProbe(encoded_key_slice())) {
   }
 
   // RowSetKeyProbes are usually allocated on the stack, which means that we