kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/5] kudu git commit: compaction-test: use default bloom sizing
Date Thu, 23 Mar 2017 04:18:57 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 889d15246 -> 47520a7e8


compaction-test: use default bloom sizing

To make this test more realistic, use the default bloom filter size,
which has some optimizations to avoid slow 'div' instructions.

Change-Id: Id80e4a9dd693f0eb41e09f037f2ad72790ae1362
Reviewed-on: http://gerrit.cloudera.org:8080/6429
Reviewed-by: David Ribeiro Alves <dralves@apache.org>
Tested-by: Kudu Jenkins


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

Branch: refs/heads/master
Commit: fd90897c7c585365021d302bed614244edc63a71
Parents: 889d152
Author: Todd Lipcon <todd@apache.org>
Authored: Sun Mar 19 15:19:19 2017 -0700
Committer: Todd Lipcon <todd@apache.org>
Committed: Wed Mar 22 07:22:38 2017 +0000

----------------------------------------------------------------------
 src/kudu/tablet/compaction-test.cc | 12 ++++++------
 src/kudu/tablet/tablet.cc          |  4 ++--
 src/kudu/tablet/tablet.h           |  5 +++--
 3 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/fd90897c/src/kudu/tablet/compaction-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/compaction-test.cc b/src/kudu/tablet/compaction-test.cc
index 427a1cd..52649f9 100644
--- a/src/kudu/tablet/compaction-test.cc
+++ b/src/kudu/tablet/compaction-test.cc
@@ -237,7 +237,7 @@ class TestCompaction : public KuduRowSetTest {
     // Flush with a large roll threshold so we only write a single file.
     // This simplifies the test so we always need to reopen only a single rowset.
     RollingDiskRowSetWriter rsw(tablet()->metadata(), projection,
-                                BloomFilterSizing::BySizeAndFPRate(32*1024, 0.01f),
+                                Tablet::DefaultBloomSizing(),
                                 roll_threshold);
     ASSERT_OK(rsw.Open());
     ASSERT_OK(FlushCompactionInput(input, snap, HistoryGcOpts::Disabled(), &rsw));
@@ -413,7 +413,7 @@ class TestCompaction : public KuduRowSetTest {
       ASSERT_OK(BuildCompactionInput(merge_snap, rowsets, schema_, &compact_input));
       // Use a low target row size to increase the number of resulting rowsets.
       RollingDiskRowSetWriter rdrsw(tablet()->metadata(), schema_,
-                                    BloomFilterSizing::BySizeAndFPRate(32 * 1024, 0.01f),
+                                    Tablet::DefaultBloomSizing(),
                                     1024 * 1024); // 1 MB
       ASSERT_OK(rdrsw.Open());
       ASSERT_OK(FlushCompactionInput(compact_input.get(), merge_snap, HistoryGcOpts::Disabled(),
@@ -489,11 +489,11 @@ TEST_F(TestCompaction, TestFlushMRSWithRolling) {
 
   rows.clear();
   rowsets[1]->DebugDump(&rows);
-  EXPECT_EQ(R"(RowIdxInBlock: 0; Base: (string key="hello 00154700", int32 val=15470, )"
-                "int32 nullable_val=15470); Undo Mutations: [@15471(DELETE)]; Redo Mutations:
[];",
+  EXPECT_EQ(R"(RowIdxInBlock: 0; Base: (string key="hello 00017150", int32 val=1715, )"
+            "int32 nullable_val=NULL); Undo Mutations: [@1716(DELETE)]; Redo Mutations: [];",
             rows[0]);
-  EXPECT_EQ(R"(RowIdxInBlock: 1; Base: (string key="hello 00154710", int32 val=15471, )"
-                "int32 nullable_val=NULL); Undo Mutations: [@15472(DELETE)]; Redo Mutations:
[];",
+  EXPECT_EQ(R"(RowIdxInBlock: 1; Base: (string key="hello 00017160", int32 val=1716, )"
+            "int32 nullable_val=1716); Undo Mutations: [@1717(DELETE)]; Redo Mutations: [];",
             rows[1]);
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd90897c/src/kudu/tablet/tablet.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet.cc b/src/kudu/tablet/tablet.cc
index 19e68c8..172e9d4 100644
--- a/src/kudu/tablet/tablet.cc
+++ b/src/kudu/tablet/tablet.cc
@@ -290,7 +290,7 @@ Status Tablet::GetMappedReadProjection(const Schema& projection,
   return cur_schema->GetMappedReadProjection(projection, mapped_projection);
 }
 
-BloomFilterSizing Tablet::bloom_sizing() const {
+BloomFilterSizing Tablet::DefaultBloomSizing() {
   return BloomFilterSizing::BySizeAndFPRate(FLAGS_tablet_bloom_block_size,
                                             FLAGS_tablet_bloom_target_fp_rate);
 }
@@ -1182,7 +1182,7 @@ Status Tablet::DoMergeCompactionOrFlush(const RowSetsInCompaction &input,
   shared_ptr<CompactionInput> merge;
   RETURN_NOT_OK(input.CreateCompactionInput(flush_snap, schema(), &merge));
 
-  RollingDiskRowSetWriter drsw(metadata_.get(), merge->schema(), bloom_sizing(),
+  RollingDiskRowSetWriter drsw(metadata_.get(), merge->schema(), DefaultBloomSizing(),
                                compaction_policy_->target_rowset_size());
   RETURN_NOT_OK_PREPEND(drsw.Open(), "Failed to open DiskRowSet for flush");
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/fd90897c/src/kudu/tablet/tablet.h
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet.h b/src/kudu/tablet/tablet.h
index 3749a71..71e73e3 100644
--- a/src/kudu/tablet/tablet.h
+++ b/src/kudu/tablet/tablet.h
@@ -390,6 +390,9 @@ class Tablet {
 
   std::string LogPrefix() const;
 
+  // Return the default bloom filter sizing parameters, configured by server flags.
+  static BloomFilterSizing DefaultBloomSizing();
+
  private:
   friend class Iterator;
   friend class TabletPeerTest;
@@ -496,8 +499,6 @@ class Tablet {
   Status FlushInternal(const RowSetsInCompaction& input,
                        const std::shared_ptr<MemRowSet>& old_ms);
 
-  BloomFilterSizing bloom_sizing() const;
-
   // Convert the specified read client schema (without IDs) to a server schema (with IDs)
   // This method is used by NewRowIterator().
   Status GetMappedReadProjection(const Schema& projection,


Mime
View raw message