[Blueprints] Consistent creation of graph

45 views
Skip to first unread message

Pierre De Wilde

unread,
Jul 31, 2011, 1:27:05 AM7/31/11
to gremli...@googlegroups.com
Hi,

The creation of graph is not consistent across Blueprints implementations:

Neo4jGraph() create directories and graph file
OrientGraph() create directories and graph file
TinkerGraph() create graph file at shutdown() time
DexGraph() create graph file

When trying to create a TinkerGraph() in an inexistent directory:

gremlin> g = new TinkerGraph('../data/tg/tinkergraph')         
==>tinkergraph[vertices:0 edges:0]
gremlin> g.loadGraphML('data/graph-example-1.xml')          
==>null
gremlin> g.shutdown()                                       
../data/tg/tinkergraph/tinkergraph.dat (No such file or directory)

Data is lost...
For consistency, directories and graph file should be created within the constructor,
not  at shutdown() time.

When trying to create a DexGraph() in an inexistent directory:

gremlin> g = new DexGraph('../data/dex/tinkergraph')  
[DEX: 3] Cannot open file

For consistency, directories and graph file should be created.

Thanks,
Pierre






Joshua Shinavier

unread,
Jul 31, 2011, 2:59:06 AM7/31/11
to gremli...@googlegroups.com
+1 to always creating the graph directory if it doesn't exist.
However, I'm not sure it's necessary to create all files at
construction time. Persistent graph DBs may write data to disk from
startup time up to and including shutdown time, and files (e.g. index
files, string tables, etc.) may be created or deleted at any point
along the way. So I don't think TinkerGraph should have to create a
(possibly empty) data file at construction time. Perhaps creating the
graph directory and checking that it is writable, at shudown time,
would be reasonable?

Josh

Joshua Shinavier

unread,
Jul 31, 2011, 3:00:21 AM7/31/11
to gremli...@googlegroups.com
On Sun, Jul 31, 2011 at 2:59 PM, Joshua Shinavier <jo...@fortytwo.net> wrote:
[...]

> (possibly empty) data file at construction time. Perhaps creating the
> graph directory and checking that it is writable, at shudown time,
> would be reasonable?

Construction time, that is.

Thanks.

Josh

Pierre De Wilde

unread,
Jul 31, 2011, 3:06:39 AM7/31/11
to gremli...@googlegroups.com
Yep, that's what I mean: create TinkerGraph directory and check if writeable at construction time.

Pierre
Reply all
Reply to author
Forward
0 new messages