IGNITE-1059: Fixed (thanks to Atri for help).
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5269baba Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5269baba Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5269baba Branch: refs/heads/ignite-950 Commit: 5269baba23e062e19981cd4c09d6f2271925fffd Parents: 204823c Author: vozerov-gridgain <voze...@gridgain.com> Authored: Wed Jul 1 16:35:38 2015 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Wed Jul 1 16:35:38 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/IgniteCacheFutureImpl.java | 42 ++++++++++++++++++++ .../processors/cache/IgniteCacheProxy.java | 2 +- .../internal/util/future/IgniteFutureImpl.java | 18 +++++++-- 3 files changed, 57 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5269baba/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheFutureImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheFutureImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheFutureImpl.java new file mode 100644 index 0000000..06c28e6 --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheFutureImpl.java @@ -0,0 +1,42 @@ +/* + * 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.*; +import org.apache.ignite.internal.*; +import org.apache.ignite.internal.util.future.*; +import org.apache.ignite.internal.util.typedef.internal.*; + +/** + * Implementation of public API future for cache. + */ +public class IgniteCacheFutureImpl<V> extends IgniteFutureImpl<V> { + /** + * Constructor. + * + * @param fut Internal future. + */ + public IgniteCacheFutureImpl(IgniteInternalFuture<V> fut) { + super(fut); + } + + /** {@inheritDoc} */ + @Override protected RuntimeException convertException(IgniteCheckedException e) { + return CU.convertToCacheException(e); + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5269baba/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java index 48fd259..3360727 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java @@ -1555,7 +1555,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V * @param fut Future for async operation. */ private <R> void setFuture(IgniteInternalFuture<R> fut) { - curFut.set(new IgniteFutureImpl<>(fut)); + curFut.set(new IgniteCacheFutureImpl<>(fut)); } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5269baba/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java index 86ad438..764e0ea 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java @@ -100,7 +100,7 @@ public class IgniteFutureImpl<V> implements IgniteFuture<V> { return fut.cancel(); } catch (IgniteCheckedException e) { - throw U.convertException(e); + throw convertException(e); } } @@ -110,7 +110,7 @@ public class IgniteFutureImpl<V> implements IgniteFuture<V> { return fut.get(); } catch (IgniteCheckedException e) { - throw U.convertException(e); + throw convertException(e); } } @@ -120,7 +120,7 @@ public class IgniteFutureImpl<V> implements IgniteFuture<V> { return fut.get(timeout); } catch (IgniteCheckedException e) { - throw U.convertException(e); + throw convertException(e); } } @@ -130,10 +130,20 @@ public class IgniteFutureImpl<V> implements IgniteFuture<V> { return fut.get(timeout, unit); } catch (IgniteCheckedException e) { - throw U.convertException(e); + throw convertException(e); } } + /** + * Convert internal exception to public exception. + * + * @param e Internal exception. + * @return Public excpetion. + */ + protected RuntimeException convertException(IgniteCheckedException e) { + return U.convertException(e); + } + /** {@inheritDoc} */ @Override public String toString() { return "IgniteFuture [orig=" + fut + ']';