diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/TableDescriptorChecker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/TableDescriptorChecker.java index a2ee1ff2559..3852a417751 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/TableDescriptorChecker.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/TableDescriptorChecker.java @@ -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); + } } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java index e7bc8b3d4b2..e55f3ff6bcc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestIllegalTableDescriptor.java @@ -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");