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

CC-190: Deprecate the topic.index.map configuration option #151

Merged
merged 4 commits into from
Nov 21, 2017

Conversation

wicknicks
Copy link
Member

Signed-off-by: Arjun Satish arjun@confluent.io

Signed-off-by: Arjun Satish <arjun@confluent.io>
Copy link
Member

@kkonstantine kkonstantine left a comment

Choose a reason for hiding this comment

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

Thanks @wicknicks !
I have a few questions, which as usual I include them as comments.

@@ -96,6 +96,8 @@ Data Conversion
* Importance: low

``topic.index.map``
This option is now deprecated. A future version may remove it completely. Please use single message transforms to map topic names to index names.
Copy link
Member

Choose a reason for hiding this comment

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

nit: A future version will remove it completely?

Copy link
Member

Choose a reason for hiding this comment

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

nit: should we also offer some guidance w.r.t appropriate SMTs?
Please use single message transforms, such as RegexRouter or others, to map topic names ...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we can add the guidance. RegexRouter is the way to go.

Yes, we should be removing this option at a later, as RegexRouter subsumes all functionality of this configuration. Unless, there is a reason to deprecate something and leave it there.

Copy link
Member

Choose a reason for hiding this comment

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

I feel that's a bit contradictory. Ones deprecates an option or a feature to signal that it will permanently be removed in the future for sure. If there's ambiguity regarding removal, then it shouldn't be marked as deprecated option.

@@ -70,6 +70,11 @@

public static final String TYPE_NAME_CONFIG = "type.name";
private static final String TYPE_NAME_DOC = "The Elasticsearch type name to use when indexing.";

/**
Copy link
Member

Choose a reason for hiding this comment

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

I believe we don't use javadoc style comments with config variables. Correct me if I'm wrong.

Copy link
Member Author

@wicknicks wicknicks Nov 20, 2017

Choose a reason for hiding this comment

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

This is mostly for reference. I suppose we could simply use // here. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, we use // everywhere besides javadoc (and copyright header)

Copy link
Member Author

Choose a reason for hiding this comment

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

An addition to my previous comment: The @deprecated annotation applies to fields as well (https://docs.oracle.com/javase/tutorial/java/annotations/predefined.html). Also, if we use Javadoc, the java compiler can report a warning when we use these fields in the code.

Copy link
Member

Choose a reason for hiding this comment

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

My point was that we skip javadocs for all the configs, it wouldn't make much sense to add it only for the deprecated ones.

If you want to include the warning during build, feel free to add the @Deprecated annotation to the variable (outside a comment - javadoc or regular).

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 use the @Deprecated annotation at least, and optionally the JavaDoc tag. In this case, I think the annotation would be sufficient.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it. Removed the javadoc, and replaced it with a @Deprecated annotation.

@@ -46,6 +46,9 @@
private final Set<String> ignoreKeyTopics;
private final boolean ignoreSchema;
private final Set<String> ignoreSchemaTopics;
/**
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above.

Copy link
Member

Choose a reason for hiding this comment

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

Me, too. :-)

Signed-off-by: Arjun Satish <arjun@confluent.io>
Signed-off-by: Arjun Satish <arjun@confluent.io>
Copy link
Member

@kkonstantine kkonstantine left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -96,6 +96,8 @@ Data Conversion
* Importance: low

``topic.index.map``
This option is now deprecated. A future version may remove it completely. Please use single message transforms, such as RegexRouter, to map topic names to index names.

Copy link
Member

@rhauch rhauch Nov 20, 2017

Choose a reason for hiding this comment

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

The goal is that this .rst file can be largely generated by running ElasticsearchSinkConnectorConfig.main(...) and replacing nearly all of the file with the output (except the first few lines). To do that, we'd have to add this text to the documentation in the code. Once that's done, run the main mentioned above and paste into the docs/configuration_options.rst file as part of your commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, @rhauch. Updated these lines using the main method.

Copy link
Member

@rhauch rhauch left a comment

Choose a reason for hiding this comment

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

The goal is that the docs/configuration_options.rst is generated from the code.

…rConfig

Signed-off-by: Arjun Satish <arjun@confluent.io>
Copy link
Member

@rhauch rhauch left a comment

Choose a reason for hiding this comment

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

LGTM. Nice job!

@wicknicks wicknicks merged commit 3fa8088 into confluentinc:master Nov 21, 2017
@wicknicks wicknicks deleted the CC-190 branch November 21, 2017 18:16
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.

3 participants