ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: Fixed exception conversion in DataStreamerImpl.
Date Thu, 15 Jun 2017 07:26:32 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 4026ddcc2 -> d15e2bde1


Fixed exception conversion in DataStreamerImpl.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d15e2bde
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d15e2bde
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d15e2bde

Branch: refs/heads/master
Commit: d15e2bde13d9a01484ea357e46f9a10a29fee227
Parents: 4026ddc
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Jun 15 10:26:27 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Jun 15 10:26:27 2017 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |  4 +--
 .../affinity/GridAffinityProcessor.java         |  4 +--
 .../processors/cache/ExchangeActions.java       | 23 +++++++++++++-
 .../GridCachePartitionExchangeManager.java      | 11 ++-----
 .../cache/IgniteFinishedCacheFutureImpl.java    | 32 ++++++++++++++++++++
 .../GridDhtPartitionsExchangeFuture.java        |  5 +--
 .../datastreamer/DataStreamerImpl.java          | 17 +++++++----
 7 files changed, 74 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d15e2bde/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index fec1892..456acf9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -3917,14 +3917,14 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
                 UUID routerId = locNode instanceof TcpDiscoveryNode ? ((TcpDiscoveryNode)locNode).clientRouterNodeId()
: null;
 
-                U.warn(log, "Dumping debug info for node [id=" + locNode.id() +
+                U.warn(ctx.cluster().diagnosticLog(), "Dumping debug info for node [id="
+ locNode.id() +
                     ", name=" + ctx.igniteInstanceName() +
                     ", order=" + locNode.order() +
                     ", topVer=" + discoMrg.topologyVersion() +
                     ", client=" + client +
                     (client && routerId != null ? ", routerId=" + routerId : "")
+ ']');
 
-                ctx.cache().context().exchange().dumpDebugInfo();
+                ctx.cache().context().exchange().dumpDebugInfo(null);
             }
             else
                 U.warn(log, "Dumping debug info for node, context is not initialized [name="
+ igniteInstanceName +

http://git-wip-us.apache.org/repos/asf/ignite/blob/d15e2bde/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
index 6b43fc7..eac6bbe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessor.java
@@ -372,6 +372,8 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
 
             cctx.awaitStarted();
 
+            AffinityAssignment assign0 = cctx.affinity().assignment(topVer);
+
             try {
                 cctx.gate().enter();
             }
@@ -380,8 +382,6 @@ public class GridAffinityProcessor extends GridProcessorAdapter {
             }
 
             try {
-                AffinityAssignment assign0 = cctx.affinity().assignment(topVer);
-
                 GridAffinityAssignment assign = assign0 instanceof GridAffinityAssignment
?
                     (GridAffinityAssignment)assign0 :
                     new GridAffinityAssignment(topVer, assign0.assignment(), assign0.idealAssignment());

http://git-wip-us.apache.org/repos/asf/ignite/blob/d15e2bde/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
index 31546be..a817589 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
@@ -25,7 +25,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.UUID;
+import org.apache.ignite.internal.util.typedef.C1;
 import org.apache.ignite.internal.util.typedef.F;
 import org.jetbrains.annotations.Nullable;
 
@@ -328,4 +328,25 @@ public class ExchangeActions {
             return desc;
         }
     }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        Object startGrps = F.viewReadOnly(cacheGrpsToStart, new C1<CacheGroupDescriptor,
String>() {
+            @Override public String apply(CacheGroupDescriptor desc) {
+                return desc.cacheOrGroupName();
+            }
+        });
+        Object stopGrps = F.viewReadOnly(cacheGrpsToStop, new C1<CacheGroupDescriptor,
String>() {
+            @Override public String apply(CacheGroupDescriptor desc) {
+                return desc.cacheOrGroupName();
+            }
+        });
+
+        return "ExchangeActions [startCaches=" + (cachesToStart != null ? cachesToStart.keySet()
: null) +
+            ", stopCaches=" + (cachesToStop != null ? cachesToStop.keySet() : null) +
+            ", startGrps=" + startGrps +
+            ", stopGrps=" + stopGrps +
+            ", resetParts=" + (cachesToResetLostParts != null ? cachesToResetLostParts.keySet()
: null) +
+            ", newState=" + newState + ']';
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/d15e2bde/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 901667f..2dff4cf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -1369,13 +1369,6 @@ public class GridCachePartitionExchangeManager<K, V> extends
GridCacheSharedMana
     }
 
     /**
-     * @throws Exception If failed.
-     */
-    public void dumpDebugInfo() throws Exception {
-        dumpDebugInfo(null);
-    }
-
-    /**
      * @param exchFut Optional current exchange future.
      * @throws Exception If failed.
      */
@@ -1858,7 +1851,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                                     break;
                                 }
                                 catch (IgniteFutureTimeoutCheckedException ignored) {
-                                    U.warn(log, "Failed to wait for partition map exchange
[" +
+                                    U.warn(diagnosticLog, "Failed to wait for partition map
exchange [" +
                                         "topVer=" + exchFut.topologyVersion() +
                                         ", node=" + cctx.localNodeId() + "]. " +
                                         "Dumping pending objects that might be the cause:
");
@@ -1868,7 +1861,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
                                             dumpDebugInfo(exchFut);
                                         }
                                         catch (Exception e) {
-                                            U.error(log, "Failed to dump debug information:
" + e, e);
+                                            U.error(diagnosticLog, "Failed to dump debug
information: " + e, e);
                                         }
 
                                         nextDumpTime = U.currentTimeMillis() + nextDumpTimeout(dumpCnt++,
futTimeout);

http://git-wip-us.apache.org/repos/asf/ignite/blob/d15e2bde/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteFinishedCacheFutureImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteFinishedCacheFutureImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteFinishedCacheFutureImpl.java
new file mode 100644
index 0000000..f7bc95b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteFinishedCacheFutureImpl.java
@@ -0,0 +1,32 @@
+/*
+ * 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.internal.util.future.GridFinishedFuture;
+
+/**
+ *
+ */
+public class IgniteFinishedCacheFutureImpl<V> extends IgniteCacheFutureImpl<V>
{
+    /**
+     * @param err Error.
+     */
+    public IgniteFinishedCacheFutureImpl(Throwable err) {
+        super(new GridFinishedFuture<V>(err));
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/d15e2bde/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 571cc3d..9ee8734 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1020,14 +1020,15 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
      *
      */
     private void dumpPendingObjects() {
-        U.warn(log, "Failed to wait for partition release future [topVer=" + topologyVersion()
+
+        U.warn(cctx.kernalContext().cluster().diagnosticLog(),
+            "Failed to wait for partition release future [topVer=" + topologyVersion() +
             ", node=" + cctx.localNodeId() + "]. Dumping pending objects that might be the
cause: ");
 
         try {
             cctx.exchange().dumpDebugInfo(this);
         }
         catch (Exception e) {
-            U.error(log, "Failed to dump debug information: " + e, e);
+            U.error(cctx.kernalContext().cluster().diagnosticLog(), "Failed to dump debug
information: " + e, e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/d15e2bde/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
index 2ae9ce7..48cacca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
@@ -77,6 +77,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheGateway;
 import org.apache.ignite.internal.processors.cache.GridCacheUtils;
 import org.apache.ignite.internal.processors.cache.IgniteCacheFutureImpl;
 import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
+import org.apache.ignite.internal.processors.cache.IgniteFinishedCacheFutureImpl;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
@@ -89,7 +90,6 @@ import org.apache.ignite.internal.util.GridConcurrentHashSet;
 import org.apache.ignite.internal.util.GridSpinBusyLock;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
-import org.apache.ignite.internal.util.future.IgniteFinishedFutureImpl;
 import org.apache.ignite.internal.util.lang.GridPeerDeployAware;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
@@ -579,7 +579,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K,
V>, Delayed
             throw e;
         }
         catch (IgniteException e) {
-            return new IgniteFinishedFutureImpl<>(e);
+            return new IgniteFinishedCacheFutureImpl<>(e);
         }
         finally {
             leaveBusy();
@@ -636,7 +636,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K,
V>, Delayed
             if (e instanceof Error || e instanceof IgniteDataStreamerTimeoutException)
                 throw e;
 
-            return new IgniteFinishedFutureImpl<>(e);
+            return new IgniteCacheFutureImpl<>(resFut);
         }
         finally {
             leaveBusy();
@@ -659,10 +659,15 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K,
V>, Delayed
         else
             checkSecurityPermission(SecurityPermission.CACHE_PUT);
 
-        KeyCacheObject key0 = cacheObjProc.toCacheKeyObject(cacheObjCtx, null, key, true);
-        CacheObject val0 = cacheObjProc.toCacheObject(cacheObjCtx, val, true);
+        try {
+            KeyCacheObject key0 = cacheObjProc.toCacheKeyObject(cacheObjCtx, null, key, true);
+            CacheObject val0 = cacheObjProc.toCacheObject(cacheObjCtx, val, true);
 
-        return addDataInternal(Collections.singleton(new DataStreamerEntry(key0, val0)));
+            return addDataInternal(Collections.singleton(new DataStreamerEntry(key0, val0)));
+        }
+        catch (Exception e) {
+            return new IgniteFinishedCacheFutureImpl<>(e);
+        }
     }
 
     /** {@inheritDoc} */


Mime
View raw message