Skip to content

Commit 058d3a4

Browse files
committed
Revert "HBASE-26450 Server configuration will overwrite HStore configuration … (#3843)"
This reverts commit 628b8b7.
1 parent 628b8b7 commit 058d3a4

2 files changed

Lines changed: 5 additions & 27 deletions

File tree

  • hbase-server/src

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@
5959
import org.apache.hadoop.hbase.Cell;
6060
import org.apache.hadoop.hbase.CellComparator;
6161
import org.apache.hadoop.hbase.CellUtil;
62+
import org.apache.hadoop.hbase.CompoundConfiguration;
6263
import org.apache.hadoop.hbase.HConstants;
6364
import org.apache.hadoop.hbase.MemoryCompactionPolicy;
6465
import org.apache.hadoop.hbase.TableName;
6566
import org.apache.hadoop.hbase.backup.FailedArchiveException;
6667
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
6768
import org.apache.hadoop.hbase.client.RegionInfo;
6869
import org.apache.hadoop.hbase.client.Scan;
70+
import org.apache.hadoop.hbase.client.TableDescriptor;
6971
import org.apache.hadoop.hbase.conf.ConfigurationManager;
7072
import org.apache.hadoop.hbase.conf.PropagatingConfigurationObserver;
7173
import org.apache.hadoop.hbase.coprocessor.ReadOnlyConfiguration;
@@ -2520,11 +2522,10 @@ protected OffPeakHours getOffPeakHours() {
25202522

25212523
@Override
25222524
public void onConfigurationChange(Configuration conf) {
2523-
Configuration storeConf = StoreUtils.createStoreConfiguration(conf, region.getTableDescriptor(),
2525+
this.conf = StoreUtils.createStoreConfiguration(conf, region.getTableDescriptor(),
25242526
getColumnFamilyDescriptor());
2525-
this.conf = storeConf;
2526-
this.storeEngine.compactionPolicy.setConf(storeConf);
2527-
this.offPeakHours = OffPeakHours.getInstance(storeConf);
2527+
this.storeEngine.compactionPolicy.setConf(conf);
2528+
this.offPeakHours = OffPeakHours.getInstance(conf);
25282529
}
25292530

25302531
/**

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,29 +2141,6 @@ public void testFlattenSnapshotWriteCompactingMemeStoreConcurrently() throws Exc
21412141
}
21422142
}
21432143

2144-
@Test
2145-
public void testOnConfigurationChange() throws IOException {
2146-
final int COMMON_MAX_FILES_TO_COMPACT = 10;
2147-
final int NEW_COMMON_MAX_FILES_TO_COMPACT = 8;
2148-
final int STORE_MAX_FILES_TO_COMPACT = 6;
2149-
2150-
//Build a table that its maxFileToCompact different from common configuration.
2151-
Configuration conf = HBaseConfiguration.create();
2152-
conf.setInt(CompactionConfiguration.HBASE_HSTORE_COMPACTION_MAX_KEY,
2153-
COMMON_MAX_FILES_TO_COMPACT);
2154-
ColumnFamilyDescriptor hcd = ColumnFamilyDescriptorBuilder.newBuilder(family)
2155-
.setConfiguration(CompactionConfiguration.HBASE_HSTORE_COMPACTION_MAX_KEY,
2156-
String.valueOf(STORE_MAX_FILES_TO_COMPACT)).build();
2157-
init(this.name.getMethodName(), conf, hcd);
2158-
2159-
//After updating common configuration, the conf in HStore itself must not be changed.
2160-
conf.setInt(CompactionConfiguration.HBASE_HSTORE_COMPACTION_MAX_KEY,
2161-
NEW_COMMON_MAX_FILES_TO_COMPACT);
2162-
this.store.onConfigurationChange(conf);
2163-
assertEquals(STORE_MAX_FILES_TO_COMPACT,
2164-
store.getStoreEngine().getCompactionPolicy().getConf().getMaxFilesToCompact());
2165-
}
2166-
21672144
private HStoreFile mockStoreFileWithLength(long length) {
21682145
HStoreFile sf = mock(HStoreFile.class);
21692146
StoreFileReader sfr = mock(StoreFileReader.class);

0 commit comments

Comments
 (0)