Trash extends Configured { public void checkpoint() throws IOException { trashPolicy.createCheckpoint(); } Trash(Configuration conf);  Trash(FileSystem fs, Configuration conf); static boolean moveToAppropriateTrash(FileSystem fs, Path p,
      Configuration conf); boolean isEnabled(); boolean moveToTrash(Path path); void checkpoint(); void expunge(); void expungeImmediately(); Runnable getEmptier(); Path getCurrentTrashDir(Path path);  }
@Test public void testTrashRestarts() throws Exception { Configuration conf = new Configuration(); conf.setClass("fs.trash.classname", AuditableTrashPolicy.class, TrashPolicy.class); conf.setClass("fs.file.impl", TestLFS.class, FileSystem.class); conf.set(FS_TRASH_INTERVAL_KEY, "50"); Trash trash = new Trash(conf); for(int i=0; i<5; i++) { trash.checkpoint(); } verifyAuditableTrashEmptier(trash, 120, 3); conf.set(FS_TRASH_INTERVAL_KEY, "100"); Trash trashNew = new Trash(conf); verifyAuditableTrashEmptier(trashNew, 120, 2); }