ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: # ignite-838
Date Wed, 29 Apr 2015 14:47:11 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-838 [created] 95f8fb27c


# ignite-838


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

Branch: refs/heads/ignite-838
Commit: 95f8fb27cf26561ebcf9e06de4d1f4307f4549b3
Parents: 5854f1d
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Apr 29 17:46:54 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Apr 29 17:46:54 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/util/nio/GridDirectParser.java    | 3 +++
 .../main/java/org/apache/ignite/spi/IgniteSpiAdapter.java    | 8 ++++++++
 .../ignite/spi/communication/tcp/TcpCommunicationSpi.java    | 8 ++++----
 3 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95f8fb27/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java
index d632cac..889a79d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java
@@ -62,6 +62,9 @@ public class GridDirectParser implements GridNioParser {
         if (msg == null && buf.hasRemaining()) {
             msg = msgFactory.create(buf.get());
 
+            if (msg == null)
+                return null;
+
             ses.addMeta(READER_META_KEY, reader = formatter.reader(msgFactory));
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95f8fb27/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
index b43f8a5..760d2a1 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
@@ -716,6 +716,14 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
 
         /** {@inheritDoc} */
         @Override public MessageFactory messageFactory() {
+            if (stopping) {
+                return new MessageFactory() {
+                    @Nullable @Override public Message create(byte type) {
+                        return null;
+                    }
+                };
+            }
+
             return null;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/95f8fb27/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 2d5c541..23d4c81 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
@@ -1341,7 +1341,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
         // If configured TCP port is busy, find first available in range.
         for (int port = locPort; port < locPort + locPortRange; port++) {
             try {
-                MessageFactory messageFactory = new MessageFactory() {
+                MessageFactory msgFactory = new MessageFactory() {
                     private MessageFactory impl;
 
                     @Nullable @Override public Message create(byte type) {
@@ -1354,7 +1354,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                     }
                 };
 
-                MessageFormatter messageFormatter = new MessageFormatter() {
+                MessageFormatter msgFormatter = new MessageFormatter() {
                     private MessageFormatter impl;
 
                     @Override public MessageWriter writer() {
@@ -1376,7 +1376,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                     }
                 };
 
-                GridDirectParser parser = new GridDirectParser(messageFactory, messageFormatter);
+                GridDirectParser parser = new GridDirectParser(msgFactory, msgFormatter);
 
                 IgnitePredicate<Message> skipRecoveryPred = new IgnitePredicate<Message>()
{
                     @Override public boolean apply(Message msg) {
@@ -1403,7 +1403,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
                         .writeTimeout(sockWriteTimeout)
                         .filters(new GridNioCodecFilter(parser, log, true),
                             new GridConnectionBytesVerifyFilter(log))
-                        .messageFormatter(messageFormatter)
+                        .messageFormatter(msgFormatter)
                         .skipRecoveryPredicate(skipRecoveryPred)
                         .build();
 


Mime
View raw message