hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1293480 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
Date Fri, 24 Feb 2012 23:41:56 GMT
Author: stack
Date: Fri Feb 24 23:41:56 2012
New Revision: 1293480

URL: http://svn.apache.org/viewvc?rev=1293480&view=rev
Log:
HBASE-5351 hbase completebulkload to a new table fails in a race

Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1293480&r1=1293479&r2=1293480&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Fri Feb 24 23:41:56 2012
@@ -44,7 +44,10 @@ Release 0.92.1 - Unreleased
    HBASE-5466  Opening a table also opens the metatable and never closes it
                (Ashley Taylor)
    HBASE-5317  Fix TestHFileOutputFormat to work against hadoop 0.23
-               (Gregory Taylor)
+               (Gregory Chanan)
+   HBASE-5351  hbase completebulkload to a new table fails in a race
+               (Gregory Chanan)
+ 
  
   IMPROVEMENTS
    HBASE-5197  [replication] Handle socket timeouts in ReplicationSource

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1293480&r1=1293479&r2=1293480&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Fri Feb
24 23:41:56 2012
@@ -420,7 +420,9 @@ public class HBaseAdmin implements Abort
 
   /**
    * Creates a new table but does not block and wait for it to come online.
-   * Asynchronous operation.
+   * Asynchronous operation.  To check if the table exists, use
+   * {@link: #isTableAvailable} -- it is not safe to create an HTable
+   * instance to this table before it is available.
    *
    * @param desc table descriptor for table
    *

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java?rev=1293480&r1=1293479&r2=1293480&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
(original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
Fri Feb 24 23:41:56 2012
@@ -664,23 +664,9 @@ public class LoadIncrementalHFiles exten
     }
     
     keys = LoadIncrementalHFiles.inferBoundaries(map);
-    try {    
-      this.hbAdmin.createTableAsync(htd, keys);
-    } catch (java.net.SocketTimeoutException e) {
-      System.err.println("Caught Socket timeout.. Mostly caused by a slow region assignment
by master!");
-    }
-
-    HTable table = new HTable(this.cfg, tableName);
+    this.hbAdmin.createTable(htd,keys);
 
-    HConnection conn = table.getConnection();
-    int ctr = 0;
-    while (!conn.isTableAvailable(table.getTableName()) && (ctr<TABLE_CREATE_MAX_RETRIES))
{
-      LOG.info("Table " + tableName + "not yet available... Sleeping for 60 more seconds...");
-      /* Every TABLE_CREATE_SLEEP milliseconds, wakes up and checks if the table is available*/
-      Thread.sleep(TABLE_CREATE_SLEEP);
-      ctr++;
-    }
-    LOG.info("Table "+ tableName +" is finally available!!");
+    LOG.info("Table "+ tableName +" is available!!");
   }
 
   @Override



Mime
View raw message