Skip to content

Commit 7725f5f

Browse files
author
Stephen Wu
committed
Address comments from stack
- rename HStoreContext to StoreContext - rewrite the getChecksumType - fix one more style issues
1 parent baeef9c commit 7725f5f

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation,
234234
private AtomicLong compactedCellsSize = new AtomicLong();
235235
private AtomicLong majorCompactedCellsSize = new AtomicLong();
236236

237-
private HStoreContext storeContext;
237+
private StoreContext storeContext;
238238

239239
/**
240240
* Constructor
@@ -331,8 +331,8 @@ protected HStore(final HRegion region, final ColumnFamilyDescriptor family,
331331
cacheOnWriteLogged = false;
332332
}
333333

334-
private HStoreContext initializeStoreContext(ColumnFamilyDescriptor family) throws IOException {
335-
return new HStoreContext.Builder()
334+
private StoreContext initializeStoreContext(ColumnFamilyDescriptor family) throws IOException {
335+
return new StoreContext.Builder()
336336
.withBloomType(family.getBloomFilterType())
337337
.withCacheConfig(createCacheConf(family))
338338
.withCellComparator(region.getCellComparator())

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStoreContext.java renamed to hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreContext.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* need of passing around the complete store.
3636
*/
3737
@InterfaceAudience.Private
38-
public class HStoreContext implements HeapSize {
38+
public final class StoreContext implements HeapSize {
3939
public static final long FIXED_OVERHEAD = ClassSize.estimateBase(HStore.class, false);
4040

4141
private final HFileContext defaultFileContext;
@@ -49,7 +49,7 @@ public class HStoreContext implements HeapSize {
4949
private final Path familyStoreDirectoryPath;
5050
private final RegionCoprocessorHost coprocessorHost;
5151

52-
private HStoreContext(Builder builder) {
52+
private StoreContext(Builder builder) {
5353
this.defaultFileContext = builder.defaultFileContext;
5454
this.cacheConf = builder.cacheConf;
5555
this.regionFileSystem = builder.regionFileSystem;
@@ -174,8 +174,8 @@ public Builder withRegionCoprocessorHost(RegionCoprocessorHost coprocessorHost)
174174
return this;
175175
}
176176

177-
public HStoreContext build() {
178-
return new HStoreContext(this);
177+
public StoreContext build() {
178+
return new StoreContext(this);
179179
}
180180
}
181181

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,8 @@ static Optional<byte[]> getSplitPoint(Collection<HStoreFile> storefiles,
147147
* @return The checksum algorithm that is set in the configuration
148148
*/
149149
public static ChecksumType getChecksumType(Configuration conf) {
150-
String checksumName = conf.get(HConstants.CHECKSUM_TYPE_NAME);
151-
return checksumName == null ? ChecksumType.getDefaultChecksumType() :
152-
ChecksumType.nameToType(checksumName);
150+
return ChecksumType.nameToType(
151+
conf.get(HConstants.CHECKSUM_TYPE_NAME, ChecksumType.getDefaultChecksumType().getName()));
153152
}
154153

155154
/**

hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHeapSize.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
import org.apache.hadoop.hbase.regionserver.DefaultMemStore;
5959
import org.apache.hadoop.hbase.regionserver.HRegion;
6060
import org.apache.hadoop.hbase.regionserver.HStore;
61-
import org.apache.hadoop.hbase.regionserver.HStoreContext;
61+
import org.apache.hadoop.hbase.regionserver.StoreContext;
6262
import org.apache.hadoop.hbase.regionserver.ImmutableSegment;
6363
import org.apache.hadoop.hbase.regionserver.MemStoreCompactor;
6464
import org.apache.hadoop.hbase.regionserver.MutableSegment;
@@ -607,7 +607,7 @@ public void testObjectSize() throws IOException {
607607
@Test
608608
public void testAutoCalcFixedOverHead() {
609609
Class[] classList = new Class[] { HFileContext.class, HRegion.class, BlockCacheKey.class,
610-
HFileBlock.class, HStore.class, LruBlockCache.class, HStoreContext.class };
610+
HFileBlock.class, HStore.class, LruBlockCache.class, StoreContext.class };
611611
for (Class cl : classList) {
612612
// do estimate in advance to ensure class is loaded
613613
ClassSize.estimateBase(cl, false);

0 commit comments

Comments
 (0)