xiaoyuyao commented on a change in pull request #489: HDDS-2747.
interface/JavaApi.md
URL: https://github.com/apache/hadoop-ozone/pull/489#discussion_r371544073
##########
File path: hadoop-hdds/docs/content/interface/JavaApi.zh.md
##########
@@ -21,4 +21,132 @@ summary: Ozone has a set of Native RPC based APIs. This is
the lowest level API'
limitations under the License.
-->
-测试页面
+Ozone 自带了支持 RPC 的客户端库,对于一般的应用场景也可以使用兼容 S3 的 REST 接口替代 Ozone 客户端 API。
+
+
+## 创建 Ozone 客户端
+
+ozone 客户端由客户端工厂创建,我们可以通过如下调用获得一个 RPC 客户端对象:
+
+{{< highlight java >}}
+OzoneClient ozClient = OzoneClientFactory.getRpcClient();
+{{< /highlight >}}
+
+如果用户想要创建指定配置的客户端,可以这样调用:
+
+{{< highlight java >}}
+OzoneClient ozClient = OzoneClientFactory.getClient();
+{{< /highlight >}}
+
+这样就会返回一个合适的客户端对象。
+
+## 使用 Ozone 客户端写数据
+
+ozone 中的数据层次为卷、桶和键。卷是桶的集合,桶是键的集合,如果要向 ozone 写数据,你需要依次获得卷、桶和键。
+
+### 创建卷
+
+有了客户端对象之后,我们需要获取 ObjectStore 的引用,获取方法为:
+
+{{< highlight java >}}
+ObjectStore objectStore = ozClient.getObjectStore();
+{{< /highlight >}}
+
+ObjectStore 对象表示了客户端连接的集群。
+
+{{< highlight java >}}
+// 我们创建一个卷来存储数据
Review comment:
我们创建一个卷来存储数据=>让我们创建一个卷来存储资产数据
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]