From 07f59c023c66743321e3f179570ad02145528a49 Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Fri, 27 Sep 2019 09:59:29 +0800 Subject: [PATCH] HADOOP-16598. Backport "HADOOP-16558 [COMMON+HDFS] use protobuf-maven-plugin to generate protobuf classes" to all active branches Signed-off-by: stack --- hadoop-common-project/hadoop-common/pom.xml | 66 ++++--------------- .../src/main/proto/FSProtos.proto | 2 +- .../main/proto/GenericRefreshProtocol.proto | 2 +- .../main/proto/GetUserMappingsProtocol.proto | 2 +- .../src/main/proto/HAServiceProtocol.proto | 2 +- .../src/main/proto/IpcConnectionContext.proto | 2 +- .../src/main/proto/ProtobufRpcEngine.proto | 2 +- .../src/main/proto/ProtocolInfo.proto | 2 +- .../RefreshAuthorizationPolicyProtocol.proto | 2 +- .../main/proto/RefreshCallQueueProtocol.proto | 2 +- .../proto/RefreshUserMappingsProtocol.proto | 2 +- .../src/main/proto/RpcHeader.proto | 2 +- .../src/main/proto/Security.proto | 2 +- .../src/main/proto/TraceAdmin.proto | 2 +- .../src/main/proto/ZKFCProtocol.proto | 2 +- .../hadoop-common/src/test/proto/test.proto | 2 +- .../src/test/proto/test_rpc_service.proto | 1 + .../hadoop-hdfs-client/pom.xml | 36 +++------- .../main/proto/ClientDatanodeProtocol.proto | 2 +- .../main/proto/ClientNamenodeProtocol.proto | 2 +- .../main/proto/ReconfigurationProtocol.proto | 2 +- .../src/main/proto/acl.proto | 2 +- .../src/main/proto/datatransfer.proto | 2 +- .../src/main/proto/encryption.proto | 2 +- .../src/main/proto/erasurecoding.proto | 2 +- .../src/main/proto/hdfs.proto | 2 +- .../src/main/proto/inotify.proto | 2 +- .../src/main/proto/xattr.proto | 2 +- hadoop-hdfs-project/hadoop-hdfs-rbf/pom.xml | 32 ++++----- .../src/main/proto/FederationProtocol.proto | 2 +- .../src/main/proto/RouterProtocol.proto | 2 +- hadoop-hdfs-project/hadoop-hdfs/pom.xml | 52 ++++++--------- .../src/main/proto/AliasMapProtocol.proto | 2 +- .../main/proto/DatanodeLifelineProtocol.proto | 2 +- .../src/main/proto/DatanodeProtocol.proto | 2 +- .../hadoop-hdfs/src/main/proto/HAZKInfo.proto | 2 +- .../src/main/proto/HdfsServer.proto | 2 +- .../main/proto/InterDatanodeProtocol.proto | 2 +- .../main/proto/InterQJournalProtocol.proto | 2 +- .../src/main/proto/JournalProtocol.proto | 2 +- .../src/main/proto/NamenodeProtocol.proto | 2 +- .../src/main/proto/QJournalProtocol.proto | 2 +- .../hadoop-hdfs/src/main/proto/editlog.proto | 2 +- .../hadoop-hdfs/src/main/proto/fsimage.proto | 2 +- hadoop-project/pom.xml | 53 ++++++++++++++- 45 files changed, 147 insertions(+), 171 deletions(-) diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml index 33a4fef528f..e80eb0f9e1a 100644 --- a/hadoop-common-project/hadoop-common/pom.xml +++ b/hadoop-common-project/hadoop-common/pom.xml @@ -351,6 +351,20 @@ + + org.xolstice.maven.plugins + protobuf-maven-plugin + + + src-compile-protoc + false + + + src-test-compile-protoc + false + + + org.apache.hadoop hadoop-maven-plugins @@ -371,58 +385,6 @@ - - compile-protoc - - protoc - - - ${protobuf.version} - ${protoc.path} - - ${basedir}/src/main/proto - - - ${basedir}/src/main/proto - - HAServiceProtocol.proto - IpcConnectionContext.proto - ProtocolInfo.proto - RpcHeader.proto - ZKFCProtocol.proto - ProtobufRpcEngine.proto - Security.proto - GetUserMappingsProtocol.proto - TraceAdmin.proto - RefreshAuthorizationPolicyProtocol.proto - RefreshUserMappingsProtocol.proto - RefreshCallQueueProtocol.proto - GenericRefreshProtocol.proto - FSProtos.proto - - - - - - compile-test-protoc - - test-protoc - - - ${protobuf.version} - ${protoc.path} - - ${basedir}/src/test/proto - - - ${basedir}/src/test/proto - - test.proto - test_rpc_service.proto - - - - resource-gz generate-resources diff --git a/hadoop-common-project/hadoop-common/src/main/proto/FSProtos.proto b/hadoop-common-project/hadoop-common/src/main/proto/FSProtos.proto index 5b8c45d0ad1..8509ca25163 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/FSProtos.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/FSProtos.proto @@ -21,7 +21,7 @@ * 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.fs"; option java_outer_classname = "FSProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/GenericRefreshProtocol.proto b/hadoop-common-project/hadoop-common/src/main/proto/GenericRefreshProtocol.proto index fe465490b19..6296f88da69 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/GenericRefreshProtocol.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/GenericRefreshProtocol.proto @@ -21,7 +21,7 @@ * 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.ipc.proto"; option java_outer_classname = "GenericRefreshProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/GetUserMappingsProtocol.proto b/hadoop-common-project/hadoop-common/src/main/proto/GetUserMappingsProtocol.proto index 51552b879f3..cb91a13b048 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/GetUserMappingsProtocol.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/GetUserMappingsProtocol.proto @@ -21,7 +21,7 @@ * 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.tools.proto"; option java_outer_classname = "GetUserMappingsProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/HAServiceProtocol.proto b/hadoop-common-project/hadoop-common/src/main/proto/HAServiceProtocol.proto index 16ee9a2e0a5..5a88a7ff03f 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/HAServiceProtocol.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/HAServiceProtocol.proto @@ -21,7 +21,7 @@ * 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.ha.proto"; option java_outer_classname = "HAServiceProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/IpcConnectionContext.proto b/hadoop-common-project/hadoop-common/src/main/proto/IpcConnectionContext.proto index 4557e893cff..16e2fb7c4db 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/IpcConnectionContext.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/IpcConnectionContext.proto @@ -21,7 +21,7 @@ * 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.ipc.protobuf"; option java_outer_classname = "IpcConnectionContextProtos"; option java_generate_equals_and_hash = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/ProtobufRpcEngine.proto b/hadoop-common-project/hadoop-common/src/main/proto/ProtobufRpcEngine.proto index a17e2078e94..fa113134027 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/ProtobufRpcEngine.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/ProtobufRpcEngine.proto @@ -21,7 +21,7 @@ * Please see http://wiki.apache.org/hadoop/Compatibility * for what changes are allowed for a *stable* .proto interface. */ - +syntax = "proto2"; /** * These are the messages used by Hadoop RPC for the Rpc Engine Protocol Buffer * to marshal the request and response in the RPC layer. diff --git a/hadoop-common-project/hadoop-common/src/main/proto/ProtocolInfo.proto b/hadoop-common-project/hadoop-common/src/main/proto/ProtocolInfo.proto index fdbc440d91c..0e9d0d4baa4 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/ProtocolInfo.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/ProtocolInfo.proto @@ -21,7 +21,7 @@ * 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.ipc.protobuf"; option java_outer_classname = "ProtocolInfoProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/RefreshAuthorizationPolicyProtocol.proto b/hadoop-common-project/hadoop-common/src/main/proto/RefreshAuthorizationPolicyProtocol.proto index 5ef1c2d0a8c..f57c6d63039 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/RefreshAuthorizationPolicyProtocol.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/RefreshAuthorizationPolicyProtocol.proto @@ -21,7 +21,7 @@ * 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.security.proto"; option java_outer_classname = "RefreshAuthorizationPolicyProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/RefreshCallQueueProtocol.proto b/hadoop-common-project/hadoop-common/src/main/proto/RefreshCallQueueProtocol.proto index 67ed1332510..463b7c548fe 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/RefreshCallQueueProtocol.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/RefreshCallQueueProtocol.proto @@ -21,7 +21,7 @@ * 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.ipc.proto"; option java_outer_classname = "RefreshCallQueueProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/RefreshUserMappingsProtocol.proto b/hadoop-common-project/hadoop-common/src/main/proto/RefreshUserMappingsProtocol.proto index 41031ed9ea0..a1130f5c2d9 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/RefreshUserMappingsProtocol.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/RefreshUserMappingsProtocol.proto @@ -21,7 +21,7 @@ * 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.security.proto"; option java_outer_classname = "RefreshUserMappingsProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto b/hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto index e8d8cbbfe70..4705b4276b8 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto @@ -21,7 +21,7 @@ * 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.ipc.protobuf"; option java_outer_classname = "RpcHeaderProtos"; option java_generate_equals_and_hash = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/Security.proto b/hadoop-common-project/hadoop-common/src/main/proto/Security.proto index 037a8781a9a..5177a86ef11 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/Security.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/Security.proto @@ -21,7 +21,7 @@ * 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.security.proto"; option java_outer_classname = "SecurityProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/TraceAdmin.proto b/hadoop-common-project/hadoop-common/src/main/proto/TraceAdmin.proto index 52d2a90abf4..8cf131bfb46 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/TraceAdmin.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/TraceAdmin.proto @@ -21,7 +21,7 @@ * 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.tracing"; option java_outer_classname = "TraceAdminPB"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/main/proto/ZKFCProtocol.proto b/hadoop-common-project/hadoop-common/src/main/proto/ZKFCProtocol.proto index a2b8dd10b30..98bc05f4a36 100644 --- a/hadoop-common-project/hadoop-common/src/main/proto/ZKFCProtocol.proto +++ b/hadoop-common-project/hadoop-common/src/main/proto/ZKFCProtocol.proto @@ -21,7 +21,7 @@ * 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.ha.proto"; option java_outer_classname = "ZKFCProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-common-project/hadoop-common/src/test/proto/test.proto b/hadoop-common-project/hadoop-common/src/test/proto/test.proto index 37e9a0bf7aa..2c41aa2bc7c 100644 --- a/hadoop-common-project/hadoop-common/src/test/proto/test.proto +++ b/hadoop-common-project/hadoop-common/src/test/proto/test.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax = "proto2"; option java_package = "org.apache.hadoop.ipc.protobuf"; option java_outer_classname = "TestProtos"; option java_generate_equals_and_hash = true; diff --git a/hadoop-common-project/hadoop-common/src/test/proto/test_rpc_service.proto b/hadoop-common-project/hadoop-common/src/test/proto/test_rpc_service.proto index 0df67a0ea3e..f6990279140 100644 --- a/hadoop-common-project/hadoop-common/src/test/proto/test_rpc_service.proto +++ b/hadoop-common-project/hadoop-common/src/test/proto/test_rpc_service.proto @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +syntax = "proto2"; option java_package = "org.apache.hadoop.ipc.protobuf"; option java_outer_classname = "TestRpcServiceProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/pom.xml b/hadoop-hdfs-project/hadoop-hdfs-client/pom.xml index 87ebc24ac15..aa9134479e1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs-client/pom.xml @@ -131,36 +131,18 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.apache.hadoop - hadoop-maven-plugins + org.xolstice.maven.plugins + protobuf-maven-plugin - compile-protoc - - protoc - + src-compile-protoc - ${protobuf.version} - ${protoc.path} - - ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto - ${basedir}/src/main/proto - - - ${basedir}/src/main/proto - - ClientDatanodeProtocol.proto - ClientNamenodeProtocol.proto - acl.proto - xattr.proto - datatransfer.proto - hdfs.proto - encryption.proto - inotify.proto - erasurecoding.proto - ReconfigurationProtocol.proto - - + false + + + ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto + + diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientDatanodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientDatanodeProtocol.proto index 52f6330e0bd..84cd771da49 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientDatanodeProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientDatanodeProtocol.proto @@ -21,7 +21,7 @@ * Please see http://wiki.apache.org/hadoop/Compatibility * for what changes are allowed for a *stable* .proto interface. */ - +syntax="proto2"; // This file contains protocol buffers that are used throughout HDFS -- i.e. // by the client, server, and data transfer protocols. diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientNamenodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientNamenodeProtocol.proto index 27c917d5f9b..3f52d16d18c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientNamenodeProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientNamenodeProtocol.proto @@ -21,7 +21,7 @@ * 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.hdfs.protocol.proto"; option java_outer_classname = "ClientNamenodeProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ReconfigurationProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ReconfigurationProtocol.proto index 12a38b110fe..bad9f45cf62 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ReconfigurationProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ReconfigurationProtocol.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax="proto2"; // This file contains protocol buffers that are used to reconfigure NameNode // and DataNode by HDFS admin. diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/acl.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/acl.proto index c2529c90c32..e9a8ccb7569 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/acl.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/acl.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax="proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "AclProtos"; option java_generate_equals_and_hash = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto index 43a03e96e08..66a69a9fcde 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto @@ -21,7 +21,7 @@ * Please see http://wiki.apache.org/hadoop/Compatibility * for what changes are allowed for a *stable* .proto interface. */ - +syntax="proto2"; // This file contains protocol buffers that are used to transfer data // to and from the datanode, as well as between datanodes. diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/encryption.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/encryption.proto index 75d3a0e2e44..bcd82d63e05 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/encryption.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/encryption.proto @@ -21,7 +21,7 @@ * Please see http://wiki.apache.org/hadoop/Compatibility * for what changes are allowed for a *stable* .proto interface. */ - +syntax="proto2"; // This file contains protocol buffers that are used throughout HDFS -- i.e. // by the client, server, and data transfer protocols. diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/erasurecoding.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/erasurecoding.proto index 5f5f66e1adc..de3bf4a9d8d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/erasurecoding.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/erasurecoding.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax="proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "ErasureCodingProtos"; option java_generate_equals_and_hash = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto index 53bdf5e1110..1f0e179f20c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto @@ -21,7 +21,7 @@ * Please see http://wiki.apache.org/hadoop/Compatibility * for what changes are allowed for a *stable* .proto interface. */ - +syntax="proto2"; // This file contains protocol buffers that are used throughout HDFS -- i.e. // by the client, server, and data transfer protocols. diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/inotify.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/inotify.proto index 53399029582..dfc6618b10a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/inotify.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/inotify.proto @@ -21,7 +21,7 @@ * Please see http://wiki.apache.org/hadoop/Compatibility * for what changes are allowed for a *stable* .proto interface. */ - +syntax="proto2"; // This file contains protocol buffers used to communicate edits to clients // as part of the inotify system. diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/xattr.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/xattr.proto index 6c8b5eb5943..a53aa86c16d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/xattr.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/xattr.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax="proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "XAttrProtos"; option java_generate_equals_and_hash = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/pom.xml b/hadoop-hdfs-project/hadoop-hdfs-rbf/pom.xml index 313205c01ec..e8623c2815d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/pom.xml @@ -174,29 +174,21 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.apache.hadoop - hadoop-maven-plugins + org.xolstice.maven.plugins + protobuf-maven-plugin - compile-protoc - - protoc - + src-compile-protoc - ${protobuf.version} - ${protoc.path} - - ${basedir}/../hadoop-hdfs-client/src/main/proto - ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto - ${basedir}/src/main/proto - - - ${basedir}/src/main/proto - - FederationProtocol.proto - RouterProtocol.proto - - + false + + + ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto + + + ${basedir}/../hadoop-hdfs-client/src/main/proto + + diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/proto/FederationProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/proto/FederationProtocol.proto index b1a62b1c345..1263630a223 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/proto/FederationProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/proto/FederationProtocol.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.federation.protocol.proto"; option java_outer_classname = "HdfsServerFederationProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/proto/RouterProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/proto/RouterProtocol.proto index f3a2b6e8abc..3eff0929775 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/proto/RouterProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/proto/RouterProtocol.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "RouterProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/pom.xml index 8fd0169a68c..2260c24e805 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml @@ -310,42 +310,30 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> + + org.xolstice.maven.plugins + protobuf-maven-plugin + + + src-compile-protoc + + false + + + ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto + + + ${basedir}/../hadoop-hdfs-client/src/main/proto + + + + + + org.apache.hadoop hadoop-maven-plugins - - compile-protoc - - protoc - - - ${protobuf.version} - ${protoc.path} - - ${basedir}/../../hadoop-common-project/hadoop-common/src/main/proto - ${basedir}/../hadoop-hdfs-client/src/main/proto - ${basedir}/src/main/proto - - - ${basedir}/src/main/proto - - HdfsServer.proto - DatanodeProtocol.proto - DatanodeLifelineProtocol.proto - HAZKInfo.proto - InterDatanodeProtocol.proto - JournalProtocol.proto - NamenodeProtocol.proto - QJournalProtocol.proto - editlog.proto - fsimage.proto - AliasMapProtocol.proto - InterQJournalProtocol.proto - - - - resource-gz generate-resources diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/AliasMapProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/AliasMapProtocol.proto index 01dd9523bfb..8050f35454e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/AliasMapProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/AliasMapProtocol.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "AliasMapProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeLifelineProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeLifelineProtocol.proto index b6ab75653a1..e10a8861e61 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeLifelineProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeLifelineProtocol.proto @@ -21,7 +21,7 @@ * 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.hdfs.protocol.proto"; option java_outer_classname = "DatanodeLifelineProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto index bf0df5bf144..f4ae012f860 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/DatanodeProtocol.proto @@ -24,7 +24,7 @@ // This file contains protocol buffers that are used throughout HDFS -- i.e. // by the client, server, and data transfer protocols. - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "DatanodeProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/HAZKInfo.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/HAZKInfo.proto index aa8b6be4532..6d45a935ee4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/HAZKInfo.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/HAZKInfo.proto @@ -21,7 +21,7 @@ * 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.hdfs.server.namenode.ha.proto"; option java_outer_classname = "HAZKInfoProtos"; package hadoop.hdfs; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/HdfsServer.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/HdfsServer.proto index 85cfb6c0d2e..78607efddab 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/HdfsServer.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/HdfsServer.proto @@ -24,7 +24,7 @@ // This file contains protocol buffers that are used throughout HDFS -- i.e. // by the client, server, and data transfer protocols. - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "HdfsServerProtos"; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/InterDatanodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/InterDatanodeProtocol.proto index 580f8d34730..47332a8817b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/InterDatanodeProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/InterDatanodeProtocol.proto @@ -24,7 +24,7 @@ // This file contains protocol buffers that are used throughout HDFS -- i.e. // by the client, server, and data transfer protocols. - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "InterDatanodeProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/InterQJournalProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/InterQJournalProtocol.proto index 0ecdff1d372..e73ca23e92f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/InterQJournalProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/InterQJournalProtocol.proto @@ -21,7 +21,7 @@ * 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.hdfs.qjournal.protocol"; option java_outer_classname = "InterQJournalProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/JournalProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/JournalProtocol.proto index 3fd029b7362..35c401e33e5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/JournalProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/JournalProtocol.proto @@ -24,7 +24,7 @@ // This file contains protocol buffers that are used throughout HDFS -- i.e. // by the client, server, and data transfer protocols. - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "JournalProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/NamenodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/NamenodeProtocol.proto index 683dc802322..892632b4134 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/NamenodeProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/NamenodeProtocol.proto @@ -24,7 +24,7 @@ // This file contains protocol buffers that are used throughout HDFS -- i.e. // by the client, server, and data transfer protocols. - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "NamenodeProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/QJournalProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/QJournalProtocol.proto index 26f44960979..dabe06132f3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/QJournalProtocol.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/QJournalProtocol.proto @@ -21,7 +21,7 @@ * 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.hdfs.qjournal.protocol"; option java_outer_classname = "QJournalProtocolProtos"; option java_generic_services = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/editlog.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/editlog.proto index f25fe591ad3..22fd7437bb8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/editlog.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/editlog.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.protocol.proto"; option java_outer_classname = "EditLogProtos"; option java_generate_equals_and_hash = true; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/fsimage.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/fsimage.proto index d943dbccd64..532aa6e2707 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/fsimage.proto +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/fsimage.proto @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +syntax = "proto2"; option java_package = "org.apache.hadoop.hdfs.server.namenode"; option java_outer_classname = "FsImageProto"; diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml index d79e18f7b51..b193c198e6f 100644 --- a/hadoop-project/pom.xml +++ b/hadoop-project/pom.xml @@ -82,6 +82,10 @@ 2.5.0 ${env.HADOOP_PROTOC_PATH} + + 0.5.1 + 1.5.0.Final + 3.4.13 2.13.0 3.0.0 @@ -1529,9 +1533,56 @@ hadoop-maven-plugins ${project.version} + + org.xolstice.maven.plugins + protobuf-maven-plugin + ${protobuf-maven-plugin.version} + true + + + com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier} + + false + + + + src-compile-protoc + generate-sources + + compile + + + false + ${basedir}/src/main/proto + ${project.build.directory}/generated-sources/java + false + true + + + + src-test-compile-protoc + generate-test-sources + + test-compile + + + ${basedir}/src/test/proto + ${project.build.directory}/generated-test-sources/java + false + true + + + + - + + + kr.motd.maven + os-maven-plugin + ${os-maven-plugin.version} + + maven-clean-plugin