Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/2824#discussion_r18957257
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -280,12 +280,29 @@ private[spark] object Utils extends Logging {
// When both streams are File stream, use transferTo to improve
copy performance.
val inChannel = in.asInstanceOf[FileInputStream].getChannel()
val outChannel = out.asInstanceOf[FileOutputStream].getChannel()
+ val initialPos = outChannel.position()
val size = inChannel.size()
// In case transferTo method transferred less data than we have
required.
while (count < size) {
count += inChannel.transferTo(count, size - count, outChannel)
}
+
+ // Check the position after transferTo loop to see if it is in the
right position and
+ // give user information if not.
+ // Position will not be increased to the expected length after
calling transferTo in
+ // kernel version 2.6.32, this issue can be seen in
+ // scalastyle:off
+ //
https://bugs.openjdk.java.net/browse/JDK-7052359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel)
--- End diff --
I'm not sure, I found some code in KafkaUtils also use this
`scalastyle:off` to turn off scalacheck.
---
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]