You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/06/23 16:22:39 UTC

svn commit: r1138893 - in /incubator/jena: Experimental/TxTDB/trunk/src-dev/tx/ Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/ Jena2/ARQ/trunk/src-dev/dev/ Scratch/AFS/trunk/ Scratch/AFS/trunk/src-dev/dev/ Scratch/AFS/trunk/src...

Author: andy
Date: Thu Jun 23 14:22:39 2011
New Revision: 1138893

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

Added:
    incubator/jena/Scratch/AFS/trunk/src/riot/io/section/
    incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenInputSection.java   (contents, props changed)
      - copied, changed from r1137534, incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputSection.java
    incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenOutputSection.java   (contents, props changed)
      - copied, changed from r1137534, incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputSection.java
Removed:
    incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputSection.java
    incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputSection.java
Modified:
    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/TransactionManager.java
    incubator/jena/Jena2/ARQ/trunk/src-dev/dev/DevARQ.java
    incubator/jena/Scratch/AFS/trunk/.classpath
    incubator/jena/Scratch/AFS/trunk/src-dev/dev/SizeIndexes.java
    incubator/jena/Scratch/AFS/trunk/src-lib/structure/radix/RadixTree.java

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=1138893&r1=1138892&r2=1138893&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java Thu Jun 23 14:22:39 2011
@@ -2,7 +2,12 @@ package tx;
 
 public class DevTx
 {
-    // DSg.add(Quad(tripleInQuad, triple)) does not affect default graph.
+    // DSG.add(Quad(tripleInQuad, triple)) does not affect default graph.
+    
+    // DatasetGraphTxnTDB to graph the NodeTable and it's caches from the dsg wrapped.
+    //   Do this in general to reuse caches - don't build on files.
+    //   Standard DSG builder to collect of BlockMgrs and all ObjectsFiles together
+    //   Txn builder reuses.  Can we do this by taking apart a DSG?
     
     // 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=1138893&r1=1138892&r2=1138893&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java Thu Jun 23 14:22:39 2011
@@ -20,6 +20,7 @@ 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.DatasetPrefixStorage ;
 import com.hp.hpl.jena.sparql.core.Quad ;
 import com.hp.hpl.jena.sparql.sse.SSE ;
 import com.hp.hpl.jena.sparql.util.QueryExecUtils ;
@@ -27,7 +28,11 @@ import com.hp.hpl.jena.tdb.TDBFactory ;
 import com.hp.hpl.jena.tdb.base.block.FileMode ;
 import com.hp.hpl.jena.tdb.base.record.Record ;
 import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
+import com.hp.hpl.jena.tdb.index.TupleIndex ;
+import com.hp.hpl.jena.tdb.nodetable.NodeTable ;
+import com.hp.hpl.jena.tdb.nodetable.NodeTupleTable ;
 import com.hp.hpl.jena.tdb.store.DatasetGraphTDB ;
+import com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
 import com.hp.hpl.jena.tdb.transaction.DatasetGraphTxnTDB ;
 import com.hp.hpl.jena.tdb.transaction.TransactionManager ;
@@ -62,6 +67,9 @@ public class TxMain
         
         initFS() ;
         DatasetGraphTDB dsg0 = build() ;
+        
+        deconstruct(dsg0) ;
+        
         load("D.ttl", dsg0) ;
         query("SELECT (Count(*) AS ?c) { ?s ?p ?o }", dsg0) ;
         
@@ -97,6 +105,31 @@ public class TxMain
         exit(0) ;
     }
     
