-
Notifications
You must be signed in to change notification settings - Fork 115
Optimize dynamic creation of diagram documents #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
1596ff6
88f810e
9de89d2
dceea2b
08fb2ee
8770afc
b6998a8
fe726d7
c5d576d
343c3c3
e3ee581
7ee85c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,7 +112,7 @@ DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/clear?confirm_ | |
| ##### Method & Url | ||
|
|
||
| ``` | ||
| POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?clone_graph_name=hugegraph | ||
| POST http://localhost:8080/graphspaces/DEFAULT/graphs/cloneGraph?clone_graph_name=hugegraph | ||
| ``` | ||
|
|
||
| ##### Request Body (可选) | ||
|
|
@@ -124,7 +124,7 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?clone_grap | |
| "gremlin.graph": "org.apache.hugegraph.HugeFactory", | ||
| "backend": "rocksdb", | ||
| "serializer": "binary", | ||
| "store": "hugegraph_clone", | ||
| "store": "cloneGraph", | ||
| "rocksdb.data_path": "./rks-data-xx", | ||
| "rocksdb.wal_path": "./rks-data-xx" | ||
| } | ||
|
|
@@ -144,7 +144,7 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?clone_grap | |
|
|
||
| ```javascript | ||
| { | ||
| "name": "hugegraph_clone", | ||
| "name": "cloneGraph", | ||
| "backend": "rocksdb" | ||
| } | ||
| ``` | ||
|
|
@@ -166,11 +166,21 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph-xx | |
|
|
||
| ##### Request Body | ||
|
|
||
| 创建一个非鉴权模式的图(设置 `Content-Type: application/json`) | ||
| 创建一个图(设置 `Content-Type: application/json`) | ||
|
|
||
| **`gremlin.graph` 配置说明:** | ||
| - 鉴权模式:`"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy"`(推荐) | ||
| - 非鉴权模式:`"gremlin.graph": "org.apache.hugegraph.HugeFactory"` | ||
|
|
||
| **注意**!! | ||
| 1. 在 1.7.0 版本中,动态创建图会导致 NPE 错误。该问题已在 [PR#2912](https://github.com/apache/incubator-hugegraph/pull/2912) 中修复。当前 master 版本和 1.7.0 之前的版本不受此问题影响。 | ||
Tsukilc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 2. 1.7.0 及之前版本,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时请确保 HugeGraph-Server 已正确配置 PD,参见 [HStore 配置](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储hstore)。 | ||
|
||
|
|
||
Tsukilc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| **RocksDB 示例:** | ||
|
|
||
| ```json | ||
| { | ||
| "gremlin.graph": "org.apache.hugegraph.HugeFactory", | ||
| "gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy", | ||
| "backend": "rocksdb", | ||
| "serializer": "binary", | ||
| "store": "hugegraph", | ||
|
|
@@ -179,9 +189,20 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph-xx | |
| } | ||
| ``` | ||
|
|
||
| > Note: | ||
| > 1. Rocksdb 存储路径不能与现有图相同(需使用不同的目录) | ||
| > 2. 如需开启新图的权限系统,需替换设置 `gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy` | ||
| **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: Rocksdb 存储路径不能与现有图相同(需使用不同的目录) | ||
|
|
||
| ##### Response Status | ||
|
|
||
|
|
@@ -216,7 +237,7 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph-xx | |
| ##### Method & Url | ||
|
|
||
| ```javascript | ||
| DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?confirm_message=I%27m%20sure%20to%20drop%20the%20graph | ||
| DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/graphA?confirm_message=I%27m%20sure%20to%20drop%20the%20graph | ||
| ``` | ||
|
|
||
| ##### Response Status | ||
|
|
@@ -486,4 +507,4 @@ PUT http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/compact | |
| "local": "OK" | ||
| } | ||
| } | ||
| ``` | ||
| ``` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 代码层面默认不携带 http:// 前缀, 作为默认 prefix_scheme 当用户自己指定 https 或其他 scheme 再覆盖 doc 之后统一为 ip+port 默认值 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -200,10 +200,29 @@ task.scheduler_type=distributed | |||||
| pd.peers=127.0.0.1:8686,127.0.0.1:8687,127.0.0.1:8688 | ||||||
| ``` | ||||||
|
|
||||||
| ```properties | ||||||
| # 简单示例(带鉴权) | ||||||
Tsukilc marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy | ||||||
|
|
||||||
| # 指定存储 hstore(必须) | ||||||
| backend=hstore | ||||||
| serializer=binary | ||||||
| store=hugegraph | ||||||
|
|
||||||
| # 指定任务调度器(1.7.0及之前必须) | ||||||
| task.scheduler_type=distributed | ||||||
imbajin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| # pd config | ||||||
| pd.peers=127.0.0.1:8686 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 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:8686 |
||||||
| ``` | ||||||
|
|
||||||
| 2. 修改 HugeGraph-Server 的 `rest-server.properties` 配置: | ||||||
|
|
||||||
| ```properties | ||||||
| usePD=true | ||||||
|
|
||||||
| # 若需要 auth | ||||||
Tsukilc marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| # 若需要 auth | |
| # 在生产环境或需要访问控制/多租户隔离时,建议启用鉴权功能,可取消注释并配置如下: |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -112,7 +112,7 @@ DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/clear?confirm_ | |||||
| ##### Method & Url | ||||||
|
|
||||||
| ``` | ||||||
| POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?clone_graph_name=hugegraph | ||||||
| POST http://localhost:8080/graphspaces/DEFAULT/graphs/cloneGraph?clone_graph_name=hugegraph | ||||||
| ``` | ||||||
|
|
||||||
| ##### Request Body [Optional] | ||||||
|
|
@@ -124,13 +124,13 @@ Clone a `non-auth` mode graph (set `Content-Type: application/json`) | |||||
| "gremlin.graph": "org.apache.hugegraph.HugeFactory", | ||||||
| "backend": "rocksdb", | ||||||
| "serializer": "binary", | ||||||
| "store": "hugegraph", | ||||||
| "store": "cloneGraph", | ||||||
| "rocksdb.data_path": "./rks-data-xx", | ||||||
| "rocksdb.wal_path": "./rks-data-xx" | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| > Note: | ||||||
| > Note: | ||||||
| > 1. The data/wal_path can't be the same as the existing graph (use separate directories) | ||||||
| > 2. Replace "gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy" to enable auth mode | ||||||
|
|
||||||
|
|
@@ -142,10 +142,10 @@ Clone a `non-auth` mode graph (set `Content-Type: application/json`) | |||||
|
|
||||||
| ##### Response Body | ||||||
|
|
||||||
| ```javascript | ||||||
| ```json | ||||||
| { | ||||||
| "name": "hugegraph_clone", | ||||||
| "backend": "rocksdb" | ||||||
| "name": "cloneGraph", | ||||||
| "backend": "rocksdb" | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
|
|
@@ -166,11 +166,21 @@ POST http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph2 | |||||
|
|
||||||
| ##### Request Body | ||||||
|
|
||||||
| Create a non-auth graph (set `Content-Type: application/json`) | ||||||
| Create a graph (set `Content-Type: application/json`) | ||||||
|
|
||||||
| **`gremlin.graph` Configuration:** | ||||||
| - Auth mode: `"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy"` (Recommended) | ||||||
| - Non-auth mode: `"gremlin.graph": "org.apache.hugegraph.HugeFactory"` | ||||||
|
|
||||||
Tsukilc marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| **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). | ||||||
|
||||||
|
|
||||||
| **RocksDB Example:** | ||||||
|
|
||||||
| ```json | ||||||
| { | ||||||
| "gremlin.graph": "org.apache.hugegraph.HugeFactory", | ||||||
| "gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy", | ||||||
| "backend": "rocksdb", | ||||||
| "serializer": "binary", | ||||||
| "store": "hugegraph2", | ||||||
|
|
@@ -179,9 +189,20 @@ Create a non-auth graph (set `Content-Type: application/json`) | |||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| > Note: | ||||||
| > 1. The data/wal_path can't be the same as the existing graph (use separate directories) | ||||||
| > 2. Replace "gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy" to enable auth mode | ||||||
| **HStore Example (for version 1.7.0 and earlier):** | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 与中文版类似,英文版的 HStore 示例也需要明确版本适用范围。 建议修改:
Suggested change
或提供 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: The data/wal_path can't be the same as the existing graph (use separate directories) | ||||||
|
|
||||||
| ##### Response Status | ||||||
|
|
||||||
|
|
@@ -216,7 +237,7 @@ Since deleting a graph is a dangerous operation, we have added parameters for co | |||||
| ##### Method & Url | ||||||
|
|
||||||
| ``` | ||||||
| DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph_clone?confirm_message=I%27m%20sure%20to%20drop%20the%20graph | ||||||
| DELETE http://localhost:8080/graphspaces/DEFAULT/graphs/graphA?confirm_message=I%27m%20sure%20to%20drop%20the%20graph | ||||||
| ``` | ||||||
|
|
||||||
| ##### Response Status | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.