|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.conf.Configured org.apache.hadoop.fs.TrashPolicy
@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class TrashPolicy
This interface is used for implementing different Trash policies. Provides factory method to create instances of the configured Trash policy.
Field Summary | |
---|---|
protected long |
deletionInterval
|
protected FileSystem |
fs
|
protected Path |
trash
|
Constructor Summary | |
---|---|
TrashPolicy()
|
Method Summary | |
---|---|
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 parameter 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. |
Methods inherited from class org.apache.hadoop.conf.Configured |
---|
getConf, setConf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FileSystem fs
protected Path trash
protected long deletionInterval
Constructor Detail |
---|
public TrashPolicy()
Method Detail |
---|
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)
conf
- the configuration to be usedfs
- the file system to be usedhome
- the home directory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |