@Test public void testAbsDelete() throws Exception { Random r = new Random(); long seed = r.nextLong(); r.setSeed(seed); System.out.println("SEED: " + seed); List<Path> dirs = buildDirs(r, base, 20); createDirs(new Path("."), dirs); FakeDefaultContainerExecutor exec = new FakeDefaultContainerExecutor(); Configuration conf = new Configuration(); exec.setConf(conf); DeletionService del = new DeletionService(exec); del.init(conf); del.start(); try { for (Path p : dirs) { del.delete((Long.parseLong(p.getName()) % 2) == 0 ? null : "dingo", p, null); } int msecToWait = 20 * 1000; for (Path p : dirs) { while (msecToWait > 0 && lfs.util().exists(p)) { Thread.sleep(100); msecToWait -= 100; } assertFalse(lfs.util().exists(p)); } } finally { del.stop(); } }
public void delete(String user, Path subDir, Path... baseDirs) { if (debugDelay != -1) { List<Path> baseDirList = null; if (baseDirs != null && baseDirs.length != 0) { baseDirList = Arrays.asList(baseDirs); } FileDeletionTask task = new FileDeletionTask(this, user, subDir, baseDirList); recordDeletionTaskInStateStore(task); sched.schedule(task, debugDelay, TimeUnit.SECONDS); } }
DeletionService extends AbstractService { public void delete(String user, Path subDir, Path... baseDirs) { if (debugDelay != -1) { List<Path> baseDirList = null; if (baseDirs != null && baseDirs.length != 0) { baseDirList = Arrays.asList(baseDirs); } FileDeletionTask task = new FileDeletionTask(this, user, subDir, baseDirList); recordDeletionTaskInStateStore(task); sched.schedule(task, debugDelay, TimeUnit.SECONDS); } } }
DeletionService extends AbstractService { public void delete(String user, Path subDir, Path... baseDirs) { if (debugDelay != -1) { List<Path> baseDirList = null; if (baseDirs != null && baseDirs.length != 0) { baseDirList = Arrays.asList(baseDirs); } FileDeletionTask task = new FileDeletionTask(this, user, subDir, baseDirList); recordDeletionTaskInStateStore(task); sched.schedule(task, debugDelay, TimeUnit.SECONDS); } } DeletionService(ContainerExecutor exec);  DeletionService(ContainerExecutor exec,
      NMStateStoreService stateStore); }
DeletionService extends AbstractService { public void delete(String user, Path subDir, Path... baseDirs) { if (debugDelay != -1) { List<Path> baseDirList = null; if (baseDirs != null && baseDirs.length != 0) { baseDirList = Arrays.asList(baseDirs); } FileDeletionTask task = new FileDeletionTask(this, user, subDir, baseDirList); recordDeletionTaskInStateStore(task); sched.schedule(task, debugDelay, TimeUnit.SECONDS); } } DeletionService(ContainerExecutor exec);  DeletionService(ContainerExecutor exec,
      NMStateStoreService stateStore); void delete(String user, Path subDir, Path... baseDirs); void scheduleFileDeletionTask(FileDeletionTask fileDeletionTask); @Private boolean isTerminated(); FileDeletionTask createFileDeletionTask(String user, Path subDir,
      Path[] baseDirs); }
DeletionService extends AbstractService { public void delete(String user, Path subDir, Path... baseDirs) { if (debugDelay != -1) { List<Path> baseDirList = null; if (baseDirs != null && baseDirs.length != 0) { baseDirList = Arrays.asList(baseDirs); } FileDeletionTask task = new FileDeletionTask(this, user, subDir, baseDirList); recordDeletionTaskInStateStore(task); sched.schedule(task, debugDelay, TimeUnit.SECONDS); } } DeletionService(ContainerExecutor exec);  DeletionService(ContainerExecutor exec,
      NMStateStoreService stateStore); void delete(String user, Path subDir, Path... baseDirs); void scheduleFileDeletionTask(FileDeletionTask fileDeletionTask); @Private boolean isTerminated(); FileDeletionTask createFileDeletionTask(String user, Path subDir,
      Path[] baseDirs);  }