@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class TrashPolicy extends Configured
修飾子とタイプ | フィールドと説明 |
---|---|
protected long |
deletionInterval |
protected FileSystem |
fs |
protected Path |
trash |
コンストラクタと説明 |
---|
TrashPolicy() |
修飾子とタイプ | メソッドと説明 |
---|---|
abstract void |
createCheckpoint()
Create a trash checkpoint.
|
abstract void |
deleteCheckpoint()
Delete old trash checkpoint(s).
|
abstract Path |
getCurrentTrashDir()
Get the current working directory of the Trash Policy
This API does not work with files deleted from encryption zone when HDFS
data encryption at rest feature is enabled as rename file between
encryption zones or encryption zone and non-encryption zone is not allowed.
|
Path |
getCurrentTrashDir(Path path)
Get the current trash directory for path specified based on the Trash
Policy
|
abstract Runnable |
getEmptier()
Return a
Runnable that periodically empties the trash of all
users, intended to be run by the superuser. |
static TrashPolicy |
getInstance(Configuration conf,
FileSystem fs)
Get an instance of the configured TrashPolicy based on the value
of the configuration parameter fs.trash.classname.
|
void |
initialize(Configuration conf,
FileSystem fs)
Used to setup the trash policy.
|
abstract boolean |
isEnabled()
Returns whether the Trash Policy is enabled for this filesystem.
|
abstract boolean |
moveToTrash(Path path)
Move a file or directory to the current trash directory.
|
getConf, setConf
protected FileSystem fs
protected long deletionInterval
public TrashPolicy()
public void initialize(Configuration conf, FileSystem fs) throws IOException
conf
- the configuration to be usedfs
- the filesystem to be usedIOException
public abstract boolean isEnabled()
public abstract boolean moveToTrash(Path path) throws IOException
IOException
public abstract void createCheckpoint() throws IOException
IOException
public abstract void deleteCheckpoint() throws IOException
IOException
public abstract Path getCurrentTrashDir()
public Path getCurrentTrashDir(Path path) throws IOException
path
- path to be deletedIOException
public abstract Runnable getEmptier() throws IOException
Runnable
that periodically empties the trash of all
users, intended to be run by the superuser.IOException
public static TrashPolicy getInstance(Configuration conf, FileSystem fs) throws IOException
conf
- the configuration to be usedfs
- the file system to be usedIOException
Copyright © 2016 Apache Software Foundation. All rights reserved.