# Minors in IGFS.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e5200210 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e5200210 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e5200210 Branch: refs/heads/ignite-329 Commit: e520021011f3e577bbd6d4be7aaddffa6315998f Parents: 83e02dc Author: vozerov-gridgain <voze...@gridgain.com> Authored: Tue Mar 10 11:39:14 2015 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Tue Mar 10 11:39:14 2015 +0300 ---------------------------------------------------------------------- .../org/apache/ignite/IgniteFileSystem.java | 24 +++++------ .../ignite/igfs/IgfsFileNotFoundException.java | 44 -------------------- .../ignite/igfs/IgfsPathNotFoundException.java | 44 ++++++++++++++++++++ .../igfs/secondary/IgfsSecondaryFileSystem.java | 10 ++--- .../igfs/common/IgfsControlResponse.java | 4 +- .../internal/processors/igfs/IgfsImpl.java | 18 ++++---- .../processors/igfs/IgfsInputStreamImpl.java | 8 ++-- .../processors/igfs/IgfsMetaManager.java | 20 ++++----- .../processors/igfs/IgfsOutputStreamImpl.java | 2 +- .../igfs/IgfsFragmentizerAbstractSelfTest.java | 4 +- .../processors/igfs/IgfsAbstractSelfTest.java | 2 +- .../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 10 ++--- .../processors/hadoop/igfs/HadoopIgfsUtils.java | 2 +- 13 files changed, 96 insertions(+), 96 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java b/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java index 51f0e71..90068c4 100644 --- a/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java +++ b/modules/core/src/main/java/org/apache/ignite/IgniteFileSystem.java @@ -80,7 +80,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * * @param path Path to get information for. * @return Summary object. - * @throws IgfsFileNotFoundException If path is not found. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path is not found. * @throws IgniteException If failed. */ public IgfsPathSummary summary(IgfsPath path) throws IgniteException; @@ -91,7 +91,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param path File path to read. * @return File input stream to read data from. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public IgfsInputStream open(IgfsPath path) throws IgniteException; @@ -102,7 +102,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param bufSize Read buffer size (bytes) or {@code zero} to use default value. * @return File input stream to read data from. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public IgfsInputStream open(IgfsPath path, int bufSize) throws IgniteException; @@ -114,7 +114,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param seqReadsBeforePrefetch Amount of sequential reads before prefetch is started. * @return File input stream to read data from. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public IgfsInputStream open(IgfsPath path, int bufSize, int seqReadsBeforePrefetch) throws IgniteException; @@ -168,7 +168,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param create Create file if it doesn't exist yet. * @return File output stream to append data to. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist and create flag is {@code false}. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist and create flag is {@code false}. */ public IgfsOutputStream append(IgfsPath path, boolean create) throws IgniteException; @@ -181,7 +181,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param props File properties to set only in case it file was just created. * @return File output stream to append data to. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist and create flag is {@code false}. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist and create flag is {@code false}. */ public IgfsOutputStream append(IgfsPath path, int bufSize, boolean create, @Nullable Map<String, String> props) throws IgniteException; @@ -194,7 +194,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param accessTime Optional last access time to set. Value {@code -1} does not update access time. * @param modificationTime Optional last modification time to set. Value {@code -1} does not update * modification time. - * @throws IgfsFileNotFoundException If target was not found. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If target was not found. * @throws IgniteException If error occurred. */ public void setTimes(IgfsPath path, long accessTime, long modificationTime) throws IgniteException; @@ -208,7 +208,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param len Size of data in the file to resolve affinity for. * @return Affinity block locations. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len) throws IgniteException; @@ -223,7 +223,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param maxLen Maximum length of a single returned block location length. * @return Affinity block locations. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len, long maxLen) throws IgniteException; @@ -384,7 +384,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param dest Destination file path. If destination path is a directory, then source file will be placed * into destination directory with original name. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If source file doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If source file doesn't exist. */ public void rename(IgfsPath src, IgfsPath dest) throws IgniteException; @@ -421,7 +421,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param path Path to list files under. * @return List of files under the specified path. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public Collection<IgfsPath> listPaths(IgfsPath path) throws IgniteException; @@ -431,7 +431,7 @@ public interface IgniteFileSystem extends IgniteAsyncSupport { * @param path Path to list files under. * @return List of files under the specified path. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public Collection<IgfsFile> listFiles(IgfsPath path) throws IgniteException; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/main/java/org/apache/ignite/igfs/IgfsFileNotFoundException.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsFileNotFoundException.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsFileNotFoundException.java deleted file mode 100644 index 436d972..0000000 --- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsFileNotFoundException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.igfs; - -/** - * {@code IGFS} exception indicating that target resource is not found. - */ -public class IgfsFileNotFoundException extends IgfsInvalidPathException { - /** */ - private static final long serialVersionUID = 0L; - - /** - * Creates exception with error message specified. - * - * @param msg Error message. - */ - public IgfsFileNotFoundException(String msg) { - super(msg); - } - - /** - * Creates exception with given exception cause. - * - * @param cause Exception cause. - */ - public IgfsFileNotFoundException(Throwable cause) { - super(cause); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java new file mode 100644 index 0000000..1f6a6ad --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsPathNotFoundException.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.igfs; + +/** + * {@code IGFS} exception indicating that target resource is not found. + */ +public class IgfsPathNotFoundException extends IgfsInvalidPathException { + /** */ + private static final long serialVersionUID = 0L; + + /** + * Creates exception with error message specified. + * + * @param msg Error message. + */ + public IgfsPathNotFoundException(String msg) { + super(msg); + } + + /** + * Creates exception with given exception cause. + * + * @param cause Exception cause. + */ + public IgfsPathNotFoundException(Throwable cause) { + super(cause); + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java index 089a8e3..9026eac 100644 --- a/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java +++ b/modules/core/src/main/java/org/apache/ignite/igfs/secondary/IgfsSecondaryFileSystem.java @@ -74,7 +74,7 @@ public interface IgfsSecondaryFileSystem { * @param dest Destination file path. If destination path is a directory, then source file will be placed * into destination directory with original name. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If source file doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If source file doesn't exist. */ public void rename(IgfsPath src, IgfsPath dest) throws IgniteException; @@ -111,7 +111,7 @@ public interface IgfsSecondaryFileSystem { * @param path Path to list files under. * @return List of files under the specified path. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public Collection<IgfsPath> listPaths(IgfsPath path) throws IgniteException; @@ -121,7 +121,7 @@ public interface IgfsSecondaryFileSystem { * @param path Path to list files under. * @return List of files under the specified path. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public Collection<IgfsFile> listFiles(IgfsPath path) throws IgniteException; @@ -132,7 +132,7 @@ public interface IgfsSecondaryFileSystem { * @param bufSize Read buffer size (bytes) or {@code zero} to use default value. * @return File input stream to read data from. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist. */ public IgfsSecondaryFileSystemPositionedReadable open(IgfsPath path, int bufSize) throws IgniteException; @@ -170,7 +170,7 @@ public interface IgfsSecondaryFileSystem { * @param props File properties to set only in case it file was just created. * @return File output stream to append data to. * @throws IgniteException In case of error. - * @throws IgfsFileNotFoundException If path doesn't exist and create flag is {@code false}. + * @throws org.apache.ignite.igfs.IgfsPathNotFoundException If path doesn't exist and create flag is {@code false}. */ public OutputStream append(IgfsPath path, int bufSize, boolean create, @Nullable Map<String, String> props) throws IgniteException; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java index 7295bda..de9bd68 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java @@ -261,7 +261,7 @@ public class IgfsControlResponse extends IgfsMessage { assert errCode != -1; if (errCode == ERR_FILE_NOT_FOUND) - throw new IgfsFileNotFoundException(err); + throw new IgfsPathNotFoundException(err); else if (errCode == ERR_PATH_ALREADY_EXISTS) throw new IgfsPathAlreadyExistsException(err); else if (errCode == ERR_DIRECTORY_NOT_EMPTY) @@ -332,7 +332,7 @@ public class IgfsControlResponse extends IgfsMessage { */ @SuppressWarnings("unchecked") private int errorCode(IgniteCheckedException e, boolean checkIo) { - if (X.hasCause(e, IgfsFileNotFoundException.class)) + if (X.hasCause(e, IgfsPathNotFoundException.class)) return ERR_FILE_NOT_FOUND; else if (e.hasCause(IgfsPathAlreadyExistsException.class)) return ERR_PATH_ALREADY_EXISTS; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java index 3c40cd1..abbfe1e 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java @@ -555,7 +555,7 @@ public final class IgfsImpl implements IgfsEx { IgniteUuid fileId = meta.fileId(path); if (fileId == null) - throw new IgfsFileNotFoundException("Failed to get path summary (path not found): " + path); + throw new IgfsPathNotFoundException("Failed to get path summary (path not found): " + path); IgfsPathSummary sum = new IgfsPathSummary(path); @@ -685,7 +685,7 @@ public final class IgfsImpl implements IgfsEx { if (mode == PRIMARY) checkConflictWithPrimary(src); - throw new IgfsFileNotFoundException("Failed to rename (source path not found): " + src); + throw new IgfsPathNotFoundException("Failed to rename (source path not found): " + src); } String srcFileName = src.name(); @@ -705,7 +705,7 @@ public final class IgfsImpl implements IgfsEx { // Destination directory doesn't exist. if (destDesc == null) - throw new IgfsFileNotFoundException("Failed to rename (destination directory does not " + + throw new IgfsPathNotFoundException("Failed to rename (destination directory does not " + "exist): " + dest); destFileName = dest.name(); @@ -974,7 +974,7 @@ public final class IgfsImpl implements IgfsEx { else if (mode == PRIMARY) { checkConflictWithPrimary(path); - throw new IgfsFileNotFoundException("Failed to list files (path not found): " + path); + throw new IgfsPathNotFoundException("Failed to list files (path not found): " + path); } return F.viewReadOnly(files, new C1<String, IgfsPath>() { @@ -1048,7 +1048,7 @@ public final class IgfsImpl implements IgfsEx { else if (mode == PRIMARY) { checkConflictWithPrimary(path); - throw new IgfsFileNotFoundException("Failed to list files (path not found): " + path); + throw new IgfsPathNotFoundException("Failed to list files (path not found): " + path); } return files; @@ -1116,7 +1116,7 @@ public final class IgfsImpl implements IgfsEx { if (info == null) { checkConflictWithPrimary(path); - throw new IgfsFileNotFoundException("File not found: " + path); + throw new IgfsPathNotFoundException("File not found: " + path); } if (!info.isFile()) @@ -1333,7 +1333,7 @@ public final class IgfsImpl implements IgfsEx { if (!create) { checkConflictWithPrimary(path); - throw new IgfsFileNotFoundException("File not found: " + path); + throw new IgfsPathNotFoundException("File not found: " + path); } if (parentId == null) @@ -1388,7 +1388,7 @@ public final class IgfsImpl implements IgfsEx { if (desc == null) { checkConflictWithPrimary(path); - throw new IgfsFileNotFoundException("Failed to update times (path not found): " + path); + throw new IgfsPathNotFoundException("Failed to update times (path not found): " + path); } // Cannot update times for root. @@ -1457,7 +1457,7 @@ public final class IgfsImpl implements IgfsEx { } if (info == null) - throw new IgfsFileNotFoundException("File not found: " + path); + throw new IgfsPathNotFoundException("File not found: " + path); if (!info.isFile()) throw new IgfsInvalidPathException("Failed to get affinity info for file (not a file): " + http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java index b72f824..30d2cf3 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsInputStreamImpl.java @@ -397,7 +397,7 @@ public class IgfsInputStreamImpl extends IgfsInputStreamAdapter { // File was deleted. if (newInfo == null) - throw new IgfsFileNotFoundException("Failed to read file block (file was concurrently " + + throw new IgfsPathNotFoundException("Failed to read file block (file was concurrently " + "deleted) [path=" + path + ", blockIdx=" + blockIdx + ']'); fileInfo = newInfo; @@ -495,15 +495,15 @@ public class IgfsInputStreamImpl extends IgfsInputStreamAdapter { pendingFuts.add(evictFut); evictFut.listen(new IgniteInClosure<IgniteInternalFuture<byte[]>>() { - @Override public void apply(IgniteInternalFuture<byte[]> t) { + @Override + public void apply(IgniteInternalFuture<byte[]> t) { pendingFuts.remove(evictFut); pendingFutsLock.lock(); try { pendingFutsCond.signalAll(); - } - finally { + } finally { pendingFutsLock.unlock(); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java index d2b94db..d340089 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java @@ -500,7 +500,7 @@ public class IgfsMetaManager extends IgfsManager { IgfsFileInfo oldInfo = info(fileId); if (oldInfo == null) - throw fsException(new IgfsFileNotFoundException("Failed to unlock file (file not found): " + fileId)); + throw fsException(new IgfsPathNotFoundException("Failed to unlock file (file not found): " + fileId)); if (!info.lockId().equals(oldInfo.lockId())) throw new IgniteCheckedException("Failed to unlock file (inconsistent file lock ID) [fileId=" + fileId + @@ -739,7 +739,7 @@ public class IgfsMetaManager extends IgfsManager { assert validTxState(true); if (parentInfo == null) - throw fsException(new IgfsFileNotFoundException("Failed to lock parent directory (not found): " + parentId)); + throw fsException(new IgfsPathNotFoundException("Failed to lock parent directory (not found): " + parentId)); if (!parentInfo.isDirectory()) throw fsException(new IgfsInvalidPathException("Parent file is not a directory: " + parentInfo)); @@ -839,7 +839,7 @@ public class IgfsMetaManager extends IgfsManager { IgfsFileInfo srcInfo = infoMap.get(srcParentId); if (srcInfo == null) - throw fsException(new IgfsFileNotFoundException("Failed to lock source directory (not found?)" + + throw fsException(new IgfsPathNotFoundException("Failed to lock source directory (not found?)" + " [srcParentId=" + srcParentId + ']')); if (!srcInfo.isDirectory()) @@ -848,7 +848,7 @@ public class IgfsMetaManager extends IgfsManager { IgfsFileInfo destInfo = infoMap.get(destParentId); if (destInfo == null) - throw fsException(new IgfsFileNotFoundException("Failed to lock destination directory (not found?)" + + throw fsException(new IgfsPathNotFoundException("Failed to lock destination directory (not found?)" + " [destParentId=" + destParentId + ']')); if (!destInfo.isDirectory()) @@ -857,7 +857,7 @@ public class IgfsMetaManager extends IgfsManager { IgfsFileInfo fileInfo = infoMap.get(fileId); if (fileInfo == null) - throw fsException(new IgfsFileNotFoundException("Failed to lock target file (not found?) [fileId=" + + throw fsException(new IgfsPathNotFoundException("Failed to lock target file (not found?) [fileId=" + fileId + ']')); IgfsListingEntry srcEntry = srcInfo.listing().get(srcFileName); @@ -865,7 +865,7 @@ public class IgfsMetaManager extends IgfsManager { // If source file does not exist or was re-created. if (srcEntry == null || !srcEntry.fileId().equals(fileId)) - throw fsException(new IgfsFileNotFoundException("Failed to remove file name from the source directory" + + throw fsException(new IgfsPathNotFoundException("Failed to remove file name from the source directory" + " (file not found) [fileId=" + fileId + ", srcFileName=" + srcFileName + ", srcParentId=" + srcParentId + ", srcEntry=" + srcEntry + ']')); @@ -1859,7 +1859,7 @@ public class IgfsMetaManager extends IgfsManager { IgfsFileInfo info = infos.get(path); if (info == null) - throw fsException(new IgfsFileNotFoundException("File not found: " + path)); + throw fsException(new IgfsPathNotFoundException("File not found: " + path)); if (!info.isFile()) throw fsException(new IgfsInvalidPathException("Failed to open file (not a file): " + path)); @@ -2049,11 +2049,11 @@ public class IgfsMetaManager extends IgfsManager { // Source path and destination (or destination parent) must exist. if (srcInfo == null) - throw fsException(new IgfsFileNotFoundException("Failed to rename " + + throw fsException(new IgfsPathNotFoundException("Failed to rename " + "(source path not found): " + src)); if (destInfo == null && destParentInfo == null) - throw fsException(new IgfsFileNotFoundException("Failed to rename " + + throw fsException(new IgfsPathNotFoundException("Failed to rename " + "(destination path not found): " + dest)); // Delegate to the secondary file system. @@ -2610,7 +2610,7 @@ public class IgfsMetaManager extends IgfsManager { IgfsFileInfo fileInfo = infoMap.get(fileId); if (fileInfo == null) - throw fsException(new IgfsFileNotFoundException("Failed to update times " + + throw fsException(new IgfsPathNotFoundException("Failed to update times " + "(path was not found): " + fileName)); IgfsFileInfo parentInfo = infoMap.get(parentId); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java index 6c6dd9d..c5b3e20 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsOutputStreamImpl.java @@ -364,7 +364,7 @@ class IgfsOutputStreamImpl extends IgfsOutputStreamAdapter { try { meta.unlock(fileInfo, modificationTime); } - catch (IgfsFileNotFoundException ignore) { + catch (IgfsPathNotFoundException ignore) { data.delete(fileInfo); // Safety to ensure that all data blocks are deleted. throw new IOException("File was concurrently deleted: " + path); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java index 3fa0804..60b6bb2 100644 --- a/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/igfs/IgfsFragmentizerAbstractSelfTest.java @@ -133,13 +133,13 @@ public class IgfsFragmentizerAbstractSelfTest extends IgfsCommonAbstractTest { IgniteUuid fileId = meta.fileId(path); if (fileId == null) - throw new IgfsFileNotFoundException("File not found: " + path); + throw new IgfsPathNotFoundException("File not found: " + path); IgfsFileInfo fileInfo = meta.info(fileId); do { if (fileInfo == null) - throw new IgfsFileNotFoundException("File not found: " + path); + throw new IgfsPathNotFoundException("File not found: " + path); if (fileInfo.fileMap().ranges().isEmpty()) return; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java index 080c647..c6eabde 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java @@ -878,7 +878,7 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest { return null; } - }, IgfsFileNotFoundException.class, "File not found: " + FILE); + }, IgfsPathNotFoundException.class, "File not found: " + FILE); } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java index 3320a96..3a7464c 100644 --- a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java +++ b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java @@ -126,7 +126,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys */ public static IgfsException cast(String msg, IOException e) { if (e instanceof FileNotFoundException) - return new IgfsFileNotFoundException(e); + return new IgfsPathNotFoundException(e); else if (e instanceof ParentNotDirectoryException) return new IgfsParentNotDirectoryException(msg, e); else if (e instanceof PathIsNotEmptyDirectoryException) @@ -233,7 +233,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys FileStatus[] statuses = fileSys.listStatus(convert(path)); if (statuses == null) - throw new IgfsFileNotFoundException("Failed to list files (path not found): " + path); + throw new IgfsPathNotFoundException("Failed to list files (path not found): " + path); Collection<IgfsPath> res = new ArrayList<>(statuses.length); @@ -243,7 +243,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys return res; } catch (FileNotFoundException ignored) { - throw new IgfsFileNotFoundException("Failed to list files (path not found): " + path); + throw new IgfsPathNotFoundException("Failed to list files (path not found): " + path); } catch (IOException e) { throw handleSecondaryFsError(e, "Failed to list statuses due to secondary file system exception: " + path); @@ -256,7 +256,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys FileStatus[] statuses = fileSys.listStatus(convert(path)); if (statuses == null) - throw new IgfsFileNotFoundException("Failed to list files (path not found): " + path); + throw new IgfsPathNotFoundException("Failed to list files (path not found): " + path); Collection<IgfsFile> res = new ArrayList<>(statuses.length); @@ -271,7 +271,7 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements IgfsSecondaryFileSys return res; } catch (FileNotFoundException ignored) { - throw new IgfsFileNotFoundException("Failed to list files (path not found): " + path); + throw new IgfsPathNotFoundException("Failed to list files (path not found): " + path); } catch (IOException e) { throw handleSecondaryFsError(e, "Failed to list statuses due to secondary file system exception: " + path); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5200210/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java ---------------------------------------------------------------------- diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java index 3fe8124..0e3d127 100644 --- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java +++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsUtils.java @@ -109,7 +109,7 @@ public class HadoopIgfsUtils { // First check for any nested IOException; if exists - re-throw it. if (e.hasCause(IOException.class)) return e.getCause(IOException.class); - else if (e.hasCause(IgfsFileNotFoundException.class)) + else if (e.hasCause(IgfsPathNotFoundException.class)) return new FileNotFoundException(path); // TODO: Or PathNotFoundException? else if (e.hasCause(IgfsParentNotDirectoryException.class)) return new ParentNotDirectoryException(path);