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 18:37:41 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.0 d1f761eec -> 70b7434c2


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/70b7434c
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/70b7434c
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/70b7434c

Branch: refs/heads/branch-1.0
Commit: 70b7434c2283076c2fe2308fe0972577b4463ca0
Parents: d1f761e
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri May 29 11:37:42 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Fri May 29 11:37:42 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/70b7434c/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 bc30e26..88dcd1e 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
@@ -1376,6 +1376,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 <= maxVersions
+      if (hcd.getMinVersions() > hcd.getMaxVersions()) {
+        throw new DoNotRetryIOException("Min versions for column family " + hcd.getNameAsString()
+          + " must be less than the Max versions. Set " + CONF_KEY + " to false at conf or
table "
+          + "descriptor if you want to bypass sanity checks");
+      }
+
       // check replication scope
       if (hcd.getScope() < 0) {
         throw new DoNotRetryIOException("Replication scope for column family "

http://git-wip-us.apache.org/repos/asf/hbase/blob/70b7434c/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 f1eb053..85c0475 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
@@ -5559,6 +5559,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