You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jm...@apache.org on 2012/09/01 00:17:42 UTC

svn commit: r1379638 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java

Author: jmhsieh
Date: Fri Aug 31 22:17:42 2012
New Revision: 1379638

URL: http://svn.apache.org/viewvc?rev=1379638&view=rev
Log:
HBASE-5076 HBase shell hangs when creating some 'illegal' tables (liang xie)

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java?rev=1379638&r1=1379637&r2=1379638&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java Fri Aug 31 22:17:42 2012
@@ -414,6 +414,15 @@ public class HTableDescriptor implements
           "> at 0. User-space table names can only start with 'word " +
           "characters': i.e. [a-zA-Z_0-9]: " + Bytes.toString(tableName));
     }
+    if (HConstants.CLUSTER_ID_FILE_NAME.equalsIgnoreCase(Bytes
+        .toString(tableName))
+        || HConstants.SPLIT_LOGDIR_NAME.equalsIgnoreCase(Bytes
+            .toString(tableName))
+        || HConstants.VERSION_FILE_NAME.equalsIgnoreCase(Bytes
+            .toString(tableName))) {
+      throw new IllegalArgumentException(Bytes.toString(tableName)
+          + " conflicted with system reserved words");
+    }
     for (int i = 0; i < tableName.length; i++) {
       if (Character.isLetterOrDigit(tableName[i]) || tableName[i] == '_' || 
     		  tableName[i] == '-' || tableName[i] == '.') {