HBASE-13776 Setting illegal versions for HColumnDescriptor does not throw IllegalArgumentException (Yuhao Bi)
This commit is contained in:
parent
695c4790cd
commit
93e475e5ba
|
@ -1498,6 +1498,15 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
|
||||||
}
|
}
|
||||||
// max versions already being checked
|
// 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
|
// check replication scope
|
||||||
if (hcd.getScope() < 0) {
|
if (hcd.getScope() < 0) {
|
||||||
String message = "Replication scope for column family "
|
String message = "Replication scope for column family "
|
||||||
|
|
|
@ -5566,6 +5566,14 @@ public class TestFromClientSide {
|
||||||
}
|
}
|
||||||
checkTableIsLegal(htd);
|
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);
|
hcd.setScope(-1);
|
||||||
checkTableIsIllegal(htd);
|
checkTableIsIllegal(htd);
|
||||||
hcd.setScope(0);
|
hcd.setScope(0);
|
||||||
|
|
Loading…
Reference in New Issue