|
||||||||||
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.Trash
public class Trash
Provides a trash feature. Files may be moved to a trash directory. They're initially stored in a current sub-directory of the trash directory. Within that sub-directory their original path is preserved. Periodically one may checkpoint the current trash and remove older checkpoints. (This design permits trash management without enumeration of the full trash content, without date support in the filesystem, and without clock synchronization.)
Constructor Summary | |
---|---|
Trash(Configuration conf)
Construct a trash can accessor. |
Method Summary | |
---|---|
void |
checkpoint()
Create a trash checkpoint. |
void |
expunge()
Delete old checkpoints. |
Runnable |
getEmptier()
Return a Runnable that periodically empties the trash. |
static void |
main(String[] args)
Run an emptier. |
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 |
Constructor Detail |
---|
public Trash(Configuration conf) throws IOException
conf
- a Configuration
IOException
Method Detail |
---|
public boolean moveToTrash(Path path) throws IOException
IOException
public void checkpoint() throws IOException
IOException
public void expunge() throws IOException
IOException
public Runnable getEmptier()
Runnable
that periodically empties the trash.
Only one checkpoint is kept at a time.
public static void main(String[] args) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |