@Test public void testWriteCuboidStatistics() throws IOException { final Configuration conf = HadoopUtil.getCurrentConfiguration(); File tmp = File.createTempFile("cuboidstatistics", ""); final Path outputPath = new Path(tmp.getParent().toString() + File.separator + RandomUtil.randomUUID().toString()); if (!FileSystem.getLocal(conf).exists(outputPath)) { // FileSystem.getLocal(conf).create(outputPath); } System.out.println(outputPath); Map<Long, HLLCounter> cuboidHLLMap = Maps.newHashMap(); CubeStatsWriter.writeCuboidStatistics(conf, outputPath, cuboidHLLMap, 100); FileSystem.getLocal(conf).delete(outputPath, true); } }
/** * Use MRAsyncDiskService.moveAndDeleteAllVolumes instead. */ @Deprecated public void deleteLocalFiles() throws IOException { String[] localDirs = getLocalDirs(); for (int i = 0; i < localDirs.length; i++) { FileSystem.getLocal(this).delete(new Path(localDirs[i]), true); } }
public void deleteLocalFiles(String subdir) throws IOException { String[] localDirs = getLocalDirs(); for (int i = 0; i < localDirs.length; i++) { FileSystem.getLocal(this).delete(new Path(localDirs[i], subdir), true); } }
/** * Use MRAsyncDiskService.moveAndDeleteAllVolumes instead. */ @Deprecated public void deleteLocalFiles() throws IOException { String[] localDirs = getLocalDirs(); for (int i = 0; i < localDirs.length; i++) { FileSystem.getLocal(this).delete(new Path(localDirs[i]), true); } }
/** * Use MRAsyncDiskService.moveAndDeleteAllVolumes instead. * @see org.apache.hadoop.util.MRAsyncDiskService#cleanupAllVolumes() */ @Deprecated public void deleteLocalFiles() throws IOException { String[] localDirs = getLocalDirs(); for (int i = 0; i < localDirs.length; i++) { FileSystem.getLocal(this).delete(new Path(localDirs[i])); } }
/** * Use MRAsyncDiskService.moveAndDeleteAllVolumes instead. */ @Deprecated public void deleteLocalFiles() throws IOException { String[] localDirs = getLocalDirs(); for (int i = 0; i < localDirs.length; i++) { FileSystem.getLocal(this).delete(new Path(localDirs[i]), true); } }
public void deleteLocalFiles(String subdir) throws IOException { String[] localDirs = getLocalDirs(); for (int i = 0; i < localDirs.length; i++) { FileSystem.getLocal(this).delete(new Path(localDirs[i], subdir), true); } }
public void deleteLocalFiles(String subdir) throws IOException { String[] localDirs = getLocalDirs(); for (int i = 0; i < localDirs.length; i++) { FileSystem.getLocal(this).delete(new Path(localDirs[i], subdir)); } }
public void deleteLocalFiles(String subdir) throws IOException { String[] localDirs = getLocalDirs(); for (int i = 0; i < localDirs.length; i++) { FileSystem.getLocal(this).delete(new Path(localDirs[i], subdir), true); } }
/** * Use MRAsyncDiskService.moveAndDeleteAllVolumes instead. */ @Deprecated public void deleteLocalFiles() throws IOException { String[] localDirs = getLocalDirs(); for (int i = 0; i < localDirs.length; i++) { FileSystem.getLocal(this).delete(new Path(localDirs[i]), true); } }
void deleteLocalFiles(String subdir) throws IOException { try { String[] localDirs = getLocalDirs(); for (String localDir : localDirs) { FileSystem.getLocal(conf).delete(new Path(localDir, subdir), true); } } catch (NullPointerException e) { LOG.info(e); } }
public void deleteLocalFiles(String subdir) throws IOException { try { String[] localDirs = getLocalDirs(); for (String localDir : localDirs) { FileSystem.getLocal(this.conf).delete(new Path(localDir, subdir), true); } } catch (NullPointerException e) { LOG.info(e); } }
@Before public void setup() throws IOException { conf = new Configuration(false); conf.set("fs.file.impl", LocalFileSystem.class.getName()); fileSys = FileSystem.getLocal(conf); fileSys.delete(new Path(TEST_ROOT_DIR), true); }
private String readFile(String out) throws IOException { Path path = new Path(out); FileStatus stat = lfs.getFileStatus(path); FSDataInputStream in = lfs.open(path); byte[] buffer = new byte[(int)stat.getLen()]; in.readFully(buffer); in.close(); lfs.delete(path, false); return new String(buffer); }
@Before @Override public void setUp() throws IOException { fileSys.delete(new Path(TEST_ROOT_DIR), true); super.setUp(); }
@Test public void testCopyFileFromLocal() throws Exception { Path testRoot = new Path(testRootDir, "testPutFile"); lfs.delete(testRoot, true); lfs.mkdirs(testRoot); Path targetDir = new Path(testRoot, "target"); Path filePath = new Path(testRoot, new Path("srcFile")); lfs.create(filePath).close(); checkPut(filePath, targetDir, false); }
@Test public void testCopyFileFromLocal() throws Exception { Path testRoot = new Path(testRootDir, "testPutFile"); lfs.delete(testRoot, true); lfs.mkdirs(testRoot); Path targetDir = new Path(testRoot, "target"); Path filePath = new Path(testRoot, new Path("srcFile")); lfs.create(filePath).close(); checkPut(filePath, targetDir, false); }
@Override public void setUp() throws Exception { LocalFileSystem fs = FileSystem.getLocal(conf); if (fs.exists(TEST_ROOT) && !fs.delete(TEST_ROOT, true)) { Assert.fail("Can't clean up test root dir"); } fs.mkdirs(TEST_ROOT); }
@Override public void setUp() throws Exception { LocalFileSystem fs = FileSystem.getLocal(conf); if (fs.exists(TEST_ROOT) && !fs.delete(TEST_ROOT, true)) { Assert.fail("Can't clean up test root dir"); } fs.mkdirs(TEST_ROOT); }