New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-14613][ML] Add @Since into the matrix and vector classes in spark-mllib-local #12416
Conversation
@@ -759,6 +769,8 @@ object SparseMatrix { | |||
|
|||
/** | |||
* Factory methods for [[org.apache.spark.ml.linalg.Matrix]]. | |||
* | |||
* @since 2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be annotations not scaladoc, like @Since("2.0.0")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen Jira description says that these can not be annotations:
In spark-mllib-local, we're no longer to be able to use
@Since
annotation. As a result, we will switch to standard java doc style using /*@Since
/*. This task will add those new APIs as@Since 2.0
Not sure of reasoning behind it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, because that's actually an annotation in Spark Core and it's not available. My mistake. For now fair enough then. But do write 2.0.0
ok to test |
All the public methods need to have |
@srowen I think using scala annotation is easier, and I like it more. What do you think that we have a copy of |
Test build #55938 has finished for PR 12416 at commit
|
I think either moving the annotation to a common base (like sketch) or copying it would be a good idea. |
Yeah, really it doesn't belong there though. It belongs in some super-core project behind all of the projects behind core. For one class, maybe not worth it; if there are many others, maybe so. |
@srowen Maybe not sketch, we have some testing annotations in common/tags - we could extend that beyond just testing tags to include the documentation tags we want to access? |
|
If |
I like @srowen 's idea. Having the shared annotation in |
@pravingadakh let me know if you need any help :) |
You would move the annotation. There's no sense in having two copies. Tagging @rxin since he made the tags module I believe. |
yea just move it. |
Test build #56373 has finished for PR 12416 at commit
|
<goals><goal>add-source</goal></goals> | ||
<configuration> | ||
<sources> | ||
<source>src/main/java</source> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually required? the scala compiler plugin should already know all of these source locations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is only required by src/test/java/
, but thought I should include all source directories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What requires it? I wonder if this isn't actually a problem that needs to be solved by the classifier declarations below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We moved existing test annotations under common/tags
from src/main
package to src/test
package, thus those annotation imports will not work as is, since by default src/test
will be treated as test sources directory unless we explicitly mark it as sources directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin already knows about src/test though. I think your problem is something else, like what's below or this: you have a problem with the new directory structure. They're now under a directory called "org.apache.spark.tags" instead of nested dirs "org/apache/spark/tags"
Test build #56378 has finished for PR 12416 at commit
|
Ping @pravingadakh for update. Thanks. |
@dbtsai I'll update the PR soon, I have been overwhelmed by office work :( |
Test build #56795 has finished for PR 12416 at commit
|
Test build #56796 has finished for PR 12416 at commit
|
val values: Array[Double], | ||
override val isTransposed: Boolean) extends Matrix { | ||
@Since("2.0.0") | ||
class DenseMatrix @Since("2.0.0") ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be overkill, since the class is marked "since 2.0.0". Everything in it is implicitly "since 2.0.0" as well -- or later. But right now there's no later version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct to my eyes. The Since annotation is in place as a non-test class; the existing test classes are moved into the test source root. The parent pom now declares available dependencies on the test or non-test artifacts from this module. Everything refers to the new module, and most dependencies are non-test (which implicitly includes the test artifacts) because they need |
@pravingadakh sorry this needs a rebase now |
1da5e91
to
9b36881
Compare
@srowen Done rebasing. |
I was going to ask why do we need an annotation for this (instead of javadoc's |
Test build #57273 has finished for PR 12416 at commit
|
Test build #57276 has finished for PR 12416 at commit
|
Thanks. Merged into master. |
Looks like this one breaks the pr builder? https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/57289/testReport/org.apache.spark.network/ChunkFetchIntegrationSuite/ChunkFetchIntegrationSuite/ |
Sorry. I am going to revert it. I believe it breaks the build. Seems those build changes are not related to adding Since tag. |
I have reverted this commit. |
Hm, is the issue that the SBT build won't see these classes now that they're test-scope? they are properly test scope though. If really necessary we could, I suppose, bring them back into compile scope, but that would be unfortunate. Does anyone know enough SBT to see how to make it see the test classes? |
Seems we are moving ExtendedYarnTest to src/test, but we are not making others depend on the test jar? Also, can we separate the build change with adding Since tag to those ML methods? I am not sure they should be done in a single PR. |
In sql/hive's pom, we have
I am wondering if we have to specify |
Yeah these are separable. Really, adding the annotation requires the build change, and the latter grew to dominate the change. Hm, I had suggested using This particular failure is turning up from lots of tests, that are in modules with nothing to do with the test tags. Was the last change to declare all these 'tags' dependencies the problem? most modules have nothing to do with it. They're just annotations... they don't matter to any logic. |
Haven't looked in detail (and missed this in my not-so-careful read of the original patch), but that could be a problem, yes. The test tags need to be in every project's test classpath. Regarding |
@srowen I undid the changes done in
which I believe has nothing to do with python module changes (maybe I do not have updated code in my branch). So yes, I think build failure is due to changes (related to |
@pravingadakh The changes in Is there any way to reproduce it locally? Why the original Jenkins build worked? |
@@ -66,7 +66,7 @@ | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.spark</groupId> | |||
<artifactId>spark-test-tags_${scala.binary.version}</artifactId> | |||
<artifactId>spark-tags_${scala.binary.version}</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, what you have to do is: everywhere you're changing this, you need to also add <classifier>tests</classifier>
. In modules where both the test and non-test tags are used, you need both dependencies (with and without classifier).
It might be easier to just leave the test tags in the main source base...
@dbtsai @srowen My mistake, apparently changes in Passed build sbt command:
Failed build sbt command:
But both command works (weird) for me locally. |
OK, let's try this PR again but only with the tag changes first. (You're even welcome to make a separate JIRA that blocks this one, since that much is a fairly separable change.) I vote for just leaving these tags in Thanks @pravingadakh , my suggestion ended up being the wrong one here. |
@srowen I'm little confused here, could you please elaborate a bit here? What tag changes specifically? |
Meaning, let's leave aside the actual original change in the PR, which is to annotate some methods as |
Aah ok, got it thanks. I'll create new jira for that and make that a blocker for this one. |
@pravingadakh go ahead - would be good to get this in for 2.0 |
@pravingadakh if you're busy, I may resubmit this change on your behalf to try to get it in for 2.0 |
@srowen Yes, please go ahead. Thanks. |
See #13074 for the module change. I'm also moving other common annotations |
…nto spark-tags ## What changes were proposed in this pull request? (See #12416 where most of this was already reviewed and committed; this is just the module structure and move part. This change does not move the annotations into test scope, which was the apparently problem last time.) Rename `spark-test-tags` -> `spark-tags`; move common annotations like `Since` to `spark-tags` ## How was this patch tested? Jenkins tests. Author: Sean Owen <sowen@cloudera.com> Closes #13074 from srowen/SPARK-15290. (cherry picked from commit 122302c) Signed-off-by: Sean Owen <sowen@cloudera.com>
…nto spark-tags ## What changes were proposed in this pull request? (See #12416 where most of this was already reviewed and committed; this is just the module structure and move part. This change does not move the annotations into test scope, which was the apparently problem last time.) Rename `spark-test-tags` -> `spark-tags`; move common annotations like `Since` to `spark-tags` ## How was this patch tested? Jenkins tests. Author: Sean Owen <sowen@cloudera.com> Closes #13074 from srowen/SPARK-15290.
What changes were proposed in this pull request?
This PR adds
@since
tag into the matrix and vector classes in spark-mllib-local.How was this patch tested?
Scala-style checks passed.