Titan BatchLoading berkeleydb不持久 [英] Titan BatchLoading berkeleydb not persistent

查看:133
本文介绍了Titan BatchLoading berkeleydb不持久的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不知道我的问题在哪里。
Im使用Titan 0.5.0(与较新的Titan版本相同)...

i really cant figure out where my problem is. Im using Titan 0.5.0 (It's the same problem with the newer Titan versions...)

我想从中加载一堆顶点和边一个包含100k条目的csv文件(每行导致至少3个节点和一些边)进入我的图形。
大约需要5分钟才能完成导入。

I want to load a bunch of vertices and edges from a csv file with 100k entries (each line results in at least 3 nodes and some edges) into my graph. It's taking about 5 minutes to finally complete the import.

所以我尝试使用配置 storage.batch-loading =是的。
嗯,仅需2分钟即可完成导入,这显着提高了速度。

So i tried the same with the configuration storage.batch-loading = true. Well it's significant faster with only 2 minutes to complete the import.

但是问题是,如果即时通讯打开 storage.batch-loading = true 选项,节点和边不会持久保存到数据库中。因此,如果我关闭Gremlin并重新打开图形,则它是空的。

But the problem is, if im turning on the storage.batch-loading = true option, the nodes and edges are not saved persistent to the database. So if im shutting down Gremlin and reopening my graph, it's empty.

storage.batch-loading 设置为false。是的,我要在导入后提交Batchgraph,还需要提交图形本身。

It's working like a charm with the storage.batch-loading set to false. It takes longer but the entries are saved persistent.

是的。
我缺少什么吗?

Yes, i'm commiting the Batchgraph after the import and also the graph itself. Am I'm missing something?

在此示例中,我只想导入约3万个节点进行测试,但它们也不会永久保存。
配置:

In this example i want to import just about 30k nodes for testing, but they are also not saved persistent. Configuration:

storage.backend=berkeleyje
storage.directory=graph

storage.batch-loading = true

query.fast-property =  true

克里姆林宫脚本:

g = TitanFactory.open("../graphs/batchImportTest2/batchImportTest2.properties")

//1 Prepare Graph for import

m = g.getManagementSystem();
username = m.makePropertyKey('username').dataType(String.class).make()
m.buildIndex('byUsername',Vertex.class).addKey(username).unique().buildCompositeIndex()
email = m.makePropertyKey('email').dataType(String.class).make()
m.buildIndex('byEmail',Vertex.class).addKey(email).unique().buildCompositeIndex()
m.commit()
g.commit()

//2 Import Nodes and Edges

bg = new BatchGraph(g, VertexIDType.STRING, 50000)
new File("userInfo_js.txt").eachLine({ final String line ->def (username,email) = line.split('\t')*.trim();def userVertex = bg.getVertex(username) ?: bg.addVertex(username); userVertex.setProperty("username", username);userVertex.setProperty("email", email)})
bg.commit()
g.commit() 


推荐答案

我试图重现它,但是一切正常。有关我的shell会话的完整记录,请参阅我的Gist,也许您可​​以发现一个不同之处:

I tried to reproduce it, but it all works as expected. See my Gist for a complete record of my shell session, maybe you can spot a difference:

https://gist.github.com/dkuppitz/5319a2fa7f9a8069fa15

这篇关于Titan BatchLoading berkeleydb不持久的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