Optimize dynamic creation of diagram documents#444
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request optimizes documentation for HugeGraph by adding configuration examples, clarifying setup instructions, and improving consistency across API documentation.
Changes:
- Added PD (Placement Driver) configuration examples with authentication support for both English and Chinese HugeGraph server documentation
- Updated REST API graph operation examples to use more consistent naming (e.g.,
cloneGraphinstead ofhugegraph_clone) - Added important notes about version-specific requirements for hstore backend configuration
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| content/en/docs/quickstart/hugegraph/hugegraph-server.md | Added PD configuration example with authentication and pd.peers settings for multi-node setup |
| content/en/docs/clients/restful-api/graphs.md | Updated graph naming examples, improved formatting, and added version-specific configuration note |
| content/cn/docs/quickstart/hugegraph/hugegraph-server.md | Chinese version of PD configuration changes with authentication examples |
| content/cn/docs/clients/restful-api/graphs.md | Chinese version of REST API documentation updates with consistent graph naming |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| Create a non-auth graph (set `Content-Type: application/json`) | ||
| **Note**!! For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in | ||
| the request body |
There was a problem hiding this comment.
The new note at line 170 mentions that hstore backend requires task.scheduler_type: distributed for version 1.7.0 and earlier, but there is no complete example showing this configuration in the "Create graph" section.
Suggestion:
Add a complete hstore example in section 6.1.5 to help users understand the full configuration:
{
"gremlin.graph": "org.apache.hugegraph.HugeFactory",
"backend": "hstore",
"serializer": "binary",
"store": "hugegraph2",
"task.scheduler_type": "distributed",
"pd.peers": "127.0.0.1:8686"
}This would make the documentation much more user-friendly for new hstore users.
| ##### Request Body | ||
|
|
||
| 创建一个非鉴权模式的图(设置 `Content-Type: application/json`) | ||
| **注意**!!1.7.0 及之前,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed" |
There was a problem hiding this comment.
第 170 行提到 hstore 后端在 1.7.0 及之前版本需要 task.scheduler_type: distributed,但在「创建图」章节没有提供完整的 hstore 示例。
建议:
在 6.1.5 节添加完整的 hstore 示例,帮助用户理解完整配置:
{
"gremlin.graph": "org.apache.hugegraph.HugeFactory",
"backend": "hstore",
"serializer": "binary",
"store": "hugegraph2",
"task.scheduler_type": "distributed",
"pd.peers": "127.0.0.1:8686"
}这样对想使用 hstore 后端的新用户会更友好。
| ``` | ||
|
|
||
| ```properties | ||
| # Full example (with authentication) |
There was a problem hiding this comment.
Same issue as the Chinese version - the simplified example starting at line 220 is missing task.scheduler_type=distributed which is required for hstore backend (as noted in graphs.md:171).
Suggestion:
Add to the configuration example:
task.scheduler_type=distributed| ##### Request Body | ||
|
|
||
| 创建一个非鉴权模式的图(设置 `Content-Type: application/json`) | ||
| **注意**!!1.7.0 及之前,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed" |
There was a problem hiding this comment.
🧹 Minor - Consider adding cross-reference link
For better user experience, consider adding a link to the hugegraph-server.md configuration guide here, since users dynamically creating hstore graphs via API also need to configure the server properly first.
Suggestion:
**注意**!!1.7.0 及之前,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时需要确保 HugeGraph-Server 已正确配置 PD,详见[配置 HStore](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储-hstore)|
|
||
| Create a non-auth graph (set `Content-Type: application/json`) | ||
| **Note**!! For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in | ||
| the request body |
There was a problem hiding this comment.
🧹 Minor - Consider adding cross-reference link (EN)
For better user experience, consider adding a link to the hugegraph-server.md configuration guide.
Suggestion:
**Note**!! For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in the request body. Also ensure HugeGraph-Server is properly configured with PD, see [HStore Configuration](/docs/quickstart/hugegraph/hugegraph-server/#511-distributed-storage-hstore)| store=hugegraph | ||
|
|
||
| # pd config | ||
| pd.peers=127.0.0.1:8686 |
There was a problem hiding this comment.
🧹 Minor - Missing pd.peers explanation in simplified example
The comment says "pd config" but doesn't explain what pd.peers is or how to configure it for different scenarios (single PD vs multiple PD nodes).
Suggestion:
# PD 配置(必须)- 配置 PD 服务的地址和 RPC 端口
# 单个 PD 节点时配置一个地址,多个 PD 节点时用逗号分隔
pd.peers=127.0.0.1:8686Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| } | ||
| ``` | ||
|
|
||
| **HStore 示例:** |
There was a problem hiding this comment.
第 190 行的标题 "HStore 示例:" 缺少版本和模式说明,用户无法清楚知道这个示例适用于什么场景。
建议修改:
| **HStore 示例:** | |
| **HStore 示例(非鉴权模式 - 仅适用于 1.7.0 及之前版本):** |
或者,如果要提供 1.7.0+ 的示例,应该使用:
| **HStore 示例:** | |
| **HStore 示例(鉴权模式 - 适用于 1.7.0+):** | |
| \`\`\`json | |
| { | |
| "gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy", | |
| "backend": "hstore", | |
| "serializer": "binary", | |
| "store": "hugegraph2", | |
| "task.scheduler_type": "distributed", | |
| "pd.peers": "127.0.0.1:8686" | |
| } | |
| \`\`\` |
| ``` | ||
|
|
||
| > Note: | ||
| **HStore Example (for version 1.7.0 and earlier):** |
There was a problem hiding this comment.
与中文版类似,英文版的 HStore 示例也需要明确版本适用范围。
建议修改:
| **HStore Example (for version 1.7.0 and earlier):** | |
| **HStore Example (for version 1.7.0 and earlier - non-auth mode):** |
或提供 1.7.0+ 版本的示例(建议同时提供两个版本的示例)。
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| ``` | ||
|
|
||
| **HStore 示例:** |
There was a problem hiding this comment.
The Chinese HStore example section title is missing version information for consistency with the English version. The English version says "HStore Example (for version 1.7.0 and earlier):" while the Chinese version only says "HStore 示例:". Consider adding version information like "HStore 示例(1.7.0 及之前):" to match the English documentation.
| **HStore 示例:** | |
| **HStore 示例(1.7.0 及之前):** |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
代码层面默认不携带 http:// 前缀, 作为默认 prefix_scheme
当用户自己指定 https 或其他 scheme 再覆盖
doc 之后统一为 ip+port 默认值
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| **注意**!! | ||
| 1. 在 1.7.0 版本中,动态创建图会导致 NPE 错误。该问题已在 [PR#2912](https://github.com/apache/incubator-hugegraph/pull/2912) 中修复。当前 master 版本和 1.7.0 之前的版本不受此问题影响。 | ||
| 2. 1.7.0 及之前版本,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时请确保 HugeGraph-Server 已正确配置 PD,参见 [HStore 配置](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储hstore)。 |
There was a problem hiding this comment.
The note mentions "1.7.0 及之前版本" (version 1.7.0 and earlier) but the first point says "在 1.7.0 版本中" (in version 1.7.0) the issue exists and "1.7.0 之前的版本不受此问题影响" (versions before 1.7.0 are not affected). This creates confusion about whether version 1.7.0 itself has the issue. If only 1.7.0 has the issue, then point 2 should say "1.7.0 版本" not "1.7.0 及之前版本".
|
|
||
| **Note**!! | ||
| 1. In version 1.7.0, dynamic graph creation would cause a NPE. This issue has been fixed in [PR#2912](https://github.com/apache/incubator-hugegraph/pull/2912). The current master version and versions after 1.7.0 do not have this problem. | ||
| 2. For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in the request body. Also ensure HugeGraph-Server is properly configured with PD, see [HStore Configuration](/docs/quickstart/hugegraph/hugegraph-server/#511-distributed-storage-hstore). |
There was a problem hiding this comment.
The note mentions "For version 1.7.0 and earlier" but point 1 states that the NPE issue exists in version 1.7.0 and that "versions after 1.7.0 do not have this problem." This creates confusion about whether versions before 1.7.0 also need the workaround. If only 1.7.0 has the issue, then this should say "For version 1.7.0" not "For version 1.7.0 and earlier".
| ```properties | ||
| usePD=true | ||
|
|
||
| # 若需要 auth |
There was a problem hiding this comment.
The comment says "若需要 auth" (if auth is needed) but should be more specific. The English version says "If auth is needed" which is also vague. Both should clarify when authentication is actually needed or recommended, matching the context from the examples which use auth mode by default.
| # 若需要 auth | |
| # 在生产环境或需要访问控制/多租户隔离时,建议启用鉴权功能,可取消注释并配置如下: |
* fix: fix graphs.md --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> 515fb75
Optimize dynamic creation of diagram documents