HADOOP-16560. [YARN] use protobuf-maven-plugin to generate protobuf classes (#1496)

Signed-off-by:  Vinayakumar B <vinayakumarb@apache.org>
This commit is contained in:
Duo Zhang 2019-09-24 08:50:36 +08:00 committed by GitHub
parent 0a716bd3a5
commit bfe1dac29d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 160 additions and 221 deletions

View File

@ -118,45 +118,22 @@
</resources>
<plugins>
<plugin>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-maven-plugins</artifactId>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<executions>
<execution>
<id>compile-protoc</id>
<goals>
<goal>protoc</goal>
</goals>
<id>src-compile-protoc</id>
<configuration>
<protocVersion>${protobuf.version}</protocVersion>
<protocCommand>${protoc.path}</protocCommand>
<imports>
<param>${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto</param>
<param>${basedir}/src/main/proto</param>
<param>${basedir}/src/main/proto/server</param>
</imports>
<source>
<directory>${basedir}/src/main/proto</directory>
<includes>
<include>yarn_protos.proto</include>
<include>yarn_service_protos.proto</include>
<include>applicationmaster_protocol.proto</include>
<include>applicationclient_protocol.proto</include>
<include>containermanagement_protocol.proto</include>
<include>server/yarn_server_resourcemanager_service_protos.proto</include>
<include>server/resourcemanager_administration_protocol.proto</include>
<include>application_history_client.proto</include>
<include>server/application_history_server.proto</include>
<include>client_SCM_protocol.proto</include>
<include>server/SCM_Admin_protocol.proto</include>
<include>yarn_csi_adaptor.proto</include>
<include>YarnCsiAdaptor.proto</include>
</includes>
</source>
<skip>false</skip>
<additionalProtoPathElements>
<additionalProtoPathElement>
${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto
</additionalProtoPathElement>
</additionalProtoPathElements>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>

View File

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

View File

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

View File

@ -22,6 +22,7 @@
* for what changes are allowed for a *stable* .proto interface.
*/
syntax = "proto2";
option java_package = "org.apache.hadoop.yarn.proto";
option java_outer_classname = "ApplicationClientProtocol";
option java_generic_services = true;

View File

@ -16,6 +16,7 @@
* limitations under the License.
*/
syntax = "proto2";
/**
* These .proto interfaces are public and stable.
* Please see http://wiki.apache.org/hadoop/Compatibility

View File

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

View File

@ -22,6 +22,7 @@
* for what changes are allowed for a *stable* .proto interface.
*/
syntax = "proto2";
option java_package = "org.apache.hadoop.yarn.proto";
option java_outer_classname = "ContainerManagementProtocol";
option java_generic_services = true;

View File

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

View File

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

View File

@ -22,6 +22,7 @@
* for what changes are allowed for a *stable* .proto interface.
*/
syntax = "proto2";
option java_package = "org.apache.hadoop.yarn.proto";
option java_outer_classname = "ResourceManagerAdministrationProtocol";
option java_generic_services = true;

View File

@ -22,6 +22,7 @@
* for what changes are allowed for a *stable* .proto interface.
*/
syntax = "proto2";
option java_package = "org.apache.hadoop.yarn.proto";
option java_outer_classname = "YarnServerResourceManagerServiceProtos";
option java_generic_services = true;

View File

@ -15,6 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto2";
option java_package = "org.apache.hadoop.yarn.proto";
option java_outer_classname = "CsiAdaptorProtos";
option java_generate_equals_and_hash = true;
@ -90,4 +92,4 @@ message NodeUnpublishVolumeRequest {
message NodeUnpublishVolumeResponse {
// Intentionally empty.
}
}

View File

@ -22,6 +22,7 @@
* for what changes are allowed for a *stable* .proto interface.
*/
syntax = "proto2";
option java_package = "org.apache.hadoop.yarn.proto";
option java_outer_classname = "YarnProtos";
option java_generic_services = true;

View File

@ -22,6 +22,7 @@
* for what changes are allowed for a *stable* .proto interface.
*/
syntax = "proto2";
option java_package = "org.apache.hadoop.yarn.proto";
option java_outer_classname = "YarnServiceProtos";
option java_generic_services = true;

View File

@ -41,31 +41,17 @@
<plugins>
<plugin>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-maven-plugins</artifactId>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<executions>
<execution>
<id>compile-protoc</id>
<goals>
<goal>protoc</goal>
</goals>
<id>src-compile-protoc</id>
<configuration>
<protocVersion>${protobuf.version}</protocVersion>
<protocCommand>${protoc.path}</protocCommand>
<imports>
<param>${basedir}/src/main/proto</param>
</imports>
<source>
<directory>${basedir}/src/main/proto</directory>
<includes>
<include>ClientAMProtocol.proto</include>
</includes>
</source>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>

View File

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

View File

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

View File

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

View File

@ -255,6 +255,26 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<executions>
<execution>
<id>src-compile-protoc</id>
<configuration>
<skip>false</skip>
<additionalProtoPathElements>
<additionalProtoPathElement>
${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto
</additionalProtoPathElement>
<additionalProtoPathElement>
${basedir}/../hadoop-yarn-api/src/main/proto
</additionalProtoPathElement>
</additionalProtoPathElements>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-maven-plugins</artifactId>
@ -275,27 +295,6 @@
</source>
</configuration>
</execution>
<execution>
<id>compile-protoc</id>
<goals>
<goal>protoc</goal>
</goals>
<configuration>
<protocVersion>${protobuf.version}</protocVersion>
<protocCommand>${protoc.path}</protocCommand>
<imports>
<param>${basedir}/../../../hadoop-common-project/hadoop-common/src/main/proto</param>
<param>${basedir}/../hadoop-yarn-api/src/main/proto</param>
<param>${basedir}/src/main/proto</param>
</imports>
<source>
<directory>${basedir}/src/main/proto</directory>
<includes>
<include>yarn_security_token.proto</include>
</includes>
</source>
</configuration>
</execution>
<execution>
<id>resource-gz</id>
<phase>generate-resources</phase>

View File

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

View File

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

View File

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

View File

@ -161,37 +161,22 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-maven-plugins</artifactId>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<executions>
<execution>
<id>compile-protoc</id>
<goals>
<goal>protoc</goal>
</goals>
<id>src-compile-protoc</id>
<configuration>
<protocVersion>${protobuf.version}</protocVersion>
<protocCommand>${protoc.path}</protocCommand>
<imports>
<param>${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto</param>
<param>${basedir}/../../hadoop-yarn-api/src/main/proto</param>
<param>${basedir}/src/main/proto</param>
</imports>
<source>
<directory>${basedir}/src/main/proto</directory>
<includes>
<include>distributed_scheduling_am_protocol.proto</include>
<include>yarn_server_common_protos.proto</include>
<include>yarn_server_common_service_protos.proto</include>
<include>yarn_server_common_service_protos.proto</include>
<include>yarn_server_federation_protos.proto</include>
<include>ResourceTracker.proto</include>
<include>SCMUploader.proto</include>
<include>collectornodemanager_protocol.proto</include>
</includes>
</source>
<skip>false</skip>
<additionalProtoPathElements>
<additionalProtoPathElement>
${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto
</additionalProtoPathElement>
<additionalProtoPathElement>
${basedir}/../../hadoop-yarn-api/src/main/proto
</additionalProtoPathElement>
</additionalProtoPathElements>
</configuration>
</execution>
</executions>

View File

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

View File

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

View File

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

View File

@ -16,13 +16,13 @@
* limitations under the License.
*/
/**
* These .proto interfaces are public and stable.
* Please see http://wiki.apache.org/hadoop/Compatibility
* for what changes are allowed for a *stable* .proto interface.
*/
syntax = "proto2";
option java_package = "org.apache.hadoop.yarn.proto";
option java_outer_classname = "DistributedSchedulingAMProtocol";
option java_generic_services = true;

View File

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

View File

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

View File

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

View File

@ -355,32 +355,22 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-maven-plugins</artifactId>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<executions>
<execution>
<id>compile-protoc</id>
<goals>
<goal>protoc</goal>
</goals>
<id>src-compile-protoc</id>
<configuration>
<protocVersion>${protobuf.version}</protocVersion>
<protocCommand>${protoc.path}</protocCommand>
<imports>
<param>${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto</param>
<param>${basedir}/../../hadoop-yarn-api/src/main/proto</param>
<param>${basedir}/src/main/proto</param>
</imports>
<source>
<directory>${basedir}/src/main/proto</directory>
<includes>
<include>yarn_server_nodemanager_recovery.proto</include>
<include>yarn_server_nodemanager_service_protos.proto</include>
<include>LocalizationProtocol.proto</include>
</includes>
</source>
<skip>false</skip>
<additionalProtoPathElements>
<additionalProtoPathElement>
${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto
</additionalProtoPathElement>
<additionalProtoPathElement>
${basedir}/../../hadoop-yarn-api/src/main/proto
</additionalProtoPathElement>
</additionalProtoPathElements>
</configuration>
</execution>
</executions>

View File

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

View File

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

View File

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

View File

@ -285,53 +285,42 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-maven-plugins</artifactId>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<executions>
<execution>
<id>compile-protoc</id>
<goals>
<goal>protoc</goal>
</goals>
<id>src-compile-protoc</id>
<configuration>
<protocVersion>${protobuf.version}</protocVersion>
<protocCommand>${protoc.path}</protocCommand>
<imports>
<param>${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto</param>
<param>${basedir}/../../hadoop-yarn-api/src/main/proto</param>
<param>${basedir}/../../hadoop-yarn-common/src/main/proto</param>
<param>${basedir}/../hadoop-yarn-server-common/src/main/proto</param>
<param>${basedir}/src/main/proto</param>
</imports>
<source>
<directory>${basedir}/src/main/proto</directory>
<includes>
<include>yarn_server_resourcemanager_recovery.proto</include>
</includes>
</source>
<skip>false</skip>
<additionalProtoPathElements>
<additionalProtoPathElement>
${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto
</additionalProtoPathElement>
<additionalProtoPathElement>
${basedir}/../../hadoop-yarn-api/src/main/proto
</additionalProtoPathElement>
<additionalProtoPathElement>
${basedir}/../../hadoop-yarn-common/src/main/proto
</additionalProtoPathElement>
<additionalProtoPathElement>
${basedir}/../hadoop-yarn-server-common/src/main/proto
</additionalProtoPathElement>
</additionalProtoPathElements>
</configuration>
</execution>
<execution>
<id>compile-test-protoc</id>
<goals>
<goal>test-protoc</goal>
</goals>
<id>src-test-compile-protoc</id>
<configuration>
<protocVersion>${protobuf.version}</protocVersion>
<protocCommand>${protoc.path}</protocCommand>
<imports>
<param>${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto</param>
<param>${basedir}/../../hadoop-yarn-api/src/main/proto</param>
<param>${basedir}/src/test/proto</param>
</imports>
<source>
<directory>${basedir}/src/test/proto</directory>
<includes>
<include>test_client_tokens.proto</include>
</includes>
</source>
<skip>false</skip>
<additionalProtoPathElements>
<additionalProtoPathElement>
${basedir}/../../../../hadoop-common-project/hadoop-common/src/main/proto
</additionalProtoPathElement>
<additionalProtoPathElement>
${basedir}/../../hadoop-yarn-api/src/main/proto
</additionalProtoPathElement>
</additionalProtoPathElements>
</configuration>
</execution>
</executions>

View File

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

View File

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

View File

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

View File

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