From: Jack P. <jac...@gm...> - 2015-04-13 21:50:51
|
Quick review: Create an embedded repo with the code found in the blueprints test case. Essentially, copy that code directly. If there is no journal in the assigned directory, the javadoc tells me it will create one. The test case reads an XML blueprints GML file and paints the vertices and edges properly. But... It does not create the persistent repo. No journal file exists after closing. Next... hand create a journal and drop it in the assigned directory. Now, the system blows somewhere in importing the GML file. But, it did put 10 MB of stuff in the journal. It was suggested that there is a missing "properties" of some kind, specifically telling the system that the Sail must be a file type, not in memory. What follows is a naive attempt to create a system property (which, it turns out, is never read), but in any case, the result is the same. Here is that code, and narrative. File f = new File(DBPATH); System.out.println(f.getAbsolutePath()); System.setProperty(BigdataSail.Options.FILE, f.getAbsolutePath()); final BigdataGraph graph = BigdataGraphFactory.open(DBPATH, true); System.out.println("GRAPH "+graph); GraphMLReader.inputGraph(graph, example); for (Vertex v : graph.getVertices()) { System.err.println(v); } for (Edge e : graph.getEdges()) { System.err.println(e); } graph.shutdown(); I actually create an empty file at DBPATH mygraphjournal.jnl I have to believe that Sail knows about it because it explodes to 10,485,760 bytes But, it was doing that all along. Following the code, we land at BigdataSail openSail(final String file, final boolean create) which, if the file doesn't exist, and create == true, then it creates the same property internally; it's not assuming anything. That starts at BigdataSailFactory line 216 Now, below that starting at line 291: /** * Create a new bigdata instance using the specified options. Since no * journal file is specified this must be an in-memory instance. */ public static BigdataSail createSail(final String file, final Option... args) { But, that code was called from line 223 which is where the file does not exist, and create == true So, let us look at that code through my possibly distorted lens: I call BigdataSail openSail(final String file, final boolean create) { with a file path, for a file which does not yet exist. That code first asks: does the file exist? If not, then it asks is create == false; if so, toss a bitch. Otherwise, call createSail with my file path, But, that code's javadoc says "what the hell, since no journal file, let's make it in-memory". Really? Read the code, it calls createSail(final Properties props, final String file, final Option... args) with empty properties, and ignores the sent in file. How can that work? In any case, back to my situation. My read of the code calls this: BigdataSail openSail(final String file, final boolean create) arrives with a file that does exist, and create == true. So, it takes the else branch, where it creates the necessary property, just as I did, which, really, means it never actually consulted system environment properties after all, and builds a sail. Which means the event I am experiencing lies somewhere else in the flow of things., After all, it did create a sail and it wrote 10 MB of stuff in there. So, it knows what's going on, filewise. That tells me that something else is going on, having much more to do with file loading. So, now, I am hand stepping through in debug mode. I put breakpoints anywhere the code calls the graph (said code being inside the Blueprints graph reader). Always, it ends up in AbstractTripleStore.copyStatements line 3783, where it jumps into TempTripleStore to get a temporary store which it made down in my user data space, followed by jumping into a ThreadPool, and returning a future which, internally, says NotMaterializedException No present clue what's going on. |