hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r677684 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java src/java/org/apache/hadoop/hbase/master/RegionManager.java
Date Thu, 17 Jul 2008 18:54:25 GMT
Author: jimk
Date: Thu Jul 17 11:54:25 2008
New Revision: 677684

URL: http://svn.apache.org/viewvc?rev=677684&view=rev
Log:
HBASE-424   Should be able to enable/disable .META. table

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=677684&r1=677683&r2=677684&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Thu Jul 17 11:54:25 2008
@@ -193,6 +193,7 @@
    HBASE-34    Set memcache flush size per column (Andrew Purtell via Stack)
    HBASE-42    Set region split size on table creation (Andrew Purtell via Stack)
    HBASE-43    Add a read-only attribute to columns (Andrew Purtell via Stack)
+   HBASE-424   Should be able to enable/disable .META. table
 
   IMPROVEMENTS
    HBASE-559   MR example job to count table rows

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=677684&r1=677683&r2=677684&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Thu Jul 17
11:54:25 2008
@@ -312,7 +312,6 @@
     if (this.master == null) {
       throw new MasterNotRunningException("master has been shut down");
     }
-    HTableDescriptor.isLegalTableName(tableName);
     try {
       this.master.enableTable(tableName);
     } catch (RemoteException e) {
@@ -373,7 +372,6 @@
     if (this.master == null) {
       throw new MasterNotRunningException("master has been shut down");
     }
-    HTableDescriptor.isLegalTableName(tableName);
     try {
       this.master.disableTable(tableName);
     } catch (RemoteException e) {

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java?rev=677684&r1=677683&r2=677684&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/RegionManager.java Thu Jul
17 11:54:25 2008
@@ -519,15 +519,21 @@
     byte [] firstMetaRegion = null;
     Set<MetaRegion> metaRegions = new HashSet<MetaRegion>();
     
-    synchronized (onlineMetaRegions) {
-      if (onlineMetaRegions.size() == 1) {
-        firstMetaRegion = onlineMetaRegions.firstKey();
-      } else if (onlineMetaRegions.containsKey(tableName)) {
-        firstMetaRegion = tableName;
-      } else {
-        firstMetaRegion = onlineMetaRegions.headMap(tableName).lastKey();
+    if (Bytes.equals(tableName, HConstants.META_TABLE_NAME)) {
+      metaRegions.add(new MetaRegion(rootRegionLocation.get(),
+          HRegionInfo.ROOT_REGIONINFO.getRegionName()));
+      
+    } else {
+      synchronized (onlineMetaRegions) {
+        if (onlineMetaRegions.size() == 1) {
+          firstMetaRegion = onlineMetaRegions.firstKey();
+        } else if (onlineMetaRegions.containsKey(tableName)) {
+          firstMetaRegion = tableName;
+        } else {
+          firstMetaRegion = onlineMetaRegions.headMap(tableName).lastKey();
+        }
+        metaRegions.addAll(onlineMetaRegions.tailMap(firstMetaRegion).values());
       }
-      metaRegions.addAll(onlineMetaRegions.tailMap(firstMetaRegion).values());
     }
     return metaRegions;
   }



Mime
View raw message