Skip to content

Commit e6887bd

Browse files
committed
HADOOP-17046. Support downstreams' existing Hadoop-rpc implementations using non-shaded protobuf classes (#2026)
1 parent 542c478 commit e6887bd

File tree

81 files changed

+2233
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2233
-169
lines changed

hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@
283283
<!-- protobuf generated code -->
284284
<Class name="~org\.apache\.hadoop\.ipc\.protobuf\.ProtobufRpcEngineProtos.*"/>
285285
</Match>
286+
<Match>
287+
<!-- protobuf generated code -->
288+
<Class name="~org\.apache\.hadoop\.ipc\.protobuf\.ProtobufRpcEngine2Protos.*"/>
289+
</Match>
286290
<Match>
287291
<!-- protobuf generated code -->
288292
<Class name="~org\.apache\.hadoop\.ipc\.protobuf\.ProtocolInfoProtos.*"/>

hadoop-common-project/hadoop-common/pom.xml

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,12 @@
390390
<executions>
391391
<execution>
392392
<id>src-compile-protoc</id>
393-
<configuration><skip>false</skip></configuration>
393+
<configuration>
394+
<skip>false</skip>
395+
<excludes>
396+
<exclude>ProtobufRpcEngine.proto</exclude>
397+
</excludes>
398+
</configuration>
394399
</execution>
395400
<execution>
396401
<id>src-test-compile-protoc</id>
@@ -406,6 +411,9 @@
406411
<id>replace-generated-sources</id>
407412
<configuration>
408413
<skip>false</skip>
414+
<excludes>
415+
<exclude>**/ProtobufRpcEngineProtos.java</exclude>
416+
</excludes>
409417
</configuration>
410418
</execution>
411419
<execution>
@@ -418,6 +426,14 @@
418426
<id>replace-sources</id>
419427
<configuration>
420428
<skip>false</skip>
429+
<!--These classes have direct Protobuf references for backward compatibility reasons-->
430+
<excludes>
431+
<exclude>**/ProtobufHelper.java</exclude>
432+
<exclude>**/RpcWritable.java</exclude>
433+
<exclude>**/ProtobufRpcEngineCallback.java</exclude>
434+
<exclude>**/ProtobufRpcEngine.java</exclude>
435+
<exclude>**/ProtobufRpcEngineProtos.java</exclude>
436+
</excludes>
421437
</configuration>
422438
</execution>
423439
<execution>
@@ -1010,7 +1026,79 @@
10101026
</plugins>
10111027
</build>
10121028
</profile>
1013-
1029+
<!-- profile to use already generated protobuf code using 2.5.0 for aarch64-->
1030+
<profile>
1031+
<id>aarch64</id>
1032+
<activation>
1033+
<activeByDefault>false</activeByDefault>
1034+
<os>
1035+
<arch>aarch64</arch>
1036+
</os>
1037+
</activation>
1038+
<build>
1039+
<plugins>
1040+
<plugin>
1041+
<groupId>org.codehaus.mojo</groupId>
1042+
<artifactId>build-helper-maven-plugin</artifactId>
1043+
<executions>
1044+
<execution>
1045+
<id>add-source-legacy-protobuf</id>
1046+
<phase>generate-sources</phase>
1047+
<goals>
1048+
<goal>add-source</goal>
1049+
</goals>
1050+
<configuration>
1051+
<sources>
1052+
<source>${basedir}/src/main/arm-java</source>
1053+
</sources>
1054+
</configuration>
1055+
</execution>
1056+
</executions>
1057+
</plugin>
1058+
</plugins>
1059+
</build>
1060+
</profile>
1061+
<!-- profile to generate protobuf code using 2.5.0-->
1062+
<profile>
1063+
<id>x86_64</id>
1064+
<activation>
1065+
<activeByDefault>false</activeByDefault>
1066+
<os>
1067+
<arch>!aarch64</arch>
1068+
</os>
1069+
</activation>
1070+
<build>
1071+
<plugins>
1072+
<plugin>
1073+
<groupId>org.xolstice.maven.plugins</groupId>
1074+
<artifactId>protobuf-maven-plugin</artifactId>
1075+
<executions>
1076+
<execution>
1077+
<id>src-compile-protoc-legacy</id>
1078+
<phase>generate-sources</phase>
1079+
<goals>
1080+
<goal>compile</goal>
1081+
</goals>
1082+
<configuration>
1083+
<skip>false</skip>
1084+
<!--Generating with old protobuf version for backward compatibility-->
1085+
<protocArtifact>
1086+
com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
1087+
</protocArtifact>
1088+
<includeDependenciesInDescriptorSet>false</includeDependenciesInDescriptorSet>
1089+
<protoSourceRoot>${basedir}/src/main/proto</protoSourceRoot>
1090+
<outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
1091+
<clearOutputDirectory>false</clearOutputDirectory>
1092+
<includes>
1093+
<include>ProtobufRpcEngine.proto</include>
1094+
</includes>
1095+
</configuration>
1096+
</execution>
1097+
</executions>
1098+
</plugin>
1099+
</plugins>
1100+
</build>
1101+
</profile>
10141102
</profiles>
10151103
</project>
10161104

0 commit comments

Comments
 (0)