jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1137751 - in /incubator/jena/Jena2/TDB/trunk: src-dev/reports/ReportLoadOnSSD.java src/main/java/com/hp/hpl/jena/tdb/base/block/BlockMgrMem.java
Date Mon, 20 Jun 2011 19:20:40 GMT
Author: andy
Date: Mon Jun 20 19:20:40 2011
New Revision: 1137751

URL: http://svn.apache.org/viewvc?rev=1137751&view=rev
Log: (empty)

Added:
    incubator/jena/Jena2/TDB/trunk/src-dev/reports/ReportLoadOnSSD.java   (with props)
Modified:
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/block/BlockMgrMem.java

Added: incubator/jena/Jena2/TDB/trunk/src-dev/reports/ReportLoadOnSSD.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src-dev/reports/ReportLoadOnSSD.java?rev=1137751&view=auto
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src-dev/reports/ReportLoadOnSSD.java (added)
+++ incubator/jena/Jena2/TDB/trunk/src-dev/reports/ReportLoadOnSSD.java Mon Jun 20 19:20:40
2011
@@ -0,0 +1,96 @@
+/*
+ * (c) Copyright 2011 Epimorphics Ltd.
+ * All rights reserved.
+ * [See end of file]
+ */
+
+package reports;
+
+import java.io.BufferedInputStream ;
+import java.io.IOException ;
+import java.io.InputStream ;
+
+import org.openjena.atlas.io.IO ;
+import org.openjena.atlas.lib.FileOps ;
+
+import com.hp.hpl.jena.graph.Node ;
+import com.hp.hpl.jena.graph.Triple ;
+import com.hp.hpl.jena.tdb.TDBFactory ;
+import com.hp.hpl.jena.tdb.store.DatasetGraphTDB ;
+import com.hp.hpl.jena.tdb.store.bulkloader.BulkLoader ;
+import com.hp.hpl.jena.vocabulary.RDF ;
+
+public class ReportLoadOnSSD
+{
+    public static void main(String[] args) throws IOException{
+        /*
+         * The data can be found here
+http://downloads.dbpedia.org/3.6/en/mappingbased_properties_en.nt.bz2
+I appended the ontology to end of file it can be found here
+http://downloads.dbpedia.org/3.6/dbpedia_3.6.owl.bz2
+         */
+
+        /* Also supposed to fail:
+         * http://moustaki.org/resources/jamendo-rdf.tar.gz
+         */
+        
+        //SystemTDB.setFileMode(FileMode.direct) ;
+        
+        String datafile = "/home/afs/Desktop/jamendo-rdf/jamendo.nt" ;
+        DatasetGraphTDB datasetGraph ;
+        
+        if ( false ) {
+            String dir = "DB-X" ;
+            FileOps.clearDirectory(dir) ;
+            datasetGraph = TDBFactory.createDatasetGraph(dir);
+        }
+        else
+            datasetGraph = TDBFactory.createDatasetGraph();
+
+      /* I saw the BulkLoader had two ways of loading data based on whether
+      the dataset existed already. I did two runs one with the following two
+      lines commented out to test both ways the BulkLoader runs. Hopefully
+      this had the desired effect. */
+        
+        if ( false )
+        {
+            datasetGraph.getDefaultGraph().add( new Triple(Node.createURI("urn:hello"),
+                                                           RDF.type.asNode(),
+                                                           Node.createURI("urn:house")));
+            datasetGraph.sync();
+        }
+        InputStream inputStream = IO.openFile(datafile) ;
+        inputStream = new BufferedInputStream(inputStream, 16*1024) ;
+
+        //BulkLoader bulkLoader = new BulkLoader();
+        BulkLoader.loadDataset(datasetGraph, inputStream, true);
+    }
+
+}
+
+/*
+ * (c) Copyright 2011 Epimorphics Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
\ No newline at end of file

Propchange: incubator/jena/Jena2/TDB/trunk/src-dev/reports/ReportLoadOnSSD.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/block/BlockMgrMem.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/block/BlockMgrMem.java?rev=1137751&r1=1137750&r2=1137751&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/block/BlockMgrMem.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/block/BlockMgrMem.java
Mon Jun 20 19:20:40 2011
@@ -35,7 +35,7 @@ public class BlockMgrMem extends BlockMg
     private static ByteBuffer FreeBlock = ByteBuffer.allocate(0) ;      // Marker
 
     // This controls whether blocks are copied in and out
-    public static boolean SafeMode = true ;
+    public static boolean SafeMode = false ;
     private final boolean safeModeThisMgr ;                            
     
     // Create via the BlockMgrFactory.



Mime
View raw message