@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class TrashPolicy extends Configured
Modifier and Type | Field and Description |
---|---|
protected long |
deletionInterval |
protected FileSystem |
fs |
protected Path |
trash |
Constructor and Description |
---|
TrashPolicy() |
Modifier and Type | Method and Description |
---|---|
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
|
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,
Path home)
Get an instance of the configured TrashPolicy based on the value
of the configuration paramater fs.trash.classname.
|
abstract void |
initialize(Configuration conf,
FileSystem fs,
Path home)
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 abstract void initialize(Configuration conf, FileSystem fs, Path home)
conf
- the configuration to be usedfs
- the filesystem to be usedhome
- the home directorypublic 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 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, Path home) throws IOException
conf
- the configuration to be usedfs
- the file system to be usedhome
- the home directoryIOException
Copyright © 2014 Apache Software Foundation. All Rights Reserved.