bbeaudreault commented on code in PR #5654:
URL: https://github.com/apache/hbase/pull/5654#discussion_r1467095859
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java:
##########
@@ -2047,6 +2049,16 @@ public Configuration getReadOnlyConfiguration() {
return new ReadOnlyConfiguration(this.conf);
}
+ @Override
+ public int getMinBlockSizeBytes() {
+ if (minBlockSizeBytes > 0) {
+ return minBlockSizeBytes;
+ }
+ minBlockSizeBytes =
Arrays.stream(this.htableDescriptor.getColumnFamilies())
+
.mapToInt(ColumnFamilyDescriptor::getBlocksize).min().orElse(HConstants.DEFAULT_BLOCKSIZE);
+ return minBlockSizeBytes;
+ }
Review Comment:
I might recommend simply calculating this in HRegion construction. It's
basically free to do there, and in terms of memory usage a 0 value takes the
same as any other.
Otherwise the variable needs to be volatile and you need to handle
synchronization
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]