Skip to content
Permalink
Browse files
Upgrade doc for version 0.10 (#38)
Change-Id: Icf41ff970ffa119da63816bb2ea0888b13619c6a
  • Loading branch information
Linary authored and javeme committed Oct 17, 2019
1 parent 893f67b commit 3221913251db260fbe0ba86be2eee38b94071f6c
Showing 6 changed files with 404 additions and 289 deletions.
@@ -188,7 +188,7 @@ userdata(String key, Object value) | The same key, the latter will cover the for
```java
// 使用 Automatic 的 Id 策略
schema.vertexLabel("person").properties("name", "age").ifNotExist().create();
schema.vertexLabel("person").useAutomaticId().properties("name", "age").primaryKeys("name").ifNotExist().create();
schema.vertexLabel("person").useAutomaticId().properties("name", "age").ifNotExist().create();
// 使用 Customize_String 的 Id 策略
schema.vertexLabel("person").useCustomizeStringId().properties("name", "age").ifNotExist().create();
@@ -274,10 +274,10 @@ GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:josh"&direct

**分页查询所有边,获取第一页(page不带参数值),限定3条**

##### Url
##### Method & Url

```
http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
```

##### Response Status
@@ -445,4 +445,4 @@ DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop

```json
204
```
```
@@ -18,20 +18,36 @@ HugeGraphServer 内部集成了 GremlinServer 和 RestServer,而 gremlin-serve
gremlin-server.yaml 文件默认的内容如下:

```yaml
# host and port of gremlin server
#host: 127.0.0.1
#port: 8182
# timeout in ms of gremlin query
scriptEvaluationTimeout: 30000
# If you want to start gremlin-server for gremlin-console(web-socket),
# please change `HttpChannelizer` to `WebSocketChannelizer` or comment this line.
channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
graphs: {
hugegraph: conf/hugegraph.properties
}
plugins:
- com.baidu.hugegraph
scriptEngines: {
gremlin-groovy: {
imports: [java.lang.Math],
staticImports: [java.lang.Math.PI],
scripts: [scripts/empty-sample.groovy]
plugins: {
com.baidu.hugegraph.plugin.HugeGraphGremlinPlugin: {},
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {
classImports: [
java.lang.Math,
com.baidu.hugegraph.util.DateUtil,
com.baidu.hugegraph.traversal.optimize.Text
],
methodImports: [java.lang.Math#*]
},
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {
files: [scripts/empty-sample.groovy]
}
}
}
}
serializers:
@@ -40,31 +56,31 @@ serializers:
serializeResultToString: false,
ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry]
}
}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0,
}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1,
config: {
serializeResultToString: true,
serializeResultToString: false,
ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry]
}
}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0,
}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
config: {
serializeResultToString: false,
ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry]
}
}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0,
}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0,
config: {
serializeResultToString: false,
ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry]
}
}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0,
}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0,
config: {
serializeResultToString: false,
ioRegistries: [com.baidu.hugegraph.io.HugeGraphIoRegistry]
}
}
}
metrics: {
consoleReporter: {enabled: false, interval: 180000},
csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
@@ -88,8 +104,10 @@ ssl: {

上面的配置项很多,但目前只需要关注如下几个配置项:channelizer 和 graphs。

- channelizer:GremlinServer 与客户端有两种通信方式,分别是 WebSocket 和 HTTP(默认)。如果选择 WebSocket,用户可以通过 [Gremlin-Console](/clients/gremlin-console.html) 快速体验 HugeGraph 的特性,但是不支持大规模数据导入,推荐使用 HTTP 的通信方式,我们的一些外围组件都是基于 HTTP 实现的;
- graphs:GremlinServer 启动时需要打开的图,该项是一个 map 结构,key 是图的名字,value 是该图的配置文件路径;
- channelizer:GremlinServer 与客户端有两种通信方式,分别是 WebSocket 和 HTTP(默认)。如果选择 WebSocket,
用户可以通过 [Gremlin-Console](/clients/gremlin-console.html) 快速体验 HugeGraph 的特性,但是不支持大规模数据导入,
推荐使用 HTTP 的通信方式,HugeGraph 的外围组件都是基于 HTTP 实现的;

默认GremlinServer是服务在 localhost:8182,如果需要修改,配置 host、port 即可

0 comments on commit 3221913

Please sign in to comment.