fix(server): 'serverStarted' error when execute gremlin example (#2473)

This commit is contained in:
V_Galaxy 2024-03-05 15:21:42 +08:00 committed by GitHub
parent 6861ed5e94
commit eb6570c992
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -15,16 +15,15 @@
* limitations 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.hugegraph.masterelection.GlobalMasterInfo
import org.apache.tinkerpop.gremlin.structure.T
RegisterUtil.registerRocksDB()
conf = "conf/graphs/hugegraph.properties"
graph = HugeFactory.open(conf)
graph.serverStarted(IdGenerator.of("server-tinkerpop"), NodeRole.MASTER)
graph.serverStarted(GlobalMasterInfo.master("server-tinkerpop"))
schema = graph.schema()
schema.propertyKey("name").asText().ifNotExist().create()