Skip to content
Snippets Groups Projects
Commit 5a3c04bb authored by Liang-Chi Hsieh's avatar Liang-Chi Hsieh Committed by Sean Owen
Browse files

[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.
parent 5287eec5
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment