/** * Resolve mode for the given path. * * @param path Path. * @return Mode. */ private IgfsMode resolveMode(IgfsPath path) { return modeRslvr.resolveMode(path); }
/** {@inheritDoc} */ @Override public IgfsMode mode(IgfsPath path) { A.notNull(path, "path"); return modeRslvr.resolveMode(path); }
/** {@inheritDoc} */ @Override public boolean isProxy(URI path) { IgfsMode mode = F.isEmpty(cfg.getPathModes()) ? cfg.getDefaultMode() : modeRslvr.resolveMode(new IgfsPath(path)); return mode == PROXY; }
/** * @throws Exception If failed. */ @Test public void testResolve() throws Exception { assertEquals(DUAL_SYNC, reslvr.resolveMode(IgfsPath.ROOT)); assertEquals(DUAL_SYNC, reslvr.resolveMode(new IgfsPath("/a"))); assertEquals(DUAL_SYNC, reslvr.resolveMode(new IgfsPath("/a/1"))); assertEquals(PRIMARY, reslvr.resolveMode(new IgfsPath("/a/P"))); assertEquals(PRIMARY, reslvr.resolveMode(new IgfsPath("/a/P/c"))); assertEquals(PRIMARY, reslvr.resolveMode(new IgfsPath("/a/P/c/2"))); assertEquals(DUAL_ASYNC, reslvr.resolveMode(new IgfsPath("/a/b/"))); assertEquals(DUAL_ASYNC, reslvr.resolveMode(new IgfsPath("/a/b/3"))); assertEquals(DUAL_ASYNC, reslvr.resolveMode(new IgfsPath("/a/b/3/4"))); assertEquals(PROXY, reslvr.resolveMode(new IgfsPath("/a/b/c/d"))); assertEquals(PROXY, reslvr.resolveMode(new IgfsPath("/a/b/c/d/5"))); assertEquals(PROXY, reslvr.resolveMode(new IgfsPath("/a/b/c/d/6"))); }
/** * @throws Exception If failed. */ @Test public void testModeResolver() throws Exception { IgfsModeResolver mr = ((IgniteHadoopFileSystem)fs).getModeResolver(); assertEquals(mode, mr.resolveMode(IgfsPath.ROOT)); }
/** * Resolve IGFS mode for the given path and compare it with expected one. * * @param pathStr Path ot resolve. * @param expMode Expected mode. * @throws Exception If failed. */ private void checkMode(String pathStr, IgfsMode expMode) throws Exception { assert igfs != null; IgfsPath path = new IgfsPath(pathStr); IgfsModeResolver rslvr = igfs.modeResolver(); IgfsMode mode = rslvr.resolveMode(path); assertEquals(expMode, mode); }
log.debug("Rename file [src=" + src + ", dest=" + dest + ']'); IgfsMode mode = resolveMode(src); "upper level to self sub-dir) [src=" + src + ", dest=" + dest + ']'); if (evictExclude(src, mode == PRIMARY) != evictExclude(dest, modeRslvr.resolveMode(dest) == PRIMARY)) throw new IgfsInvalidPathException("Cannot move file to a path with different eviction " + "exclude setting (need to copy and remove)");
/** * Resolve mode for the given path. * * @param path Path. * @return Mode. */ private IgfsMode resolveMode(IgfsPath path) { return modeRslvr.resolveMode(path); }
/** {@inheritDoc} */ @Override public IgfsMode mode(IgfsPath path) { A.notNull(path, "path"); return modeRslvr.resolveMode(path); }
/** {@inheritDoc} */ @Override public boolean isProxy(URI path) { IgfsMode mode = F.isEmpty(cfg.getPathModes()) ? cfg.getDefaultMode() : modeRslvr.resolveMode(new IgfsPath(path)); return mode == PROXY; }
log.debug("Rename file [src=" + src + ", dest=" + dest + ']'); IgfsMode mode = resolveMode(src); "upper level to self sub-dir) [src=" + src + ", dest=" + dest + ']'); if (evictExclude(src, mode == PRIMARY) != evictExclude(dest, modeRslvr.resolveMode(dest) == PRIMARY)) throw new IgfsInvalidPathException("Cannot move file to a path with different eviction " + "exclude setting (need to copy and remove)");