jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1138619 - in /incubator/jena: Experimental/TxTDB/trunk/src-dev/setup/ Experimental/TxTDB/trunk/src-dev/tx/ Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/ Jena2/ARQ/trunk/src-dev/dev/
Date Wed, 22 Jun 2011 20:28:04 GMT
Author: andy
Date: Wed Jun 22 20:28:04 2011
New Revision: 1138619

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

Modified:
    incubator/jena/Experimental/TxTDB/trunk/src-dev/setup/DatasetBuilderStd.java
    incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java
    incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/ObjectFileTrans.java
    incubator/jena/Jena2/ARQ/trunk/src-dev/dev/DevARQ.java
    incubator/jena/Jena2/ARQ/trunk/src-dev/dev/RunARQ.java

Modified: incubator/jena/Experimental/TxTDB/trunk/src-dev/setup/DatasetBuilderStd.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src-dev/setup/DatasetBuilderStd.java?rev=1138619&r1=1138618&r2=1138619&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/setup/DatasetBuilderStd.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/setup/DatasetBuilderStd.java Wed Jun 22
20:28:04 2011
@@ -390,8 +390,8 @@ public class DatasetBuilderStd implement
     
     public static class RangeIndexBuilderStd implements RangeIndexBuilder
     {
-        private BlockMgrBuilder bMgrNodes ;
-        private BlockMgrBuilder bMgrRecords ;
+        protected final BlockMgrBuilder bMgrNodes ;
+        protected final BlockMgrBuilder bMgrRecords ;
         public RangeIndexBuilderStd( BlockMgrBuilder blockMgrBuilderNodes,
                                      BlockMgrBuilder blockMgrBuilderRecords)
         {

Modified: incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java?rev=1138619&r1=1138618&r2=1138619&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java Wed Jun 22 20:28:04 2011
@@ -2,6 +2,8 @@ package tx;
 
 public class DevTx
 {
+    // DSg.add(Quad(tripleInQuad, triple)) does not affect default graph.
+    
     // Transaction needs to do FileRef to file. 
     // Every sync hits the NodeTupleTable sync the node table repeatedly - keep dirty flag?

     

Modified: incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java?rev=1138619&r1=1138618&r2=1138619&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java Wed Jun 22 20:28:04 2011
@@ -6,24 +6,11 @@
 
 package tx;
 
-import static com.hp.hpl.jena.tdb.base.record.RecordLib.intToRecord ;
-import static com.hp.hpl.jena.tdb.index.IndexTestLib.testInsert ;
-import static org.openjena.atlas.test.Gen.strings ;
-
-import java.nio.ByteBuffer ;
-import java.util.Iterator ;
-
-import org.junit.Test ;
 import org.openjena.atlas.lib.Bytes ;
 import org.openjena.atlas.lib.FileOps ;
-import org.openjena.atlas.lib.Pair ;
-import org.openjena.atlas.lib.StrUtils ;
 import org.openjena.atlas.logging.Log ;
-import org.openjena.atlas.test.Gen ;
-import org.slf4j.Logger ;
-import org.slf4j.LoggerFactory ;
-import tx.base.FileRef ;
 
+import com.hp.hpl.jena.graph.Triple ;
 import com.hp.hpl.jena.query.DatasetFactory ;
 import com.hp.hpl.jena.query.Query ;
 import com.hp.hpl.jena.query.QueryExecution ;
@@ -33,33 +20,16 @@ import com.hp.hpl.jena.query.Syntax ;
 import com.hp.hpl.jena.rdf.model.Model ;
 import com.hp.hpl.jena.rdf.model.ModelFactory ;
 import com.hp.hpl.jena.sparql.core.DatasetGraph ;
+import com.hp.hpl.jena.sparql.core.Quad ;
+import com.hp.hpl.jena.sparql.sse.SSE ;
 import com.hp.hpl.jena.sparql.util.QueryExecUtils ;
-import com.hp.hpl.jena.tdb.TDB ;
 import com.hp.hpl.jena.tdb.TDBFactory ;
-import com.hp.hpl.jena.tdb.TDBLoader ;
-import com.hp.hpl.jena.tdb.base.block.BlockMgr ;
-import com.hp.hpl.jena.tdb.base.block.BlockMgrFactory ;
-import com.hp.hpl.jena.tdb.base.block.BlockMgrLogger ;
-import com.hp.hpl.jena.tdb.base.block.BlockMgrTracker ;
 import com.hp.hpl.jena.tdb.base.block.FileMode ;
-import com.hp.hpl.jena.tdb.base.file.Location ;
-import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile ;
 import com.hp.hpl.jena.tdb.base.record.Record ;
 import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
-import com.hp.hpl.jena.tdb.base.record.RecordLib ;
-import com.hp.hpl.jena.tdb.base.recordbuffer.RecordBufferPage ;
-import com.hp.hpl.jena.tdb.index.IndexTestLib ;
-import com.hp.hpl.jena.tdb.index.RangeIndex ;
-import com.hp.hpl.jena.tdb.index.bplustree.BPTreeNode ;
-import com.hp.hpl.jena.tdb.index.bplustree.BPlusTree ;
-import com.hp.hpl.jena.tdb.index.bplustree.BPlusTreeParams ;
 import com.hp.hpl.jena.tdb.store.DatasetGraphTDB ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
-import com.hp.hpl.jena.tdb.transaction.DatasetBuilderTxn ;
 import com.hp.hpl.jena.tdb.transaction.DatasetGraphTxnTDB ;
-import com.hp.hpl.jena.tdb.transaction.Journal ;
-import com.hp.hpl.jena.tdb.transaction.JournalEntry ;
-import com.hp.hpl.jena.tdb.transaction.JournalEntryType ;
 import com.hp.hpl.jena.tdb.transaction.TransactionManager ;
 import com.hp.hpl.jena.update.UpdateAction ;
 import com.hp.hpl.jena.update.UpdateFactory ;
@@ -88,27 +58,29 @@ public class TxMain
     
     public static void main(String... args)
     {
-        SystemTDB.setFileMode(FileMode.direct) ;
-        DatasetGraphTDB dsg0 = build() ;
-        
-        //If direct , this is needed - why?  Did it ever work?
-        // dsg0.sync() ;
+        if ( false ) SystemTDB.setFileMode(FileMode.direct) ;
         
-        //load("D.ttl", dsg0) ;
+        initFS() ;
+        DatasetGraphTDB dsg0 = build() ;
+        load("D.ttl", dsg0) ;
         query("SELECT (Count(*) AS ?c) { ?s ?p ?o }", dsg0) ;
+        
+
         //query("SELECT * { ?s ?p ?o }", dsg0) ;
-        exit(0) ;
+        //exit(0) ;
         System.out.println("Txn") ;
         DatasetGraphTxnTDB dsg = buildTx(dsg0) ;
         load("D1.ttl", dsg) ;
+        Triple t = SSE.parseTriple("( <http://example/z1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://example/foo>)") ;
+        dsg.delete(new Quad(Quad.defaultGraphNodeGenerated, t)) ;
+        
         
         //dsg.commit() ;
         System.out.println("Query 1") ;
-        //query("SELECT * { ?s ?p ?o }", dsg) ;
-        query("SELECT (Count(*) AS ?c) { ?s ?p ?o }", dsg) ;
+        query("SELECT * { ?s ?p ?o }", dsg) ;
+        //query("SELECT (Count(*) AS ?c) { ?s ?p ?o }", dsg) ;
         System.out.println("Query 2") ;
         query("SELECT * { ?s ?p ?o }", dsg0) ;
-        
         exit(0) ;
         
         //query("SELECT * { ?s ?p ?o }", dsg0) ;
@@ -125,10 +97,14 @@ public class TxMain
         exit(0) ;
     }
     
-    private static DatasetGraphTDB build()
+    private static void initFS()
     {
         FileOps.ensureDir(DBdir) ;
         FileOps.clearDirectory(DBdir) ;
+    }
+    
+    private static DatasetGraphTDB build()
+    {
         DatasetGraphTDB dsg = TDBFactory.createDatasetGraph(DBdir) ;
         return dsg ;
     }

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java?rev=1138619&r1=1138618&r2=1138619&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java
(original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java
Wed Jun 22 20:28:04 2011
@@ -114,8 +114,7 @@ public class BlockMgrJournal implements 
     @Override
     public Block getReadIterator(long id)
     {
-        logState() ;
-        
+        //logState() ;
         checkIfClosed() ;
         Block block = localBlock(id) ;
         if ( block == null )

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java?rev=1138619&r1=1138618&r2=1138619&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
(original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
Wed Jun 22 20:28:04 2011
@@ -40,7 +40,7 @@ public class DatasetBuilderTxn extends D
     public DatasetBuilderTxn(TransactionManager txnMgr) { setStd() ; this.txnMgr = txnMgr
; }
     
     // ---- Add tracking
-    static BlockMgrBuilder track(BlockMgrBuilder other) { return new BlockMgrBuilderLogger(other)
; }
+    static BlockMgrBuilder logging(BlockMgrBuilder other) { return new BlockMgrBuilderLogger(other)
; }
     
     static class BlockMgrBuilderLogger implements BlockMgrBuilder
     {
@@ -68,22 +68,25 @@ public class DatasetBuilderTxn extends D
 
         // Add track(...) to log.
         IndexBuilder indexBuilder = new IndexBuilderStd(blockMgrBuilder, blockMgrBuilder)
;
-        
-        RangeIndexBuilder rangeIndexBuilder = new RangeIndexBuilderStd(blockMgrBuilder, track(blockMgrBuilder))
;
-        //RangeIndexBuilder rangeIndexBuilder = new RangeIndexBuilderStd(blockMgrBuilder,
blockMgrBuilder) ;
+
+        // Add logging to a BlockMgrBuilder (here, just the records par of the B+Tree
+        //RangeIndexBuilder rangeIndexBuilder = new RangeIndexBuilderStd(blockMgrBuilder,
logging(blockMgrBuilder)) ;
+        RangeIndexBuilder rangeIndexBuilder = new RangeIndexBuilderStd(blockMgrBuilder, blockMgrBuilder)
;
 
         NodeTableBuilder nodeTableBuilder = new NodeTableBuilderStd(indexBuilder, objectFileBuilder)
         {
+            // track all Nodetbale operations
             @Override
             public NodeTable buildNodeTable(FileSet fsIndex, FileSet fsObjectFile, int sizeNode2NodeIdCache,
int sizeNodeId2NodeCache)
             {
                 NodeTable nt = super.buildNodeTable(fsIndex, fsObjectFile, sizeNode2NodeIdCache,
sizeNodeId2NodeCache) ;
-                if ( true )
+                if ( false )
                     nt = new NodeTableLogger(fsObjectFile.getBasename(), nt) ;
                 return nt ;
                 
             }
-        } ;
+        } ; 
+        
         TupleIndexBuilder tupleIndexBuilder = new TupleIndexBuilderStd(rangeIndexBuilder)
;
         set(nodeTableBuilder, tupleIndexBuilder, indexBuilder, rangeIndexBuilder, blockMgrBuilder,
objectFileBuilder) ;
     }
@@ -92,7 +95,9 @@ public class DatasetBuilderTxn extends D
     protected DatasetPrefixStorage makePrefixTable(Location location, ConcurrencyPolicy policy)
     {
         DatasetPrefixStorage x = super.makePrefixTable(location, policy) ;
-        x = new DatasetPrefixStorageLogger(x) ;
+        // Logging.
+        if ( false )
+            x = new DatasetPrefixStorageLogger(x) ;
         return x ;
     }
 
@@ -139,7 +144,7 @@ public class DatasetBuilderTxn extends D
             ObjectFileTrans objFileTrans = new ObjectFileTrans(txn, main, backing) ;
             txn.add(objFileTrans) ;
             ObjectFile objFile = objFileTrans ;
-            if ( true )
+            if ( false )
             {
                 String fn = FileOps.basename(fileSet.filename(ext)) ;
                 objFile = new ObjectFileLogger(fn, objFile) ;

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/ObjectFileTrans.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/ObjectFileTrans.java?rev=1138619&r1=1138618&r2=1138619&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/ObjectFileTrans.java
(original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/ObjectFileTrans.java
Wed Jun 22 20:28:04 2011
@@ -37,8 +37,7 @@ public class ObjectFileTrans implements 
 
         //  [TxTDB:PATCH-UP] Begin is not being called.
         this.otherAllocOffset = base.length() ;
-        
-        Log.info(this, getLabel()+": otherAllocOffset = "+otherAllocOffset) ;
+        //Log.info(this, getLabel()+": otherAllocOffset = "+otherAllocOffset) ;
     }
 
     // Begin read ==> passthrough.
@@ -106,7 +105,7 @@ public class ObjectFileTrans implements 
             return ;
         }
         
-        Log.warn(this, "Attempt to reposition over base file") ;
+        Log.warn(this, "Unexpected: Attempt to reposition over base file") ;
         base.reposition(id) ;
         other.reposition(0) ;
         otherAllocOffset = base.length() ;

Modified: incubator/jena/Jena2/ARQ/trunk/src-dev/dev/DevARQ.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src-dev/dev/DevARQ.java?rev=1138619&r1=1138618&r2=1138619&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src-dev/dev/DevARQ.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src-dev/dev/DevARQ.java Wed Jun 22 20:28:04 2011
@@ -2,6 +2,8 @@ package dev ;
 
 public class DevARQ
 {
+    // QueryEngineHTTP - content negotiation, Apache httpClient.
+    
     // Langbase - calls EventManager.send... but Turtle rpefixes done after (read is not
finished)
     //   JenaReaderRIOT to do the event? 
     // One token call to Tokenizer.parse -- Replace SSE.parseNode stuff.

Modified: incubator/jena/Jena2/ARQ/trunk/src-dev/dev/RunARQ.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src-dev/dev/RunARQ.java?rev=1138619&r1=1138618&r2=1138619&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src-dev/dev/RunARQ.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src-dev/dev/RunARQ.java Wed Jun 22 20:28:04 2011
@@ -67,6 +67,7 @@ import com.hp.hpl.jena.sparql.core.Datas
 import com.hp.hpl.jena.sparql.core.DatasetGraphFactory ;
 import com.hp.hpl.jena.sparql.engine.ExecutionContext ;
 import com.hp.hpl.jena.sparql.engine.QueryExecutionBase ;
+import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP ;
 import com.hp.hpl.jena.sparql.engine.main.JoinClassifier ;
 import com.hp.hpl.jena.sparql.expr.Expr ;
 import com.hp.hpl.jena.sparql.expr.ExprEvalException ;
@@ -126,6 +127,18 @@ public class RunARQ
     
     public static void main(String[] argv) throws Exception
     {
+     
+        {
+            Query query = QueryFactory.create("SELECT (count(*) AS ?C) { { SELECT ?s { ?s
?p ?o } LIMIT 100000000} }") ;
+            QueryEngineHTTP qExec = QueryExecutionFactory.createServiceRequest("http://dbpedia.org/sparql",
query) ;
+            qExec.addParam("timeout", "10000") ;
+            ResultSetFormatter.out(qExec.execSelect()) ;
+            exit(0) ;
+            
+            
+        }
+        
+        
         
         riotcmd.infer.main("--rdfs=D.ttl", "D.ttl") ;
         exit(0) ;



Mime
View raw message