aboutsummaryrefslogtreecommitdiff
path: root/unsafe
diff options
context:
space:
mode:
authorLiang-Chi Hsieh <viirya@gmail.com>2015-05-21 23:12:00 +0100
committerSean Owen <sowen@cloudera.com>2015-05-21 23:12:00 +0100
commit5a3c04bb92e21bd221a75c4ae13a71f7d4716b44 (patch)
tree6d647cc280693d18cc41845c3333171e80d5e49a /unsafe
parent5287eec5a6948c0c6e0baaebf35f512324c0679a (diff)
downloadspark-5a3c04bb92e21bd221a75c4ae13a71f7d4716b44.tar.gz
spark-5a3c04bb92e21bd221a75c4ae13a71f7d4716b44.tar.bz2
spark-5a3c04bb92e21bd221a75c4ae13a71f7d4716b44.zip
[SPARK-7800] isDefined should not marked too early in putNewKey
JIRA: https://issues.apache.org/jira/browse/SPARK-7800 `isDefined` is marked as true twice in `Location.putNewKey`. The first one is unnecessary and will cause problem because it is too early and before some assert checking. E.g., if an attempt with incorrect `keyLengthBytes` marks `isDefined` as true, the location can not be used later. ping JoshRosen Author: Liang-Chi Hsieh <viirya@gmail.com> Closes #6324 from viirya/dup_isdefined and squashes the following commits: cbfe03b [Liang-Chi Hsieh] isDefined should not marked too early in putNewKey.
Diffstat (limited to 'unsafe')
-rw-r--r--unsafe/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java1
1 files changed, 0 insertions, 1 deletions
diff --git a/unsafe/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java b/unsafe/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java
index bd4ca74cc7..0b4d8d286f 100644
--- a/unsafe/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java
+++ b/unsafe/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java
@@ -429,7 +429,6 @@ public final class BytesToBytesMap {
long valueBaseOffset,
int valueLengthBytes) {
assert (!isDefined) : "Can only set value once for a key";
- isDefined = true;
assert (keyLengthBytes % 8 == 0);
assert (valueLengthBytes % 8 == 0);
if (size == MAX_CAPACITY) {