hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r677603 - in /hadoop/hbase/trunk/src: java/org/apache/hadoop/hbase/util/Migrate.java test/org/apache/hadoop/hbase/util/TestMetaUtils.java
Date Thu, 17 Jul 2008 15:00:36 GMT
Author: stack
Date: Thu Jul 17 08:00:36 2008
New Revision: 677603

URL: http://svn.apache.org/viewvc?rev=677603&view=rev
Log:
HBASE-62 Allow user add arbitrary key/value pairs to table and column descriptors; Remove
an exception catch I'd left in place, remove unused imports

Modified:
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/Migrate.java
    hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/util/TestMetaUtils.java

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/Migrate.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/Migrate.java?rev=677603&r1=677602&r2=677603&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/Migrate.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/Migrate.java Thu Jul 17 08:00:36
2008
@@ -22,9 +22,7 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.commons.cli.Options;
 import org.apache.commons.logging.Log;
@@ -43,7 +41,6 @@
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.io.BatchUpdate;
 import org.apache.hadoop.hbase.regionserver.HRegion;
-import org.apache.hadoop.hbase.regionserver.HStore;
 import org.apache.hadoop.hbase.regionserver.HStoreFile;
 import org.apache.hadoop.util.GenericOptionsParser;
 import org.apache.hadoop.util.Tool;
@@ -82,18 +79,14 @@
 public class Migrate extends Configured implements Tool {
   private static final Log LOG = LogFactory.getLog(Migrate.class);
 
-  private static final String OLD_PREFIX = "hregion_";
-
   private final HBaseConfiguration conf;
   private FileSystem fs;
   
   // Gets set by migration methods if we are in readOnly mode.
-  private boolean migrationNeeded = false;
+  boolean migrationNeeded = false;
+
+  boolean readOnly = false;
 
-  private boolean readOnly = false;
-  
-  private final Set<String> references = new HashSet<String>();
-  
   // Filesystem version of hbase 0.1.x.
   private static final float HBASE_0_1_VERSION = 0.1f;
   
@@ -183,12 +176,13 @@
         LOG.info("No upgrade necessary.");
         return 0;
       }
-      if (versionStr == null || Float.parseFloat(versionStr) < 0.1) {
+      if (versionStr == null ||
+          Float.parseFloat(versionStr) < HBASE_0_1_VERSION) {
         throw new IOException("Install 0.1.x of hbase and run its " +
           "migration first");
       }
       float version = Float.parseFloat(versionStr);
-      if (version == 0.1f) {
+      if (version == HBASE_0_1_VERSION) {
         checkForUnrecoveredLogFiles(getRootDirFiles());
         migrateToV5();
       } else {
@@ -254,8 +248,6 @@
           return true;
         }
       });
-    } catch (Exception e) {
-      LOG.error("", e);
     } finally {
       utils.shutdown();
     }

Modified: hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/util/TestMetaUtils.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/util/TestMetaUtils.java?rev=677603&r1=677602&r2=677603&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/util/TestMetaUtils.java (original)
+++ hadoop/hbase/trunk/src/test/org/apache/hadoop/hbase/util/TestMetaUtils.java Thu Jul 17
08:00:36 2008
@@ -49,7 +49,7 @@
     // Now assert columns were added and deleted.
     this.cluster = new MiniHBaseCluster(this.conf, 1);
     HTable t = new HTable(conf, editTable);
-    HTableDescriptor htd = t.getMetadata();
+    HTableDescriptor htd = t.getTableDescriptor();
     HColumnDescriptor hcd = htd.getFamily(newColumn);
     assertTrue(hcd != null);
     assertNull(htd.getFamily(Bytes.toBytes(oldColumn)));



Mime
View raw message