Skip to content

Commit

Permalink
[KYUUBI-SHADED #48] Remove unused annotations for HMS client generate…
Browse files Browse the repository at this point in the history
…d thrift code

### _Why are the changes needed?_

Change thrift arg `generated_annotations` from `undated` to `suppress` to remove the following annotation, to make it compilable without additional dependency for Java 11+
```
javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)")
```

Remove Hadoop classification annotations, it is only used for Hadoop project to generate Javadocs, useless for us.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #48 from pan3793/thrift-ann.

4781e6a [Cheng Pan] 17
ea9c8d3 [Cheng Pan] Remove unused annotations for HMS client generated thrift code

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
  • Loading branch information
pan3793 committed Aug 19, 2024
1 parent b20fd14 commit e667499
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 47 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ jobs:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java: [8, 17]
steps:
- uses: actions/checkout@v3
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
java-version: ${{ matrix.java }}
cache: 'maven'
check-latest: false
- name: Setup Maven
Expand Down
30 changes: 1 addition & 29 deletions kyuubi-relocated-hive-metastore-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ under the License.
<thrift.home>you-must-set-this-to-run-thrift</thrift.home>
<thrift.file>src/main/thrift/hive_metastore.thrift</thrift.file>
<thrift.gen.dir>${basedir}/src/gen/thrift</thrift.gen.dir>
<thrift.args>-I ${thrift.home} -strict --gen java:beans,generated_annotations=undated</thrift.args>
<thrift.args>-I ${thrift.home} -strict --gen java:beans,generated_annotations=suppress</thrift.args>
</properties>

<dependencies>
Expand Down Expand Up @@ -179,34 +179,6 @@ under the License.
<quiet>false</quiet>
</configuration>
</execution>
<execution>
<id>process-thrift-sources-interface-annotations</id>
<goals>
<goal>replace</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<basedir>${basedir}/src/gen/thrift/gen-javabean/org/apache/kyuubi/shaded/hive/metastore/api/</basedir>
<filesToInclude>*.java</filesToInclude>
<replacements>
<replacement>
<token>public class</token>
<value>@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class</value>
<unescape>true</unescape>
</replacement>
<replacement>
<token>public static class</token>
<value>@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class</value>
<unescape>true</unescape>
</replacement>
<replacement>
<token>public interface</token>
<value>@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public interface</value>
<unescape>true</unescape>
</replacement>
</replacements>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e667499

Please sign in to comment.