You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/12/17 16:29:21 UTC

[GitHub] [flink] Myasuka opened a new pull request #10610: [FLINK-13910] Add missing serialVersionUID for serializable classes

Myasuka opened a new pull request #10610: [FLINK-13910] Add missing serialVersionUID for serializable classes
URL: https://github.com/apache/flink/pull/10610
 
 
   ## What is the purpose of the change
   
   Add `serialVersionUID` for all production serializable classes.
   
   ## Brief change log
   
   All `serialVersionUID` of classes in this PR is auto generated by my customized intellij-IDEA (please refer to my [repo](https://github.com/Myasuka/intellij-community/tree/add-SerialVersionUID)).  Generally, we could use [serialver](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/serialver.html) to get the `serialVersionUID`, however, how to insert them into the classes become a bit complex, that's why I want to leverage intellj-IDEA's feature of [auto generating serialVersionUID](https://stackoverflow.com/questions/24573643/how-to-generate-serial-version-uid-in-intellij). 
   
   However, both intellij and eclipse use different rules to generate `serialVersionUID` compared with JVM or serialver. To ensure these newly added `serialVersionUID`s are compatible with old ones, I have to use code class path to get SerialVersionUID from `ObjectStreamClass`. Eventually, I chose to modify and rebuild a customized IDE.
   
   1. build Flink from source: 
   ~~~ shell
   mvn clean package -DskipTests -Dfast -Pskip-webui-build -T 1C
   ~~~
   2. Build and run my customized intellij IDEA, you could refer to the [README](https://github.com/Myasuka/intellij-community/tree/add-SerialVersionUID)
   3. Run `Analyze` -> `Run inspection by name` -> select `serializable class without serialVersionUID` -> choose `Project Production Files` and click to `Ignore anonymous inner classes`. 
   4. Then you will get the results for all production classes without `serialVersionUID` in the bottom window and click `Add 'serialVersionUID' field` on the right side.  Wait for a while to get the final result.
   
   ## Verifying this change
   
   This change is already covered by existing tests.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: **yes**, add `serialVersionUID`
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services