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

[FLINK-8149][kinesis] Replace usages of deprecated SerializationSchema #5069

Closed
wants to merge 2 commits into from

Conversation

yew1eb
Copy link
Contributor

@yew1eb yew1eb commented Nov 25, 2017

What is the purpose of the change

The deprecated SerializationSchema in flink-streaming-java, has been moved to flink-core.
replace usages of deprecated SerializationSchema in flink-connector-kinesis.

Brief change log

  • Replace usages of DeserializationSchema, SerializationSchema, SimpleStringSchema

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@@ -41,7 +42,6 @@
import org.apache.flink.streaming.connectors.kinesis.serialization.KinesisDeserializationSchema;
import org.apache.flink.streaming.connectors.kinesis.serialization.KinesisDeserializationSchemaWrapper;
import org.apache.flink.streaming.connectors.kinesis.util.KinesisConfigUtil;
import org.apache.flink.streaming.util.serialization.DeserializationSchema;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can not simply remove the usage of this, as that will be an user API-breaking change (for users that use the FlinkKinesisConsumer(String, DeserializationSchema<T>, Properties) constructor).

Instead of removing this, we should deprecate the constructors that accept the deprecated DeserializationSchema interface, and add new corresponding constructors that accept the new migrated DeserializationSchema.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sense.

import org.apache.flink.configuration.Configuration;
import org.apache.flink.runtime.state.FunctionInitializationContext;
import org.apache.flink.runtime.state.FunctionSnapshotContext;
import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction;
import org.apache.flink.streaming.api.functions.sink.RichSinkFunction;
import org.apache.flink.streaming.connectors.kinesis.serialization.KinesisSerializationSchema;
import org.apache.flink.streaming.connectors.kinesis.util.KinesisConfigUtil;
import org.apache.flink.streaming.util.serialization.SerializationSchema;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here; see above coment.

@tzulitai
Copy link
Contributor

tzulitai commented Nov 27, 2017

Thanks for the PR @yew1eb! I have one comment regarding how the change breaks user API.

@yew1eb
Copy link
Contributor Author

yew1eb commented Nov 29, 2017

@tzulitai, thanks for your review. I have updated the PR according to your comments.

@tzulitai
Copy link
Contributor

LGTM, merging this ..

@tzulitai
Copy link
Contributor

Ah, I just realized that my comment on the last review is irrelevant, since org.apache.flink.streaming.util.serialization.SerializationSchema extends org.apache.flink.api.common.serialization.SerializationSchema, meaning that there is no API-breaking change.

Sorry about this. The PR is good to go without the extra follow-up fix. Merging the first commit.

@asfgit asfgit closed this in a744d4b Nov 30, 2017
@bowenli86
Copy link
Member

bowenli86 commented Dec 7, 2017

I just saw the code in src tree and traced back to this PR. I feel it's really bad to have runnable examples (with java main method) in a lib jar that Flink distributes.

Can we move the examples to /test? I believe that's the right way of adding examples

@tzulitai
Copy link
Contributor

tzulitai commented Dec 7, 2017

@bowenli86 do you mean the ProduceIntoKinesis and ConsumeFromKinesis classes?
I agree that we should move them to /test, but we should consider that as a separate issue than this one. Could you open a JIRA for that?

@bowenli86
Copy link
Member

My apologies! Silly mistake at late night when the brain is quite inactive.... I forgot to check the files history, and thought this PR (which shows as latest commit) added those examples...

Opened FLINK-8218. Sincere apologies again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants