Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/9610#discussion_r44742346
--- Diff:
core/src/main/scala/org/apache/spark/shuffle/IndexShuffleBlockResolver.scala ---
@@ -75,13 +81,68 @@ private[spark] class IndexShuffleBlockResolver(conf:
SparkConf) extends ShuffleB
}
/**
+ * Check whether there are index file and data file also they are
matched with each other, returns
+ * the lengths of each block in data file, if there are matched, or
return null.
+ */
+ private def checkIndexAndDataFile(index: File, data: File, blocks: Int):
Array[Long] = {
+ val lengths = new Array[Long](blocks)
+ if (index.length() == (blocks + 1) * 8) {
--- End diff --
instead of the nested `if-else`'s, it might be clearer to write this as:
```
// can you add a comment here to explain this check
if (index.length() != (blocks + 1) * 8) {
return null
}
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]