Skip to content
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

Add experimental annotation to SPI developer guide #14021

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/src/main/sphinx/develop/spi-overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,12 @@ configuration variable ``plugin.dir``. In order for Trino to pick up
the new plugin, you must restart Trino.

Plugins must be installed on all nodes in the Trino cluster (coordinator and workers).

Marking as experimental
-----------------------

If your SPI is experimental or still a work in progress, you can use the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guide is about building plugins that implement the SPI, not provide new SPIs. I think this paragraph should be rephrased to explain that using an SPI marked as experimental, the developer should expect it to change in future releases and be ready to adjust to these changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should say something like

SPI elements that are annotated with `@Experimental` are subject to change without any notice, deprecation period.
Their signatures or semantics may change, and a compilation error is not guaranteed.
Use at your own risk.

Or, we can copy more words from https://github.com/google/guava/blob/2b55799273247661132f999d66943c6adb6ccc35/guava/src/com/google/common/annotations/Beta.java#L23-L35

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW Experimental already has a javadoc saying what it is and after #14033 it will be revealed in javadocs. Do we need to mention it here at all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth it, we don't publish Javadocs anywhere, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The information contained in javadoc is more important that one in this doc.
I do assume it's already visible to SPI users one way or the other. If not, we have a bigger problem that supplementing this (nice) docs with more information.

``@Experimental`` annotation on top of any public class, method, or field to
signify this. You can view `the annotation's implementation
<https://github.com/trinodb/trino/blob/master/core/trino-spi/src/main/java/io/trino/spi/Experimental.java>`_
for more information.