public class LockUtil extends Object
| Constructor and Description |
|---|
LockUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
createLockFile(Configuration conf,
Path lockFile,
boolean accept)
Create a lock file.
|
static void |
createLockFile(FileSystem fs,
Path lockFile,
boolean accept)
Create a lock file.
|
static boolean |
removeLockFile(Configuration conf,
Path lockFile)
Remove lock file.
|
static boolean |
removeLockFile(FileSystem fs,
Path lockFile)
Remove lock file.
|
public static void createLockFile(FileSystem fs, Path lockFile, boolean accept) throws IOException
fs - filesystemlockFile - name of the lock fileaccept - if true, and the target file exists, consider it valid. If false
and the target file exists, throw an IOException.IOException - if accept is false, and the target file already exists, or if
it's a directory.public static void createLockFile(Configuration conf, Path lockFile, boolean accept) throws IOException
conf - configuration to find the FileSystem lockFile
belongs tolockFile - name of the lock fileaccept - if true, and the target file exists, consider it valid. If false
and the target file exists, throw an IOException.IOException - if accept is false, and the target file already exists, or if
it's a directory.public static boolean removeLockFile(FileSystem fs, Path lockFile) throws IOException
fs - filesystemlockFile - lock file nameIOException - if lock file exists but it is a directory.public static boolean removeLockFile(Configuration conf, Path lockFile) throws IOException
conf - configuration to find the FileSystem lockFile
belongs tolockFile - lock file nameIOException - if lock file exists but it is a directory.Copyright © 2021 The Apache Software Foundation