public class FileSystemBasedLockProvider extends Object implements LockProvider<String>, Serializable
LockProvider implementation allows to lock table operations
using DFS. Users might need to manually clean the Locker's path if writeClient crash and never run again.
NOTE: This only works for DFS with atomic create/delete operation| Modifier and Type | Field and Description |
|---|---|
protected LockConfiguration |
lockConfiguration |
| Constructor and Description |
|---|
FileSystemBasedLockProvider(LockConfiguration lockConfiguration,
StorageConfiguration<?> configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected String |
generateLogStatement(LockState state) |
String |
getCurrentOwnerLockInfo() |
String |
getLock() |
static TypedProperties |
getLockConfig(String tablePath)
Returns a filesystem based lock config with given table path.
|
void |
initLockInfo() |
void |
reloadCurrentOwnerLockInfo() |
boolean |
tryLock(long time,
TimeUnit unit) |
void |
unlock() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlock, lockInterruptibly, newCondition, tryLockprotected LockConfiguration lockConfiguration
public FileSystemBasedLockProvider(LockConfiguration lockConfiguration, StorageConfiguration<?> configuration)
public void close()
close in interface AutoCloseableclose in interface LockProvider<String>public String getLock()
getLock in interface LockProvider<String>public String getCurrentOwnerLockInfo()
getCurrentOwnerLockInfo in interface LockProvider<String>public void initLockInfo()
public void reloadCurrentOwnerLockInfo()
public static TypedProperties getLockConfig(String tablePath)
Copyright © 2024 The Apache Software Foundation. All rights reserved.