ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [15/50] [abbrv] incubator-ignite git commit: # gg-9791 - Communication fixes
Date Tue, 24 Feb 2015 09:09:53 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java
index 73319ad..71fcc74 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsAckMessage.java
@@ -110,7 +110,7 @@ public class IgfsAckMessage extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)3)))
+            if (!writer.writeHeader(directType(), (byte)3))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
index 4b83de0..ffd0a79 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlockKey.java
@@ -162,7 +162,7 @@ public final class IgfsBlockKey extends MessageAdapter implements Externalizable
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)4)))
+            if (!writer.writeHeader(directType(), (byte)4))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java
index cc14ff6..6475bf3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsBlocksMessage.java
@@ -91,7 +91,7 @@ public class IgfsBlocksMessage extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)3)))
+            if (!writer.writeHeader(directType(), (byte)3))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java
index c157154..e30bec1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsCommunicationMessage.java
@@ -53,7 +53,7 @@ public abstract class IgfsCommunicationMessage extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)0)))
+            if (!writer.writeHeader(directType(), (byte)0))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java
index 799deb9..8057e21 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsDeleteMessage.java
@@ -114,7 +114,7 @@ public class IgfsDeleteMessage extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)2)))
+            if (!writer.writeHeader(directType(), (byte)2))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java
index f949046..626a24e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileAffinityRange.java
@@ -267,7 +267,7 @@ public class IgfsFileAffinityRange extends MessageAdapter implements Externaliza
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)5)))
+            if (!writer.writeHeader(directType(), (byte)5))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java
index 4696942..ce819d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerRequest.java
@@ -86,7 +86,7 @@ public class IgfsFragmentizerRequest extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)2)))
+            if (!writer.writeHeader(directType(), (byte)2))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java
index 5d071df..fdcf6a1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFragmentizerResponse.java
@@ -62,7 +62,7 @@ public class IgfsFragmentizerResponse extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)1)))
+            if (!writer.writeHeader(directType(), (byte)1))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java
index 1c72a34..18f5870 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsSyncMessage.java
@@ -79,7 +79,7 @@ public class IgfsSyncMessage extends IgfsCommunicationMessage {
             return false;
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)2)))
+            if (!writer.writeHeader(directType(), (byte)2))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java
index fc9309e..d61543f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java
@@ -103,7 +103,7 @@ public class GridTaskResultRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)2)))
+            if (!writer.writeHeader(directType(), (byte)2))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java
index 112368a..5bd6e11 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultResponse.java
@@ -121,7 +121,7 @@ public class GridTaskResultResponse extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)4)))
+            if (!writer.writeHeader(directType(), (byte)4))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java
index bd6c6d0..be0ce55 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerCancelRequest.java
@@ -59,7 +59,7 @@ public class GridStreamerCancelRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)1)))
+            if (!writer.writeHeader(directType(), (byte)1))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
index 31d4b4d..d49b4c0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerExecutionRequest.java
@@ -154,7 +154,7 @@ public class GridStreamerExecutionRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)7)))
+            if (!writer.writeHeader(directType(), (byte)7))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java
index 8763dc2..1e2b2c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/streamer/GridStreamerResponse.java
@@ -79,7 +79,7 @@ public class GridStreamerResponse extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)2)))
+            if (!writer.writeHeader(directType(), (byte)2))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java
index 328e46d..f96e0fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridByteArrayList.java
@@ -411,7 +411,7 @@ public class GridByteArrayList extends MessageAdapter implements Externalizable
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)2)))
+            if (!writer.writeHeader(directType(), (byte)2))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java
index 83f81b5..a29dbcb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridLongList.java
@@ -509,7 +509,7 @@ public class GridLongList extends MessageAdapter implements Externalizable
{
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)2)))
+            if (!writer.writeHeader(directType(), (byte)2))
                 return false;
 
             writer.onHeaderWritten();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/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 24146c4..b76c5d4 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
@@ -55,17 +55,9 @@ public class GridDirectParser implements GridNioParser {
         MessageAdapter msg = ses.removeMeta(MSG_META_KEY);
 
         if (msg == null && buf.hasRemaining()) {
-            MessageReader reader = formatter.reader(msgFactory);
+            msg = msgFactory.create(buf.get());
 
-            reader.setBuffer(buf);
-
-            MessageHeader header = reader.readHeader();
-
-            if (reader.isLastRead()) {
-                msg = msgFactory.create(header.messageType());
-
-                msg.setReader(reader);
-            }
+            msg.setReader(formatter.reader(msgFactory));
         }
 
         boolean finished = false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageHeader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageHeader.java
b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageHeader.java
deleted file mode 100644
index 99d2d57..0000000
--- a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageHeader.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.plugin.extensions.communication;
-
-/**
- * Message header.
- */
-public final class MessageHeader {
-    /** Message type. */
-    private final byte msgType;
-
-    /** Fields count. */
-    private final byte fieldCnt;
-
-    /**
-     * @param msgType Message type.
-     * @param fieldCnt Fields count.
-     */
-    public MessageHeader(byte msgType, byte fieldCnt) {
-        this.msgType = msgType;
-        this.fieldCnt = fieldCnt;
-    }
-
-    public byte messageType() {
-        return msgType;
-    }
-
-    /**
-     * @return Fields count.
-     */
-    public byte fieldsCount() {
-        return fieldCnt;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
index 72d7785..dae8845 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageReader.java
@@ -35,12 +35,7 @@ public interface MessageReader {
      */
     public void setBuffer(ByteBuffer buf);
 
-    /**
-     * Reads message header.
-     *
-     * @return Header.
-     */
-    public MessageHeader readHeader();
+    public boolean beforeMessageRead();
 
     /**
      * Reads {@code byte} value.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java
b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java
index 5b669d6..0e35b62 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageWriter.java
@@ -38,9 +38,10 @@ public interface MessageWriter {
     /**
      * Writes message header.
      *
-     * @param header Header.
+     * @param type Message type.
+     * @param fieldCnt Fields count.ß
      */
-    public boolean writeHeader(MessageHeader header);
+    public boolean writeHeader(byte type, byte fieldCnt);
 
     /**
      * Writes {@code byte} value.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e2f2bc0a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
index 9761dad..66d50f8 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingRequest.java
@@ -59,7 +59,7 @@ public class JobStealingRequest extends MessageAdapter {
         writer.setBuffer(buf);
 
         if (!writer.isHeaderWritten()) {
-            if (!writer.writeHeader(new MessageHeader(directType(), (byte)1)))
+            if (!writer.writeHeader(directType(), (byte)1))
                 return false;
 
             writer.onHeaderWritten();


Mime
View raw message