Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 7b761f18d -> e6a6b5b72


HDFS-11127. Block Storage : add block storage service protocol. Contributed by 
Chen Liang


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e6a6b5b7
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e6a6b5b7
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e6a6b5b7

Branch: refs/heads/HDFS-7240
Commit: e6a6b5b729bbd548b0ee5bfec13e9640f28f9c7a
Parents: 7b761f1
Author: Anu Engineer <[email protected]>
Authored: Fri Nov 11 09:59:58 2016 -0800
Committer: Anu Engineer <[email protected]>
Committed: Fri Nov 11 09:59:58 2016 -0800

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/pom.xml         |   1 +
 .../src/main/proto/CBlockServiceProtocol.proto  | 133 +++++++++++++++++++
 2 files changed, 134 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e6a6b5b7/hadoop-hdfs-project/hadoop-hdfs/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml 
b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
index 0d0465d..3693a73 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
@@ -354,6 +354,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd";>
                   <include>fsimage.proto</include>
                   <include>StorageContainerLocationProtocol.proto</include>
                   <include>StorageContainerDatanodeProtocol.proto</include>
+                  <include>CBlockServiceProtocol.proto</include>
                 </includes>
               </source>
               
<output>${project.build.directory}/generated-sources/java</output>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e6a6b5b7/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/CBlockServiceProtocol.proto
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/CBlockServiceProtocol.proto 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/CBlockServiceProtocol.proto
new file mode 100644
index 0000000..36e4b59
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/proto/CBlockServiceProtocol.proto
@@ -0,0 +1,133 @@
+/**
+ * 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.
+ */
+
+/**
+ * These .proto interfaces are private and unstable.
+ * Please see http://wiki.apache.org/hadoop/Compatibility
+ * for what changes are allowed for a *unstable* .proto interface.
+ */
+
+option java_package = "org.apache.hadoop.cblock.protocol.proto";
+option java_outer_classname = "CBlockServiceProtocolProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+package hadoop.cblock;
+
+/**
+* This message is sent to CBlock server to create a volume. Creating
+* volume requries four parameters: owner of the volume, name of the volume
+* size of volume and block size of the volume.
+*/
+message CreateVolumeRequestProto {
+    required string userName = 1;
+    required string volumeName = 2;
+    required uint64 volumeSize = 3;
+    optional uint32 blockSize = 4 [default = 4096];
+}
+
+/**
+* Empty response message.
+*/
+message CreateVolumeResponseProto {
+
+}
+
+/**
+* This message is sent to CBlock server to delete a volume. The volume
+* is specified by owner name and volume name. If force is set to
+* false, volume will be deleted only if it is empty. Otherwise delete it
+* regardless.
+*/
+message DeleteVolumeRequestProto {
+    required string userName = 1;
+    required string volumeName = 2;
+    optional bool force = 3;
+}
+
+/**
+* Empty response message.
+*/
+message DeleteVolumeResponseProto {
+
+}
+
+/**
+* This message is sent to CBlock server to request info of a volume. The
+* volume is specified by owner name and volume name.
+*/
+message InfoVolumeRequestProto {
+    required string userName = 1;
+    required string volumeName = 2;
+}
+
+/**
+* This message describes the information of a volume.
+* Currently, the info includes the volume creation parameters and a number
+* as the usage of the volume, in terms of number of bytes.
+*/
+message VolumeInfoProto {
+    required string userName = 1;
+    required string volumeName = 2;
+    required uint64 volumeSize = 3;
+    required uint64 blockSize = 4;
+    optional uint64 usage = 5;
+    // TODO : potentially volume ACL
+}
+
+/**
+* This message is sent from CBlock server as response of info volume request.
+*/
+message InfoVolumeResponseProto {
+    optional VolumeInfoProto volumeInfo = 1;
+}
+
+/**
+* This message is sent to CBlock server to list all available volume.
+*/
+message ListVolumeRequestProto {
+    optional string userName = 1;
+}
+
+/**
+* This message is sent from CBlock server as response of volume listing.
+*/
+message ListVolumeResponseProto {
+    repeated VolumeInfoProto volumeEntry = 1;
+}
+
+service CBlockServiceProtocolService {
+    /**
+    * Create a volume.
+    */
+    rpc createVolume(CreateVolumeRequestProto) 
returns(CreateVolumeResponseProto);
+
+    /**
+    * Delete a volume.
+    */
+    rpc deleteVolume(DeleteVolumeRequestProto) 
returns(DeleteVolumeResponseProto);
+
+    /**
+    * Get info of a volume.
+    */
+    rpc infoVolume(InfoVolumeRequestProto) returns(InfoVolumeResponseProto);
+
+    /**
+    * List all available volumes.
+    */
+    rpc listVolume(ListVolumeRequestProto) returns(ListVolumeResponseProto);
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to