HADOOP-16561. [MAPREDUCE] use protobuf-maven-plugin to generate protobuf classes (#1500)

Signed-off-by: Vinayakumar B <vinayakumarb@apache.org>
This commit is contained in:
Duo Zhang 2019-09-24 08:52:12 +08:00 committed by GitHub
parent bfe1dac29d
commit e8e7d7b4cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 41 deletions

View File

@ -56,31 +56,21 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.hadoop</groupId> <groupId>org.xolstice.maven.plugins</groupId>
<artifactId>hadoop-maven-plugins</artifactId> <artifactId>protobuf-maven-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<id>compile-protoc</id> <id>src-compile-protoc</id>
<goals>
<goal>protoc</goal>
</goals>
<configuration> <configuration>
<protocVersion>${protobuf.version}</protocVersion> <skip>false</skip>
<protocCommand>${protoc.path}</protocCommand> <additionalProtoPathElements>
<imports> <additionalProtoPathElement>
<param>${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto</param> ${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto
<param>${basedir}/../../../hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto</param> </additionalProtoPathElement>
<param>${basedir}/src/main/proto</param> <additionalProtoPathElement>
</imports> ${basedir}/../../../hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto
<source> </additionalProtoPathElement>
<directory>${basedir}/src/main/proto</directory> </additionalProtoPathElements>
<includes>
<include>HSAdminRefreshProtocol.proto</include>
<include>mr_protos.proto</include>
<include>mr_service_protos.proto</include>
<include>MRClientProtocol.proto</include>
</includes>
</source>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>

View File

@ -16,6 +16,7 @@
* limitations under the License. * limitations under the License.
*/ */
syntax = "proto2";
option java_package = "org.apache.hadoop.mapreduce.v2.hs.proto"; option java_package = "org.apache.hadoop.mapreduce.v2.hs.proto";
option java_outer_classname = "HSAdminRefreshProtocolProtos"; option java_outer_classname = "HSAdminRefreshProtocolProtos";
option java_generic_services = true; option java_generic_services = true;

View File

@ -16,6 +16,7 @@
* limitations under the License. * limitations under the License.
*/ */
syntax = "proto2";
option java_package = "org.apache.hadoop.yarn.proto"; option java_package = "org.apache.hadoop.yarn.proto";
option java_outer_classname = "MRClientProtocol"; option java_outer_classname = "MRClientProtocol";
option java_generic_services = true; option java_generic_services = true;

View File

@ -16,6 +16,7 @@
* limitations under the License. * limitations under the License.
*/ */
syntax = "proto2";
option java_package = "org.apache.hadoop.mapreduce.v2.proto"; option java_package = "org.apache.hadoop.mapreduce.v2.proto";
option java_outer_classname = "MRProtos"; option java_outer_classname = "MRProtos";
option java_generic_services = true; option java_generic_services = true;

View File

@ -16,6 +16,7 @@
* limitations under the License. * limitations under the License.
*/ */
syntax = "proto2";
option java_package = "org.apache.hadoop.mapreduce.v2.proto"; option java_package = "org.apache.hadoop.mapreduce.v2.proto";
option java_outer_classname = "MRServiceProtos"; option java_outer_classname = "MRServiceProtos";
option java_generic_services = true; option java_generic_services = true;

View File

@ -60,27 +60,18 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.hadoop</groupId> <groupId>org.xolstice.maven.plugins</groupId>
<artifactId>hadoop-maven-plugins</artifactId> <artifactId>protobuf-maven-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<id>compile-protoc</id> <id>src-compile-protoc</id>
<goals>
<goal>protoc</goal>
</goals>
<configuration> <configuration>
<protocVersion>${protobuf.version}</protocVersion> <skip>false</skip>
<protocCommand>${protoc.path}</protocCommand> <additionalProtoPathElements>
<imports> <additionalProtoPathElement>
<param>${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto</param> ${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto
<param>${basedir}/src/main/proto</param> </additionalProtoPathElement>
</imports> </additionalProtoPathElements>
<source>
<directory>${basedir}/src/main/proto</directory>
<includes>
<include>ShuffleHandlerRecovery.proto</include>
</includes>
</source>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>

View File

@ -16,6 +16,7 @@
* limitations under the License. * limitations under the License.
*/ */
syntax = "proto2";
option java_package = "org.apache.hadoop.mapred.proto"; option java_package = "org.apache.hadoop.mapred.proto";
option java_outer_classname = "ShuffleHandlerRecoveryProtos"; option java_outer_classname = "ShuffleHandlerRecoveryProtos";
option java_generic_services = true; option java_generic_services = true;