From 2599bd8eab1f05f404e89c75faa469c3c59d19f6 Mon Sep 17 00:00:00 2001 From: meiyi Date: Wed, 22 Sep 2021 11:08:51 +0800 Subject: [PATCH] Revert "Provide getConfiguration method for Region and Store interface (#3671)" This reverts commit 4f6e0cf601316e4bc96f41de0b8f4ae2cf2a9c90. --- .../hadoop/hbase/coprocessor/ReadOnlyConfiguration.java | 4 ++-- .../java/org/apache/hadoop/hbase/regionserver/HRegion.java | 6 ------ .../java/org/apache/hadoop/hbase/regionserver/HStore.java | 6 ------ .../java/org/apache/hadoop/hbase/regionserver/Region.java | 7 ------- .../java/org/apache/hadoop/hbase/regionserver/Store.java | 7 ------- 5 files changed, 2 insertions(+), 28 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ReadOnlyConfiguration.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ReadOnlyConfiguration.java index d7705ef25b7..b805c50e153 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ReadOnlyConfiguration.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/ReadOnlyConfiguration.java @@ -44,10 +44,10 @@ import org.apache.yetus.audience.InterfaceAudience; * Wraps a Configuration to make it read-only. */ @InterfaceAudience.Private -public class ReadOnlyConfiguration extends Configuration { +class ReadOnlyConfiguration extends Configuration { private final Configuration conf; - public ReadOnlyConfiguration(final Configuration conf) { + ReadOnlyConfiguration(final Configuration conf) { this.conf = conf; } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 8afadc797dc..22e3901e224 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -119,7 +119,6 @@ import org.apache.hadoop.hbase.client.TableDescriptorBuilder; import org.apache.hadoop.hbase.conf.ConfigurationManager; import org.apache.hadoop.hbase.conf.PropagatingConfigurationObserver; import org.apache.hadoop.hbase.coprocessor.CoprocessorHost; -import org.apache.hadoop.hbase.coprocessor.ReadOnlyConfiguration; import org.apache.hadoop.hbase.errorhandling.ForeignExceptionSnare; import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; import org.apache.hadoop.hbase.exceptions.TimeoutIOException; @@ -1963,11 +1962,6 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi } } - @Override - public Configuration getReadOnlyConfiguration() { - return new ReadOnlyConfiguration(this.conf); - } - private ThreadPoolExecutor getStoreOpenAndCloseThreadPool( final String threadNamePrefix) { int numStores = Math.max(1, this.htableDescriptor.getColumnFamilyCount()); 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 44665047a06..c4e34beca40 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 @@ -69,7 +69,6 @@ import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.conf.ConfigurationManager; import org.apache.hadoop.hbase.conf.PropagatingConfigurationObserver; -import org.apache.hadoop.hbase.coprocessor.ReadOnlyConfiguration; import org.apache.hadoop.hbase.io.HeapSize; import org.apache.hadoop.hbase.io.compress.Compression; import org.apache.hadoop.hbase.io.crypto.Encryption; @@ -2802,11 +2801,6 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, return mixedRowReadsCount.sum(); } - @Override - public Configuration getReadOnlyConfiguration() { - return new ReadOnlyConfiguration(this.conf); - } - void updateMetricsStore(boolean memstoreRead) { if (memstoreRead) { memstoreOnlyRowReadsCount.increment(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java index 2b8502b4fd0..5cca201dcfe 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java @@ -22,7 +22,6 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.CompareOperator; @@ -598,10 +597,4 @@ public interface Region extends ConfigurationObserver { * max wait time period. */ boolean waitForFlushes(long timeout); - - /** - * @return a read only configuration of this region; throws {@link UnsupportedOperationException} - * if you try to set a configuration. - */ - Configuration getReadOnlyConfiguration(); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java index fd1acd9a136..6ec9c51930c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java @@ -22,7 +22,6 @@ import java.util.Collection; import java.util.OptionalDouble; import java.util.OptionalLong; -import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.HBaseInterfaceAudience; @@ -293,10 +292,4 @@ public interface Store { * @return the number of read requests from the files under this store. */ long getMixedRowReadsCount(); - - /** - * @return a read only configuration of this store; throws {@link UnsupportedOperationException} - * if you try to set a configuration. - */ - Configuration getReadOnlyConfiguration(); }