HBASE-22529 Add sanity check for in-memory compaction policy
Signed-off-by: Toshihiro Suzuki <brfrn169@gmail.com>
This commit is contained in:
parent
e87db35d1a
commit
40e1c9e310
|
@ -188,6 +188,13 @@ public final class TableDescriptorChecker {
|
||||||
" must be greater than zero.";
|
" must be greater than zero.";
|
||||||
warnOrThrowExceptionForFailure(logWarn, message, null);
|
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);
|
hcd.setScope(0);
|
||||||
checkTableIsLegal(htd);
|
checkTableIsLegal(htd);
|
||||||
|
|
||||||
|
hcd.setValue(ColumnFamilyDescriptorBuilder.IN_MEMORY_COMPACTION, "INVALID");
|
||||||
|
checkTableIsIllegal(htd);
|
||||||
|
hcd.setValue(ColumnFamilyDescriptorBuilder.IN_MEMORY_COMPACTION, "NONE");
|
||||||
|
checkTableIsLegal(htd);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
hcd.setDFSReplication((short) -1);
|
hcd.setDFSReplication((short) -1);
|
||||||
fail("Illegal value for setDFSReplication did not throw");
|
fail("Illegal value for setDFSReplication did not throw");
|
||||||
|
|
Loading…
Reference in New Issue