ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [19/44] incubator-ignite git commit: ignite-306 review
Date Thu, 26 Feb 2015 09:29:20 GMT
ignite-306 review


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

Branch: refs/heads/ignite-217
Commit: 1a3a49bffbc001bb6435e73fd1a98a8b5f4794eb
Parents: 1809af1
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Tue Feb 24 18:13:37 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Tue Feb 24 18:13:37 2015 +0300

----------------------------------------------------------------------
 .../internal/util/IgniteExceptionRegistry.java  | 24 +++++---------------
 .../org/apache/ignite/mxbean/IgniteMXBean.java  |  2 +-
 .../communication/tcp/TcpCommunicationSpi.java  |  6 ++---
 3 files changed, 10 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1a3a49bf/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteExceptionRegistry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteExceptionRegistry.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteExceptionRegistry.java
index d2fca6e..fd69d50 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteExceptionRegistry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteExceptionRegistry.java
@@ -20,8 +20,6 @@ package org.apache.ignite.internal.util;
 import org.apache.ignite.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.spi.communication.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.*;
 
 import java.util.*;
 import java.util.concurrent.*;
@@ -30,7 +28,7 @@ import java.util.concurrent.atomic.*;
 import static org.apache.ignite.IgniteSystemProperties.*;
 
 /**
- * Class collects errors from {@link TcpCommunicationSpi} and {@link TcpDiscoverySpi}.
+ * Utility to collect suppressed errors within internal code.
  */
 public class IgniteExceptionRegistry {
     /** */
@@ -70,7 +68,7 @@ public class IgniteExceptionRegistry {
         while (queue.size() >= maxSize)
             queue.pollLast();
 
-        queue.offerFirst(new IgniteExceptionInfo(e, msg, Thread.currentThread().getId(),

+        queue.offerFirst(new IgniteExceptionInfo(e, msg, Thread.currentThread().getId(),
             Thread.currentThread().getName(), U.currentTimeMillis()));
     }
 
@@ -80,20 +78,10 @@ public class IgniteExceptionRegistry {
      * @return Exceptions.
      */
     Collection<IgniteExceptionInfo> getErrors() {
-        int size = queue.size();
-
-        List<IgniteExceptionInfo> errors = new ArrayList<>(size);
+        List<IgniteExceptionInfo> errors = new ArrayList<>();
 
-        int cnt = 0;
-
-        for (IgniteExceptionInfo entry : queue) {
-            if (cnt < size)
-                errors.add(entry);
-            else
-                break;
-            
-            ++cnt;
-        }
+        for (IgniteExceptionInfo entry : queue)
+            errors.add(entry);
 
         return errors;
     }
@@ -118,7 +106,7 @@ public class IgniteExceptionRegistry {
         int cnt = 0;
 
         Iterator<IgniteExceptionInfo> descIter = queue.descendingIterator();
-        
+
         while (descIter.hasNext() && cnt < size){
             IgniteExceptionInfo error = descIter.next();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1a3a49bf/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
index 7cf83fb..cb63c4b 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
@@ -363,6 +363,6 @@ public interface IgniteMXBean {
     /**
      * Prints errors.
      */
-    @MXBeanDescription("Print errors.")
+    @MXBeanDescription("Prints last suppressed errors.")
     public void printLastErrors();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1a3a49bf/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 1f15465..af1563e 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -1879,7 +1879,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                         log.debug("Failed to establish shared memory connection with local
node (node has left): " +
                             node.id());
 
-                    onException("Failed to establish shared memory connection with local
node (node has left): " 
+                    onException("Failed to establish shared memory connection with local
node (node has left): "
                         + node.id(), e);
                 }
             }
@@ -2121,7 +2121,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                         client = null;
                     }
 
-                    onException("Client creation failed. Addr=" + addr + '.', e);
+                    onException("Client creation failed [addr=" + addr + ", err=" + e + ']',
e);
 
                     if (log.isDebugEnabled())
                         log.debug("Client creation failed [addr=" + addr + ", err=" + e +
']');
@@ -2842,7 +2842,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                             log.debug("Recovery reconnect failed, " +
                                 "node left [rmtNode=" + recoveryDesc.node().id() + ", err="
+ e + ']');
 
-                        onException("Recovery reconnect failed, node left [rmtNode=" + recoveryDesc.node().id()
+ "]", 
+                        onException("Recovery reconnect failed, node left [rmtNode=" + recoveryDesc.node().id()
+ "]",
                             e);
                     }
 


Mime
View raw message