Uh oh!
There was an error while loading. Please reload this page.
SPARK-1518: FileLogger: Fix compile against Hadoop trunk - #898
Conversation
AmplabJenkins
commented
May 28, 2014
Merged build triggered. |
AmplabJenkins
commented
May 28, 2014
Merged build started. |
AmplabJenkins
commented
May 28, 2014
Merged build finished. |
AmplabJenkins
commented
May 28, 2014
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15241/ |
rxin
commented
May 28, 2014
Colin it appears this method does not exist in older version of Hadoop. I wonder if we need to put this into a shim ... |
pwendell
commented
May 28, 2014
@cmccabe - ah I thought you said this was added in 0.21... Our default build compiles against Hadoop 1.0.4... isn't 1.0.4 newer? |
cmccabe
commented
May 28, 2014
hflush was in hadoop 0.21. You can download http://archive.apache.org/dist/hadoop/core/hadoop-0.21.0/hadoop-0.21.0.tar.gz and check for yourself in common/src/java/org/apache/hadoop/fs/FSDataOutputStream.java. I also verified that hadoop 1.0.4 does not have hflush (although, amusingly enough, it does have references to hflush in the code and documentation... from patches that were cherry-picked from other branches, presumably.) Instead, it has an implementation of hflush (I think?) inside the sync function. Looking at the "Hadoop genealogy" reveals how this could have happened: http://2.bp.blogspot.com/-GO6HF0OAFHw/UOfNEH-4sEI/AAAAAAAAAD0/dEWFFYTRgYw/s1600/output-file.png It looks like what happened was that the hadoop 0.20 line kind of diverged from the hadoop 0.21 line. The 1.0.4 release somehow came out of the 0.20 line, while the 0.21 line mutated into hadoop 2.x at some point. This was all before my time... even CDH3 had hflush, which is the oldest version of Hadoop I ever worked on. Sounds like we're back to reflection tricks, then. |
pwendell
commented
May 28, 2014
Yeah so I'm guessing @andrewor14 didn't use flush because it wasn't there (which is consistent with the docs). If you are feeling adventurous, I think we could write a Scala macro to do this reflection at compile time. Regular reflection should work as well. I think you'd just want to check if hflush is present and it not call sync. |
pwendell
commented
May 28, 2014
By the way, your chart has me thinking, we need to document the Spark version genealogy: :P |
ash211
commented
May 28, 2014
Ha! On an actually-useful note, it'd be nice to have somewhere that lists On Wed, May 28, 2014 at 12:06 AM, Patrick Wendell
|
rxin
commented
May 28, 2014
They do exists on github: https://github.com/apache/spark/releases |
rxin
commented
May 28, 2014
But definitely a good idea to make them more visible. |
AmplabJenkins
commented
May 28, 2014
Merged build triggered. |
AmplabJenkins
commented
May 28, 2014
Merged build started. |
ash211
commented
May 28, 2014
Wait nevermind, they're listed here: https://spark.apache.org/downloads.html On Wed, May 28, 2014 at 12:12 AM, Reynold Xin notifications@github.comwrote:
|
cmccabe
commented
May 28, 2014
The chart was made by Konstantin Boudnik, I just linked to it. I like the Spark version genealogy more-- it's a little easier to understand. :) Here's a version that uses regular reflection. |
There was a problem hiding this comment.
It appears that [getMethod()](http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getMethod%28java.lang.String, java.lang.Class...%29) throws NoSuchMethodException rather than returning null.
There was a problem hiding this comment.
By the way, the "Scala" way to do this may just be
Try(cls.getMethod("hflush")).getOrElse(cls.getMethod("sync"))AmplabJenkins
commented
May 28, 2014
Merged build finished. |
AmplabJenkins
commented
May 28, 2014
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15248/ |
AmplabJenkins
commented
May 28, 2014
Merged build triggered. |
AmplabJenkins
commented
May 28, 2014
Merged build started. |
AmplabJenkins
commented
May 28, 2014
Merged build finished. |
AmplabJenkins
commented
May 28, 2014
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15260/ |
AmplabJenkins
commented
May 28, 2014
Merged build triggered. |
AmplabJenkins
commented
May 28, 2014
Merged build started. |
AmplabJenkins
commented
May 28, 2014
Merged build finished. |
AmplabJenkins
commented
May 28, 2014
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15262/ |
AmplabJenkins
commented
May 28, 2014
Merged build triggered. |
AmplabJenkins
commented
May 28, 2014
Merged build started. |
There was a problem hiding this comment.
Mind adding See SPARK-1518 here? This might be a little hard to grok for someone not familiar with the nuances of Hadoop API's
AmplabJenkins
commented
May 28, 2014
Merged build finished. |
AmplabJenkins
commented
May 28, 2014
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15263/ |
In Hadoop trunk (currently Hadoop 3.0.0), the deprecated FSDataOutputStream#sync() method has been removed. Instead, the FSDataOutputStream#hflush method fills the same role. We should call hflush if it is available. This patch uses reflection to maintain support for old versions of Hadoop that do not have hflush, but which do have the deprecated sync method.
AmplabJenkins
commented
May 28, 2014
Merged build triggered. |
AmplabJenkins
commented
May 28, 2014
Merged build started. |
AmplabJenkins
commented
May 28, 2014
Merged build finished. All automated tests passed. |
AmplabJenkins
commented
May 28, 2014
All automated tests passed. |
pwendell
commented
Jun 4, 2014
LGTM - thanks for this colin! |
In Hadoop trunk (currently Hadoop 3.0.0), the deprecated FSDataOutputStream#sync() method has been removed. Instead, we should call FSDataOutputStream#hflush, which does the same thing as the deprecated method used to do. Author: Colin McCabe <cmccabe@cloudera.com> Closes#898 from cmccabe/SPARK-1518 and squashes the following commits: 752b9d7 [Colin McCabe] FileLogger: Fix compile against Hadoop trunk (cherry picked from commit 1765c8d) Signed-off-by: Patrick Wendell <pwendell@gmail.com>
In Hadoop trunk (currently Hadoop 3.0.0), the deprecated FSDataOutputStream#sync() method has been removed. Instead, we should call FSDataOutputStream#hflush, which does the same thing as the deprecated method used to do. Author: Colin McCabe <cmccabe@cloudera.com> Closesapache#898 from cmccabe/SPARK-1518 and squashes the following commits: 752b9d7 [Colin McCabe] FileLogger: Fix compile against Hadoop trunk
In Hadoop trunk (currently Hadoop 3.0.0), the deprecated FSDataOutputStream#sync() method has been removed. Instead, we should call FSDataOutputStream#hflush, which does the same thing as the deprecated method used to do. Author: Colin McCabe <cmccabe@cloudera.com> Closesapache#898 from cmccabe/SPARK-1518 and squashes the following commits: 752b9d7 [Colin McCabe] FileLogger: Fix compile against Hadoop trunk
In Hadoop trunk (currently Hadoop 3.0.0), the deprecated
FSDataOutputStream#sync() method has been removed. Instead, we should
call FSDataOutputStream#hflush, which does the same thing as the
deprecated method used to do.