ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: Optimizing shuffle ket write (offheap -> heap).
Date Fri, 18 Nov 2016 09:38:23 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.6.10-hadoop-debug be74c2961 -> 65b59b571


Optimizing shuffle ket write (offheap -> heap).


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

Branch: refs/heads/ignite-1.6.10-hadoop-debug
Commit: 65b59b571b7c601aa82199324a6a33da8ddf233f
Parents: be74c29
Author: devozerov <vozerov@gridgain.com>
Authored: Fri Nov 18 12:37:54 2016 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Fri Nov 18 12:37:54 2016 +0300

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/65b59b57/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 992cca6..5ccf749 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(long ptr, byte[] b, int off, int len) {
+        if (len <= 16) {
+            for (int i = 0; i < len; i++)
+                GridUnsafe.putByte(b, BYTE_ARR_OFF + off + i, GridUnsafe.getByte(ptr + 1));
+        }
+        else
+            UNSAFE.copyMemory(null, ptr, b, BYTE_ARR_OFF + off, len);
+    }
+
     public static void copyMemory(byte[] b, int off, int len, long ptr) {
         if (len <= 16) {
             for (int i = 0; i < len; i++)

http://git-wip-us.apache.org/repos/asf/ignite/blob/65b59b57/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleMessage.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleMessage.java
b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleMessage.java
index 69dfe64..9ebc980 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleMessage.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleMessage.java
@@ -169,7 +169,7 @@ public class HadoopShuffleMessage implements HadoopMessage {
 
         off += 4;
 
-        GridUnsafe.copyMemory(null, ptr, buf, GridUnsafe.BYTE_ARR_OFF + off, size);
+        GridUnsafe.copyMemory(ptr, buf, off, size);
 
         off += size;
     }


Mime
View raw message