public abstract class FSLockFactory extends LockFactory
Directory
is an FSDirectory
.Constructor and Description |
---|
FSLockFactory() |
Modifier and Type | Method and Description |
---|---|
static FSLockFactory |
getDefault()
Returns the default locking implementation for this platform.
|
protected abstract Lock |
obtainFSLock(FSDirectory dir,
String lockName)
Implement this method to obtain a lock for a FSDirectory instance.
|
Lock |
obtainLock(Directory dir,
String lockName)
Return a new obtained Lock instance identified by lockName.
|
public static final FSLockFactory getDefault()
NativeFSLockFactory
.public final Lock obtainLock(Directory dir, String lockName) throws IOException
LockFactory
obtainLock
in class LockFactory
lockName
- name of the lock to be created.LockObtainFailedException
- (optional specific exception) if the lock could
not be obtained because it is currently held elsewhere.IOException
- if any i/o error occurs attempting to gain the lockprotected abstract Lock obtainFSLock(FSDirectory dir, String lockName) throws IOException
IOException
- if the lock could not be obtained.Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.