HBASE-22529 Add sanity check for in-memory compaction policy

Signed-off-by: Toshihiro Suzuki <brfrn169@gmail.com>
This commit is contained in:
Junegunn Choi 2019-12-04 13:55:53 +09:00 committed by Toshihiro Suzuki
parent 570cc3c4a4
commit 5e34a59d90
2 changed files with 12 additions and 0 deletions

View File

@ -188,6 +188,13 @@ public final class TableDescriptorChecker {
" must be greater than zero.";
warnOrThrowExceptionForFailure(logWarn, message, null);
}
// check in-memory compaction
try {
hcd.getInMemoryCompaction();
} catch (IllegalArgumentException e) {
warnOrThrowExceptionForFailure(logWarn, e.getMessage(), e);
}
}
}

View File

@ -151,6 +151,11 @@ public class TestIllegalTableDescriptor {
hcd.setScope(0);
checkTableIsLegal(htd);
hcd.setValue(ColumnFamilyDescriptorBuilder.IN_MEMORY_COMPACTION, "INVALID");
checkTableIsIllegal(htd);
hcd.setValue(ColumnFamilyDescriptorBuilder.IN_MEMORY_COMPACTION, "NONE");
checkTableIsLegal(htd);
try {
hcd.setDFSReplication((short) -1);
fail("Illegal value for setDFSReplication did not throw");