+    private static void deconstruct(DatasetGraphTDB dsg)
+    {
+        /* Better:
+        dsg.getBlockMgrs(), getNodeTable() etc 
+          */  
+        
+        // Tuples
+        NodeTupleTable ntt = dsg.getTripleTable().getNodeTupleTable() ;
+        NodeTable nt = ntt.getNodeTable() ;
+        // Find indexes.  Find object table.
+        
+        for ( TupleIndex index : ntt.getTupleTable().getIndexes() )
+        {
+            // Find RangeIndex, find BPT, find BlockMgrs.
+        }
+        
+        DatasetPrefixStorage prefixes = dsg.getPrefixes() ;
+        // Cast to TDB.
+        DatasetPrefixesTDB prefixesTDB = null ;
+        
+        
+        
+        
+    }
+
     private static void initFS()
     {
         FileOps.ensureDir(DBdir) ;

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java?rev=1138893&r1=1138892&r2=1138893&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java Thu Jun 23 14:22:39 2011
@@ -46,7 +46,9 @@ public class TransactionManager
 
         DatasetGraphTDB dsgtdb = (DatasetGraphTDB)dsg ;
         // For now, always build a parallel dataset - later, associate with the DatasetGraphTDB
+        // [TxTDB:TODO]
         // THIS IS NECESSARY BECAUSE THE DATASET MAY HAVE BEEN UPDATED AND CHANGES STILL IN CACHES.
+        // MUST WRITE OUT - BUT ALSO REUSE CACHES
         dsgtdb.sync() ; 
         
         Location location = dsgtdb.getLocation() ;

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=1138893&r1=1138892&r2=1138893&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src-dev/dev/DevARQ.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src-dev/dev/DevARQ.java Thu Jun 23 14:22:39 2011
@@ -2,6 +2,8 @@ package dev ;
 
 public class DevARQ
 {
+    // FILTER(?x=?y) optimization - at least FILTER(sameTerm(?x,?y)) 
+    
     // QueryEngineHTTP - content negotiation, Apache httpClient.
     
     // Langbase - calls EventManager.send... but Turtle rpefixes done after (read is not finished)

Modified: incubator/jena/Scratch/AFS/trunk/.classpath
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/trunk/.classpath?rev=1138893&r1=1138892&r2=1138893&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/trunk/.classpath (original)
+++ incubator/jena/Scratch/AFS/trunk/.classpath Thu Jun 23 14:22:39 2011
@@ -20,6 +20,6 @@
 	<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
 	<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar"/>
 	<classpathentry kind="lib" path="/ARQ/classes" sourcepath="/ARQ/src"/>
-	<classpathentry kind="lib" path="/TxTDB/classes"/>
+	<classpathentry kind="lib" path="/TxTDB/classes" sourcepath="/TxTDB/src"/>
 	<classpathentry kind="output" path="classes"/>
 </classpath>

Modified: incubator/jena/Scratch/AFS/trunk/src-dev/dev/SizeIndexes.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/trunk/src-dev/dev/SizeIndexes.java?rev=1138893&r1=1138892&r2=1138893&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/trunk/src-dev/dev/SizeIndexes.java (original)
+++ incubator/jena/Scratch/AFS/trunk/src-dev/dev/SizeIndexes.java Thu Jun 23 14:22:39 2011
@@ -58,11 +58,13 @@ public class SizeIndexes
             index.add(r) ;
             if ( useRadix )
             {
-                System.out.println();
+                System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>");
                 ((RadixIndex)index).radix.print() ;
+                System.out.println("Records");
                 Iterator<Record> iter = index.iterator() ;
                 for ( ; iter.hasNext() ; )
                     System.out.println(iter.next()) ;
+                System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<");
             }
         }
 

Modified: incubator/jena/Scratch/AFS/trunk/src-lib/structure/radix/RadixTree.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/trunk/src-lib/structure/radix/RadixTree.java?rev=1138893&r1=1138892&r2=1138893&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/trunk/src-lib/structure/radix/RadixTree.java (original)
+++ incubator/jena/Scratch/AFS/trunk/src-lib/structure/radix/RadixTree.java Thu Jun 23 14:22:39 2011
@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory ;
 import org.openjena.atlas.AtlasException ;
 import org.openjena.atlas.io.IndentedWriter ;
 import org.openjena.atlas.iterator.Iter ;
+import org.openjena.atlas.lib.ByteBufferLib ;
 import org.openjena.atlas.lib.Bytes ;
 
 /* http://en.wikipedia.org/wiki/Radix_tree */
@@ -653,14 +654,15 @@ public final class RadixTree
                 node = node.nodes.get(0) ;
             }
             // But we need to track the key for copying reasons.
-            if ( logging && log.isDebugEnabled() )
+            if ( false && logging && log.isDebugEnabled() )
             {
-                log.debug("initial: "+node) ;
-                log.debug("initial: "+Bytes.asHex(slot.array())) ;
+                log.debug("Iterator start: "+node) ;
+                log.debug("Iterator start: "+slot) ;
             }
             
         }
         
+        /** Copy bytes from the array ([], start, length) to the end of a ByteBuffer */
         static ByteBuffer appendBytes(byte[] array, int start, int length, ByteBuffer bb) 
         {
             if ( bb.position()+length > bb.capacity() )
@@ -672,7 +674,7 @@ public final class RadixTree
 //            System.arraycopy(bb.array(), bb.position(), array, 0, length) ;
 //            bb.position((bb.position()+length)) ;
             try {
-            bb.put(array, start, length) ;
+                bb.put(array, start, length) ;
             } catch (java.nio.BufferOverflowException ex)
             {
                 System.err.println() ;

Copied: incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenInputSection.java (from r1137534, incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputSection.java)
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenInputSection.java?p2=incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenInputSection.java&p1=incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputSection.java&r1=1137534&r2=1138893&rev=1138893&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenInputSection.java (original)
+++ incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenInputSection.java Thu Jun 23 14:22:39 2011
@@ -4,7 +4,7 @@
  * [See endLog of file]
  */
 
-package riot.io;
+package riot.io.section;
 
 import java.util.Iterator ;
 import java.util.List ;
@@ -15,6 +15,7 @@ import org.openjena.riot.tokens.Token ;
 import riot.comms.End ;
 import riot.comms.TokenComms ;
 import riot.comms.TokenStreamEndpoint ;
+import riot.io.TokenInputStream ;
 
 
 

Propchange: incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenInputSection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenOutputSection.java (from r1137534, incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputSection.java)
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenOutputSection.java?p2=incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenOutputSection.java&p1=incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputSection.java&r1=1137534&r2=1138893&rev=1138893&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/trunk/src/riot/io/TokenOutputSection.java (original)
+++ incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenOutputSection.java Thu Jun 23 14:22:39 2011
@@ -4,9 +4,11 @@
  * [See endLog of file]
  */
 
-package riot.io;
+package riot.io.section;
 
 import riot.comms.End ;
+import riot.io.TokenOutputStream ;
+import riot.io.TokenOutputStreamWrapper ;
 
 public class TokenOutputSection extends TokenOutputStreamWrapper
 {

Propchange: incubator/jena/Scratch/AFS/trunk/src/riot/io/section/TokenOutputSection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain