private void deleteCorruptedFile(String path) { try { namenode.getRpcServer().delete(path, true); LOG.info("Fsck: deleted corrupt file " + path); } catch (Exception e) { LOG.error("Fsck: error deleting corrupted file " + path, e); internalError = true; } }
final boolean b = np.delete(fullpath, recursive.getValue()); final String js = JsonUtil.toJsonString("boolean", b); return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
final boolean b = np.delete(fullpath, recursive.getValue()); final String js = JsonUtil.toJsonString("boolean", b); return Response.ok(js).type(MediaType.APPLICATION_JSON).build();
private void deleteCorruptedFile(String path) { try { namenode.getRpcServer().delete(path, true); LOG.info("Fsck: deleted corrupt file " + path); } catch (Exception e) { LOG.error("Fsck: error deleting corrupted file " + path, e); internalError = true; } }
private void deleteCorruptedFile(String path) { try { namenode.getRpcServer().delete(path, true); LOG.info("Fsck: deleted corrupt file " + path); } catch (Exception e) { LOG.error("Fsck: error deleting corrupted file " + path, e); internalError = true; } }
@Override public void run() { thr = Thread.currentThread(); FsPermission p = new FsPermission((short)0777); int i = 0; while (!stopped) { try { String dirname = "/thr-" + thr.getId() + "-dir-" + i; nn.mkdirs(dirname, p, true); nn.delete(dirname, true); } catch (SafeModeException sme) { // This is OK - the tests will bring NN in and out of safemode } catch (Throwable e) { LOG.warn("Got error in transaction thread", e); caught.compareAndSet(null, e); break; } i++; } }
/** * Tests for delete call */ @Test public void testDelete() throws Exception { String dir = "/testNamenodeRetryCache/testDelete"; // Two retried calls to create a non existent file newCall(); nnRpc.mkdirs(dir, perm, true); newCall(); Assert.assertTrue(nnRpc.delete(dir, false)); Assert.assertTrue(nnRpc.delete(dir, false)); Assert.assertTrue(nnRpc.delete(dir, false)); // non-retried call fails and gets false as return newCall(); Assert.assertFalse(nnRpc.delete(dir, false)); }