/** {@inheritDoc} */ @Override public boolean equals(Object o) { if (o == this) return true; if (o == null || !(o instanceof LocalFileSystemBlockKey)) return false; LocalFileSystemBlockKey that = (LocalFileSystemBlockKey)o; return blockId == that.blockId && path.equals(that.path); }
/** {@inheritDoc} */ @Override public boolean equals(Object o) { if (o == this) return true; if (o == null || getClass() != o.getClass()) return false; IgfsFileImpl that = (IgfsFileImpl)o; return path.equals(that.path); }
@Override public Boolean onSuccess(Map<IgfsPath, IgfsEntryInfo> infos) throws Exception { fs.mkdirs(path, props); assert !infos.isEmpty(); // Now perform synchronization again starting with the last created parent. IgfsPath parentPath = null; for (IgfsPath curPath : infos.keySet()) { if (parentPath == null || curPath.isSubDirectoryOf(parentPath)) parentPath = curPath; } assert parentPath != null; IgfsEntryInfo parentPathInfo = infos.get(parentPath); synchronize(fs, parentPath, parentPathInfo, path, true, null); if (evts.isRecordable(EventType.EVT_IGFS_DIR_CREATED)) { IgfsPath evtPath = path; while (!parentPath.equals(evtPath)) { pendingEvts.addFirst(new IgfsEvent(evtPath, locNode, EventType.EVT_IGFS_DIR_CREATED)); evtPath = evtPath.parent(); assert evtPath != null; // If this fails, then ROOT does not exist. } } return true; }
if (parentPath.equals(firstParentPath)) infos.put(firstParentPath, idToInfo.get(pathToId.get(firstParentPath))); else {
@Override public boolean apply(Event e) { IgfsEvent e0 = (IgfsEvent)e; return e0.type() == EVT_IGFS_FILE_OPENED_WRITE && e0.path().equals(file1); } },
/** {@inheritDoc} */ @Override public boolean apply(Event e) { IgfsEvent e0 = (IgfsEvent)e; return e0.type() == evt && e0.path().equals(path); } }
@Override public boolean apply(Event e) { IgfsEvent e0 = (IgfsEvent)e; return e0.type() == EVT_IGFS_FILE_CLOSED_WRITE && e0.path().equals(file1); } }
@Override public boolean apply(Event e) { IgfsEvent e0 = (IgfsEvent)e; return e0.type() == EVT_IGFS_FILE_PURGED && e0.path().equals(file1); } },
/** * Test list files routine. * * @throws Exception If failed. */ @Test public void testListFiles() throws Exception { create(igfs, paths(DIR, SUBDIR, SUBSUBDIR), paths(FILE)); Collection<IgfsFile> paths = igfs.listFiles(SUBDIR); assert paths != null; assert paths.size() == 2; Iterator<IgfsFile> iter = paths.iterator(); IgfsFile path1 = iter.next(); IgfsFile path2 = iter.next(); assert (SUBSUBDIR.equals(path1.path()) && FILE.equals(path2.path())) || (FILE.equals(path1.path()) && SUBSUBDIR.equals(path2.path())); }
/** * Test list files routine when the path doesn't exist locally. * * @throws Exception If failed. */ @Test public void testListFilesPathMissing() throws Exception { create(igfsSecondary, paths(DIR, SUBDIR, SUBSUBDIR), paths(FILE)); Collection<IgfsFile> paths = igfs.listFiles(SUBDIR); assert paths != null; assert paths.size() == 2; Iterator<IgfsFile> iter = paths.iterator(); IgfsFile path1 = iter.next(); IgfsFile path2 = iter.next(); assert (SUBSUBDIR.equals(path1.path()) && FILE.equals(path2.path())) || (FILE.equals(path1.path()) && SUBSUBDIR.equals(path2.path())); }
if (!status.isDirectory() && !curPath.equals(endPath)) throw new IgniteCheckedException("Failed to create path the locally because secondary file " + "system directory structure was modified concurrently and the path is not a directory as " +
if (src.equals(dest)) return null; // Rename to itself is a no-op.
if (!root.equals(p2)) { GridTestUtils.assertThrowsInherited(log, new Callable<Object>() { @Override public Object call() throws Exception {
/** {@inheritDoc} */ @Override public boolean equals(Object o) { if (o == this) return true; if (o == null || !(o instanceof LocalFileSystemBlockKey)) return false; LocalFileSystemBlockKey that = (LocalFileSystemBlockKey)o; return blockId == that.blockId && path.equals(that.path); }
/** {@inheritDoc} */ @Override public boolean equals(Object o) { if (o == this) return true; if (o == null || getClass() != o.getClass()) return false; IgfsFileImpl that = (IgfsFileImpl)o; return path.equals(that.path); }
@Override public Boolean onSuccess(Map<IgfsPath, IgfsEntryInfo> infos) throws Exception { fs.mkdirs(path, props); assert !infos.isEmpty(); // Now perform synchronization again starting with the last created parent. IgfsPath parentPath = null; for (IgfsPath curPath : infos.keySet()) { if (parentPath == null || curPath.isSubDirectoryOf(parentPath)) parentPath = curPath; } assert parentPath != null; IgfsEntryInfo parentPathInfo = infos.get(parentPath); synchronize(fs, parentPath, parentPathInfo, path, true, null); if (evts.isRecordable(EventType.EVT_IGFS_DIR_CREATED)) { IgfsPath evtPath = path; while (!parentPath.equals(evtPath)) { pendingEvts.addFirst(new IgfsEvent(evtPath, locNode, EventType.EVT_IGFS_DIR_CREATED)); evtPath = evtPath.parent(); assert evtPath != null; // If this fails, then ROOT does not exist. } } return true; }
if (!status.isDirectory() && !curPath.equals(endPath)) throw new IgniteCheckedException("Failed to create path the locally because secondary file " + "system directory structure was modified concurrently and the path is not a directory as " +
if (src.equals(dest)) return null; // Rename to itself is a no-op.