Skip to content

Commit 12b5645

Browse files
cooper-lzywhitewumfoesa-yangabby-cyberrandomJoe211
authored
Merge 3.0.0 to master (#1484)
* Update deploy.yaml * Update deploy.yaml * Update studio & color * Update mkdocs.yml * Update 2.balance-syntax.md (#1394) * update cheatsheet (#1393) * update cheatsheet * Update 6.cheatsheet-for-ngql-command.md * Update 6.cheatsheet-for-ngql-command.md * studio * Update 3.vid.md * Delete overrides/partials directory * fix links (#1395) * Update 2.how-to-create-subsciption.md * Update 3.property-reference.md * Update 2.boolean.md * Update 12.hash.md * update * Update 2.match.md * fix links (#1397) * Update 2.match.md * Update optional-match.md * Update 5.lookup.md * Update 5.lookup.md * Update 3.go.md * Update 3.go.md * Update 3.go.md * Update 3.go.md * Space level metrics (#1396) * space-level-metrics * Update 4.use-dashboard.md * updates * Update limit syntax in GO (#1398) * Update 3.go.md * nGQL cheatsheet added (#1399) * Update 2.deploy-connect-dashboard-ent.md (#1401) * Add cloud picture and change name (#1402) * Update 1.install-nebula-graph-by-compiling-the-source-code.md * Update 5.2.connection-configuration-and-use.md * Update mkdocs.yml * fix typo (#1404) * version correspondence between dashboard & nebula (#1405) * version correspondence between dashboard & nebula * version upgrade * update algorithm (#1406) * Update limit.md * Update sample.md * Update 1.create-space.md * Update 1.create-space.md * Update 2.drop-tag.md * Update README.md * Update README.md * Update 4.delete-edge.md * Update 4.delete-edge.md * Update 2.graph-modeling.md * Update 2.1.path.md * Update 1.insert-edge.md * Update 2.show-native-indexes.md * Update nebula-algorithm.md * Update 2.1.show-create-index.md * Update 1.text-based-index-restrictions.md * Update source_manage-service.md * Update 1.text-based-index-restrictions.md * Update 4.nebula-graph-crud.md * Update 2.find-path.md * Update 2.find-path.md * Add ranking config in exchange examples (#1407) * add license check (#1410) * Update 2.match.md * Update 2.match.md * Update nebula-plato.md (#1411) * Update 1.nebula-client.md * update start sh * update stop sh * update stop sh * change start service setting * update start * Update nebula-plato.md * Add ranking config in exchange examples (#1412) * timestamp_in_logfile_name and logrotate faq (#1400) * Fix exchange conf link (#1414) * Update note.css * Update 3.cluster-information.md * disable balance data (#1416) * update config shell * update nebula-dashboard server config * fix schema rule (#1418) * Update README.md * Update 2.deploy-dashboard.md * Add next step * Update mkdocs.yml (#1422) * Update 1.what-is-dashboard-ent.md * [WIP]update Studio (#1419) * [WIP]update Studio * update-0124 * Update st-ug-deploy.md * [wip] explore 216 --what is explorer & deployment updates (#1417) * [wip] explore 216 --what is explorer updates * explorer 216 -- deploy&connect * Update mkdocs.yml * Update mkdocs.yml * [WIP] explorer220-overview (#1421) * explorer220-overview * Update ex-ug-page-overview.md * Update st-ug-what-is-graph-studio.md * Explorer220 query (#1423) * explorer220-overview * explorer 220-query * Update st-ug-crud-tag.md * node-filtering (#1424) * dashboard ent config_file update (#1426) * dashboard ent config_file update * Update 2.deploy-connect-dashboard-ent.md * Create 2.deploy-connect-dashboard-ent.md * Update 1.insert-edge.md * Update 2.data-model.md * Update 2.graph-modeling.md * dashboard-ent-custom-installation path (#1430) * dashboard-ent-custom-installation path * Update 1.create-cluster.md * update-picture * Update 1.what-is-dashboard.md * [WIP] explorer 220 graph-exploration (#1429) * explorer 220 - canvas (#1433) * Update 2.deploy-dashboard.md * Update 2.deploy-dashboard.md * Update upgrade docs (#1427) * Update upgrade docs * Update upgrade docs * Update upgrade-nebula-from-200-to-latest.md * Update upgrade-nebula-graph-to-latest.md * Update upgrade-nebula-graph-to-latest.md * Update upgrade-nebula-graph-to-latest.md * Update upgrade-nebula-graph-to-latest.md * Update upgrade-nebula-graph-to-latest.md * Update upgrade-nebula-graph-to-latest.md * Resolve Whitewum's and Harris's comments * Fix some issues * update resource calculation * add caution for date_time_zonespec.csv * delete zone (#1434) * manage storage hosts (#1437) * manage storage hosts * update * Update manage-storage-host.md * Add faq for job id issue (#1438) * Remove zone (#1439) * Remove zone (#1440) * Remove zone * Update 4.nebula-graph-crud.md * Exchange support PostgreSQL data source (#1441) * [WIP] explorer220-updates (#1435) * explorer220-updates * updates * Update mkdocs.yml * console updates * Update canvas-overview.md * Update visualization-mode.md * Update visualization-mode.md * show hosts (#1442) * show hosts The `show hosts` command displays the version * Update 6.show-hosts.md * Update learning-path.md * Update 2.data-model.md * Update compaction.md * Update compaction.md * Update compaction.md * Update 3.system-design.md * Update 3.system-design.md * Update st-ug-release-note.md * Update nebula-bench.md * Update how-to-contribute.md * Update how-to-contribute.md * Update 6.eco-tool-version.md * Update 6.eco-tool-version.md * Update 0.FAQ.md * Create 0.FAQ.md (#1443) * Update use-importer.md * Update mkdocs.yml * Update 6.eco-tool-version.md * update clients (#1444) * Update 3.system-design.md * Update ex-ug-deploy.md (#1445) * Update ex-ug-graph-exploration.md * update docs (#1446) * Update ex-ug-graph-exploration.md * Update 6.kill-query.md (#1448) * Update 2.deploy-dashboard.md * Update ex-ug-shortcuts.md * Update ex-ug-graph-exploration.md (#1449) * Update st-ug-deploy-by-helm.md (#1450) * Update explorer-console.md (#1451) * Update source_connect-to-nebula-graph.md * Update 5.nebula-python-client.md (#1452) as we use format string in nebula-python, don't support python3.5 * update * Update 6.show-hosts.md * add gifs for dashboard 110 (#1453) * Update 6.pricing.md * Update 1.what-is-br.md * Update 4.storage-service.md * Update 2.deploy-dashboard.md (#1455) * Update 1.what-is-nebula-graph.md * Update mkdocs.yml (#1456) * Update 2.deploy-dashboard.md (#1457) * Update 2.deploy-dashboard.md * Dashboard community deploy&connect updates (#1460) * deploy&connect updates for dashboard community * Update mkdocs.yml * update release notes (#1459) * update release notes * update * update * update * Update releasenote.md * Update 2.deploy-dashboard.md * Update releasenote.md * Update releasenote.md * Update learning-path.md fix invalid video list url * Update deploy.yaml * Update visualization-mode.md (#1463) * Update ex-ug-compile.md * Update releasenote.md * Update releasenote.md * update br 0211 (#1461) * update br 0211 * update * add * Update 4.br-restore-data.md * Update 4.br-restore-data.md * Update 2.compile-br.md * Update 1.configurations.md * Update mkdocs.yml * Update mkdocs.yml * Update upgrade-nebula-graph-to-latest.md * Update upgrade-nebula-graph-to-latest.md * Update upgrade-nebula-graph-to-latest.md * fixed some issues (#1467) * Update releasenote.md * Update 2.deploy-connect-dashboard-ent.md (#1468) * Update 4.describe-space.md * Update upgrade-nebula-graph-to-latest.md * Update releasenote.md * Create releasenote.md * Update releasenote.md * Update mkdocs.yml * update-br * Update 2.deploy-connect-dashboard-ent.md * update branch of client (#1469) * Update mkdocs.yml * Update 4.nebula-java-client.md * update compatibility (#1470) * Update 3.br-backup-data.md * Update 3.br-backup-data.md * Update nebula-plato.md * Update 3.br-backup-data.md * Update nebula-plato.md * Update st-ug-deploy.md * Update 3.br-backup-data.md * Update st-ug-deploy.md * Update 4.br-restore-data.md * Update 4.br-restore-data.md * Update 3.br-backup-data.md * Update st-ug-release-note.md * Update ex-ug-limitations.md * Update mkdocs.yml * Update use-importer.md * Update use-importer.md * Update nebula-algorithm.md * Update config-with-header.md * Update config-without-header.md * Update releasenote.md * Update st-ug-what-is-graph-studio.md * Update nebula-algorithm.md * Update nebula-spark-connector.md (#1473) * Update ex-ug-import-from-mysql.md * update exchange 3.0.0 (#1474) * [WIP]change plato name (#1472) * change plato name * update * Update nebula-analytics.md * Update nebula-analytics.md * Update 6.eco-tool-version.md * Update 3.system-design.md * Update nebula-analytics.md * Update releasenote.md * Update releasenote.md * add br * Update releasenote.md * Update releasenote.md * Update releasenote.md * Update releasenote.md * Update learning-path.md * Update learning-path.md * Update learning-path.md * Update learning-path.md (#1476) * Update nebula-console.md * Update nebula-console.md (#1477) * Update studio 3.2.1 (#1478) * Update 6.eco-tool-version.md (#1479) * Update logo.css (#1480) * Update 1.configurations.md (#1481) * Fix link and add cloud (#1482) * Update nebula-cloud.md * Update 6.eco-tool-version.md * update * update Co-authored-by: min.wu <[email protected]> Co-authored-by: foesa <[email protected]> Co-authored-by: abby.huang <[email protected]> Co-authored-by: randomJoe211 <[email protected]> Co-authored-by: li Nico <[email protected]> Co-authored-by: Harris.Chu <[email protected]> Co-authored-by: Steam <[email protected]> Co-authored-by: Nut He <[email protected]>
1 parent 4ff37ec commit 12b5645

File tree

296 files changed

+2160
-1894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

296 files changed

+2160
-1894
lines changed

docs-2.0/1.introduction/1.what-is-nebula-graph.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Nebula Graph 采用 shared-nothing 架构,支持在不停止数据库服务的
3030

3131
### 易开发
3232

33-
Nebula Graph 提供 Java、Python、C++和 Go 等流行编程语言的客户端,更多客户端仍在开发中。详情请参见 [Nebula Graph clients](../14.client/1.nebula-client.md)
33+
Nebula Graph 提供 Java、Python、C++ 和 Go 等流行编程语言的客户端,更多客户端仍在开发中。详情请参见 [Nebula Graph clients](../14.client/1.nebula-client.md)
3434

3535
### 高可靠访问控制
3636

docs-2.0/1.introduction/2.1.path.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050

5151
用户也可以观看视频了解路径的相关概念。
5252

53-
[Nebula Algorithm](https://www.bilibili.com/video/BV1Uf4y1t72L)(03 分 09 秒)
53+
[Path](https://www.bilibili.com/video/BV1Uf4y1t72L)(03 分 09 秒)
5454

5555
<iframe src="//player.bilibili.com/player.html?aid=291311326&bvid=BV1Uf4y1t72L&cid=361000311&page=1&high_quality=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" width="720px" height="480px"> </iframe>

docs-2.0/1.introduction/2.data-model.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ Nebula Graph 数据模型使用 6 种基本的数据模型:
2727

2828
- 两点之间可以有多条边。
2929
- 边是有方向的,不存在无向边。
30-
- 四元组 `<起点 VID、Edge type、边排序值 (Rank)、终点 VID>` 用于唯一标识一条边。边没有 EID。
30+
- 四元组 `<起点 VID、Edge type、边排序值 (rank)、终点 VID>` 用于唯一标识一条边。边没有 EID。
3131
- 一条边有且仅有一个 Edge type。
32-
- 一条边有且仅有一个 rank。其为 int64,默认为 0。
32+
- 一条边有且仅有一个 rank,类型为 int64,默认值为 0。
33+
34+
!!! 关于 rank
35+
36+
rank 可以用来区分 Edge type、起始点、目的点都相同的边。该值完全由用户自己指定。
37+
读取时必须自行取得全部的 rank 值后排序过滤和拼接。
38+
不支持诸如 `next(), pre(), head(), tail(), max(), min(), lessThan(), moreThan()` 等函数功能,也不能通过创建索引加速访问或者条件过滤。
3339

3440
- 标签(Tag)
3541

docs-2.0/1.introduction/3.nebula-graph-architecture/4.storage-service.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Storage 服务是由 nebula-storaged 进程提供的,用户可以根据场景
2626

2727
- Storage interface 层
2828

29-
Storage 服务的最上层,定义了一系列和图相关的 API。API 请求会在这一层被翻译成一组针对[分片](#数据分片)的 KV 操作,例如:
29+
Storage 服务的最上层,定义了一系列和图相关的 API。API 请求会在这一层被翻译成一组针对[分片](#_4)的 KV 操作,例如:
3030

3131
- `getNeighbors`:查询一批点的出边或者入边,返回边以及对应的属性,并且支持条件过滤。
3232

@@ -70,6 +70,7 @@ Nebula Graph 使用自行开发的 KVStore,而不是其他开源 KVStore,原
7070

7171
- 支持多个图空间,不同图空间相互隔离,每个图空间可以设置自己的分片数和副本数。
7272

73+
<!--
7374
## 数据存储格式
7475
7576
图存储的主要数据是点和边,Nebula Graph 将点和边的信息存储为 key,同时将点和边的属性信息存储在 value 中,以便更高效地使用属性过滤。
@@ -109,7 +110,7 @@ Nebula Graph 使用自行开发的 KVStore,而不是其他开源 KVStore,原
109110
- 2.0 中取消了 1.x 中的保留字段`Timestamp`。
110111
- 2.0 中边数据新增字段`PlaceHolder`。
111112
- 2.0 中修改了索引的格式,以便支持范围查询。
112-
113+
-->
113114
### 属性说明
114115

115116
Nebula Graph 使用强类型 Schema。
@@ -122,6 +123,7 @@ Nebula Graph 使用强类型 Schema。
122123

123124
![data partitioning](https://www-cdn.nebula-graph.com.cn/nebula-blog/DataModel02.png)
124125

126+
<!--
125127
### 切边与存储放大
126128
127129
Nebula Graph 中逻辑上的一条边对应着硬盘上的两个键值对(key-value pair),在边的数量和属性较多时,存储放大现象较明显。边的存储方式如下图所示。
@@ -143,7 +145,7 @@ EdgeA_Out 和 EdgeA_In 以方向相反的两条边的形式存在于存储层,
143145
如 EdgeA_Out 和 EdgeA_In 一样,Nebula Graph 冗余了存储每条边的信息,导致存储边所需的实际空间翻倍。因为边对应的 Key 占用的硬盘空间较小,但 Value 占用的空间与属性值的长度和数量成正比,所以,当边的属性值较大或数量较多时候,硬盘空间占用量会比较大。
144146
145147
如果对边进行操作,为了保证两个键值对的最终一致性,可以开启 [TOSS 功能](../../5.configurations-and-logs/1.configurations/3.graph-config.md),开启后,会先在正向边所在的分片进行操作,然后在反向边所在分片进行操作,最后返回结果。
146-
148+
-->
147149
### 分片算法
148150

149151
分片策略采用**静态 Hash **的方式,即对点 VID 进行取模操作,同一个点的所有 Tag、出边和入边信息都会存储到同一个分片,这种方式极大地提升了查询效率。
@@ -266,10 +268,12 @@ Storage 服务基于 Raft 协议实现的分布式架构,与 HDFS 的分布式
266268

267269
总而言之,Storage 服务更加轻量级,精简了一些功能,架构没有 HDFS 复杂,可以有效提高小块存储的读写性能。
268270

271+
<!--
269272
## 视频
270273
271274
用户也可以通过视频全方位了解 Nebula Graph 的存储设计。
272275
273276
- [nMeetup·上海 | Storage in Nebula Graph 2.0](https://www.bilibili.com/video/BV16b4y1Q77k)(24 分 29 秒)
274277
275278
<iframe src="//player.bilibili.com/player.html?aid=629800372&bvid=BV16b4y1Q77k&cid=317031300&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" width="720px" height="480px"> </iframe>
279+
-->

docs-2.0/1.introduction/3.vid.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
## VID 使用建议
2424

25-
- Nebula Graph 1.x 只支持 VID 类型为`INT64`,2.x 支持`INT64``FIXED_STRING(<N>)`。在`CREATE SPACE`中通过参数`vid_type`可以指定 VID 类型。
25+
- Nebula Graph 1.x 只支持 VID 类型为`INT64`2.x 开始支持`INT64``FIXED_STRING(<N>)`。在`CREATE SPACE`中通过参数`vid_type`可以指定 VID 类型。
2626

2727
- 可以使用`id()`函数,指定或引用该点的 VID;
2828

docs-2.0/14.client/1.nebula-client.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Nebula Graph 提供多种类型客户端,便于用户连接、管理 Nebula Gr
1414

1515
!!! note
1616

17-
除 Nebula Java 之外,其他客户端暂不支持线程安全(thread-safe)。
17+
客户端暂不支持线程安全(thread-safe)。

docs-2.0/14.client/3.nebula-cpp-client.md

+7-23
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
|Nebula Graph 版本|Nebula CPP 版本|
1414
|:---|:---|
1515
|{{ nebula.release }}|{{cpp.release}}|
16-
|2.0.1|2.0.0|
17-
|2.0.0|2.0.0|
16+
|2.6.x|2.5.0|
17+
|2.5.x|2.5.0|
18+
|2.0.x|2.0.0|
1819

1920
## 安装 Nebula CPP
2021

@@ -23,7 +24,7 @@
2324
- (推荐)如果需要安装指定版本的 Nebula CPP,请使用选项`--branch`指定分支。例如安装 v{{ cpp.release }}发布版本,请执行如下命令:
2425

2526
```bash
26-
$ git clone --branch v{{ cpp.release }} https://github.com/vesoft-inc/nebula-cpp.git
27+
$ git clone --branch {{cpp.branch}} https://github.com/vesoft-inc/nebula-cpp.git
2728
```
2829

2930
- 如果需要安装日常开发版本,请执行如下命令下载`master`分支的源码:
@@ -82,7 +83,7 @@
8283

8384
将 CPP 文件编译为可执行文件即可。接下来以`SessionExample.cpp`为例,介绍如何操作。
8485

85-
1. 使用[示例代码](https://github.com/vesoft-inc/nebula-cpp/blob/master/examples/SessionExample.cpp)创建`SessionExample.cpp`文件。
86+
1. 使用[示例代码](https://github.com/vesoft-inc/nebula-cpp/blob/{{cpp.branch}}/examples/SessionExample.cpp)创建`SessionExample.cpp`文件。
8687

8788
2. 编译文件,命令如下:
8889

@@ -102,22 +103,5 @@
102103

103104
### 核心代码
104105

105-
详细示例请参见 [SessionExample](https://github.com/vesoft-inc/nebula-cpp/blob/master/examples/SessionExample.cpp)。
106-
107-
```C++
108-
nebula::init(&argc, &argv);
109-
auto address = "192.168.xx.1:9669";
110-
nebula::ConnectionPool pool;
111-
pool.init({address}, nebula::Config{});
112-
auto session = pool.getSession("root", "nebula");
113-
114-
auto result = session.execute("SHOW HOSTS");
115-
std::cout << *result.data;
116-
117-
std::atomic_bool complete{false};
118-
session.asyncExecute("SHOW HOSTS", [&complete](nebula::ExecutionResponse&& cbResult) {
119-
std::cout << *cbResult.data;
120-
complete.store(true);
121-
});
122-
session.release();
123-
```
106+
详细示例请参见 [SessionExample](https://github.com/vesoft-inc/nebula-cpp/blob/{{cpp.branch}}/examples/SessionExample.cpp)。
107+

docs-2.0/14.client/4.nebula-java-client.md

+7-51
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
|Nebula Graph 版本|Nebula Java 版本|
1212
|:---|:---|
1313
|{{ nebula.release }}|{{java.release}}|
14-
|2.0.1|2.0.0|
15-
|2.0.0|2.0.0|
14+
|2.6.x|2.6.1|
15+
|2.0.x|2.0.0|
1616
|2.0.0-rc1|2.0.0-rc1|
1717

1818
## 下载 Nebula Java
1919

2020
- (推荐)如果需要使用指定版本的 Nebula Java,请使用选项`--branch`指定分支。例如使用 v{{ java.release }}发布版本,请执行如下命令:
2121

2222
```bash
23-
$ git clone --branch v{{ java.release }} https://github.com/vesoft-inc/nebula-java.git
23+
$ git clone --branch {{java.branch}} https://github.com/vesoft-inc/nebula-java.git
2424
```
2525

2626
- 如果需要安装日常开发版本,请执行如下命令下载`master`分支的源码:
@@ -39,13 +39,13 @@
3939

4040
!!! note
4141

42-
`2.0.0-SNAPSHOT`为日常研发版本,可能存在未知问题,建议使用 release 版本号替换`2.0.0-SNAPSHOT`。
42+
`3.0.0-SNAPSHOT`为日常研发版本,可能存在未知问题,建议使用 release 版本号替换`3.0.0-SNAPSHOT`。
4343

4444
```bash
4545
<dependency>
4646
<groupId>com.vesoft</groupId>
4747
<artifactId>client</artifactId>
48-
<version>2.0.0-SNAPSHOT</version>
48+
<version>3.0.0-SNAPSHOT</version>
4949
</dependency>
5050
```
5151

@@ -64,49 +64,5 @@
6464

6565
### 核心代码
6666

67-
详细示例请参见 [GraphClientExample](https://github.com/vesoft-inc/nebula-java/blob/master/examples/src/main/java/com/vesoft/nebula/examples/GraphClientExample.java)
68-
69-
```java
70-
NebulaPool pool = new NebulaPool();
71-
Session session = null;
72-
try {
73-
NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig();
74-
nebulaPoolConfig.setMaxConnSize(100);
75-
List<HostAddress> addresses = Arrays.asList(new HostAddress("192.168.xx.1", 9669),
76-
new HostAddress("192.168.xx.2", 9670));
77-
pool.init(addresses, nebulaPoolConfig);
78-
session = pool.getSession("root", "nebula", false);
79-
80-
//create space
81-
String space = "test";
82-
String createSpace = "CREATE SPACE IF NOT EXISTS " + space + " (partition_num=15, replica_factor=1, vid_type=fixed_string(30)); ";
83-
ResultSet resp = session.execute(createSpace);
84-
85-
//create schema
86-
String createSchema = "USE " + space + "; CREATE TAG IF NOT EXISTS person(name string, age int);"
87-
+ "CREATE EDGE IF NOT EXISTS like(likeness double)";
88-
ResultSet resp = session.execute(createSchema);
89-
90-
//insert vertex
91-
String insertVertexes = "INSERT VERTEX person(name, age) VALUES " + "'Bob':('Bob', 10), "
92-
+ "'Lily':('Lily', 9), " + "'Tom':('Tom', 10), " + "'Jerry':('Jerry', 13), "
93-
+ "'John':('John', 11);";
94-
ResultSet resp = session.execute(insertVertexes);
95-
96-
// inert edge
97-
String insertEdges = "INSERT EDGE like(likeness) VALUES " + "'Bob'->'Lily':(80.0), "
98-
+ "'Bob'->'Tom':(70.0), " + "'Lily'->'Jerry':(84.0), " + "'Tom'->'Jerry':(68.3), "
99-
+ "'Bob'->'John':(97.2);";
100-
ResultSet resp = session.execute(insertEdges);
101-
102-
// query
103-
String query = "GO FROM \"Bob\" OVER like " + "YIELD properties($$).name, properties($$).age, properties(edge).likeness";
104-
ResultSet resp = session.execute(query);
105-
printResult(resp);
106-
}finally {
107-
if (session != null) {
108-
session.release();
109-
}
110-
pool.close();
111-
}
112-
```
67+
详细示例请参见 [GraphClientExample](https://github.com/vesoft-inc/nebula-java/blob/{{java.branch}}/examples/src/main/java/com/vesoft/nebula/examples/GraphClientExample.java)
68+

docs-2.0/14.client/5.nebula-python-client.md

+6-67
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44

55
## 前提条件
66

7-
已安装 Python,版本为 3.5 及以上。
7+
已安装 Python,版本为 3.6 及以上。
88

99
## 版本对照表
1010

1111
|Nebula Graph 版本|Nebula Python 版本|
1212
|:---|:---|
1313
|{{ nebula.release }}|{{python.release}}|
14-
|2.0.1|2.0.0|
15-
|2.0.0|2.0.0|
14+
|2.6.x|2.6.0|
15+
|2.0.x|2.0.0|
1616
|2.0.0-rc1|2.0.0rc1|
1717

1818
## 安装 Nebula Python
1919

2020
### pip 安装
2121

2222
```bash
23-
$ pip install nebula2-python==<version>
23+
$ pip install nebula3-python==<version>
2424
```
2525

2626
### 克隆源码安装
@@ -30,7 +30,7 @@ $ pip install nebula2-python==<version>
3030
- (推荐)如果需要安装指定版本的 Nebula Python,请使用选项`--branch`指定分支。例如安装 v{{ python.release }}发布版本,请执行如下命令:
3131

3232
```bash
33-
$ git clone --branch v{{ python.release }} https://github.com/vesoft-inc/nebula-python.git
33+
$ git clone --branch {{python.branch}} https://github.com/vesoft-inc/nebula-python.git
3434
```
3535

3636
- 如果需要安装日常开发版本,请执行如下命令下载`master`分支的源码:
@@ -53,66 +53,5 @@ $ pip install nebula2-python==<version>
5353

5454
## 核心代码
5555

56-
详细示例请参见 [Example](https://github.com/vesoft-inc/nebula-python/tree/master/example)。
56+
详细示例请参见 [Example](https://github.com/vesoft-inc/nebula-python/tree/{{python.branch}}/example)。
5757

58-
### 连接 Graph 服务
59-
60-
```python
61-
# 定义配置
62-
config = Config()
63-
config.max_connection_pool_size = 10
64-
# 初始化连接池
65-
connection_pool = ConnectionPool()
66-
# 如果给定的服务器正常,则返回 true,否则返回 false。
67-
ok = connection_pool.init([('192.168.xx.1', 9669)], config)
68-
69-
# 方法 1:控制连接自行释放。
70-
# 从连接池中获取会话
71-
session = connection_pool.get_session('root', 'nebula')
72-
73-
# 选择图空间
74-
session.execute('USE basketballplayer')
75-
76-
# 执行查看 TAG 命令
77-
result = session.execute('SHOW TAGS')
78-
print(result)
79-
80-
# 释放会话
81-
session.release()
82-
83-
# 方法 2:使用 session_context,会话将被自动释放。
84-
with connection_pool.session_context('root', 'nebula') as session:
85-
session.execute('USE basketballplayer;')
86-
result = session.execute('SHOW TAGS;')
87-
print(result)
88-
89-
# 关闭连接池
90-
connection_pool.close()
91-
```
92-
93-
### 连接 Storage 服务
94-
95-
```python
96-
# 设置所有 Meta 服务地址
97-
meta_cache = MetaCache([('192.168.xx.1', 9559),
98-
('192.168.xx.2', 9559),
99-
('192.168.xx.3', 9559)],
100-
50000)
101-
graph_storage_client = GraphStorageClient(meta_cache)
102-
103-
resp = graph_storage_client.scan_vertex(
104-
space_name='ScanSpace',
105-
tag_name='person')
106-
while resp.has_next():
107-
result = resp.next()
108-
for vertex_data in result:
109-
print(vertex_data)
110-
111-
resp = graph_storage_client.scan_edge(
112-
space_name='ScanSpace',
113-
edge_name='friend')
114-
while resp.has_next():
115-
result = resp.next()
116-
for edge_data in result:
117-
print(edge_data)
118-
```

0 commit comments

Comments
 (0)