Skip to content

[SPARK-13986][CORE][MLLIB] Remove DeveloperApi-annotations for non-publics #11797

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

Closed
wants to merge 2 commits into from
Closed

[SPARK-13986][CORE][MLLIB] Remove DeveloperApi-annotations for non-publics #11797

wants to merge 2 commits into from

Conversation

dongjoon-hyun
Copy link
Member

What changes were proposed in this pull request?

Spark uses @DeveloperApi annotation, but sometimes it seems to conflict with visibility. This PR tries to fix those conflict by removing annotations for non-publics. The following is the example.

JobResult.scala

@DeveloperApi
sealed trait JobResult

@DeveloperApi
case object JobSucceeded extends JobResult

-@DeveloperApi
private[spark] case class JobFailed(exception: Exception) extends JobResult

How was this patch tested?

Pass the existing Jenkins test.

@dongjoon-hyun dongjoon-hyun changed the title Make @DeveloperApi-annotated things public. [SPARK-13986][CORE][MLLIB] Make @DeveloperApi-annotated things public. Mar 17, 2016
@SparkQA
Copy link

SparkQA commented Mar 17, 2016

Test build #53474 has finished for PR 11797 at commit 6f3ea7a.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class JobFailed(exception: Exception) extends JobResult
    • trait ValidatorParams extends Params
    • class MatrixUDT extends UserDefinedType[Matrix]
    • case class NodeIndexUpdater(
    • class NodeIdCache(
    • class ImpurityStats(

@dongjoon-hyun
Copy link
Member Author

Just rebased.

@jodersky
Copy link
Member

I agree there are discrepancies between the intended meaning of annotations and access modifiers, however my reaction would be to keep everything private and make stuff public on an actual requirement basis.

Making things public is easy, however reverting things to private once they're in the wild is hard and can have many unforeseen consequences. So my recommendation is to remove the @DeveloperAPI annotation but keep the current access scope.

@rxin
Copy link
Contributor

rxin commented Mar 18, 2016

+1 to what @jodersky said.

@SparkQA
Copy link

SparkQA commented Mar 18, 2016

Test build #53486 has finished for PR 11797 at commit ec7fff2.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class JobFailed(exception: Exception) extends JobResult
    • trait ValidatorParams extends Params
    • class MatrixUDT extends UserDefinedType[Matrix]
    • case class NodeIndexUpdater(
    • class NodeIdCache(
    • class ImpurityStats(

@dongjoon-hyun
Copy link
Member Author

Thank you, @jodersky and @rxin . I'll do like that.

Just one more question: JobFailed is needed to be private[spark]?

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-13986][CORE][MLLIB] Make @DeveloperApi-annotated things public. [SPARK-13986][CORE][MLLIB] Remove DeveloperApi-annotations for non-publics Mar 18, 2016
@dongjoon-hyun
Copy link
Member Author

I updated this PR and JIRA according to the comments. Thank you all.

@SparkQA
Copy link

SparkQA commented Mar 18, 2016

Test build #53499 has finished for PR 11797 at commit c9284b8.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Mar 18, 2016

Test build #53503 has finished for PR 11797 at commit 696ea5c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Mar 21, 2016

Merged to master

@asfgit asfgit closed this in df61fbd Mar 21, 2016
@dongjoon-hyun
Copy link
Member Author

Oh, Thank you, @srowen !

roygao94 pushed a commit to roygao94/spark that referenced this pull request Mar 22, 2016
…publics

## What changes were proposed in this pull request?

Spark uses `DeveloperApi` annotation, but sometimes it seems to conflict with visibility. This PR tries to fix those conflict by removing annotations for non-publics. The following is the example.

**JobResult.scala**
```scala
DeveloperApi
sealed trait JobResult

DeveloperApi
case object JobSucceeded extends JobResult

-DeveloperApi
private[spark] case class JobFailed(exception: Exception) extends JobResult
```

## How was this patch tested?

Pass the existing Jenkins test.

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes apache#11797 from dongjoon-hyun/SPARK-13986.
@dongjoon-hyun dongjoon-hyun deleted the SPARK-13986 branch March 29, 2016 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants