You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2019/11/07 16:55:06 UTC

[kudu] branch master updated (6c64693 -> 5b182a3)

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

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


    from 6c64693  docs: recommend memkind for NVM cache users
     new 0e41d5a  Fix some typos in comment.
     new 5b182a3  [cfile] not_null -> is_null

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/cfile/cfile_writer.cc                   | 20 ++++++++++----------
 src/kudu/cfile/cfile_writer.h                    |  1 +
 src/kudu/integration-tests/create-table-itest.cc |  2 +-
 src/kudu/tools/rebalancer_tool.h                 |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)


[kudu] 01/02: Fix some typos in comment.

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

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

commit 0e41d5afed0c0ab99106339f1494beb44a2b6617
Author: triplesheep <tr...@gmail.com>
AuthorDate: Thu Nov 7 16:37:42 2019 +0800

    Fix some typos in comment.
    
    Change-Id: I852b18b2118264f20dd4b2894b0b56dc5e86ae46
    Reviewed-on: http://gerrit.cloudera.org:8080/14653
    Tested-by: Alexey Serbin <as...@cloudera.com>
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
 src/kudu/integration-tests/create-table-itest.cc | 2 +-
 src/kudu/tools/rebalancer_tool.h                 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/kudu/integration-tests/create-table-itest.cc b/src/kudu/integration-tests/create-table-itest.cc
index efcf2f5..c7b91f1 100644
--- a/src/kudu/integration-tests/create-table-itest.cc
+++ b/src/kudu/integration-tests/create-table-itest.cc
@@ -379,7 +379,7 @@ TEST_F(CreateTableITest, TestSpreadReplicasEvenlyWithDimension) {
     for (int ts_idx = 0; ts_idx < kNumServers; ts_idx++) {
       num_new_replicas[ts_idx] = inspect_->ListTabletsOnTS(ts_idx).size();
     }
-    // Add partition with 'label3' to 'test-table2'
+    // Add partition with 'label3' to 'test-table1'
     ASSERT_OK(alter_table_func(client_.get(), &client_schema, "test-table1", 100, 200, "label3"));
     for (int ts_idx = 0; ts_idx < kNumServers; ts_idx++) {
       int num_replicas = inspect_->ListTabletsOnTS(ts_idx).size();
diff --git a/src/kudu/tools/rebalancer_tool.h b/src/kudu/tools/rebalancer_tool.h
index 7747e67..ac7dbe3 100644
--- a/src/kudu/tools/rebalancer_tool.h
+++ b/src/kudu/tools/rebalancer_tool.h
@@ -157,7 +157,7 @@ class RebalancerTool : public rebalance::Rebalancer {
 
     bool UpdateMovesInProgressStatus(bool* has_errors, bool* timed_out) override;
 
-    // Get the cluter location the runner is slated to run/running at.
+    // Get the cluster location the runner is slated to run/running at.
     // 'boost::none' means all the cluster.
     virtual const boost::optional<std::string>& location() const = 0;
 


[kudu] 02/02: [cfile] not_null -> is_null

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

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

commit 5b182a356c5825f95a2956924e7143e27a0be2aa
Author: lingbin <li...@gmail.com>
AuthorDate: Thu Nov 7 14:10:20 2019 +0800

    [cfile] not_null -> is_null
    
    In a bitmap, we use `true` to represent `null`. So when we iterate
    over a bitmap, if it returns `true`, its meaning is "it is a null"
    
    In the original implementation, it was incorrectly named `not_null`
    
    Change-Id: I836ebce2eae6f8df18ec256b000fee23fd62ce3e
    Reviewed-on: http://gerrit.cloudera.org:8080/14651
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
 src/kudu/cfile/cfile_writer.cc | 20 ++++++++++----------
 src/kudu/cfile/cfile_writer.h  |  1 +
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/kudu/cfile/cfile_writer.cc b/src/kudu/cfile/cfile_writer.cc
index 32d7cc6..fce4b76 100644
--- a/src/kudu/cfile/cfile_writer.cc
+++ b/src/kudu/cfile/cfile_writer.cc
@@ -154,7 +154,7 @@ Status CFileWriter::Start() {
   if (compression_ != NO_COMPRESSION) {
     const CompressionCodec* codec;
     RETURN_NOT_OK(GetCompressionCodec(compression_, &codec));
-    block_compressor_ .reset(new CompressedBlockBuilder(codec));
+    block_compressor_.reset(new CompressedBlockBuilder(codec));
   }
 
   CFileHeaderPB header;
@@ -331,12 +331,12 @@ Status CFileWriter::AppendNullableEntries(const uint8_t *bitmap,
 
   const uint8_t *ptr = reinterpret_cast<const uint8_t *>(entries);
 
-  size_t nblock;
-  bool not_null = false;
+  size_t nitems;
+  bool is_null = false;
   BitmapIterator bmap_iter(bitmap, count);
-  while ((nblock = bmap_iter.Next(&not_null)) > 0) {
-    if (not_null) {
-      size_t rem = nblock;
+  while ((nitems = bmap_iter.Next(&is_null)) > 0) {
+    if (is_null) {
+      size_t rem = nitems;
       do {
         int n = data_block_->Add(ptr, rem);
         DCHECK_GE(n, 0);
@@ -352,9 +352,9 @@ Status CFileWriter::AppendNullableEntries(const uint8_t *bitmap,
 
       } while (rem > 0);
     } else {
-      null_bitmap_builder_->AddRun(false, nblock);
-      ptr += nblock * typeinfo_->size();
-      value_count_ += nblock;
+      null_bitmap_builder_->AddRun(false, nitems);
+      ptr += nitems * typeinfo_->size();
+      value_count_ += nitems;
     }
   }
 
@@ -373,7 +373,7 @@ Status CFileWriter::FinishCurDataBlock() {
 
   rowid_t first_elem_ord = value_count_ - num_elems_in_block;
   VLOG(1) << "Appending data block for values " <<
-    first_elem_ord << "-" << (first_elem_ord + num_elems_in_block);
+    first_elem_ord << "-" << value_count_;
 
   // The current data block is full, need to push it
   // into the file, and add to index
diff --git a/src/kudu/cfile/cfile_writer.h b/src/kudu/cfile/cfile_writer.h
index 191a073..9057138 100644
--- a/src/kudu/cfile/cfile_writer.h
+++ b/src/kudu/cfile/cfile_writer.h
@@ -78,6 +78,7 @@ class NullBitmapBuilder {
     return nitems_;
   }
 
+  // If value parameter is true, it means that all values in this run are null
   void AddRun(bool value, size_t run_length = 1) {
     nitems_ += run_length;
     rle_encoder_.Put(value, run_length);