imbajin commented on code in PR #415:
URL:
https://github.com/apache/incubator-hugegraph-doc/pull/415#discussion_r2444621607
##########
content/cn/docs/clients/hugegraph-client.md:
##########
@@ -455,6 +456,39 @@ Edge knows1 = marko.addEdge("knows", vadas, "city",
"Beijing");
**注意:当 frequency 为 multiple 时必须要设置 sortKeys 对应属性类型的值。**
-### 4 简单示例
+### 4 图管理
+client支持一个物理部署中多个 GraphSpace,每个 GraphSpace 下可以含多个图(graph)。
+- 兼容:不指定 GraphSpace 时,默认使用 "DEFAULT" 空间
-简单示例见[HugeGraph-Client](/cn/docs/quickstart/client/hugegraph-client)
+#### 4.1 创建GraphSpace
+
+```java
+GraphSpaceManager spaceManager = hugeClient.graphSpace();
+
+// 定义 GraphSpace 配置
+GraphSpace graphSpace = new GraphSpace();
+graphSpace.setName("myGraphSpace");
+graphSpace.setDescription("Business data graph space");
+graphSpace.setMaxGraphNumber(10); // 最大图数量
+graphSpace.setMaxRoleNumber(100); // 最大角色数量
+
+// 创建 GraphSpace
+spaceManager.createGraphSpace(graphSpace);
+```
+#### 4.2 GraphSpace 接口汇总
+
+| category | interface | description
|
+|----------|------------------------|------------------------------------------|
+| 查询 | listGraphSpace() | 获取所有 GraphSpace 列表 |
+| | getGraphSpace(String name) | 获取指定 GraphSpace
|
+| | space.getName() | 获取 GraphSpace 名称 |
+| 更新 | space.setDescription(String description) | 修改 GraphSpace 描述信息
|
+| | space.setMaxGraphNumber(int maxNumber) | 设置 GraphSpace 最大图数量
|
+| | space.setMaxRoleNumber(int maxRoleNumber) | 设置 GraphSpace 最大图数量
|
+| | updateGraphSpace(String name, GraphSpace space) | 更新 GraphSpace
配置 |
+| 删除 | removeGraphSpace(String name) | 删除指定 GraphSpace
|
+
+
+### 5 简单示例
+
+简单示例见[HugeGraph-Client](/cn/docs/quickstart/client/hugegraph-client)
Review Comment:
🧹 **文件末尾缺少换行符**: 根据项目 .editorconfig 规范(`insert_final_newline =
true`)和最佳实践,Markdown 文件应以换行符结尾。
建议在文件最后一行后添加一个空行。
##########
content/en/docs/quickstart/client/hugegraph-client.md:
##########
@@ -73,9 +73,10 @@ import org.apache.hugegraph.structure.gremlin.ResultSet;
public class SingleExample {
public static void main(String[] args) throws IOException {
- // If connect failed will throw a exception.
- HugeClient hugeClient = HugeClient.builder("http://localhost:8080",
+ HugeClient hugeClient = HugeClient.builder("http://127.0.0.1:8080",
Review Comment:
⚠️ **删除了有用的注释**: 原有的注释 "If connect failed will throw a exception"
对新手用户理解连接异常处理很有帮助,建议保留。
虽然这个注释在代码层面可能显得多余,但在教学文档中,明确说明可能的异常情况是很好的实践。
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]