Repository: spark Updated Branches: refs/heads/master f181aee07 -> 0bf8df250
[HOTFIX] Fix Java 7 compilation break Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/0bf8df25 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/0bf8df25 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/0bf8df25 Branch: refs/heads/master Commit: 0bf8df250e0aeae306e2ef33e612ca27187447ed Parents: f181aee Author: Reynold Xin <r...@databricks.com> Authored: Thu Apr 21 17:52:10 2016 -0700 Committer: Reynold Xin <r...@databricks.com> Committed: Thu Apr 21 17:52:10 2016 -0700 ---------------------------------------------------------------------- .../org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java | 5 ++--- .../util/collection/unsafe/sort/UnsafeInMemorySorter.java | 6 ++---- .../apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java | 3 +-- .../util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java | 3 +-- 4 files changed, 6 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/0bf8df25/core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java b/core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java index 6863094..75a0e80 100644 --- a/core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java +++ b/core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java @@ -17,7 +17,6 @@ package org.apache.spark.shuffle.sort; -import java.lang.Long; import java.util.Comparator; import org.apache.spark.memory.MemoryConsumer; @@ -102,7 +101,7 @@ final class ShuffleInMemorySorter { array.getBaseOffset(), newArray.getBaseObject(), newArray.getBaseOffset(), - array.size() * (Long.BYTES / memoryAllocationFactor) + array.size() * (8 / memoryAllocationFactor) ); consumer.freeArray(array); array = newArray; @@ -113,7 +112,7 @@ final class ShuffleInMemorySorter { } public long getMemoryUsage() { - return array.size() * Long.BYTES; + return array.size() * 8; } /** http://git-wip-us.apache.org/repos/asf/spark/blob/0bf8df25/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java index 5f46ef9..03973f3 100644 --- a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java +++ b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java @@ -17,7 +17,6 @@ package org.apache.spark.util.collection.unsafe.sort; -import java.lang.Long; import java.util.Comparator; import org.apache.avro.reflect.Nullable; @@ -27,7 +26,6 @@ import org.apache.spark.memory.TaskMemoryManager; import org.apache.spark.unsafe.Platform; import org.apache.spark.unsafe.array.LongArray; import org.apache.spark.util.collection.Sorter; -import org.apache.spark.util.collection.unsafe.sort.RadixSort; /** * Sorts records using an AlphaSort-style key-prefix sort. This sort stores pointers to records @@ -163,7 +161,7 @@ public final class UnsafeInMemorySorter { } public long getMemoryUsage() { - return array.size() * Long.BYTES; + return array.size() * 8; } public boolean hasSpaceForAnotherRecord() { @@ -179,7 +177,7 @@ public final class UnsafeInMemorySorter { array.getBaseOffset(), newArray.getBaseObject(), newArray.getBaseOffset(), - array.size() * (Long.BYTES / memoryAllocationFactor)); + array.size() * (8 / memoryAllocationFactor)); consumer.freeArray(array); array = newArray; } http://git-wip-us.apache.org/repos/asf/spark/blob/0bf8df25/core/src/test/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java b/core/src/test/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java index 43e32f0..278a827 100644 --- a/core/src/test/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java +++ b/core/src/test/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java @@ -17,7 +17,6 @@ package org.apache.spark.shuffle.sort; -import java.lang.Long; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Random; @@ -83,7 +82,7 @@ public class ShuffleInMemorySorterSuite { for (String str : dataToSort) { if (!sorter.hasSpaceForAnotherRecord()) { sorter.expandPointerArray( - consumer.allocateArray(sorter.getMemoryUsage() / Long.BYTES * 2)); + consumer.allocateArray(sorter.getMemoryUsage() / 8 * 2)); } final long recordAddress = memoryManager.encodePageNumberAndOffset(dataPage, position); final byte[] strBytes = str.getBytes(StandardCharsets.UTF_8); http://git-wip-us.apache.org/repos/asf/spark/blob/0bf8df25/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java index 23f4abf..4a2f65a 100644 --- a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java +++ b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java @@ -17,7 +17,6 @@ package org.apache.spark.util.collection.unsafe.sort; -import java.lang.Long; import java.nio.charset.StandardCharsets; import java.util.Arrays; @@ -114,7 +113,7 @@ public class UnsafeInMemorySorterSuite { for (int i = 0; i < dataToSort.length; i++) { if (!sorter.hasSpaceForAnotherRecord()) { sorter.expandPointerArray( - consumer.allocateArray(sorter.getMemoryUsage() / Long.BYTES * 2)); + consumer.allocateArray(sorter.getMemoryUsage() / 8 * 2)); } // position now points to the start of a record (which holds its length). final int recordLength = Platform.getInt(baseObject, position); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org