Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -247,8 +247,13 @@ public <K extends ImmutableBytesWritable> CacheEntry<K> toCacheEntry(byte[] byte

// Determines the partition, i.e. spillFile the tuple should get spilled to.
private int getPartition(ImmutableBytesWritable key) {
int hashCode = key.hashCode();
// *Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE
if (hashCode == Integer.MIN_VALUE) {
hashCode = hashCode >> 1;
}
// Simple implementation hash mod numFiles
return Math.abs(key.hashCode()) % numSpillFiles;
return Math.abs(hashCode) % numSpillFiles;
}

/**
Expand Down