HBASE-22529 Add sanity check for in-memory compaction policy
Signed-off-by: Toshihiro Suzuki <brfrn169@gmail.com>
This commit is contained in:
parent
570cc3c4a4
commit
5e34a59d90
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue