hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Toby White (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (HBASE-1184) HColumnDescriptor is a little too restrictive with family names
Date Wed, 04 Feb 2009 21:19:59 GMT

    [ https://issues.apache.org/jira/browse/HBASE-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670510#action_12670510
] 

tow21 edited comment on HBASE-1184 at 2/4/09 1:19 PM:
-----------------------------------------------------------

The patch below fixes the issue.

It reverses the sense of the test, and simply tests that each character is not a control character.

It also tidies up the error message slightly (removing the reference to ending with colons,
since that is tested in a separate check)

Index: src/java/org/apache/hadoop/hbase/HColumnDescriptor.java
===================================================================
--- src/java/org/apache/hadoop/hbase/HColumnDescriptor.java     (revision 740857)
+++ src/java/org/apache/hadoop/hbase/HColumnDescriptor.java     (working copy)
@@ -242,12 +242,11 @@
         Bytes.toString(b));
     }
     for (int i = 0; i < (b.length - 1); i++) {
-      if (Character.isLetterOrDigit(b[i]) || b[i] == '_' || b[i] == '.') {
-        continue;
+      if (Character.isISOControl(b[i])) {
+        throw new IllegalArgumentException("Illegal character <" + b[i] +
+          ">. Family names cannot contain control characters: " +
+          Bytes.toString(b));
       }
-      throw new IllegalArgumentException("Illegal character <" + b[i] +
-        ">. Family names  can only contain  'word characters' and must end" +
-        "with a colon: " + Bytes.toString(b));
     }
     return b;
   }


      was (Author: tow21):
    The attached patch fixes the issue.

It reverses the sense of the test, and simply tests that each character is not a control character.

It also tidies up the error message slightly (removing the reference to ending with colons,
since that is tested in a separate check)
  
> HColumnDescriptor is a little too restrictive with family names
> ---------------------------------------------------------------
>
>                 Key: HBASE-1184
>                 URL: https://issues.apache.org/jira/browse/HBASE-1184
>             Project: Hadoop HBase
>          Issue Type: Improvement
>    Affects Versions: 0.19.0
>            Reporter: Toby White
>            Priority: Minor
>
> HColumnDescriptor crrently requires of its family names that they be letters, digits,
underscores or periods.
> Character.isLetterOrDigit(b[i]) || b[i] == '_' || b[i] == '.'
> It would be nice if it let rather more characters be used (personally, I'd like to use
a hyphen!)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message