Skip to content

Commit e154084

Browse files
authored
HADOOP-17046. Support downstreams' existing Hadoop-rpc implementations using non-shaded protobuf classes (#2026)
1 parent 7c4de59 commit e154084

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
@@ -395,7 +395,12 @@
395395
<executions>
396396
<execution>
397397
<id>src-compile-protoc</id>
398-
<configuration><skip>false</skip></configuration>
398+
<configuration>
399+
<skip>false</skip>
400+
<excludes>
401+
<exclude>ProtobufRpcEngine.proto</exclude>
402+
</excludes>
403+
</configuration>
399404
</execution>
400405
<execution>
401406
<id>src-test-compile-protoc</id>
@@ -411,6 +416,9 @@
411416
<id>replace-generated-sources</id>
412417
<configuration>
413418
<skip>false</skip>
419+
<excludes>
420+
<exclude>**/ProtobufRpcEngineProtos.java</exclude>
421+
</excludes>
414422
</configuration>
415423
</execution>
416424
<execution>
@@ -423,6 +431,14 @@
423431
<id>replace-sources</id>
424432
<configuration>
425433
<skip>false</skip>
434+
<!--These classes have direct Protobuf references for backward compatibility reasons-->
435+
<excludes>
436+
<exclude>**/ProtobufHelper.java</exclude>
437+
<exclude>**/RpcWritable.java</exclude>
438+
<exclude>**/ProtobufRpcEngineCallback.java</exclude>
439+
<exclude>**/ProtobufRpcEngine.java</exclude>
440+
<exclude>**/ProtobufRpcEngineProtos.java</exclude>
441+
</excludes>
426442
</configuration>
427443
</execution>
428444
<execution>
@@ -1015,7 +1031,79 @@
10151031
</plugins>
10161032
</build>
10171033
</profile>
1018-
1034+
<!-- profile to use already generated protobuf code using 2.5.0 for aarch64-->
1035+
<profile>
1036+
<id>aarch64</id>
1037+
<activation>
1038+
<activeByDefault>false</activeByDefault>
1039+
<os>
1040+
<arch>aarch64</arch>
1041+
</os>
1042+
</activation>
1043+
<build>
1044+
<plugins>
1045+
<plugin>
1046+
<groupId>org.codehaus.mojo</groupId>
1047+
<artifactId>build-helper-maven-plugin</artifactId>
1048+
<executions>
1049+
<execution>
1050+
<id>add-source-legacy-protobuf</id>
1051+
<phase>generate-sources</phase>
1052+
<goals>
1053+
<goal>add-source</goal>
1054+
</goals>
1055+
<configuration>
1056+
<sources>
1057+
<source>${basedir}/src/main/arm-java</source>
1058+
</sources>
1059+
</configuration>
1060+
</execution>
1061+
</executions>
1062+
</plugin>
1063+
</plugins>
1064+
</build>
1065+
</profile>
1066+
<!-- profile to generate protobuf code using 2.5.0-->
1067+
<profile>
1068+
<id>x86_64</id>
1069+
<activation>
1070+
<activeByDefault>false</activeByDefault>
1071+
<os>
1072+
<arch>!aarch64</arch>
1073+
</os>
1074+
</activation>
1075+
<build>
1076+
<plugins>
1077+
<plugin>
1078+
<groupId>org.xolstice.maven.plugins</groupId>
1079+
<artifactId>protobuf-maven-plugin</artifactId>
1080+
<executions>
1081+
<execution>
1082+
<id>src-compile-protoc-legacy</id>
1083+
<phase>generate-sources</phase>
1084+
<goals>
1085+
<goal>compile</goal>
1086+
</goals>
1087+
<configuration>
1088+
<skip>false</skip>
1089+
<!--Generating with old protobuf version for backward compatibility-->
1090+
<protocArtifact>
1091+
com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
1092+
</protocArtifact>
1093+
<includeDependenciesInDescriptorSet>false</includeDependenciesInDescriptorSet>
1094+
<protoSourceRoot>${basedir}/src/main/proto</protoSourceRoot>
1095+
<outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
1096+
<clearOutputDirectory>false</clearOutputDirectory>
1097+
<includes>
1098+
<include>ProtobufRpcEngine.proto</include>
1099+
</includes>
1100+
</configuration>
1101+
</execution>
1102+
</executions>
1103+
</plugin>
1104+
</plugins>
1105+
</build>
1106+
</profile>
10191107
</profiles>
10201108
</project>
10211109

0 commit comments

Comments
 (0)