Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/895#discussion_r13468264
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -862,6 +862,52 @@ private[spark] object Utils extends Logging {
Source.fromBytes(buff).mkString
}
+ def offsetBytes(files: Seq[File], startIndex: Long, endIndex: Long):
String = {
+ val fileLengths = files.map { _.length }
+ val fileToLength = files.zip(fileLengths).toMap
+ logDebug("Log files: \n" + fileToLength.mkString("\n"))
+
+ val stringBuffer = new StringBuffer((endIndex - startIndex).toInt)
--- End diff --
It might be nice here to assert some basic things to throw better
exceptions if they are wrong:
```
startIndex >= 0
endIndex > startIndex
endIndex > length of all files
```
---
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.
---