wchevreuil commented on code in PR #5809:
URL: https://github.com/apache/hbase/pull/5809#discussion_r1560694700
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/util/TableDescriptorChecker.java:
##########
@@ -210,6 +215,37 @@ private static void checkReplicationScope(final
Configuration conf, final TableD
});
}
+ private static void checkDateTieredCompactionForTimeRangeDataTiering(final
Configuration conf,
+ final TableDescriptor td) throws IOException {
+ // Table level configurations
+ checkDateTieredCompactionForTimeRangeDataTiering(conf);
+ for (ColumnFamilyDescriptor cfd : td.getColumnFamilies()) {
+ // Column family level configurations
+ Configuration cfdConf =
+ new
CompoundConfiguration().add(conf).addStringMap(cfd.getConfiguration());
+ checkDateTieredCompactionForTimeRangeDataTiering(cfdConf);
+ }
+ }
+
+ private static void checkDateTieredCompactionForTimeRangeDataTiering(final
Configuration conf)
+ throws IOException {
+ final String DATE_TIERED_STORE_ENGINE =
+ "org.apache.hadoop.hbase.regionserver.DateTieredStoreEngine";
+ final String errorMessage =
+ "Time Range Data Tiering should be enabled with Date Tiered Compaction.";
+
+ warnOrThrowExceptionForFailure(false, () -> {
+
+ // Determine whether Date Tiered Compaction will be enabled when Time
Range Data Tiering is
+ // enabled after the configuration change.
+ if
(DataTieringType.TIME_RANGE.name().equals(conf.get(DataTieringManager.DATATIERING_KEY)))
{
+ if
(!DATE_TIERED_STORE_ENGINE.equals(conf.get(StoreEngine.STORE_ENGINE_CLASS_KEY)))
{
+ throw new IOException(errorMessage);
+ }
Review Comment:
Nit: We should throw IllegalArgumentException, since this is rather a config
error.
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/util/TableDescriptorChecker.java:
##########
@@ -210,6 +215,37 @@ private static void checkReplicationScope(final
Configuration conf, final TableD
});
}
+ private static void checkDateTieredCompactionForTimeRangeDataTiering(final
Configuration conf,
+ final TableDescriptor td) throws IOException {
+ // Table level configurations
+ checkDateTieredCompactionForTimeRangeDataTiering(conf);
+ for (ColumnFamilyDescriptor cfd : td.getColumnFamilies()) {
+ // Column family level configurations
+ Configuration cfdConf =
+ new
CompoundConfiguration().add(conf).addStringMap(cfd.getConfiguration());
+ checkDateTieredCompactionForTimeRangeDataTiering(cfdConf);
+ }
+ }
+
+ private static void checkDateTieredCompactionForTimeRangeDataTiering(final
Configuration conf)
+ throws IOException {
+ final String DATE_TIERED_STORE_ENGINE =
Review Comment:
nit: make this a public constant somewhere in the date tiered compaction
code, then import static here.
--
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]