private static class TableLockManager.ZKTableLockManager.TableLockImpl extends Object implements TableLockManager.TableLock
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
isShared |
(package private) InterProcessLock |
lock |
(package private) long |
lockTimeoutMs |
(package private) String |
purpose |
(package private) ServerName |
serverName |
(package private) TableName |
tableName |
(package private) ZooKeeperWatcher |
zkWatcher |
Constructor and Description |
---|
TableLockManager.ZKTableLockManager.TableLockImpl(TableName tableName,
ZooKeeperWatcher zkWatcher,
ServerName serverName,
long lockTimeoutMs,
boolean isShared,
String purpose) |
Modifier and Type | Method and Description |
---|---|
void |
acquire()
Acquire the lock, with the configured lock timeout.
|
private InterProcessLock |
createTableLock() |
void |
release()
Release the lock already held.
|
long lockTimeoutMs
TableName tableName
InterProcessLock lock
boolean isShared
ZooKeeperWatcher zkWatcher
ServerName serverName
String purpose
public TableLockManager.ZKTableLockManager.TableLockImpl(TableName tableName, ZooKeeperWatcher zkWatcher, ServerName serverName, long lockTimeoutMs, boolean isShared, String purpose)
public void acquire() throws IOException
TableLockManager.TableLock
acquire
in interface TableLockManager.TableLock
LockTimeoutException
- If unable to acquire a lock within a specified
time period (if any)IOException
- If unrecoverable error occurspublic void release() throws IOException
TableLockManager.TableLock
release
in interface TableLockManager.TableLock
IOException
- If there is an unrecoverable error releasing the lockprivate InterProcessLock createTableLock()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.