Repository: incubator-ignite Updated Branches: refs/heads/ignite-26 a1cc0a9a2 -> 76316fe95
# ignite-26 Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/76316fe9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/76316fe9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/76316fe9 Branch: refs/heads/ignite-26 Commit: 76316fe95f8942c8b38180ee2443c3a665ca9927 Parents: a1cc0a9 Author: sboikov <semen.boi...@inria.fr> Authored: Mon Feb 2 22:05:56 2015 +0300 Committer: sboikov <semen.boi...@inria.fr> Committed: Mon Feb 2 22:30:02 2015 +0300 ---------------------------------------------------------------------- .../internal/TaskEventSubjectIdSelfTest.java | 2 +- .../CacheAtomicUpdateTimeoutException.java | 4 +- ...acheAtomicUpdateTimeoutCheckedException.java | 47 ++++++++++++++++++++ .../dht/atomic/GridDhtAtomicUpdateFuture.java | 2 +- .../dht/atomic/GridNearAtomicUpdateFuture.java | 2 +- .../ignite/internal/util/IgniteUtils.java | 2 + .../GridCacheAtomicTimeoutSelfTest.java | 13 +++--- ...pcEndpointRegistrationOnWindowsSelfTest.java | 4 +- .../discovery/tcp/GridTcpDiscoverySelfTest.java | 4 +- .../websession/GridWebSessionListener.java | 3 +- 10 files changed, 67 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java index e66fdbf..9b6c596 100644 --- a/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/internal/TaskEventSubjectIdSelfTest.java @@ -201,7 +201,7 @@ public class TaskEventSubjectIdSelfTest extends GridCommonAbstractTest { return null; } }, - ComputeTaskTimeoutCheckedException.class, + ComputeTaskTimeoutException.class, null ); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicUpdateTimeoutException.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicUpdateTimeoutException.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicUpdateTimeoutException.java index c1cac73..0ae9d76 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicUpdateTimeoutException.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheAtomicUpdateTimeoutException.java @@ -17,12 +17,12 @@ package org.apache.ignite.cache; -import org.apache.ignite.*; +import javax.cache.*; /** * Exception thrown when atomic operation timeout occurs. */ -public class CacheAtomicUpdateTimeoutException extends IgniteCheckedException { +public class CacheAtomicUpdateTimeoutException extends CacheException { /** */ private static final long serialVersionUID = 0L; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAtomicUpdateTimeoutCheckedException.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAtomicUpdateTimeoutCheckedException.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAtomicUpdateTimeoutCheckedException.java new file mode 100644 index 0000000..97494e8 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAtomicUpdateTimeoutCheckedException.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.cache; + +import org.apache.ignite.*; + +/** + * Exception thrown when atomic operation timeout occurs. + */ +public class CacheAtomicUpdateTimeoutCheckedException extends IgniteCheckedException { + /** */ + private static final long serialVersionUID = 0L; + + /** + * Creates new timeout exception with given error message. + * + * @param msg Error message. + */ + public CacheAtomicUpdateTimeoutCheckedException(String msg) { + super(msg); + } + + /** + * Creates new timeout exception with given error message and optional nested exception. + * + * @param msg Error message. + * @param cause Optional nested exception (can be <tt>null</tt>). + */ + public CacheAtomicUpdateTimeoutCheckedException(String msg, Throwable cause) { + super(msg, cause); + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java index 83c3f46..d833e66 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateFuture.java @@ -169,7 +169,7 @@ public class GridDhtAtomicUpdateFuture<K, V> extends GridFutureAdapter<Void> long mapTime0 = mapTime; if (mapTime0 > 0 && U.currentTimeMillis() > mapTime0 + timeout) { - IgniteCheckedException ex = new CacheAtomicUpdateTimeoutException("Cache update timeout out " + + IgniteCheckedException ex = new CacheAtomicUpdateTimeoutCheckedException("Cache update timeout out " + "(consider increasing networkTimeout configuration property)."); updateRes.addFailedKeys(keys, ex); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java index 7b90e9f..2fe70f1 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java @@ -305,7 +305,7 @@ public class GridNearAtomicUpdateFuture<K, V> extends GridFutureAdapter<Object> long mapTime0 = mapTime; if (mapTime0 > 0 && U.currentTimeMillis() > mapTime0 + timeout) - onDone(new CacheAtomicUpdateTimeoutException("Cache update timeout out " + + onDone(new CacheAtomicUpdateTimeoutCheckedException("Cache update timeout out " + "(consider increasing networkTimeout configuration property).")); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java index 185e20d..957d90d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java @@ -658,6 +658,8 @@ public abstract class IgniteUtils { @Nullable public static CacheException convertToCacheException(IgniteCheckedException e) { if (e instanceof CachePartialUpdateCheckedException) return new CachePartialUpdateException((CachePartialUpdateCheckedException)e); + else if (e instanceof CacheAtomicUpdateTimeoutCheckedException) + return new CacheAtomicUpdateTimeoutException(e.getMessage(), e); if (e.getCause() instanceof CacheException) return (CacheException)e.getCause(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java index 3387ba6..843856a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java @@ -23,6 +23,7 @@ import org.apache.ignite.cache.affinity.*; import org.apache.ignite.cluster.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.*; +import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.spi.*; import org.apache.ignite.internal.managers.communication.*; import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*; @@ -133,7 +134,7 @@ public class GridCacheAtomicTimeoutSelfTest extends GridCommonAbstractTest { fail(); } - catch (CacheAtomicUpdateTimeoutException ignore) { + catch (CacheAtomicUpdateTimeoutCheckedException ignore) { // Expected exception. } } @@ -167,7 +168,7 @@ public class GridCacheAtomicTimeoutSelfTest extends GridCommonAbstractTest { fail(); } - catch (CacheAtomicUpdateTimeoutException ignore) { + catch (CacheAtomicUpdateTimeoutCheckedException ignore) { // Expected exception. } } @@ -202,8 +203,8 @@ public class GridCacheAtomicTimeoutSelfTest extends GridCommonAbstractTest { fail(); } catch (IgniteCheckedException e) { - assertTrue("Invalid exception thrown: " + e, X.hasCause(e, CacheAtomicUpdateTimeoutException.class) - || X.hasSuppressed(e, CacheAtomicUpdateTimeoutException.class)); + assertTrue("Invalid exception thrown: " + e, X.hasCause(e, CacheAtomicUpdateTimeoutCheckedException.class) + || X.hasSuppressed(e, CacheAtomicUpdateTimeoutCheckedException.class)); } } @@ -237,8 +238,8 @@ public class GridCacheAtomicTimeoutSelfTest extends GridCommonAbstractTest { fail(); } catch (IgniteCheckedException e) { - assertTrue("Invalid exception thrown: " + e, X.hasCause(e, CacheAtomicUpdateTimeoutException.class) - || X.hasSuppressed(e, CacheAtomicUpdateTimeoutException.class)); + assertTrue("Invalid exception thrown: " + e, X.hasCause(e, CacheAtomicUpdateTimeoutCheckedException.class) + || X.hasSuppressed(e, CacheAtomicUpdateTimeoutCheckedException.class)); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsServerManagerIpcEndpointRegistrationOnWindowsSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsServerManagerIpcEndpointRegistrationOnWindowsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsServerManagerIpcEndpointRegistrationOnWindowsSelfTest.java index 3920ad6..c6d9838 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsServerManagerIpcEndpointRegistrationOnWindowsSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/fs/GridGgfsServerManagerIpcEndpointRegistrationOnWindowsSelfTest.java @@ -45,9 +45,9 @@ public class GridGgfsServerManagerIpcEndpointRegistrationOnWindowsSelfTest return G.start(cfg); } - }, IgniteCheckedException.class, null); + }, IgniteException.class, null); - assert e.getCause().getMessage().contains(" should not be configured on Windows (configure " + + assert e.getCause().getCause().getMessage().contains(" should not be configured on Windows (configure " + IpcServerTcpEndpoint.class.getSimpleName() + ")"); } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java index 6db7f95..6cc5e59 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/GridTcpDiscoverySelfTest.java @@ -851,7 +851,7 @@ public class GridTcpDiscoverySelfTest extends GridCommonAbstractTest { return null; } }, - IgniteCheckedException.class, + IgniteException.class, null); } finally { @@ -880,7 +880,7 @@ public class GridTcpDiscoverySelfTest extends GridCommonAbstractTest { return null; } }, - IgniteCheckedException.class, + IgniteException.class, null); } finally { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/76316fe9/modules/web/src/main/java/org/apache/ignite/cache/websession/GridWebSessionListener.java ---------------------------------------------------------------------- diff --git a/modules/web/src/main/java/org/apache/ignite/cache/websession/GridWebSessionListener.java b/modules/web/src/main/java/org/apache/ignite/cache/websession/GridWebSessionListener.java index b78dd86..32db814 100644 --- a/modules/web/src/main/java/org/apache/ignite/cache/websession/GridWebSessionListener.java +++ b/modules/web/src/main/java/org/apache/ignite/cache/websession/GridWebSessionListener.java @@ -19,6 +19,7 @@ package org.apache.ignite.cache.websession; import org.apache.ignite.*; import org.apache.ignite.cache.*; +import org.apache.ignite.internal.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; @@ -121,7 +122,7 @@ class GridWebSessionListener { } } } - catch (CacheException | IgniteCheckedException e) { + catch (CacheException | IgniteInterruptedCheckedException e) { U.error(log, "Failed to update session attributes [id=" + sesId + ']', e); } }