/** {@inheritDoc} */ @Override public boolean exists(IgfsPath path) { return igfs.exists(path); }
/** {@inheritDoc} */ @Override protected Boolean call0(IgfsContext ctx) throws Exception { return ctx.igfs().exists(path); }
/** {@inheritDoc} */ @Override public boolean exists(String path) { return igfsEx.exists(new IgfsPath(path)); }
IgfsPath path = new IgfsPath(split0.file()); if (igfs.exists(path)) { Collection<IgfsBlockLocation> blocks;
assert primary.exists(IGFS_PATH_DUAL); assert secondary.exists(IGFS_PATH_DUAL); assert !primary.exists(IGFS_PATH_DUAL); assert !secondary.exists(IGFS_PATH_DUAL); assert !fs.exists(PATH_DUAL); assert primary.exists(IGFS_PATH_DUAL); assert secondary.exists(IGFS_PATH_DUAL); assert fs.exists(PATH_DUAL); assert secondary.exists(IGFS_PATH_PROXY); assert fs.exists(PATH_PROXY);
/** * Tests Hadoop command line integration. */ @Test public void testHadoopCommandLine() throws Exception { assertEquals(0, executeHadoopCmd("fs", "-ls", "/")); assertEquals(0, executeHadoopCmd("fs", "-mkdir", "/input")); assertEquals(0, executeHadoopCmd("fs", "-put", new File(testWorkDir, "test-data").getAbsolutePath(), "/input")); assertTrue(igfs.exists(new IgfsPath("/input/test-data"))); assertEquals(0, executeHadoopCmd("jar", examplesJar.getAbsolutePath(), "wordcount", "/input", "/output")); IgfsPath path = new IgfsPath("/user/" + System.getProperty("user.name") + "/"); assertTrue(igfs.exists(path)); IgfsPath jobStatPath = null; for (IgfsPath jobPath : igfs.listPaths(path)) { assertNull(jobStatPath); jobStatPath = jobPath; } File locStatFile = new File(testWorkDir, "performance"); assertEquals(0, executeHadoopCmd("fs", "-get", jobStatPath.toString() + "/performance", locStatFile.toString())); long evtCnt = HadoopTestUtils.simpleCheckJobStatFile(new BufferedReader(new FileReader(locStatFile))); assertTrue(evtCnt >= 22); //It's the minimum amount of events for job with combiner. assertTrue(igfs.exists(new IgfsPath("/output"))); BufferedReader in = new BufferedReader(new InputStreamReader(igfs.open(new IgfsPath("/output/part-r-00000")))); List<String> res = new ArrayList<>(); String line; while ((line = in.readLine()) != null) res.add(line); Collections.sort(res); assertEquals("[blue\t150, green\t200, red\t100, yellow\t50]", res.toString()); }
/** * Ensure that the given paths don't exist in the given IGFS. * * @param uni secondary FS. * @param paths Paths. * @throws Exception If failed. */ protected void checkNotExist(IgfsSecondaryFileSystemTestAdapter uni, IgfsPath... paths) throws Exception { IgfsEx ex = uni.igfs(); for (IgfsPath path : paths) { if (ex != null) assert !ex.exists(path) : "Path exists [igfs=" + ex.name() + ", path=" + path + ']'; assert !uni.exists(path.toString()) : "Path exists [igfs=" + uni.name() + ", path=" + path + ']'; } }
/** {@inheritDoc} */ @Override public boolean exists(IgfsPath path) { return igfs.exists(path); }
@Override public Void apply() { switch (cmd) { case EXISTS: res.response(igfs.exists(req.path()));
/** {@inheritDoc} */ @Override protected Boolean call0(IgfsContext ctx) throws Exception { return ctx.igfs().exists(path); }
@Override public Void apply() { switch (cmd) { case EXISTS: res.response(igfs.exists(req.path()));