jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1206256 - in /incubator/jena: Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java
Date Fri, 25 Nov 2011 16:53:06 GMT
Author: andy
Date: Fri Nov 25 16:53:05 2011
New Revision: 1206256

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

Modified:
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java
    incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java?rev=1206256&r1=1206255&r2=1206256&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java
Fri Nov 25 16:53:05 2011
@@ -18,9 +18,11 @@
 
 package com.hp.hpl.jena.tdb.transaction;
 
+import java.nio.ByteBuffer ;
 import java.util.Iterator ;
 
 import org.openjena.atlas.iterator.Iter ;
+import org.openjena.atlas.lib.ByteBufferLib ;
 import org.openjena.atlas.lib.Pair ;
 import org.slf4j.Logger ;
 import org.slf4j.LoggerFactory ;
@@ -28,6 +30,7 @@ import org.slf4j.LoggerFactory ;
 import com.hp.hpl.jena.graph.Node ;
 import com.hp.hpl.jena.tdb.TDBException ;
 import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile ;
+import com.hp.hpl.jena.tdb.base.record.Record ;
 import com.hp.hpl.jena.tdb.index.Index ;
 import com.hp.hpl.jena.tdb.nodetable.NodeTable ;
 import com.hp.hpl.jena.tdb.nodetable.NodeTableCache ;
@@ -205,12 +208,14 @@ public class NodeTableTrans implements N
     
     private void dump()
     {
+        System.err.println(">>>>>>>>>>") ;
         System.err.println("label = "+label) ;
         System.err.println("txn = "+txn) ;
         System.err.println("offset = "+offset) ;
         System.err.println("journalStartOffset = "+journalStartOffset) ;
         System.err.println("journal = "+journal.getLabel()) ;
         
+        System.err.println("nodeTableJournal >>>") ;
         Iterator<Pair<NodeId, Node>> iter = nodeTableJournal.all() ;
         for ( ; iter.hasNext() ; )
         {
@@ -222,7 +227,25 @@ public class NodeTableTrans implements N
             // This does the write.
             NodeId nodeId2 = base.getAllocateNodeId(node) ;
             System.err.println(x + "  mapped=" + mapped + " getAlloc="+nodeId2) ;
-        }                
+        }
+        
+        System.err.println("journal >>>") ;
+        Iterator<Pair<Long, ByteBuffer>> iter1 = this.journal.all() ;
+        for ( ; iter1.hasNext() ; )
+        {
+            Pair<Long, ByteBuffer> p = iter1.next() ;
+            System.err.println(p.getLeft()+" : "+p.getRight()) ;
+            ByteBufferLib.print(System.err, p.getRight()) ;
+        }
+        
+        System.err.println("nodeIndex >>>") ;
+        Iterator<Record> iter2 = this.nodeIndex.iterator() ;
+        for ( ; iter2.hasNext() ; )
+        {
+            Record r = iter2.next() ;
+            System.err.println(r) ;
+        }
+        System.err.println("<<<<<<<<<<") ;
     }
     
     @Override

Modified: incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java?rev=1206256&r1=1206255&r2=1206256&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java (original)
+++ incubator/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena163_TDBDifferentIds.java Fri Nov
25 16:53:05 2011
@@ -79,26 +79,28 @@ public class Jena163_TDBDifferentIds
     // Output style.
     static boolean logging                      = false ;
     
-    static final int numReaderTasks             = 0 ;   // 5
+    // XXX Switch to threads choosing a mix of actions. 
+    
+    static final int numReaderTasks             = 5 ;   // 5
     static final int numWriterTasksA            = 3 ;   // 3
     static final int numWriterTasksC            = 5 ;   // 5
 
-    static final int readerSeqRepeats           = 2 ;   // 8
-    static final int readerMaxPause             = 15 ;  // 20
+    static final int readerSeqRepeats           = 8 ;   // 8
+    static final int readerMaxPause             = 20 ;  // 20
 
-    static final int writerAbortSeqRepeats      = 2 ;   // 4
+    static final int writerAbortSeqRepeats      = 3 ;   // 4
     static final int writerCommitSeqRepeats     = 4 ;   // 4
-    static final int writerMaxPause             = 15 ;  // 20
+    static final int writerMaxPause             = 20 ;  // 20
 
-    static final int numThreadsInPool           = 4 ;           // If <= 0 then use an
unbounded thread pool.   
+    static final int numThreadsInPool           = 6 ;           // If <= 0 then use an
unbounded thread pool.   
     private static ExecutorService execService  = null ;
     
     private static int iteration                = 0 ;
     private static int numIterationsPerBlock    = 100 ;
     private static int colCount                 = 0 ;
     private static int colMax                   = 200 ;
-    private static boolean inlineProgress       = true ; // Set true so that every transaction
print a letter for what it does. 
-    private static Semaphore startPoint ; 
+    private static boolean inlineProgress       = true ;   // Set true so that every transaction
print a letter for what it does. 
+    private static Semaphore startPoint ;  
 
     /** TODO
      * Ideally: better mixes of R, C and A.
@@ -338,8 +340,11 @@ public class Jena163_TDBDifferentIds
     
     public static void start()
     {
-        try { startPoint.acquire() ; }
-        catch (InterruptedException e) { e.printStackTrace(); }
+        if ( startPoint != null )
+        {
+            try { startPoint.acquire() ; }
+            catch (InterruptedException e) { e.printStackTrace(); }
+        }
         pause(10) ;
     }
 
@@ -413,7 +418,9 @@ public class Jena163_TDBDifferentIds
             }
         } ;
         
-        startPoint = new Semaphore(0) ;
+        // All threads start and queue on this - otherwise the thread start up as the executeor
is loaded.
+        // That can lead to uninterstin sequences of actions. 
+        startPoint = null ; //new Semaphore(0) ;
 
         int RN1 = numReaderTasks/2 ;
         int RN2 = Math.min(1, numReaderTasks) ;
@@ -427,16 +434,18 @@ public class Jena163_TDBDifferentIds
         
         // Define the query mix.
         submit(execService, procW_c, WC1, "COMMIT-") ;
-        submit(execService, procR,   RN1, "READ-") ;
         submit(execService, procW_a, WA1, "ABORT-") ;
-        submit(execService, procR,   RN2, "READ-") ;
+        submit(execService, procR,   RN1, "READ-") ;
         submit(execService, procW_c, WC2, "COMMIT-") ;
+        submit(execService, procR,   RN2, "READ-") ;
 //        submit(execService, procR,   RN3, "READ-") ;
 //        submit(execService, procW_c, WA2, "ABORT-") ;
         submit(execService, procW_c, WA2, "ABORT-") ;
         submit(execService, procR,   RN3, "READ-") ;
         
-        startPoint.release(4000) ;
+        if ( startPoint != null )
+            // Let them all go.
+            startPoint.release(4000) ;
         
         try
         {



Mime
View raw message