diff options
author | Mridul Muralidharan <mridul@gmail.com> | 2013-09-04 07:46:46 +0530 |
---|---|---|
committer | Mridul Muralidharan <mridul@gmail.com> | 2013-09-04 07:46:46 +0530 |
commit | 1e2474b814719673ce0faa2a8551d1acfb135ead (patch) | |
tree | ec1545f6417cbbe44bd4e4c12fa685415b0668a8 /core | |
parent | b3a82b7df38e4c3e9cd12ca60aa18fa10c8d84c8 (diff) | |
download | spark-1e2474b814719673ce0faa2a8551d1acfb135ead.tar.gz spark-1e2474b814719673ce0faa2a8551d1acfb135ead.tar.bz2 spark-1e2474b814719673ce0faa2a8551d1acfb135ead.zip |
Address review comments - rename toHash to nonNegativeHash
Diffstat (limited to 'core')
3 files changed, 3 insertions, 3 deletions
diff --git a/core/src/main/scala/org/apache/spark/network/netty/ShuffleSender.scala b/core/src/main/scala/org/apache/spark/network/netty/ShuffleSender.scala index 17d59caf9a..8afcbe190a 100644 --- a/core/src/main/scala/org/apache/spark/network/netty/ShuffleSender.scala +++ b/core/src/main/scala/org/apache/spark/network/netty/ShuffleSender.scala @@ -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)) diff --git a/core/src/main/scala/org/apache/spark/storage/DiskStore.scala b/core/src/main/scala/org/apache/spark/storage/DiskStore.scala index e24f627dd8..63447baf8c 100644 --- a/core/src/main/scala/org/apache/spark/storage/DiskStore.scala +++ b/core/src/main/scala/org/apache/spark/storage/DiskStore.scala @@ -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 diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index 54768b798f..b890be2f6f 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -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 |