ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: Fixing write.
Date Thu, 17 Nov 2016 16:23:06 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.6.10-hadoop-debug c173c1c74 -> be74c2961


Fixing write.


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

Branch: refs/heads/ignite-1.6.10-hadoop-debug
Commit: be74c2961f2f80acd3b29f299468ffbd93082161
Parents: c173c1c
Author: devozerov <vozerov@gridgain.com>
Authored: Thu Nov 17 19:22:49 2016 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Thu Nov 17 19:22:49 2016 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/internal/util/GridUnsafe.java    | 9 +++++++++
 .../hadoop/shuffle/streams/HadoopDataOutStream.java         | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/be74c296/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
index 1f7a53c..992cca6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
@@ -1035,6 +1035,15 @@ public abstract class GridUnsafe {
         UNSAFE.copyMemory(src, dst, len);
     }
 
+    public static void copyMemory(byte[] b, int off, int len, long ptr) {
+        if (len <= 16) {
+            for (int i = 0; i < len; i++)
+                GridUnsafe.putByte(ptr + i, GridUnsafe.getByte(b, BYTE_ARR_OFF + off + i));
+        }
+        else
+            UNSAFE.copyMemory(b, BYTE_ARR_OFF + off, null, ptr, len);
+    }
+
     /**
      * Sets all bytes in a given block of memory to a copy of another block.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/be74c296/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataOutStream.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataOutStream.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataOutStream.java
index f7b1a73..c39cc5f 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataOutStream.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/streams/HadoopDataOutStream.java
@@ -67,7 +67,7 @@ public class HadoopDataOutStream extends OutputStream implements DataOutput
{
 
     /** {@inheritDoc} */
     @Override public void write(byte[] b, int off, int len) {
-        GridUnsafe.copyMemory(b, GridUnsafe.BYTE_ARR_OFF + off, null, move(len), len);
+        GridUnsafe.copyMemory(b, off, len, move(len));
     }
 
     /** {@inheritDoc} */


Mime
View raw message