You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/02/02 15:17:35 UTC
[43/43] incubator-ignite git commit: # ignite-26
# 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/cd4040d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cd4040d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cd4040d5
Branch: refs/heads/ignite-26
Commit: cd4040d5bea5dc598f308850e0d695379012077c
Parents: 2f24882
Author: sboikov <sb...@gridgain.com>
Authored: Mon Feb 2 17:16:30 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Feb 2 17:16:30 2015 +0300
----------------------------------------------------------------------
.../cache/GridCacheWriteBehindStore.java | 3 ++-
.../processors/cache/IgniteCacheProxy.java | 8 +-------
.../apache/ignite/internal/util/IgniteUtils.java | 17 +++++++++++++++++
.../ignite/yardstick/compute/model/NoopTask.java | 9 ++++-----
4 files changed, 24 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd4040d5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java
index 7e53b25..c52ea5a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStore.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.store.*;
+import org.apache.ignite.internal.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.lifecycle.*;
import org.apache.ignite.thread.*;
@@ -487,7 +488,7 @@ public class GridCacheWriteBehindStore<K, V> extends CacheStore<K, V> implements
* @param key Key for which update is performed.
* @param val New value, may be null for remove operation.
* @param operation Updated value status
- * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException If interrupted while waiting for value to be flushed.
+ * @throws IgniteInterruptedCheckedException If interrupted while waiting for value to be flushed.
*/
private void updateCache(K key,
@Nullable Entry<? extends K, ? extends V> val,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd4040d5/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 86fdeda..3599fcb 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
@@ -1066,13 +1066,7 @@ public class IgniteCacheProxy<K, V> extends IgniteAsyncSupportAdapter<IgniteCach
* @return Cache exception.
*/
private CacheException cacheException(IgniteCheckedException e) {
- if (e instanceof CachePartialUpdateCheckedException)
- return new CachePartialUpdateException((CachePartialUpdateCheckedException)e);
-
- if (e.getCause() instanceof CacheException)
- return (CacheException)e.getCause();
-
- return new CacheException(e);
+ return U.convertCacheException(e);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd4040d5/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 c33083f..9a79a57 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
@@ -47,6 +47,7 @@ import org.jdk8.backport.*;
import org.jetbrains.annotations.*;
import sun.misc.*;
+import javax.cache.*;
import javax.management.*;
import javax.naming.*;
import javax.net.ssl.*;
@@ -651,6 +652,22 @@ public abstract class IgniteUtils {
}
/**
+ * @param e Ignite checked exception.
+ * @return Ignite runtime exception.
+ */
+ @Nullable public static CacheException convertCacheException(IgniteCheckedException e) {
+ if (e instanceof CachePartialUpdateCheckedException)
+ return new CachePartialUpdateException((CachePartialUpdateCheckedException)e);
+
+ if (e.getCause() instanceof CacheException)
+ return (CacheException)e.getCause();
+
+ C1<IgniteCheckedException, IgniteException> converter = exceptionConverters.get(e.getClass());
+
+ return converter != null ? new CacheException(converter.apply(e)) : new CacheException(e);
+ }
+
+ /**
* @return System time approximated by 10 ms.
*/
public static long currentTimeMillis() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd4040d5/modules/yardstick/src/main/java/org/apache/ignite/yardstick/compute/model/NoopTask.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/compute/model/NoopTask.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/compute/model/NoopTask.java
index 34ab2ad..d3cf55e 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/compute/model/NoopTask.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/compute/model/NoopTask.java
@@ -17,7 +17,6 @@
package org.apache.ignite.yardstick.compute.model;
-import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
import org.jetbrains.annotations.*;
@@ -45,7 +44,7 @@ public class NoopTask implements ComputeTask<Object, Object> {
@Override public ComputeJobResultPolicy result(
ComputeJobResult res,
List<ComputeJobResult> rcvd
- ) throws IgniteCheckedException {
+ ) {
return ComputeJobResultPolicy.WAIT;
}
@@ -53,7 +52,7 @@ public class NoopTask implements ComputeTask<Object, Object> {
@Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(
List<ClusterNode> subgrid,
@Nullable Object arg
- ) throws IgniteCheckedException {
+ ) {
Map<ComputeJob, ClusterNode> map = new HashMap<>((int)(subgrid.size() * jobs / 0.75));
for (ClusterNode gridNode : subgrid) {
@@ -66,7 +65,7 @@ public class NoopTask implements ComputeTask<Object, Object> {
}
/** {@inheritDoc} */
- @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteCheckedException {
+ @Nullable @Override public Object reduce(List<ComputeJobResult> results) {
return null;
}
@@ -75,7 +74,7 @@ public class NoopTask implements ComputeTask<Object, Object> {
*/
public static class NoopJob implements ComputeJob, Externalizable {
/** {@inheritDoc} */
- @Nullable @Override public Object execute() throws IgniteCheckedException {
+ @Nullable @Override public Object execute() {
return null;
}