Skip to content

Commit e4489c3

Browse files
viiryaJoshRosen
authored andcommitted
[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. (cherry picked from commit 5a3c04b) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
1 parent ba04b52 commit e4489c3

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

unsafe/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ public void putNewKey(
429429
long valueBaseOffset,
430430
int valueLengthBytes) {
431431
assert (!isDefined) : "Can only set value once for a key";
432-
isDefined = true;
433432
assert (keyLengthBytes % 8 == 0);
434433
assert (valueLengthBytes % 8 == 0);
435434
if (size == MAX_CAPACITY) {

0 commit comments

Comments
 (0)