You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by hu...@apache.org on 2021/11/12 03:16:14 UTC

[hbase] branch revert-3843-HBASE-26450 created (now 8828f75)

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

huangzhuoyue pushed a change to branch revert-3843-HBASE-26450
in repository https://gitbox.apache.org/repos/asf/hbase.git.


      at 8828f75  Revert "HBASE-26450 Server configuration will overwrite HStore configuration … (#3843)"

This branch includes the following new commits:

     new 8828f75  Revert "HBASE-26450 Server configuration will overwrite HStore configuration … (#3843)"

The 1 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.


[hbase] 01/01: Revert "HBASE-26450 Server configuration will overwrite HStore configuration … (#3843)"

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

huangzhuoyue pushed a commit to branch revert-3843-HBASE-26450
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 8828f759abecc12b0a4a97d14e0521fdda9372d3
Author: GeorryHuang <nz...@googlemail.com>
AuthorDate: Fri Nov 12 11:14:17 2021 +0800

    Revert "HBASE-26450 Server configuration will overwrite HStore configuration … (#3843)"
    
    This reverts commit 628b8b7f650dc2053c2ddf8559d945817c25b894.
---
 .../apache/hadoop/hbase/regionserver/HStore.java   |  9 +++++----
 .../hadoop/hbase/regionserver/TestHStore.java      | 23 ----------------------
 2 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
index 32693ab..47cb795 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
@@ -59,6 +59,7 @@ import org.apache.hadoop.fs.permission.FsAction;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
 import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.CompoundConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.MemoryCompactionPolicy;
 import org.apache.hadoop.hbase.TableName;
@@ -66,6 +67,7 @@ import org.apache.hadoop.hbase.backup.FailedArchiveException;
 import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
 import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.client.TableDescriptor;
 import org.apache.hadoop.hbase.conf.ConfigurationManager;
 import org.apache.hadoop.hbase.conf.PropagatingConfigurationObserver;
 import org.apache.hadoop.hbase.coprocessor.ReadOnlyConfiguration;
@@ -2520,11 +2522,10 @@ public class HStore implements Store, HeapSize, StoreConfigInformation,
 
   @Override
   public void onConfigurationChange(Configuration conf) {
-    Configuration storeConf = StoreUtils.createStoreConfiguration(conf, region.getTableDescriptor(),
+    this.conf = StoreUtils.createStoreConfiguration(conf, region.getTableDescriptor(),
       getColumnFamilyDescriptor());
-    this.conf = storeConf;
-    this.storeEngine.compactionPolicy.setConf(storeConf);
-    this.offPeakHours = OffPeakHours.getInstance(storeConf);
+    this.storeEngine.compactionPolicy.setConf(conf);
+    this.offPeakHours = OffPeakHours.getInstance(conf);
   }
 
   /**
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java
index 7491068..6618742 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java
@@ -2141,29 +2141,6 @@ public class TestHStore {
     }
   }
 
-  @Test 
-  public void testOnConfigurationChange() throws IOException {
-    final int COMMON_MAX_FILES_TO_COMPACT = 10;
-    final int NEW_COMMON_MAX_FILES_TO_COMPACT = 8;
-    final int STORE_MAX_FILES_TO_COMPACT = 6;
-
-    //Build a table that its maxFileToCompact different from common configuration.
-    Configuration conf = HBaseConfiguration.create();
-    conf.setInt(CompactionConfiguration.HBASE_HSTORE_COMPACTION_MAX_KEY,
-      COMMON_MAX_FILES_TO_COMPACT);
-    ColumnFamilyDescriptor hcd = ColumnFamilyDescriptorBuilder.newBuilder(family)
-      .setConfiguration(CompactionConfiguration.HBASE_HSTORE_COMPACTION_MAX_KEY,
-        String.valueOf(STORE_MAX_FILES_TO_COMPACT)).build();
-    init(this.name.getMethodName(), conf, hcd);
-
-    //After updating common configuration, the conf in HStore itself must not be changed.
-    conf.setInt(CompactionConfiguration.HBASE_HSTORE_COMPACTION_MAX_KEY,
-      NEW_COMMON_MAX_FILES_TO_COMPACT);
-    this.store.onConfigurationChange(conf);
-    assertEquals(STORE_MAX_FILES_TO_COMPACT,
-      store.getStoreEngine().getCompactionPolicy().getConf().getMaxFilesToCompact());
-  }
-
   private HStoreFile mockStoreFileWithLength(long length) {
     HStoreFile sf = mock(HStoreFile.class);
     StoreFileReader sfr = mock(StoreFileReader.class);