public class LockUtil
extends java.lang.Object
| Constructor and Description |
|---|
LockUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
createLockFile(FileSystem fs,
Path lockFile,
boolean accept)
Create a lock file.
|
static boolean |
removeLockFile(FileSystem fs,
Path lockFile)
Remove lock file.
|
public static void createLockFile(FileSystem fs, Path lockFile, boolean accept) throws java.io.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.java.io.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 java.io.IOException
fs - filesystemlockFile - lock file namejava.io.IOException - if lock file exists but it is a directory.Copyright © 2019 The Apache Software Foundation