Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7C2549610 for ; Fri, 12 Dec 2014 07:16:33 +0000 (UTC) Received: (qmail 2986 invoked by uid 500); 12 Dec 2014 07:16:33 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 2957 invoked by uid 500); 12 Dec 2014 07:16:33 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 2948 invoked by uid 99); 12 Dec 2014 07:16:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2014 07:16:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 12 Dec 2014 07:14:45 +0000 Received: (qmail 95492 invoked by uid 99); 12 Dec 2014 07:14:40 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2014 07:14:40 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8169BA285DC; Fri, 12 Dec 2014 07:14:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Fri, 12 Dec 2014 07:15:03 -0000 Message-Id: <08b2f537b53c4cafa9ab11be5dd4e258@git.apache.org> In-Reply-To: <858f2843d730461b9380ed10f06a037b@git.apache.org> References: <858f2843d730461b9380ed10f06a037b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [25/64] [abbrv] [partial] incubator-ignite git commit: Rename GridException to IgniteCheckedException, GridRuntimeException to IgniteException. X-Virus-Checked: Checked by ClamAV on apache.org http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java index 2f00e69..44e110f 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsImpl.java @@ -114,9 +114,9 @@ public final class GridGgfsImpl implements GridGgfsEx { * Creates GGFS instance with given context. * * @param ggfsCtx Context. - * @throws GridException In case of error. + * @throws IgniteCheckedException In case of error. */ - GridGgfsImpl(GridGgfsContext ggfsCtx) throws GridException { + GridGgfsImpl(GridGgfsContext ggfsCtx) throws IgniteCheckedException { assert ggfsCtx != null; this.ggfsCtx = ggfsCtx; @@ -133,7 +133,7 @@ public final class GridGgfsImpl implements GridGgfsEx { if (secondaryFs == null) { if (cfg.getDefaultMode() == PROXY) - throw new GridException("Mode cannot be PROXY if secondary file system hasn't been defined."); + throw new IgniteCheckedException("Mode cannot be PROXY if secondary file system hasn't been defined."); dfltMode = PRIMARY; } @@ -175,7 +175,7 @@ public final class GridGgfsImpl implements GridGgfsEx { modes.add(new T2<>(new IgniteFsPath(mode.getKey()), mode0)); } catch (IllegalArgumentException e) { - throw new GridException("Invalid path found in mode pattern: " + mode.getKey(), e); + throw new IgniteCheckedException("Invalid path found in mode pattern: " + mode.getKey(), e); } } } @@ -254,9 +254,9 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param path File path in the secondary file system. * @param out Output stream to that file. * @return Created batch. - * @throws GridException In case new batch cannot be created. + * @throws IgniteCheckedException In case new batch cannot be created. */ - private GridGgfsFileWorkerBatch newBatch(final IgniteFsPath path, OutputStream out) throws GridException { + private GridGgfsFileWorkerBatch newBatch(final IgniteFsPath path, OutputStream out) throws IgniteCheckedException { assert path != null; assert out != null; @@ -299,13 +299,13 @@ public final class GridGgfsImpl implements GridGgfsEx { } } else - throw new GridException("Cannot create new output stream to the secondary file system because GGFS is " + + throw new IgniteCheckedException("Cannot create new output stream to the secondary file system because GGFS is " + "stopping: " + path); } /** * @return {@code True} if entered busy section. - * @throws GridRuntimeException If failed to await caches start. + * @throws IgniteException If failed to await caches start. */ private boolean enterBusy() { meta.awaitInit(); @@ -342,7 +342,7 @@ public final class GridGgfsImpl implements GridGgfsEx { try { batch.awaitIfFinished(); } - catch (GridException ignore) { + catch (IgniteCheckedException ignore) { // No-op. } } @@ -389,7 +389,7 @@ public final class GridGgfsImpl implements GridGgfsEx { /** {@inheritDoc} */ @SuppressWarnings("ConstantConditions") - @Override public GridGgfsStatus globalSpace() throws GridException { + @Override public GridGgfsStatus globalSpace() throws IgniteCheckedException { if (enterBusy()) { try { IgniteBiTuple space = ggfsCtx.kernalContext().grid().compute().execute( @@ -406,7 +406,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public void globalSampling(@Nullable Boolean val) throws GridException { + @Override public void globalSampling(@Nullable Boolean val) throws IgniteCheckedException { if (enterBusy()) { try { if (meta.sampling(val)) { @@ -436,7 +436,7 @@ public final class GridGgfsImpl implements GridGgfsEx { try { return meta.sampling(); } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to get sampling state.", e); return false; @@ -461,7 +461,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public boolean exists(IgniteFsPath path) throws GridException { + @Override public boolean exists(IgniteFsPath path) throws IgniteCheckedException { A.notNull(path, "path"); if (log.isDebugEnabled()) @@ -470,7 +470,7 @@ public final class GridGgfsImpl implements GridGgfsEx { IgniteFsMode mode = modeRslvr.resolveMode(path); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); boolean res = false; @@ -497,7 +497,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public IgniteFsFile info(IgniteFsPath path) throws GridException { + @Override public IgniteFsFile info(IgniteFsPath path) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -508,7 +508,7 @@ public final class GridGgfsImpl implements GridGgfsEx { IgniteFsMode mode = modeRslvr.resolveMode(path); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); GridGgfsFileInfo info = resolveFileInfo(path, mode); @@ -526,7 +526,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public IgniteFsPathSummary summary(IgniteFsPath path) throws GridException { + @Override public IgniteFsPathSummary summary(IgniteFsPath path) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -554,7 +554,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public IgniteFsFile update(IgniteFsPath path, Map props) throws GridException { + @Override public IgniteFsFile update(IgniteFsPath path, Map props) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -567,7 +567,7 @@ public final class GridGgfsImpl implements GridGgfsEx { IgniteFsMode mode = modeRslvr.resolveMode(path); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); else if (mode != PRIMARY) { assert mode == DUAL_SYNC || mode == DUAL_ASYNC; @@ -610,7 +610,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public void rename(IgniteFsPath src, IgniteFsPath dest) throws GridException { + @Override public void rename(IgniteFsPath src, IgniteFsPath dest) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(src, "src"); @@ -623,7 +623,7 @@ public final class GridGgfsImpl implements GridGgfsEx { Set childrenModes = modeRslvr.resolveChildrenModes(src); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + src); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + src); if (src.equals(dest)) return; // Rename to itself is a no-op. @@ -719,7 +719,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public boolean delete(IgniteFsPath path, boolean recursive) throws GridException { + @Override public boolean delete(IgniteFsPath path, boolean recursive) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -731,7 +731,7 @@ public final class GridGgfsImpl implements GridGgfsEx { Set childrenModes = modeRslvr.resolveChildrenModes(path); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); boolean res = false; @@ -781,10 +781,10 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param recursive Recursive deletion flag. * @return {@code True} if file was successfully deleted. If directory is not empty and * {@code recursive} flag is false, will return {@code false}. - * @throws GridException In case of error. + * @throws IgniteCheckedException In case of error. */ private boolean delete0(FileDescriptor desc, @Nullable IgniteFsPath parentPath, boolean recursive) - throws GridException { + throws IgniteCheckedException { IgniteFsPath curPath = parentPath == null ? new IgniteFsPath() : new IgniteFsPath(parentPath, desc.fileName); if (desc.isFile) { @@ -815,12 +815,12 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public void mkdirs(IgniteFsPath path) throws GridException { + @Override public void mkdirs(IgniteFsPath path) throws IgniteCheckedException { mkdirs(path, null); } /** {@inheritDoc} */ - @Override public void mkdirs(IgniteFsPath path, @Nullable Map props) throws GridException { + @Override public void mkdirs(IgniteFsPath path, @Nullable Map props) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -834,7 +834,7 @@ public final class GridGgfsImpl implements GridGgfsEx { IgniteFsMode mode = modeRslvr.resolveMode(path); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); else if (mode != PRIMARY) { assert mode == DUAL_SYNC || mode == DUAL_ASYNC; @@ -874,7 +874,7 @@ public final class GridGgfsImpl implements GridGgfsEx { if (oldId == null && evts.isRecordable(EVT_GGFS_DIR_CREATED)) evts.record(new IgniteFsEvent(curPath, localNode(), EVT_GGFS_DIR_CREATED)); } - catch (GridException e) { + catch (IgniteCheckedException e) { if (log.isDebugEnabled()) log.debug("Failed to create directory [path=" + path + ", parentId=" + parentId + ", fileName=" + fileName + ", step=" + step + ", e=" + e.getMessage() + ']'); @@ -907,7 +907,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public Collection listPaths(final IgniteFsPath path) throws GridException { + @Override public Collection listPaths(final IgniteFsPath path) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -918,7 +918,7 @@ public final class GridGgfsImpl implements GridGgfsEx { IgniteFsMode mode = modeRslvr.resolveMode(path); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); Set childrenModes = modeRslvr.resolveChildrenModes(path); @@ -959,7 +959,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public Collection listFiles(final IgniteFsPath path) throws GridException { + @Override public Collection listFiles(final IgniteFsPath path) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -970,7 +970,7 @@ public final class GridGgfsImpl implements GridGgfsEx { IgniteFsMode mode = modeRslvr.resolveMode(path); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); Set childrenModes = modeRslvr.resolveChildrenModes(path); @@ -1026,7 +1026,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public long usedSpaceSize() throws GridException { + @Override public long usedSpaceSize() throws IgniteCheckedException { return metrics().localSpaceSize(); } @@ -1036,18 +1036,18 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path) throws GridException { + @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path) throws IgniteCheckedException { return open(path, cfg.getStreamBufferSize(), cfg.getSequentialReadsBeforePrefetch()); } /** {@inheritDoc} */ - @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path, int bufSize) throws GridException { + @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path, int bufSize) throws IgniteCheckedException { return open(path, bufSize, cfg.getSequentialReadsBeforePrefetch()); } /** {@inheritDoc} */ @Override public GridGgfsInputStreamAdapter open(IgniteFsPath path, int bufSize, int seqReadsBeforePrefetch) - throws GridException { + throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -1063,7 +1063,7 @@ public final class GridGgfsImpl implements GridGgfsEx { IgniteFsMode mode = modeRslvr.resolveMode(path); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); else if (mode != PRIMARY) { assert mode == DUAL_SYNC || mode == DUAL_ASYNC; @@ -1107,20 +1107,20 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public IgniteFsOutputStream create(IgniteFsPath path, boolean overwrite) throws GridException { + @Override public IgniteFsOutputStream create(IgniteFsPath path, boolean overwrite) throws IgniteCheckedException { return create0(path, cfg.getStreamBufferSize(), overwrite, null, 0, null, true); } /** {@inheritDoc} */ @Override public IgniteFsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, int replication, - long blockSize, @Nullable Map props) throws GridException { + long blockSize, @Nullable Map props) throws IgniteCheckedException { return create0(path, bufSize, overwrite, null, replication, props, false); } /** {@inheritDoc} */ @Override public IgniteFsOutputStream create(IgniteFsPath path, int bufSize, boolean overwrite, @Nullable IgniteUuid affKey, int replication, long blockSize, @Nullable Map props) - throws GridException { + throws IgniteCheckedException { return create0(path, bufSize, overwrite, affKey, replication, props, false); } @@ -1135,7 +1135,7 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param props Properties. * @param simpleCreate Whether new file should be created in secondary FS using create(Path, boolean) method. * @return Output stream. - * @throws GridException If file creation failed. + * @throws IgniteCheckedException If file creation failed. */ private IgniteFsOutputStream create0( final IgniteFsPath path, @@ -1145,7 +1145,7 @@ public final class GridGgfsImpl implements GridGgfsEx { final int replication, @Nullable Map props, final boolean simpleCreate - ) throws GridException { + ) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -1160,7 +1160,7 @@ public final class GridGgfsImpl implements GridGgfsEx { GridGgfsFileWorkerBatch batch = null; if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); else if (mode != PRIMARY) { assert mode == DUAL_SYNC || mode == DUAL_ASYNC; @@ -1248,13 +1248,13 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public IgniteFsOutputStream append(IgniteFsPath path, boolean create) throws GridException { + @Override public IgniteFsOutputStream append(IgniteFsPath path, boolean create) throws IgniteCheckedException { return append(path, cfg.getStreamBufferSize(), create, null); } /** {@inheritDoc} */ @Override public IgniteFsOutputStream append(final IgniteFsPath path, final int bufSize, boolean create, - @Nullable Map props) throws GridException { + @Nullable Map props) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -1269,7 +1269,7 @@ public final class GridGgfsImpl implements GridGgfsEx { GridGgfsFileWorkerBatch batch = null; if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); else if (mode != PRIMARY) { assert mode == DUAL_SYNC || mode == DUAL_ASYNC; @@ -1333,7 +1333,7 @@ public final class GridGgfsImpl implements GridGgfsEx { /** {@inheritDoc} */ @Override public void setTimes(IgniteFsPath path, long accessTime, long modificationTime) - throws GridException { + throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -1367,12 +1367,12 @@ public final class GridGgfsImpl implements GridGgfsEx { * Checks if given path exists in secondary file system and throws exception if so. * * @param path Path to check. - * @throws GridException If path exists. + * @throws IgniteCheckedException If path exists. */ - private void checkConflictWithPrimary(IgniteFsPath path) throws GridException { + private void checkConflictWithPrimary(IgniteFsPath path) throws IgniteCheckedException { if (secondaryFs != null) { if (secondaryFs.info(path) != null) { - throw new GridException("Path mapped to a PRIMARY mode found in secondary file " + + throw new IgniteCheckedException("Path mapped to a PRIMARY mode found in secondary file " + "system. Remove path from secondary file system or change path mapping: " + path); } } @@ -1380,13 +1380,13 @@ public final class GridGgfsImpl implements GridGgfsEx { /** {@inheritDoc} */ @Override public Collection affinity(IgniteFsPath path, long start, long len) - throws GridException { + throws IgniteCheckedException { return affinity(path, start, len, 0L); } /** {@inheritDoc} */ @Override public Collection affinity(IgniteFsPath path, long start, long len, long maxLen) - throws GridException { + throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -1399,7 +1399,7 @@ public final class GridGgfsImpl implements GridGgfsEx { IgniteFsMode mode = modeRslvr.resolveMode(path); if (mode == PROXY) - throw new GridException("PROXY mode cannot be used in GGFS directly: " + path); + throw new IgniteCheckedException("PROXY mode cannot be used in GGFS directly: " + path); // Check memory first. IgniteUuid fileId = meta.fileId(path); @@ -1431,7 +1431,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public IgniteFsMetrics metrics() throws GridException { + @Override public IgniteFsMetrics metrics() throws IgniteCheckedException { if (enterBusy()) { try { IgniteFsPathSummary sum = new IgniteFsPathSummary(); @@ -1444,7 +1444,7 @@ public final class GridGgfsImpl implements GridGgfsEx { try { secondarySpaceSize = secondaryFs.usedSpaceSize(); } - catch (GridException e) { + catch (IgniteCheckedException e) { LT.warn(log, e, "Failed to get secondary file system consumed space size."); secondarySpaceSize = -1; @@ -1482,7 +1482,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public long size(IgniteFsPath path) throws GridException { + @Override public long size(IgniteFsPath path) throws IgniteCheckedException { if (enterBusy()) { try { A.notNull(path, "path"); @@ -1511,9 +1511,9 @@ public final class GridGgfsImpl implements GridGgfsEx { * * @param fileId File ID. * @param sum Summary object that will collect information. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - private void summary0(IgniteUuid fileId, IgniteFsPathSummary sum) throws GridException { + private void summary0(IgniteUuid fileId, IgniteFsPathSummary sum) throws IgniteCheckedException { assert sum != null; GridGgfsFileInfo info = meta.info(fileId); @@ -1534,7 +1534,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public void format() throws GridException { + @Override public void format() throws IgniteCheckedException { formatAsync().get(); } @@ -1543,7 +1543,7 @@ public final class GridGgfsImpl implements GridGgfsEx { * * @return Future. */ - IgniteFuture formatAsync() throws GridException { + IgniteFuture formatAsync() throws IgniteCheckedException { IgniteUuid id = meta.softDelete(null, null, ROOT_ID); if (id == null) @@ -1569,7 +1569,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public IgniteFuture awaitDeletesAsync() throws GridException { + @Override public IgniteFuture awaitDeletesAsync() throws IgniteCheckedException { Collection ids = meta.pendingDeletes(); if (!ids.isEmpty()) { @@ -1609,9 +1609,9 @@ public final class GridGgfsImpl implements GridGgfsEx { * * @param path Path to file. * @return Detailed file descriptor or {@code null}, if file does not exist. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - @Nullable private FileDescriptor getFileDescriptor(IgniteFsPath path) throws GridException { + @Nullable private FileDescriptor getFileDescriptor(IgniteFsPath path) throws IgniteCheckedException { List ids = meta.fileIds(path); GridGgfsFileInfo fileInfo = meta.info(ids.get(ids.size() - 1)); @@ -1630,9 +1630,9 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param path Path of the deleted file. * @param desc Detailed file descriptor to remove. * @param rmvLocked Whether to remove this entry in case it is has explicit lock. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - private void deleteFile(IgniteFsPath path, FileDescriptor desc, boolean rmvLocked) throws GridException { + private void deleteFile(IgniteFsPath path, FileDescriptor desc, boolean rmvLocked) throws IgniteCheckedException { IgniteUuid parentId = desc.parentId; IgniteUuid fileId = desc.fileId; @@ -1668,27 +1668,27 @@ public final class GridGgfsImpl implements GridGgfsEx { /** {@inheritDoc} */ @Override public R execute(IgniteFsTask task, @Nullable IgniteFsRecordResolver rslvr, - Collection paths, @Nullable T arg) throws GridException { + Collection paths, @Nullable T arg) throws IgniteCheckedException { return executeAsync(task, rslvr, paths, arg).get(); } /** {@inheritDoc} */ @Override public R execute(IgniteFsTask task, @Nullable IgniteFsRecordResolver rslvr, Collection paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) - throws GridException { + throws IgniteCheckedException { return executeAsync(task, rslvr, paths, skipNonExistentFiles, maxRangeLen, arg).get(); } /** {@inheritDoc} */ @Override public R execute(Class> taskCls, - @Nullable IgniteFsRecordResolver rslvr, Collection paths, @Nullable T arg) throws GridException { + @Nullable IgniteFsRecordResolver rslvr, Collection paths, @Nullable T arg) throws IgniteCheckedException { return executeAsync(taskCls, rslvr, paths, arg).get(); } /** {@inheritDoc} */ @Override public R execute(Class> taskCls, @Nullable IgniteFsRecordResolver rslvr, Collection paths, boolean skipNonExistentFiles, - long maxRangeSize, @Nullable T arg) throws GridException { + long maxRangeSize, @Nullable T arg) throws IgniteCheckedException { return executeAsync(taskCls, rslvr, paths, skipNonExistentFiles, maxRangeSize, arg).get(); } @@ -1768,7 +1768,7 @@ public final class GridGgfsImpl implements GridGgfsEx { // Exclude all PRIMARY files + the ones specified in eviction policy as exclusions. return primary || evictPlc == null || evictPlc.exclude(path); } - catch (GridException e) { + catch (IgniteCheckedException e) { LT.error(log, e, "Failed to check whether the path must be excluded from evictions: " + path); return false; @@ -1781,9 +1781,9 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param path Path. * @param mode Mode. * @return File info or {@code null} in case file is not found. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - private GridGgfsFileInfo resolveFileInfo(IgniteFsPath path, IgniteFsMode mode) throws GridException { + private GridGgfsFileInfo resolveFileInfo(IgniteFsPath path, IgniteFsMode mode) throws IgniteCheckedException { assert path != null; assert mode != null; @@ -1912,11 +1912,11 @@ public final class GridGgfsImpl implements GridGgfsEx { * @param bufSize The size of the buffer to be used. * @param mode GGFS mode. * @param batch Optional secondary file system batch. - * @throws GridException In case of error. + * @throws IgniteCheckedException In case of error. */ GgfsEventAwareOutputStream(IgniteFsPath path, GridGgfsFileInfo fileInfo, IgniteUuid parentId, int bufSize, IgniteFsMode mode, @Nullable GridGgfsFileWorkerBatch batch) - throws GridException { + throws IgniteCheckedException { super(ggfsCtx, path, fileInfo, parentId, bufSize, mode, batch, metrics); metrics.incrementFilesOpenedForWrite(); @@ -1996,7 +1996,7 @@ public final class GridGgfsImpl implements GridGgfsEx { /** {@inheritDoc} */ @Override protected Collection split(int gridSize, Object arg) - throws GridException { + throws IgniteCheckedException { Collection res = new ArrayList<>(gridSize); for (int i = 0; i < gridSize; i++) { @@ -2005,7 +2005,7 @@ public final class GridGgfsImpl implements GridGgfsEx { @IgniteInstanceResource private Ignite g; - @Nullable @Override public IgniteBiTuple execute() throws GridException { + @Nullable @Override public IgniteBiTuple execute() throws IgniteCheckedException { IgniteFs ggfs = ((GridKernal)g).context().ggfs().ggfs(ggfsName); if (ggfs == null) @@ -2024,7 +2024,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Nullable @Override public IgniteBiTuple reduce(List results) throws GridException { + @Nullable @Override public IgniteBiTuple reduce(List results) throws IgniteCheckedException { long used = 0; long max = 0; @@ -2041,7 +2041,7 @@ public final class GridGgfsImpl implements GridGgfsEx { } /** {@inheritDoc} */ - @Override public ComputeJobResultPolicy result(ComputeJobResult res, List rcvd) throws GridException { + @Override public ComputeJobResultPolicy result(ComputeJobResult res, List rcvd) throws IgniteCheckedException { // Never failover. return ComputeJobResultPolicy.WAIT; } @@ -2063,7 +2063,7 @@ public final class GridGgfsImpl implements GridGgfsEx { try { msg0.finishUnmarshal(ggfsCtx.kernalContext().config().getMarshaller(), null); } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to unmarshal message (will ignore): " + msg0, e); return; @@ -2109,7 +2109,7 @@ public final class GridGgfsImpl implements GridGgfsEx { rmv.add(id); } } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to check file existence: " + id, e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java index 18a81ef..d34c4c8 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInputStreamImpl.java @@ -277,7 +277,7 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { try { fut.get(); } - catch (GridException ignore) { + catch (IgniteCheckedException ignore) { // No-op. } } @@ -302,7 +302,7 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { data.delete(fileInfo); } } - catch (GridException e) { + catch (IgniteCheckedException e) { throw new IOError(e); // Something unrecoverable. } finally { @@ -406,7 +406,7 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { throw new IOException(e.getMessage(), e); } } - catch (GridException e) { + catch (IgniteCheckedException e) { throw new IOException(e.getMessage(), e); } } @@ -415,9 +415,9 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { * @param blockIdx Block index. * @return File block data. * @throws IOException If failed. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - private byte[] block(long blockIdx) throws IOException, GridException { + private byte[] block(long blockIdx) throws IOException, IgniteCheckedException { assert blockIdx >= 0; IgniteFuture bytesFut = locCache.get(blockIdx); @@ -512,9 +512,9 @@ public class GridGgfsInputStreamImpl extends GridGgfsInputStreamAdapter { * @param fileInfo File info. * @param blockIdx Block index. * @return Requested data block or {@code null} if nothing found. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - @Nullable protected IgniteFuture dataBlock(GridGgfsFileInfo fileInfo, long blockIdx) throws GridException { + @Nullable protected IgniteFuture dataBlock(GridGgfsFileInfo fileInfo, long blockIdx) throws IgniteCheckedException { return data.dataBlock(fileInfo, path, blockIdx, secReader); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInvalidRangeException.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInvalidRangeException.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInvalidRangeException.java index 11449de..d771055 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInvalidRangeException.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsInvalidRangeException.java @@ -9,13 +9,13 @@ package org.gridgain.grid.kernal.processors.ggfs; -import org.gridgain.grid.*; +import org.apache.ignite.*; /** * Internal exception thrown when attempted to update range that is no longer present * in file affinity map. */ -public class GridGgfsInvalidRangeException extends GridException { +public class GridGgfsInvalidRangeException extends IgniteCheckedException { /** */ private static final long serialVersionUID = 0L; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java index 48f0857..3b8c72b 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsIpcHandler.java @@ -75,7 +75,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { } /** {@inheritDoc} */ - @Override public void stop() throws GridException { + @Override public void stop() throws IgniteCheckedException { stopping = true; } @@ -185,7 +185,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { return processStreamControlRequest(ses, cmd, msg, in); default: - throw new GridException("Unsupported IPC command: " + cmd); + throw new IgniteCheckedException("Unsupported IPC command: " + cmd); } } @@ -194,15 +194,15 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { * * @param req Handshake request. * @return Response message. - * @throws GridException In case of handshake failure. + * @throws IgniteCheckedException In case of handshake failure. */ - private GridGgfsMessage processHandshakeRequest(GridGgfsHandshakeRequest req) throws GridException { + private GridGgfsMessage processHandshakeRequest(GridGgfsHandshakeRequest req) throws IgniteCheckedException { if (!F.eq(ctx.gridName(), req.gridName())) - throw new GridException("Failed to perform handshake because actual Grid name differs from expected " + + throw new IgniteCheckedException("Failed to perform handshake because actual Grid name differs from expected " + "[expected=" + req.gridName() + ", actual=" + ctx.gridName() + ']'); if (!F.eq(ggfs.name(), req.ggfsName())) - throw new GridException("Failed to perform handshake because actual GGFS name differs from expected " + + throw new IgniteCheckedException("Failed to perform handshake because actual GGFS name differs from expected " + "[expected=" + req.ggfsName() + ", actual=" + ggfs.name() + ']'); GridGgfsControlResponse res = new GridGgfsControlResponse(); @@ -222,7 +222,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { * * @return Status response. */ - private GridGgfsMessage processStatusRequest() throws GridException { + private GridGgfsMessage processStatusRequest() throws IgniteCheckedException { GridGgfsStatus status = ggfs.globalSpace(); GridGgfsControlResponse res = new GridGgfsControlResponse(); @@ -239,10 +239,10 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { * @param cmd Command. * @param msg Message. * @return Response message. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ private GridGgfsMessage processPathControlRequest(GridGgfsClientSession ses, GridGgfsIpcCommand cmd, - GridGgfsMessage msg) throws GridException { + GridGgfsMessage msg) throws IgniteCheckedException { GridGgfsPathControlRequest req = (GridGgfsPathControlRequest)msg; if (log.isDebugEnabled()) @@ -388,11 +388,11 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { * @param msg Message. * @param in Data input to read. * @return Response message if needed. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. * @throws IOException If failed. */ private GridGgfsMessage processStreamControlRequest(GridGgfsClientSession ses, GridGgfsIpcCommand cmd, - GridGgfsMessage msg, DataInput in) throws GridException, IOException { + GridGgfsMessage msg, DataInput in) throws IgniteCheckedException, IOException { GridGgfsStreamControlRequest req = (GridGgfsStreamControlRequest)msg; Long rsrcId = req.streamId(); @@ -408,7 +408,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { ", res=" + res + ']'); if (res == null) - throw new GridException("Resource to close not found: " + rsrcId); + throw new IgniteCheckedException("Resource to close not found: " + rsrcId); try { res.close(); @@ -444,7 +444,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { GridGgfsInputStreamAdapter ggfsIn = (GridGgfsInputStreamAdapter)resource(ses, rsrcId); if (ggfsIn == null) - throw new GridException("Input stream not found (already closed?): " + rsrcId); + throw new IgniteCheckedException("Input stream not found (already closed?): " + rsrcId); byte[][] chunks = ggfsIn.readChunks(pos, size); @@ -474,7 +474,7 @@ class GridGgfsIpcHandler implements GridGgfsServerHandler { IgniteFsOutputStream out = (IgniteFsOutputStream)resource(ses, rsrcId); if (out == null) - throw new GridException("Output stream not found (already closed?): " + rsrcId); + throw new IgniteCheckedException("Output stream not found (already closed?): " + rsrcId); int writeLen = req.length(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java index 93aff1a..26ffe06 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/ggfs/GridGgfsJobImpl.java @@ -71,7 +71,7 @@ public class GridGgfsJobImpl implements ComputeJob, GridInternalWrapper