jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1199885 - in /incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb: solver/QueryEngineTDB.java transaction/BlockMgrJournal.java transaction/DatasetBuilderTxn.java transaction/Transaction.java
Date Wed, 09 Nov 2011 17:29:38 GMT
Author: andy
Date: Wed Nov  9 17:29:37 2011
New Revision: 1199885

URL: http://svn.apache.org/viewvc?rev=1199885&view=rev
Log:
Renaming and tidying.

Modified:
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/solver/QueryEngineTDB.java
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/solver/QueryEngineTDB.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/solver/QueryEngineTDB.java?rev=1199885&r1=1199884&r2=1199885&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/solver/QueryEngineTDB.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/solver/QueryEngineTDB.java
Wed Nov  9 17:29:37 2011
@@ -82,8 +82,6 @@ public class QueryEngineTDB extends Quer
         // Dynamic dataset done as a special dataset
         if ( ! DynamicDatasetByRewrite && query.hasDatasetDescription() )
         {
-            //UGLY
-            
             // MIGRATION.
             // 1 - All this to ARQ.
             //     Context slot for real default graph and union graph.
@@ -92,25 +90,7 @@ public class QueryEngineTDB extends Quer
             
             doingDynamicDatasetBySpecialDataset = true ;
             DatasetGraph dsg = super.dataset; 
-            // Before dynamic dataset processing.
-            //Graph realDftGraph = dsg.getDefaultGraph() ;
             dsg = DynamicDatasets.dynamicDataset(query, dsg, super.context.isTrue(TDB.symUnionDefaultGraph)
) ;  // Flag for default union graph?
-            
-////            // Create a union graph.
-////            List<Node> namedGraphs = Iter.toList(dsg.listGraphNodes()) ;
-////            Graph unionGraph = new GraphUnionRead(dsg, namedGraphs) ;
-////            if ( super.context.isTrue(TDB.symUnionDefaultGraph) && ( query.getGraphURIs()
== null || query.getGraphURIs().size() == 0 ) )
-////                dsg.setDefaultGraph(unionGraph) ;
-//
-//            // What about <urn:x-arq:DefaultGraph> and <urn:x-arq:UnionGraph>?
-//            // really, really create those names?
-//            // --> shows in listGraphs.
-////            dsg.addGraph(Quad.unionGraph, unionGraph) ;
-////            dsg.addGraph(Quad.defaultGraphIRI, realDftGraph) ;
-//
-//            //EXPERIMENT
-//            dsg = new DynamicDatasets.DynamicDatasetGraph(dsg) ;
-//            // ----
             super.dataset = dsg ;
         }
         this.initialInput = input ; 

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java?rev=1199885&r1=1199884&r2=1199885&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/BlockMgrJournal.java
Wed Nov  9 17:29:37 2011
@@ -28,6 +28,7 @@ import org.openjena.atlas.logging.Log ;
 import org.slf4j.Logger ;
 import org.slf4j.LoggerFactory ;
 
+import com.hp.hpl.jena.tdb.ReadWrite ;
 import com.hp.hpl.jena.tdb.base.block.Block ;
 import com.hp.hpl.jena.tdb.base.block.BlockException ;
 import com.hp.hpl.jena.tdb.base.block.BlockMgr ;
@@ -49,6 +50,9 @@ public class BlockMgrJournal implements 
     public BlockMgrJournal(Transaction txn, FileRef fileRef, BlockMgr underlyingBlockMgr)
     {
         reset(txn, fileRef, underlyingBlockMgr) ;
+        if ( txn.getMode() == ReadWrite.READ &&  underlyingBlockMgr instanceof BlockMgrJournal
)
+            System.err.println("Two level BlockMgrJournal") ;
+        
     }
 
     @Override

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java?rev=1199885&r1=1199884&r2=1199885&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
Wed Nov  9 17:29:37 2011
@@ -130,7 +130,7 @@ public class DatasetBuilderTxn
                 objectFile = FileFactory.createObjectFileDisk(objFilename) ;
 
             NodeTableTrans ntt = new NodeTableTrans(txn ,fsObjectFile.getBasename(), ntBase,
idx, objectFile) ;
-            txn.add(ntt) ;
+            txn.addComponent(ntt) ;
             
             // Add inline wrapper.
             NodeTable nt = NodeTableInline.create(ntt) ;
@@ -149,7 +149,7 @@ public class DatasetBuilderTxn
             if ( baseMgr == null )
                 throw new TDBException("No BlockMgr for "+ref) ;
             BlockMgrJournal blkMgr = new BlockMgrJournal(txn, ref, baseMgr) ;
-            txn.add(blkMgr) ;
+            txn.addComponent(blkMgr) ;
             return blkMgr ;
         }
     }

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java?rev=1199885&r1=1199884&r2=1199885&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java
Wed Nov  9 17:29:37 2011
@@ -38,14 +38,14 @@ public class Transaction
     private final TransactionManager txnMgr ;
     private final List<Iterator<?>> iterators ; 
     private final Journal journal ;
-    private TxnState state ;
-    private ReadWrite mode ;
-    
+    private final ReadWrite mode ;
     private final List<NodeTableTrans> nodeTableTrans = new ArrayList<NodeTableTrans>()
;
     private final List<BlockMgrJournal> blkMgrs = new ArrayList<BlockMgrJournal>()
;
     // The dataset this is a transaction over - may be a commited, pending dataset.
-    private DatasetGraphTDB     basedsg ;
-    private DatasetGraphTxn     activedsg ;
+    private final DatasetGraphTDB   basedsg ;
+
+    private TxnState state ;
+    private DatasetGraphTxn         activedsg ;
 
     public Transaction(DatasetGraphTDB dsg, ReadWrite mode, long id, String label, TransactionManager
txnMgr)
     {
@@ -184,6 +184,8 @@ public class Transaction
         this.activedsg = activedsg ;
     }
 
+    public Journal getJournal()    { return journal ; }
+
     private static final boolean DEBUG = false ;
     
     //public void addIterator(Iterator<?> iter)       { iterators.add(iter) ; }
@@ -217,7 +219,7 @@ public class Transaction
 
         {
             if ( ! iterators.contains(iter) )
-                System.err.println("Already closed or not tracked") ;
+                System.err.println("Already closed or not tracked: "+iter) ;
             iterators.remove(iter) ;
         }
 
@@ -267,21 +269,18 @@ public class Transaction
     
     public List<TransactionLifecycle> components()
     {
-        // FIX NEEDED
         List<TransactionLifecycle> x = new ArrayList<TransactionLifecycle>()
;
         x.addAll(nodeTableTrans) ;
         x.addAll(blkMgrs) ;
         return x ;
     }
     
-    public Journal getJournal()    { return journal ; }
-
-    public void add(NodeTableTrans ntt)
+    public void addComponent(NodeTableTrans ntt)
     {
         nodeTableTrans.add(ntt) ;
     }
 
-    public void add(BlockMgrJournal blkMgr)
+    public void addComponent(BlockMgrJournal blkMgr)
     {
         blkMgrs.add(blkMgr) ;
     }



Mime
View raw message