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.
+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?
<pierredewi...@gmail.com> wrote: > 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
On Sun, Jul 31, 2011 at 2:59 PM, Joshua Shinavier <j...@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?
> On Sun, Jul 31, 2011 at 1:27 PM, Pierre De Wilde > <pierredewi...@gmail.com> wrote: >> 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
> On Sun, Jul 31, 2011 at 2:59 PM, Joshua Shinavier <j...@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
>> Josh
>> On Sun, Jul 31, 2011 at 1:27 PM, Pierre De Wilde >> <pierredewi...@gmail.com> wrote: >>> 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