From fc6182d5ed92ac70de1f4633edd5265b7be1a8dc Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Wed, 8 Jul 2015 10:37:10 -0700 Subject: [PATCH] HDFS-8726. Move protobuf files that define the client-sever protocols to hdfs-client. Contributed by Haohui Mai. --- .../dev-support/findbugsExcludeFile.xml | 4 ++ .../hadoop-hdfs-client/pom.xml | 42 +++++++++++++++++++ .../main/proto/ClientDatanodeProtocol.proto | 0 .../main/proto/ClientNamenodeProtocol.proto | 0 .../src/main/proto/acl.proto | 5 --- .../src/main/proto/datatransfer.proto | 0 .../src/main/proto/encryption.proto | 0 .../src/main/proto/hdfs.proto | 0 .../src/main/proto/inotify.proto | 0 .../src/main/proto/xattr.proto | 5 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 ++ hadoop-hdfs-project/hadoop-hdfs/pom.xml | 10 +---- .../hadoop-hdfs/src/contrib/bkjournal/pom.xml | 2 +- .../hdfs/server/namenode/FSEditLogOp.java | 4 +- .../hadoop-hdfs/src/main/proto/editlog.proto | 35 ++++++++++++++++ 15 files changed, 89 insertions(+), 21 deletions(-) rename hadoop-hdfs-project/{hadoop-hdfs => hadoop-hdfs-client}/src/main/proto/ClientDatanodeProtocol.proto (100%) rename hadoop-hdfs-project/{hadoop-hdfs => hadoop-hdfs-client}/src/main/proto/ClientNamenodeProtocol.proto (100%) rename hadoop-hdfs-project/{hadoop-hdfs => hadoop-hdfs-client}/src/main/proto/acl.proto (96%) rename hadoop-hdfs-project/{hadoop-hdfs => hadoop-hdfs-client}/src/main/proto/datatransfer.proto (100%) rename hadoop-hdfs-project/{hadoop-hdfs => hadoop-hdfs-client}/src/main/proto/encryption.proto (100%) rename hadoop-hdfs-project/{hadoop-hdfs => hadoop-hdfs-client}/src/main/proto/hdfs.proto (100%) rename hadoop-hdfs-project/{hadoop-hdfs => hadoop-hdfs-client}/src/main/proto/inotify.proto (100%) rename hadoop-hdfs-project/{hadoop-hdfs => hadoop-hdfs-client}/src/main/proto/xattr.proto (95%) create mode 100644 hadoop-hdfs-project/hadoop-hdfs/src/main/proto/editlog.proto diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/dev-support/findbugsExcludeFile.xml b/hadoop-hdfs-project/hadoop-hdfs-client/dev-support/findbugsExcludeFile.xml index be2911f3e7..ba6453dad7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/dev-support/findbugsExcludeFile.xml +++ b/hadoop-hdfs-project/hadoop-hdfs-client/dev-support/findbugsExcludeFile.xml @@ -17,4 +17,8 @@ + + + + diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/pom.xml b/hadoop-hdfs-project/hadoop-hdfs-client/pom.xml index 1b45095c5f..aeaa98058c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs-client/pom.xml @@ -63,6 +63,48 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + org.apache.hadoop + hadoop-maven-plugins + + + compile-protoc + generate-sources + + 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 + + + ${project.build.directory}/generated-sources/java + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + org.apache.hadoop.hdfs.protocol.proto + + diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/ClientDatanodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientDatanodeProtocol.proto similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/proto/ClientDatanodeProtocol.proto rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientDatanodeProtocol.proto diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/ClientNamenodeProtocol.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientNamenodeProtocol.proto similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/proto/ClientNamenodeProtocol.proto rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/ClientNamenodeProtocol.proto diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/acl.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/acl.proto similarity index 96% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/proto/acl.proto rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/acl.proto index 57cc855786..bb7fdb0168 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/acl.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/acl.proto @@ -61,11 +61,6 @@ message AclStatusProto { optional FsPermissionProto permission = 5; } -message AclEditLogProto { - required string src = 1; - repeated AclEntryProto entries = 2; -} - message ModifyAclEntriesRequestProto { required string src = 1; repeated AclEntryProto aclSpec = 2; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/datatransfer.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/proto/datatransfer.proto rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/datatransfer.proto diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/encryption.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/encryption.proto similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/proto/encryption.proto rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/encryption.proto diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/hdfs.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/proto/hdfs.proto rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/hdfs.proto diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/inotify.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/inotify.proto similarity index 100% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/proto/inotify.proto rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/inotify.proto diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/xattr.proto b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/xattr.proto similarity index 95% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/proto/xattr.proto rename to hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/xattr.proto index acdc28ebb8..6c8b5eb594 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/xattr.proto +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto/xattr.proto @@ -35,11 +35,6 @@ message XAttrProto { optional bytes value = 3; } -message XAttrEditLogProto { - optional string src = 1; - repeated XAttrProto xAttrs = 2; -} - enum XAttrSetFlagProto { XATTR_CREATE = 0x01; XATTR_REPLACE = 0x02; diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index a7c9e7c18e..f595751cc7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -710,6 +710,9 @@ Release 2.8.0 - UNRELEASED HDFS-8712. Remove 'public' and 'abstracta modifiers in FsVolumeSpi and FsDatasetSpi (Lei (Eddy) Xu via vinayakumarb) + HDFS-8726. Move protobuf files that define the client-sever protocols to + hdfs-client. (wheat9) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/pom.xml index f90644c4d3..db38851264 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml @@ -328,26 +328,20 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> ${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 - ClientDatanodeProtocol.proto - ClientNamenodeProtocol.proto DatanodeProtocol.proto HAZKInfo.proto InterDatanodeProtocol.proto JournalProtocol.proto NamenodeProtocol.proto QJournalProtocol.proto - acl.proto - xattr.proto - datatransfer.proto + editlog.proto fsimage.proto - hdfs.proto - encryption.proto - inotify.proto ${project.build.directory}/generated-sources/java diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/pom.xml index 3b205e44b0..7e58606181 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/pom.xml @@ -112,7 +112,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> ${protoc.path} ${basedir}/../../../../../hadoop-common-project/hadoop-common/src/main/proto - ${basedir}/../../../../../hadoop-hdfs-project/hadoop-hdfs/src/main/proto + ${basedir}/../../../../../hadoop-hdfs-project/hadoop-hdfs-client/src/main/proto ${basedir}/src/main/proto diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java index c8e565e2c4..ab36f17af0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java @@ -103,8 +103,8 @@ import org.apache.hadoop.hdfs.protocol.HdfsConstants; import org.apache.hadoop.hdfs.protocol.LayoutVersion; import org.apache.hadoop.hdfs.protocol.LayoutVersion.Feature; -import org.apache.hadoop.hdfs.protocol.proto.AclProtos.AclEditLogProto; -import org.apache.hadoop.hdfs.protocol.proto.XAttrProtos.XAttrEditLogProto; +import org.apache.hadoop.hdfs.protocol.proto.EditLogProtos.AclEditLogProto; +import org.apache.hadoop.hdfs.protocol.proto.EditLogProtos.XAttrEditLogProto; import org.apache.hadoop.hdfs.protocolPB.PBHelper; import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/editlog.proto b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/editlog.proto new file mode 100644 index 0000000000..f25fe591ad --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/editlog.proto @@ -0,0 +1,35 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +option java_package = "org.apache.hadoop.hdfs.protocol.proto"; +option java_outer_classname = "EditLogProtos"; +option java_generate_equals_and_hash = true; +package hadoop.hdfs; + +import "acl.proto"; +import "xattr.proto"; + +message AclEditLogProto { + required string src = 1; + repeated AclEntryProto entries = 2; +} + +message XAttrEditLogProto { + optional string src = 1; + repeated XAttrProto xAttrs = 2; +}