aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/java
diff options
context:
space:
mode:
authorReynold Xin <rxin@databricks.com>2016-04-21 17:52:10 -0700
committerReynold Xin <rxin@databricks.com>2016-04-21 17:52:10 -0700
commit0bf8df250e0aeae306e2ef33e612ca27187447ed (patch)
tree3dfb1cc72597800ea2fa4af2ceda6ca5df4e44ce /core/src/test/java
parentf181aee07c0ee105b2a34581105eeeada7d42363 (diff)
downloadspark-0bf8df250e0aeae306e2ef33e612ca27187447ed.tar.gz
spark-0bf8df250e0aeae306e2ef33e612ca27187447ed.tar.bz2
spark-0bf8df250e0aeae306e2ef33e612ca27187447ed.zip
[HOTFIX] Fix Java 7 compilation break
Diffstat (limited to 'core/src/test/java')
-rw-r--r--core/src/test/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorterSuite.java3
-rw-r--r--core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java3
2 files changed, 2 insertions, 4 deletions
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);