HBASE-13776 Setting illegal versions for HColumnDescriptor does not throw IllegalArgumentException (Yuhao Bi)
This commit is contained in:
parent
cca687d718
commit
f35b6c6b77
|
@ -1466,6 +1466,15 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
|
|||
}
|
||||
// max versions already being checked
|
||||
|
||||
// HBASE-13776 Setting illegal versions for HColumnDescriptor
|
||||
// does not throw IllegalArgumentException
|
||||
// check minVersions <= maxVerions
|
||||
if (hcd.getMinVersions() > hcd.getMaxVersions()) {
|
||||
String message = "Min versions for column family " + hcd.getNameAsString()
|
||||
+ " must be less than the Max versions.";
|
||||
warnOrThrowExceptionForFailure(logWarn, CONF_KEY, message, null);
|
||||
}
|
||||
|
||||
// check replication scope
|
||||
if (hcd.getScope() < 0) {
|
||||
String message = "Replication scope for column family "
|
||||
|
|
|
@ -5471,6 +5471,14 @@ public class TestFromClientSide {
|
|||
}
|
||||
checkTableIsLegal(htd);
|
||||
|
||||
// HBASE-13776 Setting illegal versions for HColumnDescriptor
|
||||
// does not throw IllegalArgumentException
|
||||
// finally, minVersions must be less than or equal to maxVersions
|
||||
hcd.setMaxVersions(4);
|
||||
hcd.setMinVersions(5);
|
||||
checkTableIsIllegal(htd);
|
||||
hcd.setMinVersions(3);
|
||||
|
||||
hcd.setScope(-1);
|
||||
checkTableIsIllegal(htd);
|
||||
hcd.setScope(0);
|
||||
|
|
Loading…
Reference in New Issue