Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69428185D3 for ; Wed, 1 Jul 2015 13:35:47 +0000 (UTC) Received: (qmail 15693 invoked by uid 500); 1 Jul 2015 13:35:47 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 15662 invoked by uid 500); 1 Jul 2015 13:35:47 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 15653 invoked by uid 99); 1 Jul 2015 13:35:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jul 2015 13:35:47 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 01 Jul 2015 13:33:36 +0000 Received: (qmail 14448 invoked by uid 99); 1 Jul 2015 13:35:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jul 2015 13:35:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9DA7DDFBC8; Wed, 1 Jul 2015 13:35:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-ignite git commit: IGNITE-1059: Fixed (thanks to Atri for help). Date: Wed, 1 Jul 2015 13:35:22 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-ignite Updated Branches: refs/heads/ignite-sprint-7 204823c33 -> 5269baba2 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-sprint-7 Commit: 5269baba23e062e19981cd4c09d6f2271925fffd Parents: 204823c Author: vozerov-gridgain Authored: Wed Jul 1 16:35:38 2015 +0300 Committer: vozerov-gridgain 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 extends IgniteFutureImpl { + /** + * Constructor. + * + * @param fut Internal future. + */ + public IgniteCacheFutureImpl(IgniteInternalFuture 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 extends AsyncSupportAdapter void setFuture(IgniteInternalFuture 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 implements IgniteFuture { return fut.cancel(); } catch (IgniteCheckedException e) { - throw U.convertException(e); + throw convertException(e); } } @@ -110,7 +110,7 @@ public class IgniteFutureImpl implements IgniteFuture { return fut.get(); } catch (IgniteCheckedException e) { - throw U.convertException(e); + throw convertException(e); } } @@ -120,7 +120,7 @@ public class IgniteFutureImpl implements IgniteFuture { return fut.get(timeout); } catch (IgniteCheckedException e) { - throw U.convertException(e); + throw convertException(e); } } @@ -130,10 +130,20 @@ public class IgniteFutureImpl implements IgniteFuture { 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 + ']';