org.apache.hadoop.hbase.master
Class TableLockManager.NullTableLockManager

java.lang.Object
  extended by org.apache.hadoop.hbase.master.TableLockManager
      extended by org.apache.hadoop.hbase.master.TableLockManager.NullTableLockManager
Enclosing class:
TableLockManager

@InterfaceAudience.Private
public static class TableLockManager.NullTableLockManager
extends TableLockManager

A null implementation


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.master.TableLockManager
TableLockManager.NullTableLockManager, TableLockManager.TableLock
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.master.TableLockManager
DEFAULT_TABLE_LOCK_EXPIRE_TIMEOUT_MS, DEFAULT_TABLE_READ_LOCK_TIMEOUT_MS, DEFAULT_TABLE_WRITE_LOCK_TIMEOUT_MS, TABLE_LOCK_ENABLE, TABLE_LOCK_EXPIRE_TIMEOUT, TABLE_READ_LOCK_TIMEOUT_MS, TABLE_WRITE_LOCK_TIMEOUT_MS
 
Constructor Summary
TableLockManager.NullTableLockManager()
           
 
Method Summary
 TableLockManager.TableLock readLock(TableName tableName, String purpose)
          Returns a TableLock for locking the table for shared access among read-lock holders
 void reapAllExpiredLocks()
          Force releases all table locks(read and write) that have been held longer than "hbase.table.lock.expire.ms".
 void reapWriteLocks()
          Force releases table write locks and lock attempts even if this thread does not own the lock.
 void tableDeleted(TableName tableName)
          Called after a table has been deleted, and after the table lock is released.
 void visitAllLocks(InterProcessLock.MetadataHandler handler)
          Visits all table locks(read and write), and lock attempts with the given callback MetadataHandler.
 TableLockManager.TableLock writeLock(TableName tableName, String purpose)
          Returns a TableLock for locking the table for exclusive access
 
Methods inherited from class org.apache.hadoop.hbase.master.TableLockManager
createTableLockManager, fromBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableLockManager.NullTableLockManager

public TableLockManager.NullTableLockManager()
Method Detail

writeLock

public TableLockManager.TableLock writeLock(TableName tableName,
                                            String purpose)
Description copied from class: TableLockManager
Returns a TableLock for locking the table for exclusive access

Specified by:
writeLock in class TableLockManager
Parameters:
tableName - Table to lock
purpose - Human readable reason for locking the table
Returns:
A new TableLock object for acquiring a write lock

readLock

public TableLockManager.TableLock readLock(TableName tableName,
                                           String purpose)
Description copied from class: TableLockManager
Returns a TableLock for locking the table for shared access among read-lock holders

Specified by:
readLock in class TableLockManager
Parameters:
tableName - Table to lock
purpose - Human readable reason for locking the table
Returns:
A new TableLock object for acquiring a read lock

reapAllExpiredLocks

public void reapAllExpiredLocks()
                         throws IOException
Description copied from class: TableLockManager
Force releases all table locks(read and write) that have been held longer than "hbase.table.lock.expire.ms". Assumption is that the clock skew between zookeeper and this servers is negligible. The behavior of the lock holders still thinking that they have the lock is undefined.

Specified by:
reapAllExpiredLocks in class TableLockManager
Throws:
IOException - If there is an unrecoverable error

reapWriteLocks

public void reapWriteLocks()
                    throws IOException
Description copied from class: TableLockManager
Force releases table write locks and lock attempts even if this thread does not own the lock. The behavior of the lock holders still thinking that they have the lock is undefined. This should be used carefully and only when we can ensure that all write-lock holders have died. For example if only the master can hold write locks, then we can reap it's locks when the backup master starts.

Specified by:
reapWriteLocks in class TableLockManager
Throws:
IOException - If there is an unrecoverable error

tableDeleted

public void tableDeleted(TableName tableName)
                  throws IOException
Description copied from class: TableLockManager
Called after a table has been deleted, and after the table lock is released. TableLockManager should do cleanup for the table state.

Specified by:
tableDeleted in class TableLockManager
Parameters:
tableName - name of the table
Throws:
IOException - If there is an unrecoverable error releasing the lock

visitAllLocks

public void visitAllLocks(InterProcessLock.MetadataHandler handler)
                   throws IOException
Description copied from class: TableLockManager
Visits all table locks(read and write), and lock attempts with the given callback MetadataHandler.

Specified by:
visitAllLocks in class TableLockManager
Parameters:
handler - the metadata handler to call
Throws:
IOException - If there is an unrecoverable error


Copyright © 2015 The Apache Software Foundation. All rights reserved.