liuxiaocs7 commented on code in PR #2231:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2231#discussion_r1225391960


##########
hugegraph-dist/src/assembly/static/scripts/example.groovy:
##########
@@ -15,53 +15,55 @@
  * under the License.
  */
 import org.apache.hugegraph.HugeFactory
+import org.apache.hugegraph.backend.id.IdGenerator
 import org.apache.hugegraph.dist.RegisterUtil
+import org.apache.hugegraph.type.define.NodeRole
 import org.apache.tinkerpop.gremlin.structure.T
 
-RegisterUtil.registerCassandra();
-RegisterUtil.registerScyllaDB();
+RegisterUtil.registerRocksDB()
 
-conf = "conf/hugegraph.properties"
-graph = HugeFactory.open(conf);
-schema = graph.schema();
+conf = "conf/graphs/hugegraph.properties"
+graph = HugeFactory.open(conf)
+graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)
+schema = graph.schema()
 
-schema.propertyKey("name").asText().ifNotExist().create();
-schema.propertyKey("age").asInt().ifNotExist().create();
-schema.propertyKey("city").asText().ifNotExist().create();
-schema.propertyKey("weight").asDouble().ifNotExist().create();
-schema.propertyKey("lang").asText().ifNotExist().create();
-schema.propertyKey("date").asText().ifNotExist().create();
-schema.propertyKey("price").asInt().ifNotExist().create();
+schema.propertyKey("name").asText().ifNotExist().create()
+schema.propertyKey("age").asInt().ifNotExist().create()
+schema.propertyKey("city").asText().ifNotExist().create()
+schema.propertyKey("weight").asDouble().ifNotExist().create()
+schema.propertyKey("lang").asText().ifNotExist().create()
+schema.propertyKey("date").asText().ifNotExist().create()
+schema.propertyKey("price").asInt().ifNotExist().create()
 
-schema.vertexLabel("person").properties("name", "age", 
"city").primaryKeys("name").ifNotExist().create();
-schema.vertexLabel("software").properties("name", "lang", 
"price").primaryKeys("name").ifNotExist().create();
-schema.indexLabel("personByName").onV("person").by("name").secondary().ifNotExist().create();
-schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create();
-schema.indexLabel("personByAgeAndCity").onV("person").by("age", 
"city").secondary().ifNotExist().create();
-schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create();
-schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date",
 "weight").ifNotExist().create();
-schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date",
 "weight").ifNotExist().create();
-schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create();
-schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create();
-schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create();
+schema.vertexLabel("person").properties("name", "age", 
"city").primaryKeys("name").ifNotExist().create()
+schema.vertexLabel("software").properties("name", "lang", 
"price").primaryKeys("name").ifNotExist().create()
+// 
schema.indexLabel("personByName").onV("person").by("name").secondary().ifNotExist().create()

Review Comment:
   This line seems to be a wrong usage and can be deleted directly so as not to 
cause misleading?



-- 
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]

Reply via email to