You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by la...@apache.org on 2022/07/14 02:54:35 UTC

[kudu] branch master updated (9c547a6a4 -> 5664e280a)

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

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


    from 9c547a6a4 KUDU-2671 Fix typo in master-test.cc
     new f1522c716 KUDU-2671 updated comments in C++ client API
     new 5664e280a KUDU-2671 range-specific hash schemas enabled by default

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:
 .../org/apache/kudu/client/TestAlterTable.java     |  6 -----
 .../org/apache/kudu/client/TestKuduClient.java     |  3 ---
 .../java/org/apache/kudu/client/TestKuduTable.java | 30 ----------------------
 .../apache/kudu/client/TestPartitionPruner.java    |  3 ---
 src/kudu/client/client-test.cc                     |  1 -
 src/kudu/client/client.h                           | 11 +++-----
 src/kudu/client/flex_partitioning_client-test.cc   |  7 +----
 src/kudu/client/scan_token-test.cc                 |  3 ---
 .../integration-tests/table_locations-itest.cc     |  5 ----
 src/kudu/master/catalog_manager.cc                 |  4 +--
 src/kudu/master/master-test.cc                     |  9 -------
 11 files changed, 7 insertions(+), 75 deletions(-)


[kudu] 02/02: KUDU-2671 range-specific hash schemas enabled by default

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

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

commit 5664e280a7cdbce055227da2e556f937952dd89f
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Tue Jul 12 19:24:20 2022 -0700

    KUDU-2671 range-specific hash schemas enabled by default
    
    This patch sets the default value for --enable_per_range_hash_schemas
    to be 'true' by default, enabling the support for range-specific hash
    schemas for the server side right out of the box.
    
    Change-Id: Iae6220bfec4089819b292d4f6879c4421e05e444
    Reviewed-on: http://gerrit.cloudera.org:8080/18727
    Tested-by: Kudu Jenkins
    Reviewed-by: Mahesh Reddy <mr...@cloudera.com>
    Reviewed-by: Yingchun Lai <ac...@gmail.com>
---
 .../org/apache/kudu/client/TestAlterTable.java     |  6 -----
 .../org/apache/kudu/client/TestKuduClient.java     |  3 ---
 .../java/org/apache/kudu/client/TestKuduTable.java | 30 ----------------------
 .../apache/kudu/client/TestPartitionPruner.java    |  3 ---
 src/kudu/client/client-test.cc                     |  1 -
 src/kudu/client/flex_partitioning_client-test.cc   |  7 +----
 src/kudu/client/scan_token-test.cc                 |  3 ---
 .../integration-tests/table_locations-itest.cc     |  5 ----
 src/kudu/master/catalog_manager.cc                 |  4 +--
 src/kudu/master/master-test.cc                     |  9 -------
 10 files changed, 3 insertions(+), 68 deletions(-)

diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestAlterTable.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestAlterTable.java
index 35ee0a8cb..2c4908020 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestAlterTable.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestAlterTable.java
@@ -517,9 +517,6 @@ public class TestAlterTable {
    * per range.
    */
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testAlterAddRangeWithCustomHashSchema() throws Exception {
     ArrayList<ColumnSchema> columns = new ArrayList<>(2);
     columns.add(new ColumnSchema.ColumnSchemaBuilder("c0", Type.INT32)
@@ -608,9 +605,6 @@ public class TestAlterTable {
    * ranges between partition with the table-wide and custom hash schemas.
    */
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testAlterAddRangeWithCustomHashSchemaNonCoveredRange() throws Exception {
     ArrayList<ColumnSchema> columns = new ArrayList<>(2);
     columns.add(new ColumnSchema.ColumnSchemaBuilder("c0", Type.INT32)
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java
index 00e5d8f40..82670b812 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java
@@ -746,9 +746,6 @@ public class TestKuduClient {
    * with custom hash schema.
    */
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testRangeWithCustomHashSchema() throws Exception {
     List<ColumnSchema> cols = new ArrayList<>();
     cols.add(new ColumnSchema.ColumnSchemaBuilder("c0", Type.INT64).key(true).build());
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
index 0d4a08028..80101d806 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
@@ -495,9 +495,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testCreateTablePartitionWithEmptyCustomHashSchema() throws Exception {
     PartialRow lower = basicSchema.newPartialRow();
     lower.addInt(0, -100);
@@ -549,9 +546,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testCreateTablePartitionWithCustomHashSchema() throws Exception {
     PartialRow lower = basicSchema.newPartialRow();
     lower.addInt(0, -100);
@@ -617,9 +611,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testRangePartitionWithCustomHashSchemaBasic() throws Exception {
     final int valLower = 10;
     final int valUpper = 20;
@@ -704,9 +695,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testCreateTableCustomHashSchemasTwoRanges() throws Exception {
     CreateTableOptions builder = getBasicCreateTableOptions();
 
@@ -901,9 +889,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testCreateTableCustomHashSchemasTwoMixedRanges() throws Exception {
     CreateTableOptions builder = getBasicCreateTableOptions();
 
@@ -1090,9 +1075,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testCreateTableCustomHashSchemaDifferentDimensions() throws Exception {
     // Have the table-wide hash schema different from custom hash schema per
     // various ranges: it should not be possible to create a table.
@@ -1171,9 +1153,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testGetHashSchemaForRange() throws Exception {
     final int valLower = 100;
     final int valUpper = 200;
@@ -1260,9 +1239,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testGetHashSchemaForRangeUnbounded() throws Exception {
     // The test table is created with the following ranges:
     //   (-inf, -100) [-100, 0) [0, 100), [100, +inf)
@@ -1684,9 +1660,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testAlterTableAddRangePartitionCustomHashSchemaOverlapped() throws Exception {
     final List<ColumnSchema> columns = ImmutableList.of(
         new ColumnSchema.ColumnSchemaBuilder("key", Type.INT32).key(true).build(),
@@ -1768,9 +1741,6 @@ public class TestKuduTable {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testAlterTableAddRangePartitionCustomHashSchema() throws Exception {
     final List<ColumnSchema> columns = ImmutableList.of(
         new ColumnSchema.ColumnSchemaBuilder("key", Type.INT32).key(true).build(),
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestPartitionPruner.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestPartitionPruner.java
index 60e576a4a..32c68ee7c 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestPartitionPruner.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestPartitionPruner.java
@@ -879,9 +879,6 @@ public class TestPartitionPruner {
   }
 
   @Test(timeout = 100000)
-  @KuduTestHarness.MasterServerConfig(flags = {
-      "--enable_per_range_hash_schemas=true",
-  })
   public void testPruningWithCustomHashSchemas() throws Exception {
     // CREATE TABLE timeseries
     //   (host STRING, metric STRING, timestamp UNIXTIME_MICROS, value DOUBLE)
diff --git a/src/kudu/client/client-test.cc b/src/kudu/client/client-test.cc
index 97a38618c..c86288e13 100644
--- a/src/kudu/client/client-test.cc
+++ b/src/kudu/client/client-test.cc
@@ -139,7 +139,6 @@ DECLARE_bool(allow_unsafe_replication_factor);
 DECLARE_bool(catalog_manager_support_live_row_count);
 DECLARE_bool(catalog_manager_support_on_disk_size);
 DECLARE_bool(client_use_unix_domain_sockets);
-DECLARE_bool(enable_per_range_hash_schemas);
 DECLARE_bool(enable_txn_system_client_init);
 DECLARE_bool(fail_dns_resolution);
 DECLARE_bool(location_mapping_by_uuid);
diff --git a/src/kudu/client/flex_partitioning_client-test.cc b/src/kudu/client/flex_partitioning_client-test.cc
index 17ed4baa0..8a56050d1 100644
--- a/src/kudu/client/flex_partitioning_client-test.cc
+++ b/src/kudu/client/flex_partitioning_client-test.cc
@@ -97,9 +97,6 @@ class FlexPartitioningTest : public KuduTest {
     // Reduce the TS<->Master heartbeat interval to speed up testing.
     FLAGS_heartbeat_interval_ms = 10;
 
-    // Explicitly enable support for custom hash schemas per range partition.
-    FLAGS_enable_per_range_hash_schemas = true;
-
     // Start minicluster and wait for tablet servers to connect to master.
     cluster_.reset(new InternalMiniCluster(env_, InternalMiniClusterOptions()));
     ASSERT_OK(cluster_->Start());
@@ -1667,10 +1664,8 @@ TEST_F(FlexPartitioningAlterTableTest, UnsupportedRangeSpecificHashSchema) {
 }
 
 // Make sure adding and dropping ranges with the table-wide hash schema works
-// as expected when --enable_per_range_hash_schemas=true.
+// as expected.
 TEST_F(FlexPartitioningAlterTableTest, AddDropTableWideHashSchemaPartitions) {
-  FLAGS_enable_per_range_hash_schemas = true;
-
   constexpr const char* const kTableName =
       "AddDropTableWideHashSchemaPartitions";
 
diff --git a/src/kudu/client/scan_token-test.cc b/src/kudu/client/scan_token-test.cc
index d0a6f5377..4ac87d8ce 100644
--- a/src/kudu/client/scan_token-test.cc
+++ b/src/kudu/client/scan_token-test.cc
@@ -62,7 +62,6 @@
 #include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 
-DECLARE_bool(enable_per_range_hash_schemas);
 DECLARE_bool(tserver_enforce_access_control);
 
 METRIC_DECLARE_histogram(handler_latency_kudu_master_MasterService_GetTableSchema);
@@ -583,7 +582,6 @@ TEST_F(ScanTokenTest, TestScanTokensWithNonCoveringRange) {
 }
 
 TEST_F(ScanTokenTest, ScanTokensWithCustomHashSchemasPerRange) {
-  FLAGS_enable_per_range_hash_schemas = true;
   KuduSchema schema;
   // Create schema
   {
@@ -732,7 +730,6 @@ TEST_F(ScanTokenTest, ScanTokensWithCustomHashSchemasPerRange) {
 }
 
 TEST_F(ScanTokenTest, TestScanTokensWithCustomHashSchemasPerNonCoveringRange) {
-  FLAGS_enable_per_range_hash_schemas = true;
   KuduSchema schema;
   // Create schema
   {
diff --git a/src/kudu/integration-tests/table_locations-itest.cc b/src/kudu/integration-tests/table_locations-itest.cc
index 94356c8f2..4d6829d7a 100644
--- a/src/kudu/integration-tests/table_locations-itest.cc
+++ b/src/kudu/integration-tests/table_locations-itest.cc
@@ -94,7 +94,6 @@ DEFINE_int32(benchmark_runtime_secs, 5, "Number of seconds to run the benchmark"
 DEFINE_int32(benchmark_num_threads, 16, "Number of threads to run the benchmark");
 DEFINE_int32(benchmark_num_tablets, 60, "Number of tablets to create");
 
-DECLARE_bool(enable_per_range_hash_schemas);
 DECLARE_double(leader_failure_max_missed_heartbeat_periods);
 DECLARE_int32(follower_unavailable_considered_failed_sec);
 DECLARE_int32(heartbeat_interval_ms);
@@ -475,8 +474,6 @@ TEST_F(TableLocationsTest, RangeSpecificHashingSameDimensions) {
                 }, 3);
   KuduPartialRow row(&schema);
 
-  FLAGS_enable_per_range_hash_schemas = true; // enable for testing.
-
   // Use back-to-back and sparse range placement.
   vector<pair<KuduPartialRow, KuduPartialRow>> bounds(5, { row, row });
   ASSERT_OK(bounds[0].first.SetStringNoCopy(0, "a"));
@@ -558,8 +555,6 @@ TEST_F(TableLocationsTest, RangeSpecificHashingVaryingDimensions) {
   Schema schema({ ColumnSchema("key", STRING), ColumnSchema("val", STRING) }, 2);
   KuduPartialRow row(&schema);
 
-  FLAGS_enable_per_range_hash_schemas = true; // enable for testing.
-
   vector<pair<KuduPartialRow, KuduPartialRow>> bounds(2, { row, row });
   ASSERT_OK(bounds[0].first.SetStringNoCopy(0, "a"));
   ASSERT_OK(bounds[0].second.SetStringNoCopy(0, "b"));
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index 534405aa6..e52e4225b 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -353,8 +353,8 @@ DEFINE_uint32(table_locations_cache_capacity_mb, 0,
               "of 0 means table locations are not be cached");
 TAG_FLAG(table_locations_cache_capacity_mb, advanced);
 
-DEFINE_bool(enable_per_range_hash_schemas, false,
-            "Whether the ability to specify different hash schemas per range is enabled");
+DEFINE_bool(enable_per_range_hash_schemas, true,
+            "Whether to support range-specific hash schemas for tables");
 TAG_FLAG(enable_per_range_hash_schemas, advanced);
 TAG_FLAG(enable_per_range_hash_schemas, runtime);
 
diff --git a/src/kudu/master/master-test.cc b/src/kudu/master/master-test.cc
index 5161eb349..d6bdda02c 100644
--- a/src/kudu/master/master-test.cc
+++ b/src/kudu/master/master-test.cc
@@ -122,7 +122,6 @@ using strings::Substitute;
 
 DECLARE_bool(catalog_manager_check_ts_count_for_create_table);
 DECLARE_bool(enable_metadata_cleanup_for_deleted_tables_and_tablets);
-DECLARE_bool(enable_per_range_hash_schemas);
 DECLARE_bool(master_client_location_assignment_enabled);
 DECLARE_bool(master_support_authz_tokens);
 DECLARE_bool(mock_table_metrics_for_testing);
@@ -934,7 +933,6 @@ TEST_P(AlterTableWithRangeSpecificHashSchema, TestAlterTableWithDifferentHashDim
   constexpr const char* const kTableName = "testtb";
   const Schema kTableSchema({ColumnSchema("key", INT32),
                              ColumnSchema("val", INT32)}, 2);
-  FLAGS_enable_per_range_hash_schemas = true; // enable for testing.
   FLAGS_default_num_replicas = 1;
 
   // Create a table with one partition
@@ -1030,7 +1028,6 @@ TEST_F(MasterTest, AlterTableAddAndDropRangeWithSpecificHashSchema) {
   constexpr const char* const kCol1 = "c_int64";
   const Schema kTableSchema({ColumnSchema(kCol0, INT32),
                              ColumnSchema(kCol1, INT64)}, 2);
-  FLAGS_enable_per_range_hash_schemas = true;
   FLAGS_default_num_replicas = 1;
 
   // Create a table with one range partition based on the table-wide hash schema.
@@ -1280,7 +1277,6 @@ TEST_F(MasterTest, AlterTableAddDropRangeWithTableWideHashSchema) {
   const Schema kTableSchema({ColumnSchema(kCol0, INT32),
                              ColumnSchema(kCol1, INT64),
                              ColumnSchema(kCol2, STRING)}, 2);
-  FLAGS_enable_per_range_hash_schemas = true;
   FLAGS_default_num_replicas = 1;
 
   // Create a table with one range partition based on the table-wide hash schema.
@@ -1471,7 +1467,6 @@ TEST_F(MasterTest, TestCreateTableCheckRangeInvariants) {
   // on split rows.
   {
     google::FlagSaver flag_saver;
-    FLAGS_enable_per_range_hash_schemas = true;
     KuduPartialRow split1(&kTableSchema);
     ASSERT_OK(split1.SetInt32("key", 1));
     KuduPartialRow a_lower(&kTableSchema);
@@ -1495,7 +1490,6 @@ TEST_F(MasterTest, TestCreateTableCheckRangeInvariants) {
   // CreateTableRequestPB::partition_schema::custom_hash_schema_ranges fields.
   {
     google::FlagSaver flag_saver;
-    FLAGS_enable_per_range_hash_schemas = true;
     KuduPartialRow a_lower(&kTableSchema);
     KuduPartialRow a_upper(&kTableSchema);
     ASSERT_OK(a_lower.SetInt32("key", 0));
@@ -1744,9 +1738,6 @@ TEST_F(MasterTest, NonPrimaryKeyColumnsForPerRangeCustomHashSchema) {
   const Schema kTableSchema(
       { ColumnSchema("key", INT32), ColumnSchema("int32_val", INT32) }, 1);
 
-  // Explicitly enable support for per-range custom hash bucket schemas.
-  FLAGS_enable_per_range_hash_schemas = true;
-
   // For simplicity, a single tablet replica is enough.
   FLAGS_default_num_replicas = 1;
 


[kudu] 01/02: KUDU-2671 updated comments in C++ client API

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

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

commit f1522c716f37e6a9db80de77a9783e0c48027a61
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Tue Jul 12 23:16:28 2022 -0700

    KUDU-2671 updated comments in C++ client API
    
    Since the functionality of range-specific hash schemas becomes ready
    to use, this patch removes the corresponding warning from the inline
    documentation in the C++ client API.  I also updated a few more comments
    around to use already established terminology and wording.
    
    This patch doesn't have any functional changes.
    
    Change-Id: Ibc0ac12354dc265e1a9a651e47be08b46338defd
    Reviewed-on: http://gerrit.cloudera.org:8080/18725
    Tested-by: Kudu Jenkins
    Reviewed-by: Mahesh Reddy <mr...@cloudera.com>
    Reviewed-by: Abhishek Chennaka <ac...@cloudera.com>
    Reviewed-by: Yingchun Lai <ac...@gmail.com>
---
 src/kudu/client/client.h | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/kudu/client/client.h b/src/kudu/client/client.h
index 5fabee2ac..f2d07e2d5 100644
--- a/src/kudu/client/client.h
+++ b/src/kudu/client/client.h
@@ -1315,7 +1315,7 @@ class KUDU_EXPORT KuduTableCreator {
                                         RangePartitionBound lower_bound_type = INCLUSIVE_BOUND,
                                         RangePartitionBound upper_bound_type = EXCLUSIVE_BOUND);
 
-  /// Add a range partition with a custom hash bucket schema.
+  /// Add a range partition with a custom hash schema.
   ///
   /// This method allows adding a range partition which has hash partitioning
   /// schema different from the table-wide one.
@@ -1326,11 +1326,9 @@ class KUDU_EXPORT KuduTableCreator {
   /// @li To create a range with the table-wide hash schema, use
   ///   @c KuduTableCreator::add_range_partition() instead.
   ///
-  /// @warning This functionality isn't fully implemented yet.
-  ///
   /// @param [in] partition
-  ///   Range partition with custom hash bucket schema.
-  ///   The KuduTableCreator object takes ownership of the parameter.
+  ///   Range partition with range-specific hash schema.
+  ///   The KuduTableCreator object takes ownership of the partition object.
   /// @return Reference to the modified table creator.
   KuduTableCreator& add_custom_range_partition(
       KuduRangePartition* partition);
@@ -1906,8 +1904,7 @@ class KUDU_EXPORT KuduTableAlterer {
   ///   defaults to 5 minutes.
   ///
   /// @param [in] partition
-  ///   The Kudu Range partition to be created. This Kudu Range partition can
-  ///   have a custom hash schema defined.
+  ///   The range partition to be created: it can have a custom hash schema.
   /// @return Raw pointer to this alterer object.
   KuduTableAlterer* AddRangePartition(
       KuduTableCreator::KuduRangePartition* partition);