http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteComputeImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteComputeImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteComputeImpl.java index ff7ec39..7205e76 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteComputeImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteComputeImpl.java @@ -89,7 +89,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public void affinityRun(@Nullable String cacheName, Object affKey, Runnable job) throws GridException { + @Override public void affinityRun(@Nullable String cacheName, Object affKey, Runnable job) throws IgniteCheckedException { A.notNull(affKey, "affKey"); A.notNull(job, "job"); @@ -105,7 +105,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { /** {@inheritDoc} */ @Override public <R> R affinityCall(@Nullable String cacheName, Object affKey, Callable<R> job) - throws GridException { + throws IgniteCheckedException { A.notNull(affKey, "affKey"); A.notNull(job, "job"); @@ -120,7 +120,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public <T, R> R execute(String taskName, @Nullable T arg) throws GridException { + @Override public <T, R> R execute(String taskName, @Nullable T arg) throws IgniteCheckedException { A.notNull(taskName, "taskName"); guard(); @@ -138,7 +138,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { /** {@inheritDoc} */ @Override public <T, R> R execute(Class<? extends ComputeTask<T, R>> taskCls, - @Nullable T arg) throws GridException { + @Nullable T arg) throws IgniteCheckedException { A.notNull(taskCls, "taskCls"); guard(); @@ -155,7 +155,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public <T, R> R execute(ComputeTask<T, R> task, @Nullable T arg) throws GridException { + @Override public <T, R> R execute(ComputeTask<T, R> task, @Nullable T arg) throws IgniteCheckedException { A.notNull(task, "task"); guard(); @@ -172,7 +172,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public void broadcast(Runnable job) throws GridException { + @Override public void broadcast(Runnable job) throws IgniteCheckedException { A.notNull(job, "job"); guard(); @@ -186,7 +186,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public <R> Collection<R> broadcast(Callable<R> job) throws GridException { + @Override public <R> Collection<R> broadcast(Callable<R> job) throws IgniteCheckedException { A.notNull(job, "job"); guard(); @@ -200,7 +200,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public <R, T> Collection<R> broadcast(IgniteClosure<T, R> job, @Nullable T arg) throws GridException { + @Override public <R, T> Collection<R> broadcast(IgniteClosure<T, R> job, @Nullable T arg) throws IgniteCheckedException { A.notNull(job, "job"); guard(); @@ -214,7 +214,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public void run(Runnable job) throws GridException { + @Override public void run(Runnable job) throws IgniteCheckedException { A.notNull(job, "job"); guard(); @@ -228,7 +228,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public void run(Collection<? extends Runnable> jobs) throws GridException { + @Override public void run(Collection<? extends Runnable> jobs) throws IgniteCheckedException { A.notEmpty(jobs, "jobs"); guard(); @@ -242,7 +242,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public <R, T> R apply(IgniteClosure<T, R> job, @Nullable T arg) throws GridException { + @Override public <R, T> R apply(IgniteClosure<T, R> job, @Nullable T arg) throws IgniteCheckedException { A.notNull(job, "job"); guard(); @@ -256,7 +256,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public <R> R call(Callable<R> job) throws GridException { + @Override public <R> R call(Callable<R> job) throws IgniteCheckedException { A.notNull(job, "job"); guard(); @@ -270,7 +270,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public <R> Collection<R> call(Collection<? extends Callable<R>> jobs) throws GridException { + @Override public <R> Collection<R> call(Collection<? extends Callable<R>> jobs) throws IgniteCheckedException { A.notEmpty(jobs, "jobs"); guard(); @@ -285,7 +285,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { /** {@inheritDoc} */ @Override public <T, R> Collection<R> apply(final IgniteClosure<T, R> job, - @Nullable Collection<? extends T> args) throws GridException { + @Nullable Collection<? extends T> args) throws IgniteCheckedException { A.notNull(job, "job"); A.notNull(args, "args"); @@ -301,7 +301,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { /** {@inheritDoc} */ @Override public <R1, R2> R2 call(Collection<? extends Callable<R1>> jobs, IgniteReducer<R1, R2> rdc) - throws GridException { + throws IgniteCheckedException { A.notEmpty(jobs, "jobs"); A.notNull(rdc, "rdc"); @@ -317,7 +317,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { /** {@inheritDoc} */ @Override public <R1, R2, T> R2 apply(IgniteClosure<T, R1> job, Collection<? extends T> args, - IgniteReducer<R1, R2> rdc) throws GridException { + IgniteReducer<R1, R2> rdc) throws IgniteCheckedException { A.notNull(job, "job"); A.notNull(rdc, "rdc"); A.notNull(args, "args"); @@ -391,7 +391,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public void localDeployTask(Class<? extends ComputeTask> taskCls, ClassLoader clsLdr) throws GridException { + @Override public void localDeployTask(Class<? extends ComputeTask> taskCls, ClassLoader clsLdr) throws IgniteCheckedException { A.notNull(taskCls, "taskCls", clsLdr, "clsLdr"); guard(); @@ -420,7 +420,7 @@ public class IgniteComputeImpl implements IgniteCompute, Externalizable { } /** {@inheritDoc} */ - @Override public void undeployTask(String taskName) throws GridException { + @Override public void undeployTask(String taskName) throws IgniteCheckedException { A.notNull(taskName, "taskName"); guard();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteEventsImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteEventsImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteEventsImpl.java index 3ffb417..466a9ea 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteEventsImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteEventsImpl.java @@ -60,7 +60,7 @@ public class IgniteEventsImpl extends IgniteAsyncSupportAdapter implements Ignit /** {@inheritDoc} */ @Override public <T extends IgniteEvent> List<T> remoteQuery(IgnitePredicate<T> p, long timeout, - @Nullable int... types) throws GridException { + @Nullable int... types) throws IgniteCheckedException { A.notNull(p, "p"); guard(); @@ -75,14 +75,14 @@ public class IgniteEventsImpl extends IgniteAsyncSupportAdapter implements Ignit /** {@inheritDoc} */ @Override public <T extends IgniteEvent> UUID remoteListen(@Nullable IgniteBiPredicate<UUID, T> locLsnr, - @Nullable IgnitePredicate<T> rmtFilter, @Nullable int... types) throws GridException { + @Nullable IgnitePredicate<T> rmtFilter, @Nullable int... types) throws IgniteCheckedException { return remoteListen(1, 0, true, locLsnr, rmtFilter, types); } /** {@inheritDoc} */ @Override public <T extends IgniteEvent> UUID remoteListen(int bufSize, long interval, boolean autoUnsubscribe, @Nullable IgniteBiPredicate<UUID, T> locLsnr, @Nullable IgnitePredicate<T> rmtFilter, - @Nullable int... types) throws GridException { + @Nullable int... types) throws IgniteCheckedException { A.ensure(bufSize > 0, "bufSize > 0"); A.ensure(interval >= 0, "interval >= 0"); @@ -99,7 +99,7 @@ public class IgniteEventsImpl extends IgniteAsyncSupportAdapter implements Ignit } /** {@inheritDoc} */ - @Override public void stopRemoteListen(UUID opId) throws GridException { + @Override public void stopRemoteListen(UUID opId) throws IgniteCheckedException { A.notNull(opId, "consumeId"); guard(); @@ -114,7 +114,7 @@ public class IgniteEventsImpl extends IgniteAsyncSupportAdapter implements Ignit /** {@inheritDoc} */ @Override public <T extends IgniteEvent> T waitForLocal(@Nullable IgnitePredicate<T> filter, - @Nullable int... types) throws GridException { + @Nullable int... types) throws IgniteCheckedException { guard(); try { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteManagedImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteManagedImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteManagedImpl.java index 1ebd44e..f1d034e 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteManagedImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteManagedImpl.java @@ -58,7 +58,7 @@ public class IgniteManagedImpl extends IgniteAsyncSupportAdapter implements Igni } /** {@inheritDoc} */ - @Override public void deployNodeSingleton(String name, ManagedService svc) throws GridException { + @Override public void deployNodeSingleton(String name, ManagedService svc) throws IgniteCheckedException { A.notNull(name, "name"); A.notNull(svc, "svc"); @@ -73,7 +73,7 @@ public class IgniteManagedImpl extends IgniteAsyncSupportAdapter implements Igni } /** {@inheritDoc} */ - @Override public void deployClusterSingleton(String name, ManagedService svc) throws GridException { + @Override public void deployClusterSingleton(String name, ManagedService svc) throws IgniteCheckedException { A.notNull(name, "name"); A.notNull(svc, "svc"); @@ -89,7 +89,7 @@ public class IgniteManagedImpl extends IgniteAsyncSupportAdapter implements Igni /** {@inheritDoc} */ @Override public void deployMultiple(String name, ManagedService svc, int totalCnt, int maxPerNodeCnt) - throws GridException { + throws IgniteCheckedException { A.notNull(name, "name"); A.notNull(svc, "svc"); @@ -105,7 +105,7 @@ public class IgniteManagedImpl extends IgniteAsyncSupportAdapter implements Igni /** {@inheritDoc} */ @Override public void deployKeyAffinitySingleton(String name, ManagedService svc, @Nullable String cacheName, - Object affKey) throws GridException { + Object affKey) throws IgniteCheckedException { A.notNull(name, "name"); A.notNull(svc, "svc"); A.notNull(affKey, "affKey"); @@ -121,7 +121,7 @@ public class IgniteManagedImpl extends IgniteAsyncSupportAdapter implements Igni } /** {@inheritDoc} */ - @Override public void deploy(ManagedServiceConfiguration cfg) throws GridException { + @Override public void deploy(ManagedServiceConfiguration cfg) throws IgniteCheckedException { A.notNull(cfg, "cfg"); guard(); @@ -135,7 +135,7 @@ public class IgniteManagedImpl extends IgniteAsyncSupportAdapter implements Igni } /** {@inheritDoc} */ - @Override public void cancel(String name) throws GridException { + @Override public void cancel(String name) throws IgniteCheckedException { A.notNull(name, "name"); guard(); @@ -149,7 +149,7 @@ public class IgniteManagedImpl extends IgniteAsyncSupportAdapter implements Igni } /** {@inheritDoc} */ - @Override public void cancelAll() throws GridException { + @Override public void cancelAll() throws IgniteCheckedException { guard(); try { @@ -186,7 +186,7 @@ public class IgniteManagedImpl extends IgniteAsyncSupportAdapter implements Igni /** {@inheritDoc} */ @Override public <T> T serviceProxy(String name, Class<? super T> svcItf, boolean sticky) - throws GridRuntimeException { + throws IgniteException { A.notNull(name, "name"); A.notNull(svcItf, "svcItf"); A.ensure(svcItf.isInterface(), "Service class must be an interface: " + svcItf); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteMessagingImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteMessagingImpl.java b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteMessagingImpl.java index 5b46619..6bc3b27 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteMessagingImpl.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/IgniteMessagingImpl.java @@ -59,7 +59,7 @@ public class IgniteMessagingImpl extends IgniteAsyncSupportAdapter implements Ig } /** {@inheritDoc} */ - @Override public void send(@Nullable Object topic, Object msg) throws GridException { + @Override public void send(@Nullable Object topic, Object msg) throws IgniteCheckedException { A.notNull(msg, "msg"); guard(); @@ -78,7 +78,7 @@ public class IgniteMessagingImpl extends IgniteAsyncSupportAdapter implements Ig } /** {@inheritDoc} */ - @Override public void send(@Nullable Object topic, Collection<?> msgs) throws GridException { + @Override public void send(@Nullable Object topic, Collection<?> msgs) throws IgniteCheckedException { A.ensure(!F.isEmpty(msgs), "msgs cannot be null or empty"); guard(); @@ -101,7 +101,7 @@ public class IgniteMessagingImpl extends IgniteAsyncSupportAdapter implements Ig } /** {@inheritDoc} */ - @Override public void sendOrdered(@Nullable Object topic, Object msg, long timeout) throws GridException { + @Override public void sendOrdered(@Nullable Object topic, Object msg, long timeout) throws IgniteCheckedException { A.notNull(msg, "msg"); guard(); @@ -151,7 +151,7 @@ public class IgniteMessagingImpl extends IgniteAsyncSupportAdapter implements Ig } /** {@inheritDoc} */ - @Override public UUID remoteListen(@Nullable Object topic, IgniteBiPredicate<UUID, ?> p) throws GridException { + @Override public UUID remoteListen(@Nullable Object topic, IgniteBiPredicate<UUID, ?> p) throws IgniteCheckedException { A.notNull(p, "p"); guard(); @@ -167,7 +167,7 @@ public class IgniteMessagingImpl extends IgniteAsyncSupportAdapter implements Ig } /** {@inheritDoc} */ - @Override public void stopRemoteListen(UUID opId) throws GridException { + @Override public void stopRemoteListen(UUID opId) throws IgniteCheckedException { A.notNull(opId, "opId"); saveOrGet(ctx.continuous().stopRoutine(opId)); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/executor/GridExecutorService.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/executor/GridExecutorService.java b/modules/core/src/main/java/org/gridgain/grid/kernal/executor/GridExecutorService.java index 8ea6faa..8be6cc1 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/executor/GridExecutorService.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/executor/GridExecutorService.java @@ -158,7 +158,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe try { task.cancel(); } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to cancel task: " + task, e); } } @@ -212,7 +212,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe return false; } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to get task result: " + fut, e); if (e.getCause() instanceof InterruptedException) @@ -238,7 +238,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe return addFuture(comp.<T>future()); } - catch (GridException e) { + catch (IgniteCheckedException e) { // Should not be thrown since uses asynchronous execution. return addFuture(new GridFinishedFutureEx<T>(e)); } @@ -256,7 +256,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe comp.run(task); IgniteFuture<T> fut = comp.future().chain(new CX1<IgniteFuture<?>, T>() { - @Override public T applyx(IgniteFuture<?> fut) throws GridException { + @Override public T applyx(IgniteFuture<?> fut) throws IgniteCheckedException { fut.get(); return res; @@ -265,7 +265,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe return addFuture(fut); } - catch (GridException e) { + catch (IgniteCheckedException e) { // Should not be thrown since uses asynchronous execution. return addFuture(new GridFinishedFutureEx<T>(e)); } @@ -284,7 +284,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe return addFuture(comp.future()); } - catch (GridException e) { + catch (IgniteCheckedException e) { // Should not be thrown since uses asynchronous execution. return addFuture(new GridFinishedFutureEx<>(e)); } @@ -353,7 +353,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe fut = comp.future(); } - catch (GridException e) { + catch (IgniteCheckedException e) { // Should not be thrown since uses asynchronous execution. fut = new GridFinishedFutureEx<>(e); } @@ -376,7 +376,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe cancelFuture(fut); } - catch (GridException e) { + catch (IgniteCheckedException e) { if (e.getCause() instanceof InterruptedException) { // This invokeAll() method was interrupted (therefore, need to cancel all tasks). // Note: that execution may be interrupted on remote node. Possible bug. @@ -418,7 +418,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe try { fut.cancel(); } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to cancel task: " + fut, e); } } @@ -493,7 +493,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe fut = comp.future(); } - catch (GridException e) { + catch (IgniteCheckedException e) { // Should not be thrown since uses asynchronous execution. fut = new GridFinishedFutureEx<>(e); } @@ -528,7 +528,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe cancel = true; } - catch (GridException e) { + catch (IgniteCheckedException e) { // This invokeAll() method was interrupted (therefore, need to cancel all tasks). // Note: that execution may be interrupted on remote node. Possible bug. if (e.getCause() instanceof InterruptedException) @@ -573,7 +573,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe addFuture(comp.future()); } - catch (GridException e) { + catch (IgniteCheckedException e) { // Should not be thrown since uses asynchronous execution. addFuture(new GridFinishedFutureEx(e)); } @@ -647,7 +647,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe try { fut.cancel(); } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to cancel task: " + fut, e); } @@ -674,7 +674,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe return res; } - catch (GridException e) { + catch (IgniteCheckedException e) { // Task cancellation may cause throwing exception. if (fut.isCancelled()) { RuntimeException ex = new CancellationException("Task was cancelled: " + fut); @@ -712,7 +712,7 @@ public class GridExecutorService extends GridMetadataAwareAdapter implements Exe catch (ComputeTaskTimeoutException e) { throw new ExecutionException("Task execution timed out during waiting for task result: " + fut, e); } - catch (GridException e) { + catch (IgniteCheckedException e) { // Task cancellation may cause throwing exception. if (fut.isCancelled()) { RuntimeException ex = new CancellationException("Task was cancelled: " + fut); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java index b22e7b8..df1ce3f 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsControlResponse.java @@ -9,12 +9,12 @@ package org.gridgain.grid.kernal.ggfs.common; +import org.apache.ignite.*; import org.apache.ignite.fs.*; -import org.gridgain.grid.*; import org.gridgain.grid.kernal.processors.ggfs.*; +import org.gridgain.grid.util.tostring.*; import org.gridgain.grid.util.typedef.*; import org.gridgain.grid.util.typedef.internal.*; -import org.gridgain.grid.util.tostring.*; import java.io.*; import java.util.*; @@ -246,9 +246,9 @@ public class GridGgfsControlResponse extends GridGgfsMessage { /** * @param errCode Error code. * @param err Error. - * @throws GridException Based on error code. + * @throws IgniteCheckedException Based on error code. */ - public static void throwError(Integer errCode, String err) throws GridException { + public static void throwError(Integer errCode, String err) throws IgniteCheckedException { assert err != null; assert errCode != -1; @@ -267,13 +267,13 @@ public class GridGgfsControlResponse extends GridGgfsMessage { else if (errCode == ERR_GGFS_GENERIC) throw new IgniteFsException(err); - throw new GridException(err); + throw new IgniteCheckedException(err); } /** - * @throws GridException Based on error code. + * @throws IgniteCheckedException Based on error code. */ - public void throwError() throws GridException { + public void throwError() throws IgniteCheckedException { throwError(errCode, err); } @@ -287,7 +287,7 @@ public class GridGgfsControlResponse extends GridGgfsMessage { /** * @param e Error if occurred. */ - public void error(GridException e) { + public void error(IgniteCheckedException e) { err = e.getMessage(); errCode = errorCode(e); } @@ -311,7 +311,7 @@ public class GridGgfsControlResponse extends GridGgfsMessage { * @param e Exception to analyze. * @return Error code. */ - private int errorCode(GridException e) { + private int errorCode(IgniteCheckedException e) { return errorCode(e, true); } @@ -323,7 +323,7 @@ public class GridGgfsControlResponse extends GridGgfsMessage { * @return Error code. */ @SuppressWarnings("unchecked") - private int errorCode(GridException e, boolean checkIo) { + private int errorCode(IgniteCheckedException e, boolean checkIo) { if (X.hasCause(e, IgniteFsFileNotFoundException.class)) return ERR_FILE_NOT_FOUND; else if (IgniteFsPathAlreadyExistsException.class.isInstance(e)) http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsMarshaller.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsMarshaller.java b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsMarshaller.java index a7dea92..5063129 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsMarshaller.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/ggfs/common/GridGgfsMarshaller.java @@ -9,8 +9,8 @@ package org.gridgain.grid.kernal.ggfs.common; +import org.apache.ignite.*; import org.apache.ignite.fs.*; -import org.gridgain.grid.*; import org.gridgain.grid.util.typedef.internal.*; import org.jetbrains.annotations.*; @@ -68,9 +68,9 @@ public class GridGgfsMarshaller { * @param msg Message. * @param hdr Message header. * @param out Output. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - public void marshall(GridGgfsMessage msg, byte[] hdr, ObjectOutput out) throws GridException { + public void marshall(GridGgfsMessage msg, byte[] hdr, ObjectOutput out) throws IgniteCheckedException { assert hdr != null; assert hdr.length == HEADER_SIZE; @@ -175,7 +175,7 @@ public class GridGgfsMarshaller { } } catch (IOException e) { - throw new GridException("Failed to send message to GGFS data node (is data node up and running?)", e); + throw new IgniteCheckedException("Failed to send message to GGFS data node (is data node up and running?)", e); } } @@ -184,9 +184,9 @@ public class GridGgfsMarshaller { * @param hdr Header. * @param in Input. * @return Message. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - public GridGgfsMessage unmarshall(GridGgfsIpcCommand cmd, byte[] hdr, ObjectInput in) throws GridException { + public GridGgfsMessage unmarshall(GridGgfsIpcCommand cmd, byte[] hdr, ObjectInput in) throws IgniteCheckedException { assert hdr != null; assert hdr.length == HEADER_SIZE; @@ -297,7 +297,7 @@ public class GridGgfsMarshaller { return msg; } catch (IOException | ClassNotFoundException e) { - throw new GridException("Failed to unmarshal client message: " + cmd, e); + throw new IgniteCheckedException("Failed to unmarshal client message: " + cmd, e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManager.java index 333c1c4..1a14347 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManager.java @@ -9,9 +9,10 @@ package org.gridgain.grid.kernal.managers; -import org.gridgain.grid.*; +import org.apache.ignite.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.util.tostring.*; + import java.util.*; /** @@ -25,9 +26,9 @@ public interface GridManager extends GridComponent { * Adds attributes from underlying SPI to map of all attributes. * * @param attrs Map of all attributes gotten from SPI's so far. - * @throws GridException Wrapper for exception thrown by underlying SPI. + * @throws IgniteCheckedException Wrapper for exception thrown by underlying SPI. */ - public void addSpiAttributes(Map<String, Object> attrs) throws GridException; + public void addSpiAttributes(Map<String, Object> attrs) throws IgniteCheckedException; /** * @return Returns {@code true} if at least one SPI does not have a {@code NO-OP} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManagerAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManagerAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManagerAdapter.java index 4ceed98..8a8bc0e 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManagerAdapter.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridManagerAdapter.java @@ -107,7 +107,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan return t; } - throw new GridRuntimeException("Failed to find SPI for name: " + name); + throw new IgniteException("Failed to find SPI for name: " + name); } /** {@inheritDoc} */ @@ -123,7 +123,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan } /** {@inheritDoc} */ - @Override public final void addSpiAttributes(Map<String, Object> attrs) throws GridException { + @Override public final void addSpiAttributes(Map<String, Object> attrs) throws IgniteCheckedException { for (T spi : spis) { // Inject all spi resources. ctx.resource().inject(spi); @@ -137,7 +137,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan if (retval != null) { for (Map.Entry<String, Object> e : retval.entrySet()) { if (attrs.containsKey(e.getKey())) - throw new GridException("SPI attribute collision for attribute [spi=" + spi + + throw new IgniteCheckedException("SPI attribute collision for attribute [spi=" + spi + ", attr=" + e.getKey() + ']' + ". Attribute set by one SPI implementation has the same name (name collision) as " + "attribute set by other SPI implementation. Such overriding is not allowed. " + @@ -149,16 +149,16 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan } } catch (IgniteSpiException e) { - throw new GridException("Failed to get SPI attributes.", e); + throw new IgniteCheckedException("Failed to get SPI attributes.", e); } } } /** * @param spi SPI whose internal objects need to be injected. - * @throws GridException If injection failed. + * @throws IgniteCheckedException If injection failed. */ - private void inject(IgniteSpi spi) throws GridException { + private void inject(IgniteSpi spi) throws IgniteCheckedException { if (spi instanceof IgniteSpiAdapter) { Collection<Object> injectables = ((IgniteSpiAdapter)spi).injectables(); @@ -170,9 +170,9 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan /** * @param spi SPI whose internal objects need to be injected. - * @throws GridException If injection failed. + * @throws IgniteCheckedException If injection failed. */ - private void cleanup(IgniteSpi spi) throws GridException { + private void cleanup(IgniteSpi spi) throws IgniteCheckedException { if (spi instanceof IgniteSpiAdapter) { Collection<Object> injectables = ((IgniteSpiAdapter)spi).injectables(); @@ -185,9 +185,9 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan /** * Starts wrapped SPI. * - * @throws GridException If wrapped SPI could not be started. + * @throws IgniteCheckedException If wrapped SPI could not be started. */ - protected final void startSpi() throws GridException { + protected final void startSpi() throws IgniteCheckedException { Collection<String> names = U.newHashSet(spis.length); for (T spi : spis) { @@ -196,7 +196,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan log.debug("Starting SPI: " + spi); if (names.contains(spi.getName())) - throw new GridException("Duplicate SPI name (need to explicitly configure 'setName()' property): " + + throw new IgniteCheckedException("Duplicate SPI name (need to explicitly configure 'setName()' property): " + spi.getName()); names.add(spi.getName()); @@ -208,7 +208,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan spi.spiStart(ctx.gridName()); } catch (IgniteSpiException e) { - throw new GridException("Failed to start SPI: " + spi, e); + throw new IgniteCheckedException("Failed to start SPI: " + spi, e); } if (log.isDebugEnabled()) @@ -219,9 +219,9 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan /** * Stops wrapped SPI. * - * @throws GridException If underlying SPI could not be stopped. + * @throws IgniteCheckedException If underlying SPI could not be stopped. */ - protected final void stopSpi() throws GridException { + protected final void stopSpi() throws IgniteCheckedException { for (T spi : spis) { if (log.isDebugEnabled()) log.debug("Stopping SPI: " + spi); @@ -233,7 +233,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan log.debug("SPI module stopped OK: " + spi.getClass().getName()); } catch (IgniteSpiException e) { - throw new GridException("Failed to stop SPI: " + spi, e); + throw new IgniteCheckedException("Failed to stop SPI: " + spi, e); } try { @@ -241,7 +241,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan ctx.resource().cleanup(spi); } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to remove injected resources from SPI (ignoring): " + spi, e); } } @@ -262,7 +262,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan } /** {@inheritDoc} */ - @Override public final void onKernalStart() throws GridException { + @Override public final void onKernalStart() throws IgniteCheckedException { for (final IgniteSpi spi : spis) { try { spi.onContextInitialized(new IgniteSpiContext() { @@ -314,7 +314,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan else ctx.io().sendUserMessage(asList(node), msg, topic, false, 0); } - catch (GridException e) { + catch (IgniteCheckedException e) { throw unwrapException(e); } } @@ -374,12 +374,12 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan ctx.ports().deregisterPorts(spi.getClass()); } - @Nullable @Override public <K, V> V get(String cacheName, K key) throws GridException { + @Nullable @Override public <K, V> V get(String cacheName, K key) throws IgniteCheckedException { return ctx.cache().<K, V>cache(cacheName).get(key); } @Nullable @Override public <K, V> V put(String cacheName, K key, V val, long ttl) - throws GridException { + throws IgniteCheckedException { GridCacheEntry<K, V> e = ctx.cache().<K, V>cache(cacheName).entry(key); assert e != null; @@ -390,7 +390,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan } @Nullable @Override public <K, V> V putIfAbsent(String cacheName, K key, V val, long ttl) - throws GridException { + throws IgniteCheckedException { GridCacheEntry<K, V> e = ctx.cache().<K, V>cache(cacheName).entry(key); assert e != null; @@ -400,7 +400,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan return e.setIfAbsent(val); } - @Nullable @Override public <K, V> V remove(String cacheName, K key) throws GridException { + @Nullable @Override public <K, V> V remove(String cacheName, K key) throws IgniteCheckedException { return ctx.cache().<K, V>cache(cacheName).remove(key); } @@ -409,32 +409,32 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan } @Override public void writeToSwap(String spaceName, Object key, @Nullable Object val, - @Nullable ClassLoader ldr) throws GridException { + @Nullable ClassLoader ldr) throws IgniteCheckedException { assert ctx.swap().enabled(); ctx.swap().write(spaceName, key, val, ldr); } @Nullable @Override public <T> T readFromOffheap(String spaceName, int part, Object key, - byte[] keyBytes, @Nullable ClassLoader ldr) throws GridException { + byte[] keyBytes, @Nullable ClassLoader ldr) throws IgniteCheckedException { return ctx.offheap().getValue(spaceName, part, key, keyBytes, ldr); } @Override public boolean removeFromOffheap(@Nullable String spaceName, int part, Object key, - @Nullable byte[] keyBytes) throws GridException { + @Nullable byte[] keyBytes) throws IgniteCheckedException { return ctx.offheap().removex(spaceName, part, key, keyBytes); } @Override public void writeToOffheap(@Nullable String spaceName, int part, Object key, @Nullable byte[] keyBytes, Object val, @Nullable byte[] valBytes, @Nullable ClassLoader ldr) - throws GridException { + throws IgniteCheckedException { ctx.offheap().put(spaceName, part, key, keyBytes, valBytes != null ? valBytes : ctx.config().getMarshaller().marshal(val)); } @SuppressWarnings({"unchecked"}) @Nullable @Override public <T> T readFromSwap(String spaceName, SwapKey key, - @Nullable ClassLoader ldr) throws GridException { + @Nullable ClassLoader ldr) throws IgniteCheckedException { assert ctx.swap().enabled(); return ctx.swap().readValue(spaceName, key, ldr); @@ -445,7 +445,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan } @Override public void removeFromSwap(String spaceName, Object key, - @Nullable ClassLoader ldr) throws GridException { + @Nullable ClassLoader ldr) throws IgniteCheckedException { assert ctx.swap().enabled(); ctx.swap().remove(spaceName, key, null, ldr); @@ -480,17 +480,17 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan return true; } - @Override public Collection<GridSecuritySubject> authenticatedSubjects() throws GridException { + @Override public Collection<GridSecuritySubject> authenticatedSubjects() throws IgniteCheckedException { return ctx.grid().security().authenticatedSubjects(); } - @Override public GridSecuritySubject authenticatedSubject(UUID subjId) throws GridException { + @Override public GridSecuritySubject authenticatedSubject(UUID subjId) throws IgniteCheckedException { return ctx.grid().security().authenticatedSubject(subjId); } @SuppressWarnings("unchecked") @Nullable @Override public <V> V readValueFromOffheapAndSwap(@Nullable String spaceName, - Object key, @Nullable ClassLoader ldr) throws GridException { + Object key, @Nullable ClassLoader ldr) throws IgniteCheckedException { GridCache<Object, V> cache = ctx.cache().cache(spaceName); GridCacheContext cctx = ((GridCacheProxyImpl)cache).context(); @@ -511,7 +511,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan * @param e Exception to handle. * @return GridSpiException Converted exception. */ - private IgniteSpiException unwrapException(GridException e) { + private IgniteSpiException unwrapException(IgniteCheckedException e) { // Avoid double-wrapping. if (e.getCause() instanceof IgniteSpiException) return (IgniteSpiException)e.getCause(); @@ -521,7 +521,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan }); } catch (IgniteSpiException e) { - throw new GridException("Failed to initialize SPI context.", e); + throw new IgniteCheckedException("Failed to initialize SPI context.", e); } } @@ -547,9 +547,9 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan } /** - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - protected void onKernalStart0() throws GridException { + protected void onKernalStart0() throws IgniteCheckedException { // No-op. } @@ -575,11 +575,11 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan * </pre> * Note that in case when variable name is the same as JavaBean property you * can just copy Java condition expression into description as a string. - * @throws GridException Thrown if given condition is {@code false} + * @throws IgniteCheckedException Thrown if given condition is {@code false} */ - protected final void assertParameter(boolean cond, String condDesc) throws GridException { + protected final void assertParameter(boolean cond, String condDesc) throws IgniteCheckedException { if (!cond) - throw new GridException("Grid configuration parameter failed condition check: " + condDesc); + throw new IgniteCheckedException("Grid configuration parameter failed condition check: " + condDesc); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridNoopManagerAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridNoopManagerAdapter.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridNoopManagerAdapter.java index 4c5f910..b1a8f9c 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridNoopManagerAdapter.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/GridNoopManagerAdapter.java @@ -9,9 +9,9 @@ package org.gridgain.grid.kernal.managers; +import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.spi.*; -import org.gridgain.grid.*; import org.gridgain.grid.kernal.*; import org.jetbrains.annotations.*; @@ -29,7 +29,7 @@ public class GridNoopManagerAdapter implements GridManager { } /** {@inheritDoc} */ - @Override public void addSpiAttributes(Map<String, Object> attrs) throws GridException { + @Override public void addSpiAttributes(Map<String, Object> attrs) throws IgniteCheckedException { // No-op. } @@ -39,17 +39,17 @@ public class GridNoopManagerAdapter implements GridManager { } /** {@inheritDoc} */ - @Override public void start() throws GridException { + @Override public void start() throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ - @Override public void stop(boolean cancel) throws GridException { + @Override public void stop(boolean cancel) throws IgniteCheckedException { // No-op. } /** {@inheritDoc} */ - @Override public void onKernalStart() throws GridException { + @Override public void onKernalStart() throws IgniteCheckedException { // No-op. } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointManager.java index f3e3ab7..25cd5cf 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/checkpoint/GridCheckpointManager.java @@ -9,17 +9,17 @@ package org.gridgain.grid.kernal.managers.checkpoint; +import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.compute.*; import org.apache.ignite.events.*; import org.apache.ignite.lang.*; import org.apache.ignite.marshaller.*; import org.apache.ignite.spi.*; -import org.gridgain.grid.*; +import org.apache.ignite.spi.checkpoint.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.kernal.managers.*; import org.gridgain.grid.kernal.managers.communication.*; -import org.apache.ignite.spi.checkpoint.*; import org.gridgain.grid.util.*; import org.gridgain.grid.util.tostring.*; import org.gridgain.grid.util.typedef.*; @@ -66,7 +66,7 @@ public class GridCheckpointManager extends GridManagerAdapter<CheckpointSpi> { } /** {@inheritDoc} */ - @Override public void start() throws GridException { + @Override public void start() throws IgniteCheckedException { if (ctx.config().isDaemon()) return; @@ -87,7 +87,7 @@ public class GridCheckpointManager extends GridManagerAdapter<CheckpointSpi> { } /** {@inheritDoc} */ - @Override public void stop(boolean cancel) throws GridException { + @Override public void stop(boolean cancel) throws IgniteCheckedException { if (ctx.config().isDaemon()) return; @@ -117,10 +117,10 @@ public class GridCheckpointManager extends GridManagerAdapter<CheckpointSpi> { * @param timeout Checkpoint timeout. * @param override Whether or not override checkpoint if it already exists. * @return {@code true} if checkpoint has been actually saved, {@code false} otherwise. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ public boolean storeCheckpoint(GridTaskSessionInternal ses, String key, Object state, ComputeTaskSessionScope scope, - long timeout, boolean override) throws GridException { + long timeout, boolean override) throws IgniteCheckedException { assert ses != null; assert key != null; @@ -221,7 +221,7 @@ public class GridCheckpointManager extends GridManagerAdapter<CheckpointSpi> { } } catch (IgniteSpiException e) { - throw new GridException("Failed to save checkpoint [key=" + key + ", val=" + state + ", scope=" + + throw new IgniteCheckedException("Failed to save checkpoint [key=" + key + ", val=" + state + ", scope=" + scope + ", timeout=" + timeout + ']', e); } @@ -274,9 +274,9 @@ public class GridCheckpointManager extends GridManagerAdapter<CheckpointSpi> { * @param ses Task session. * @param key Checkpoint key. * @return Loaded checkpoint. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ - @Nullable public Serializable loadCheckpoint(GridTaskSessionInternal ses, String key) throws GridException { + @Nullable public Serializable loadCheckpoint(GridTaskSessionInternal ses, String key) throws IgniteCheckedException { assert ses != null; assert key != null; @@ -294,7 +294,7 @@ public class GridCheckpointManager extends GridManagerAdapter<CheckpointSpi> { return state; } catch (IgniteSpiException e) { - throw new GridException("Failed to load checkpoint: " + key, e); + throw new IgniteCheckedException("Failed to load checkpoint: " + key, e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/collision/GridCollisionManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/collision/GridCollisionManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/collision/GridCollisionManager.java index cd31870..0a072e3 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/collision/GridCollisionManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/collision/GridCollisionManager.java @@ -9,10 +9,10 @@ package org.gridgain.grid.kernal.managers.collision; -import org.gridgain.grid.*; +import org.apache.ignite.*; +import org.apache.ignite.spi.collision.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.kernal.managers.*; -import org.apache.ignite.spi.collision.*; import org.gridgain.grid.util.typedef.internal.*; import org.jetbrains.annotations.*; @@ -35,7 +35,7 @@ public class GridCollisionManager extends GridManagerAdapter<CollisionSpi> { } /** {@inheritDoc} */ - @Override public void start() throws GridException { + @Override public void start() throws IgniteCheckedException { if (ctx.config().isDaemon()) return; @@ -59,7 +59,7 @@ public class GridCollisionManager extends GridManagerAdapter<CollisionSpi> { } /** {@inheritDoc} */ - @Override public void stop(boolean cancel) throws GridException { + @Override public void stop(boolean cancel) throws IgniteCheckedException { if (ctx.config().isDaemon()) return; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoManager.java index 99a22cf..52cd53d 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoManager.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/communication/GridIoManager.java @@ -9,18 +9,19 @@ package org.gridgain.grid.kernal.managers.communication; +import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.events.*; import org.apache.ignite.lang.*; import org.apache.ignite.marshaller.*; import org.apache.ignite.spi.*; +import org.apache.ignite.spi.communication.*; import org.gridgain.grid.*; import org.gridgain.grid.kernal.*; import org.gridgain.grid.kernal.managers.*; import org.gridgain.grid.kernal.managers.deployment.*; import org.gridgain.grid.kernal.managers.eventstorage.*; import org.gridgain.grid.kernal.processors.timeout.*; -import org.apache.ignite.spi.communication.*; import org.gridgain.grid.util.*; import org.gridgain.grid.util.direct.*; import org.gridgain.grid.util.tostring.*; @@ -40,8 +41,8 @@ import java.util.concurrent.locks.*; import static org.apache.ignite.events.IgniteEventType.*; import static org.gridgain.grid.kernal.GridTopic.*; import static org.gridgain.grid.kernal.managers.communication.GridIoPolicy.*; -import static org.jdk8.backport.ConcurrentLinkedHashMap.QueuePolicy.*; import static org.gridgain.grid.util.nio.GridNioBackPressureControl.*; +import static org.jdk8.backport.ConcurrentLinkedHashMap.QueuePolicy.*; /** * Grid communication manager. @@ -158,7 +159,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa /** {@inheritDoc} */ @SuppressWarnings("deprecation") - @Override public void start() throws GridException { + @Override public void start() throws IgniteCheckedException { assertParameter(discoDelay > 0, "discoveryStartupDelay > 0"); startSpi(); @@ -194,7 +195,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa /** {@inheritDoc} */ @SuppressWarnings({"deprecation", "SynchronizationOnLocalVariableOrMethodParameter"}) - @Override public void onKernalStart0() throws GridException { + @Override public void onKernalStart0() throws IgniteCheckedException { discoLsnr = new GridLocalEventListener() { @SuppressWarnings({"TooBroadScope", "fallthrough"}) @Override public void onEvent(IgniteEvent evt) { @@ -389,7 +390,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa } /** {@inheritDoc} */ - @Override public void stop(boolean cancel) throws GridException { + @Override public void stop(boolean cancel) throws IgniteCheckedException { stopSpi(); // Clear cache. @@ -484,7 +485,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa } } } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to process message (will ignore): " + msg, e); } finally { @@ -866,10 +867,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param msgId Message ID. * @param timeout Timeout. * @param skipOnTimeout Whether message can be skipped on timeout. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ private void send(ClusterNode node, Object topic, int topicOrd, GridTcpCommunicationMessageAdapter msg, - GridIoPolicy plc, long msgId, long timeout, boolean skipOnTimeout) throws GridException { + GridIoPolicy plc, long msgId, long timeout, boolean skipOnTimeout) throws IgniteCheckedException { assert node != null; assert topic != null; assert msg != null; @@ -883,7 +884,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa CommunicationListener commLsnr = this.commLsnr; if (commLsnr == null) - throw new GridException("Trying to send message when grid is not fully started."); + throw new IgniteCheckedException("Trying to send message when grid is not fully started."); if (msgId > 0) processOrderedMessage0(ioMsg, plc, locNodeId); @@ -898,7 +899,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa getSpi().sendMessage(node, ioMsg); } catch (IgniteSpiException e) { - throw new GridException("Failed to send message (node may have left the grid or " + + throw new IgniteCheckedException("Failed to send message (node may have left the grid or " + "TCP connection cannot be established due to firewall issues) " + "[node=" + node + ", topic=" + topic + ", msg=" + msg + ", policy=" + plc + ']', e); @@ -911,14 +912,14 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param topic Topic to send the message to. * @param msg Message to send. * @param plc Type of processing. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ public void send(UUID nodeId, Object topic, GridTcpCommunicationMessageAdapter msg, GridIoPolicy plc) - throws GridException { + throws IgniteCheckedException { ClusterNode node = ctx.discovery().node(nodeId); if (node == null) - throw new GridException("Failed to send message to node (has node left grid?): " + nodeId); + throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId); send(node, topic, msg, plc); } @@ -928,15 +929,15 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param topic Topic to send the message to. * @param msg Message to send. * @param plc Type of processing. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ @SuppressWarnings("TypeMayBeWeakened") public void send(UUID nodeId, GridTopic topic, GridTcpCommunicationMessageAdapter msg, GridIoPolicy plc) - throws GridException { + throws IgniteCheckedException { ClusterNode node = ctx.discovery().node(nodeId); if (node == null) - throw new GridException("Failed to send message to node (has node left grid?): " + nodeId); + throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId); send(node, topic, topic.ordinal(), msg, plc, -1, 0, false); } @@ -946,10 +947,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param topic Topic to send the message to. * @param msg Message to send. * @param plc Type of processing. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ public void send(ClusterNode node, Object topic, GridTcpCommunicationMessageAdapter msg, GridIoPolicy plc) - throws GridException { + throws IgniteCheckedException { send(node, topic, -1, msg, plc, -1, 0, false); } @@ -958,10 +959,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param topic Topic to send the message to. * @param msg Message to send. * @param plc Type of processing. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ public void send(ClusterNode node, GridTopic topic, GridTcpCommunicationMessageAdapter msg, GridIoPolicy plc) - throws GridException { + throws IgniteCheckedException { send(node, topic, topic.ordinal(), msg, plc, -1, 0, false); } @@ -1016,10 +1017,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param plc Type of processing. * @param timeout Timeout to keep a message on receiving queue. * @param skipOnTimeout Whether message can be skipped on timeout. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ public void sendOrderedMessage(ClusterNode node, Object topic, long msgId, GridTcpCommunicationMessageAdapter msg, - GridIoPolicy plc, long timeout, boolean skipOnTimeout) throws GridException { + GridIoPolicy plc, long timeout, boolean skipOnTimeout) throws IgniteCheckedException { assert timeout > 0 || skipOnTimeout; send(node, topic, (byte)-1, msg, plc, msgId, timeout, skipOnTimeout); @@ -1033,16 +1034,16 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param plc Type of processing. * @param timeout Timeout to keep a message on receiving queue. * @param skipOnTimeout Whether message can be skipped on timeout. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ public void sendOrderedMessage(UUID nodeId, Object topic, long msgId, GridTcpCommunicationMessageAdapter msg, - GridIoPolicy plc, long timeout, boolean skipOnTimeout) throws GridException { + GridIoPolicy plc, long timeout, boolean skipOnTimeout) throws IgniteCheckedException { assert timeout > 0 || skipOnTimeout; ClusterNode node = ctx.discovery().node(nodeId); if (node == null) - throw new GridException("Failed to send message to node (has node left grid?): " + nodeId); + throw new IgniteCheckedException("Failed to send message to node (has node left grid?): " + nodeId); send(node, topic, (byte)-1, msg, plc, msgId, timeout, skipOnTimeout); } @@ -1055,11 +1056,11 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param plc Type of processing. * @param timeout Timeout to keep a message on receiving queue. * @param skipOnTimeout Whether message can be skipped on timeout. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ public void sendOrderedMessage(Collection<? extends ClusterNode> nodes, Object topic, long msgId, GridTcpCommunicationMessageAdapter msg, GridIoPolicy plc, long timeout, boolean skipOnTimeout) - throws GridException { + throws IgniteCheckedException { assert timeout > 0 || skipOnTimeout; send(nodes, topic, -1, msg, plc, msgId, timeout, skipOnTimeout); @@ -1070,10 +1071,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param topic Topic to send the message to. * @param msg Message to send. * @param plc Type of processing. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ public void send(Collection<? extends ClusterNode> nodes, Object topic, GridTcpCommunicationMessageAdapter msg, - GridIoPolicy plc) throws GridException { + GridIoPolicy plc) throws IgniteCheckedException { send(nodes, topic, -1, msg, plc, -1, 0, false); } @@ -1082,10 +1083,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param topic Topic to send the message to. * @param msg Message to send. * @param plc Type of processing. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ public void send(Collection<? extends ClusterNode> nodes, GridTopic topic, GridTcpCommunicationMessageAdapter msg, - GridIoPolicy plc) throws GridException { + GridIoPolicy plc) throws IgniteCheckedException { send(nodes, topic, topic.ordinal(), msg, plc, -1, 0, false); } @@ -1094,9 +1095,9 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * * @param nodes Destination nodes. * @param msg Message to send. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ - public void sendUserMessage(Collection<? extends ClusterNode> nodes, Object msg) throws GridException { + public void sendUserMessage(Collection<? extends ClusterNode> nodes, Object msg) throws IgniteCheckedException { sendUserMessage(nodes, msg, null, false, 0); } @@ -1108,11 +1109,11 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param topic Message topic to use. * @param ordered Is message ordered? * @param timeout Message timeout in milliseconds for ordered messages. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ @SuppressWarnings("ConstantConditions") public void sendUserMessage(Collection<? extends ClusterNode> nodes, Object msg, - @Nullable Object topic, boolean ordered, long timeout) throws GridException { + @Nullable Object topic, boolean ordered, long timeout) throws IgniteCheckedException { boolean loc = nodes.size() == 1 && F.first(nodes).id().equals(locNodeId); byte[] serMsg = null; @@ -1184,8 +1185,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa addMessageListener(TOPIC_COMM_USER, new GridUserMessageListener(topic, (IgniteBiPredicate<UUID, Object>)p)); } - catch (GridException e) { - throw new GridRuntimeException(e); + catch (IgniteCheckedException e) { + throw new IgniteException(e); } } } @@ -1199,8 +1200,8 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa removeMessageListener(TOPIC_COMM_USER, new GridUserMessageListener(topic, (IgniteBiPredicate<UUID, Object>)p)); } - catch (GridException e) { - throw new GridRuntimeException(e); + catch (IgniteCheckedException e) { + throw new IgniteException(e); } } @@ -1213,11 +1214,11 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa * @param msgId Message ID (for ordered messages) or -1 (for unordered messages). * @param timeout Message timeout. * @param skipOnTimeout Whether message can be skipped in timeout. - * @throws GridException Thrown in case of any errors. + * @throws IgniteCheckedException Thrown in case of any errors. */ private void send(Collection<? extends ClusterNode> nodes, Object topic, int topicOrd, GridTcpCommunicationMessageAdapter msg, GridIoPolicy plc, long msgId, long timeout, boolean skipOnTimeout) - throws GridException { + throws IgniteCheckedException { assert nodes != null; assert topic != null; assert msg != null; @@ -1246,7 +1247,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa msg + ", policy=" + plc + ']'); } catch (IgniteSpiException e) { - throw new GridException("Failed to send message (nodes may have left the grid or " + + throw new IgniteCheckedException("Failed to send message (nodes may have left the grid or " + "TCP connection cannot be established due to firewall issues) " + "[nodes=" + nodes + ", topic=" + topic + ", msg=" + msg + ", policy=" + plc + ']', e); @@ -1647,10 +1648,10 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa /** * @param topic User topic. * @param predLsnr Predicate listener. - * @throws GridException If failed to inject resources to predicates. + * @throws IgniteCheckedException If failed to inject resources to predicates. */ GridUserMessageListener(@Nullable Object topic, @Nullable IgniteBiPredicate<UUID, Object> predLsnr) - throws GridException { + throws IgniteCheckedException { this.topic = topic; this.predLsnr = predLsnr; @@ -1730,7 +1731,7 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa if (dep != null) ctx.resource().inject(dep, dep.deployedClass(ioMsg.deploymentClassName()), msgBody); } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to unmarshal user message [node=" + nodeId + ", message=" + msg + ']', e); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeployment.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeployment.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeployment.java index 1c35cc0..382fdd1 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeployment.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeployment.java @@ -9,10 +9,10 @@ package org.gridgain.grid.kernal.managers.deployment; +import org.apache.ignite.*; import org.apache.ignite.compute.*; import org.apache.ignite.configuration.*; import org.apache.ignite.lang.*; -import org.gridgain.grid.*; import org.gridgain.grid.kernal.processors.task.*; import org.gridgain.grid.util.*; import org.gridgain.grid.util.lang.*; @@ -370,9 +370,9 @@ public class GridDeployment extends GridMetadataAwareAdapter implements GridDepl /** * @param cls Class to create new instance of (using default constructor). * @return New instance. - * @throws GridException If failed. + * @throws IgniteCheckedException If failed. */ - @Nullable public <T> T newInstance(Class<T> cls) throws GridException { + @Nullable public <T> T newInstance(Class<T> cls) throws IgniteCheckedException { assert cls != null; GridTuple<Constructor<?>> t = dfltCtorsCache.get(cls); @@ -387,7 +387,7 @@ public class GridDeployment extends GridMetadataAwareAdapter implements GridDepl dfltCtorsCache.putIfAbsent(cls, t = F.<Constructor<?>>t(ctor)); } catch (NoSuchMethodException e) { - throw new GridException("Failed to find empty constructor for class: " + cls, e); + throw new IgniteCheckedException("Failed to find empty constructor for class: " + cls, e); } } @@ -400,7 +400,7 @@ public class GridDeployment extends GridMetadataAwareAdapter implements GridDepl return (T)ctor.newInstance(); } catch (InstantiationException | InvocationTargetException | IllegalAccessException e) { - throw new GridException("Failed to create new instance for class: " + cls, e); + throw new IgniteCheckedException("Failed to create new instance for class: " + cls, e); } } @@ -522,9 +522,9 @@ public class GridDeployment extends GridMetadataAwareAdapter implements GridDepl * @param target Object to find a value in. * @param annCls Annotation class. * @return Value of annotated field or method. - * @throws GridException If failed to find. + * @throws IgniteCheckedException If failed to find. */ - @Nullable public Object annotatedValue(Object target, Class<? extends Annotation> annCls) throws GridException { + @Nullable public Object annotatedValue(Object target, Class<? extends Annotation> annCls) throws IgniteCheckedException { return annotatedValue(target, annCls, null, false).get1(); } @@ -534,10 +534,10 @@ public class GridDeployment extends GridMetadataAwareAdapter implements GridDepl * @param visited Set of visited objects to avoid cycling. * @param annFound Flag indicating if value has already been found. * @return Value of annotated field or method. - * @throws GridException If failed to find. + * @throws IgniteCheckedException If failed to find. */ private IgniteBiTuple<Object, Boolean> annotatedValue(Object target, Class<? extends Annotation> annCls, - @Nullable Set<Object> visited, boolean annFound) throws GridException { + @Nullable Set<Object> visited, boolean annFound) throws IgniteCheckedException { assert target != null; // To avoid infinite recursion. @@ -557,7 +557,7 @@ public class GridDeployment extends GridMetadataAwareAdapter implements GridDepl fieldVal = f.get(target); } catch (IllegalAccessException e) { - throw new GridException("Failed to get annotated field value [cls=" + cls.getName() + + throw new IgniteCheckedException("Failed to get annotated field value [cls=" + cls.getName() + ", ann=" + annCls.getSimpleName(), e); } @@ -580,7 +580,7 @@ public class GridDeployment extends GridMetadataAwareAdapter implements GridDepl } else { if (annFound) - throw new GridException("Multiple annotations have been found [cls=" + cls.getName() + + throw new IgniteCheckedException("Multiple annotations have been found [cls=" + cls.getName() + ", ann=" + annCls.getSimpleName() + "]"); val = fieldVal; @@ -592,7 +592,7 @@ public class GridDeployment extends GridMetadataAwareAdapter implements GridDepl // Methods. for (Method m : methodsWithAnnotation(cls, annCls)) { if (annFound) - throw new GridException("Multiple annotations have been found [cls=" + cls.getName() + + throw new IgniteCheckedException("Multiple annotations have been found [cls=" + cls.getName() + ", ann=" + annCls.getSimpleName() + "]"); m.setAccessible(true); @@ -601,7 +601,7 @@ public class GridDeployment extends GridMetadataAwareAdapter implements GridDepl val = m.invoke(target); } catch (Exception e) { - throw new GridException("Failed to get annotated method value [cls=" + cls.getName() + + throw new IgniteCheckedException("Failed to get annotated method value [cls=" + cls.getName() + ", ann=" + annCls.getSimpleName(), e); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentClassLoader.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentClassLoader.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentClassLoader.java index 49ff2fd..08a435e 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentClassLoader.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentClassLoader.java @@ -563,7 +563,7 @@ class GridDeploymentClassLoader extends ClassLoader implements GridDeploymentInf nodeLdrMapCp = singleNode ? nodeLdrMap : new HashMap<>(nodeLdrMap); } - GridException err = null; + IgniteCheckedException err = null; for (UUID nodeId : nodeListCp) { if (nodeId.equals(ctx.discovery().localNode().id())) @@ -594,7 +594,7 @@ class GridDeploymentClassLoader extends ClassLoader implements GridDeploymentInf else if (log.isDebugEnabled()) log.debug(msg); - err = new GridException(msg); + err = new IgniteCheckedException(msg); continue; } @@ -615,7 +615,7 @@ class GridDeploymentClassLoader extends ClassLoader implements GridDeploymentInf throw new ClassNotFoundException("Failed to peer load class [class=" + name + ", nodeClsLdrs=" + nodeLdrMapCp + ", parentClsLoader=" + getParent() + ", reason=" + res.errorMessage() + ']'); } - catch (GridException e) { + catch (IgniteCheckedException e) { // This thread should be interrupted again in communication if it // got interrupted. So we assume that thread can be interrupted // by processing cancellation request. @@ -759,7 +759,7 @@ class GridDeploymentClassLoader extends ClassLoader implements GridDeploymentInf res.byteSource().size()); } } - catch (GridException e) { + catch (IgniteCheckedException e) { // This thread should be interrupted again in communication if it // got interrupted. So we assume that thread can be interrupted // by processing cancellation request. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentCommunication.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentCommunication.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentCommunication.java index cefc7f9..453d2fb 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentCommunication.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentCommunication.java @@ -170,7 +170,7 @@ class GridDeploymentCommunication { try { req.responseTopic(marsh.unmarshal(req.responseTopicBytes(), null)); } - catch (GridException e) { + catch (IgniteCheckedException e) { U.error(log, "Failed to process deployment request (will ignore): " + req, e); return; @@ -285,7 +285,7 @@ class GridDeploymentCommunication { if (log.isDebugEnabled()) log.debug("Sent peer class loading response [node=" + node.id() + ", res=" + res + ']'); } - catch (GridException e) { + catch (IgniteCheckedException e) { if (ctx.discovery().pingNode(nodeId)) U.error(log, "Failed to send peer class loading response to node: " + nodeId, e); else if (log.isDebugEnabled()) @@ -302,9 +302,9 @@ class GridDeploymentCommunication { /** * @param rsrcName Resource to undeploy. * @param rmtNodes Nodes to send request to. - * @throws GridException If request could not be sent. + * @throws IgniteCheckedException If request could not be sent. */ - void sendUndeployRequest(String rsrcName, Collection<ClusterNode> rmtNodes) throws GridException { + void sendUndeployRequest(String rsrcName, Collection<ClusterNode> rmtNodes) throws IgniteCheckedException { assert !rmtNodes.contains(ctx.discovery().localNode()); GridTcpCommunicationMessageAdapter req = new GridDeploymentRequest(null, null, rsrcName, true); @@ -329,11 +329,11 @@ class GridDeploymentCommunication { * @param threshold Time in milliseconds when request is decided to * be obsolete. * @return Either response value or {@code null} if timeout occurred. - * @throws GridException Thrown if there is no connection with remote node. + * @throws IgniteCheckedException Thrown if there is no connection with remote node. */ @SuppressWarnings({"SynchronizationOnLocalVariableOrMethodParameter"}) GridDeploymentResponse sendResourceRequest(final String rsrcName, IgniteUuid clsLdrId, - final ClusterNode dstNode, long threshold) throws GridException { + final ClusterNode dstNode, long threshold) throws IgniteCheckedException { assert rsrcName != null; assert dstNode != null; assert clsLdrId != null; @@ -455,7 +455,7 @@ class GridDeploymentCommunication { // Interrupt again to get it in the users code. Thread.currentThread().interrupt(); - throw new GridException("Got interrupted while waiting for response from node: " + + throw new IgniteCheckedException("Got interrupted while waiting for response from node: " + dstNode.id(), e); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/06931b4b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentLocalStore.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentLocalStore.java b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentLocalStore.java index a4bce36..a6a0c03 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentLocalStore.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/managers/deployment/GridDeploymentLocalStore.java @@ -9,15 +9,16 @@ package org.gridgain.grid.kernal.managers.deployment; +import org.apache.ignite.*; import org.apache.ignite.compute.*; import org.apache.ignite.configuration.*; import org.apache.ignite.events.*; import org.apache.ignite.lang.*; import org.apache.ignite.marshaller.optimized.*; import org.apache.ignite.spi.*; +import org.apache.ignite.spi.deployment.*; import org.gridgain.grid.*; import org.gridgain.grid.kernal.*; -import org.apache.ignite.spi.deployment.*; import org.gridgain.grid.util.*; import org.gridgain.grid.util.typedef.*; import org.gridgain.grid.util.typedef.internal.*; @@ -51,7 +52,7 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter { } /** {@inheritDoc} */ - @Override public void start() throws GridException { + @Override public void start() throws IgniteCheckedException { spi.setListener(new LocalDeploymentListener()); if (log.isDebugEnabled()) @@ -313,7 +314,7 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter { } /** {@inheritDoc} */ - @Nullable @Override public GridDeployment explicitDeploy(Class<?> cls, ClassLoader clsLdr) throws GridException { + @Nullable @Override public GridDeployment explicitDeploy(Class<?> cls, ClassLoader clsLdr) throws IgniteCheckedException { try { // Make sure not to deploy peer loaded tasks with non-local class loader, // if local one exists. @@ -338,8 +339,8 @@ class GridDeploymentLocalStore extends GridDeploymentStoreAdapter { recordDeployFailed(cls, clsLdr, true); // Avoid double wrapping. - if (e.getCause() instanceof GridException) - throw (GridException)e.getCause(); + if (e.getCause() instanceof IgniteCheckedException) + throw (IgniteCheckedException)e.getCause(); throw new GridDeploymentException("Failed to deploy class: " + cls.getName(), e); }