From 0bf8df250e0aeae306e2ef33e612ca27187447ed Mon Sep 17 00:00:00 2001 From: Reynold Xin Date: Thu, 21 Apr 2016 17:52:10 -0700 Subject: [HOTFIX] Fix Java 7 compilation break --- .../java/org/apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java | 3 +-- .../spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'core/src/test/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 43e32f073a..278a827644 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); 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 23f4abfed2..4a2f65a0ed 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); -- cgit v1.2.3