Skip to content
Snippets Groups Projects
Commit 1e2474b8 authored by Mridul Muralidharan's avatar Mridul Muralidharan
Browse files

Address review comments - rename toHash to nonNegativeHash

parent b3a82b7d
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ private[spark] object ShuffleSender {
throw new Exception("Block " + blockId + " is not a shuffle block")
}
// Figure out which local directory it hashes to, and which subdirectory in that
val hash = Utils.toHash(blockId)
val hash = Utils.nonNegativeHash(blockId)
val dirId = hash % localDirs.length
val subDirId = (hash / localDirs.length) % subDirsPerLocalDir
val subDir = new File(localDirs(dirId), "%02x".format(subDirId))
......
......@@ -238,7 +238,7 @@ private class DiskStore(blockManager: BlockManager, rootDirs: String)
logDebug("Getting file for block " + blockId)
// Figure out which local directory it hashes to, and which subdirectory in that
val hash = Utils.toHash(blockId)
val hash = Utils.nonNegativeHash(blockId)
val dirId = hash % localDirs.length
val subDirId = (hash / localDirs.length) % subDirsPerLocalDir
......
......@@ -780,7 +780,7 @@ private[spark] object Utils extends Logging {
}
// Handles idiosyncracies with hash (add more as required)
def toHash(obj: AnyRef): Int = {
def nonNegativeHash(obj: AnyRef): Int = {
// Required ?
if (obj eq null) return 0
......
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