gourabtaparia commented on code in PR #5820:
URL: https://github.com/apache/hbase/pull/5820#discussion_r1562328719
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreUtils.java:
##########
@@ -204,4 +204,28 @@ public static long getStorefileFieldSize(HStoreFile file,
ToLongFunction<StoreFi
}
return f.applyAsLong(reader);
}
+
+ /**
+ * Helper for figuring out what block size to use when writing. If the user
set a block size in
+ * schema, we use that. We determine the user has set a size if the size is
not the default size.
+ * Otherwise, we check if the user has set a block size in the configuration
that is not the
+ * default size. This is annoyingly complicated but required for
compatibility.
+ * <ul>
+ * <li>If the schema specifies a non default block size, use it.</li>
+ * <li>Otherwise, if the configuration specifies a non default block size,
use it.</li>
+ * <li>Otherwise, use the default block size.</li>
+ * </ul>
+ * The default is defined by HConstants.DEFAULT_BLOCKSIZE.
+ * @param conf The configuration, can be null. Use the store
configuration wherever
+ * possible so we properly support site configuration
overrides.
+ * @param schemaBlockSize The block size as specified in the column family
schema.
+ * @return The block size to use.
+ */
+ public static int getBlockSize(Configuration conf, int schemaBlockSize) {
Review Comment:
A clarification :
Though you have already called out the "non default block size" - One
Question - Right now there can be a case where the site configuration has non
default block size say 1MB(to be applied to all the table/CF), and for some
CF/table one wants explicitly 64 KB - so setting 64KB explicitly again in the
schema won't be picked, as that is the default.
For such cases, one will need to explicitly set the schemaBlocksize(either
BLOCKSIZE or configuration override in schema) for all required tables to 1MB.
--
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]