hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From li...@apache.org
Subject svn commit: r1498615 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/TableLockManager.java
Date Mon, 01 Jul 2013 18:18:23 GMT
Author: liyin
Date: Mon Jul  1 18:18:22 2013
New Revision: 1498615

URL: http://svn.apache.org/r1498615
Log:
[HBASE-8775] Returned default behavior of lockTable to wait indefinitely.

Author: shaneh

Summary:
When working on the online schema change I changed the
default behavior of lockTable to use a timeout. I am now
changing it back to wait indefinitely and to use tryLockTable
if the timeout behavior is wanted.

Test Plan: TBD

Reviewers: gauravm, liyintang, manukranthk

Reviewed By: manukranthk

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D866649

Task ID: 2552009

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/TableLockManager.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/TableLockManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/TableLockManager.java?rev=1498615&r1=1498614&r2=1498615&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/TableLockManager.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/TableLockManager.java
Mon Jul  1 18:18:22 2013
@@ -83,8 +83,6 @@ public class TableLockManager {
    * @param tableName Table to lock
    * @param purpose Human readable reason for locking the table
    * @return True if the table was locked before the timeout false otherwise
-   * @throws TableLockTimeoutException If unable to acquire a lock within a
-   *                                   specified time period (if any)
    * @throws IOException If unrecoverable ZooKeeper error occurs
    */
   public boolean tryLockTable(byte[] tableName, String purpose, long timeout)
@@ -116,16 +114,12 @@ public class TableLockManager {
    * Lock a table, given a purpose.
    * @param tableName Table to lock
    * @param purpose Human readable reason for locking the table
-   * @throws TableLockTimeoutException If unable to acquire a lock within a
-   *                                   specified time period (if any)
    * @throws IOException If unrecoverable ZooKeeper error occurs
    */
   public void lockTable(byte[] tableName, String purpose)
   throws IOException {
-    if(!tryLockTable(tableName, purpose, lockTimeoutMs)) {
-      throw new TableLockTimeoutException("Timed out acquiring " +
-          "lock for " + Bytes.toString(tableName) + " after " + lockTimeoutMs + " ms.");
-    }
+    long waitIndefinitely = -1;
+    tryLockTable(tableName, purpose, waitIndefinitely);
   }
 
   private HLock createTableLock(String tableName, String purpose) {



Mime
View raw message