This is an automated email from the ASF dual-hosted git repository.

agoncharuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d5749e  IGNITE-5247 Always use LITTLE_ENDIAN for communication SPI - 
Fixes #7023.
7d5749e is described below

commit 7d5749e31f0314c913ac38d179768462f15f0117
Author: Alexey Goncharuk <alexey.goncha...@gmail.com>
AuthorDate: Fri Nov 8 12:48:50 2019 +0300

    IGNITE-5247 Always use LITTLE_ENDIAN for communication SPI - Fixes #7023.
    
    Signed-off-by: Alexey Goncharuk <alexey.goncha...@gmail.com>
---
 .../org/apache/ignite/internal/util/nio/GridNioServer.java |  2 +-
 .../ignite/spi/communication/tcp/TcpCommunicationSpi.java  | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index 522fbf5..86f33e2 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -3655,7 +3655,7 @@ public class GridNioServer<T> {
         private boolean directBuf;
 
         /** Byte order. */
-        private ByteOrder byteOrder = ByteOrder.nativeOrder();
+        private ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;
 
         /** NIO server listener. */
         private GridNioServerListener<T> lsnr;
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 618439f..a4de2bf 100755
--- 
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
@@ -2496,7 +2496,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter 
implements Communicati
                 if (isSslEnabled()) {
                     GridNioSslFilter sslFilter =
                         new 
GridNioSslFilter(ignite.configuration().getSslContextFactory().create(),
-                            true, ByteOrder.nativeOrder(), log);
+                            true, ByteOrder.LITTLE_ENDIAN, log);
 
                     sslFilter.directMode(true);
 
@@ -2525,7 +2525,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter 
implements Communicati
                     .serverName("tcp-comm")
                     .tcpNoDelay(tcpNoDelay)
                     .directBuffer(directBuf)
-                    .byteOrder(ByteOrder.nativeOrder())
+                    .byteOrder(ByteOrder.LITTLE_ENDIAN)
                     .socketSendBufferSize(sockSndBuf)
                     .socketReceiveBufferSize(sockRcvBuf)
                     .sendQueueLimit(msgQueueLimit)
@@ -3843,7 +3843,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter 
implements Communicati
             if (isSslEnabled()) {
                 assert sslMeta != null;
 
-                sslHnd = new BlockingSslHandler(sslMeta.sslEngine(), ch, 
directBuf, ByteOrder.nativeOrder(), log);
+                sslHnd = new BlockingSslHandler(sslMeta.sslEngine(), ch, 
directBuf, ByteOrder.LITTLE_ENDIAN, log);
 
                 if (!sslHnd.handshake())
                     throw new HandshakeException("SSL handshake is not 
completed.");
@@ -3921,7 +3921,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter 
implements Communicati
 
             buf = ByteBuffer.allocate(msg.getMessageSize());
 
-            buf.order(ByteOrder.nativeOrder());
+            buf.order(ByteOrder.LITTLE_ENDIAN);
 
             boolean written = msg.writeTo(buf, null);
 
@@ -3945,10 +3945,10 @@ public class TcpCommunicationSpi extends 
IgniteSpiAdapter implements Communicati
                 assert sslHnd != null;
 
                 buf = ByteBuffer.allocate(1000);
-                buf.order(ByteOrder.nativeOrder());
+                buf.order(ByteOrder.LITTLE_ENDIAN);
 
                 ByteBuffer decode = ByteBuffer.allocate(2 * buf.capacity());
-                decode.order(ByteOrder.nativeOrder());
+                decode.order(ByteOrder.LITTLE_ENDIAN);
 
                 for (int i = 0; i < 
RecoveryLastReceivedMessage.MESSAGE_FULL_SIZE; ) {
                     int read = ch.read(buf);
@@ -3986,7 +3986,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter 
implements Communicati
             else {
                 buf = 
ByteBuffer.allocate(RecoveryLastReceivedMessage.MESSAGE_FULL_SIZE);
 
-                buf.order(ByteOrder.nativeOrder());
+                buf.order(ByteOrder.LITTLE_ENDIAN);
 
                 for (int i = 0; i < 
RecoveryLastReceivedMessage.MESSAGE_FULL_SIZE; ) {
                     int read = ch.read(buf);

Reply via email to