hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-13776 Setting illegal versions for HColumnDescriptor does not throw IllegalArgumentException (Yuhao Bi)
Date Fri, 29 May 2015 14:35:04 GMT
Repository: hbase
Updated Branches:
  refs/heads/master cca687d71 -> f35b6c6b7


HBASE-13776 Setting illegal versions for HColumnDescriptor does not throw IllegalArgumentException
(Yuhao Bi)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f35b6c6b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f35b6c6b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f35b6c6b

Branch: refs/heads/master
Commit: f35b6c6b77f82499ebcc5eb5843e046014b2f35b
Parents: cca687d
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri May 29 07:35:02 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Fri May 29 07:35:02 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/master/HMaster.java   | 9 +++++++++
 .../org/apache/hadoop/hbase/client/TestFromClientSide.java  | 8 ++++++++
 2 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f35b6c6b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index 40d34e9..bcb652b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -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 "

http://git-wip-us.apache.org/repos/asf/hbase/blob/f35b6c6b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
index 3dc1387..5ca2b92 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
@@ -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);


Mime
View raw message