jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1377353 - in /jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb: StoreConnection.java base/file/BlockAccessBase.java base/file/BlockAccessDirect.java base/file/BlockAccessMapped.java transaction/JournalControl.java
Date Sat, 25 Aug 2012 20:45:28 GMT
Author: andy
Date: Sat Aug 25 20:45:28 2012
New Revision: 1377353

URL: http://svn.apache.org/viewvc?rev=1377353&view=rev
Log:
JENA-301
BlockAccess node id allocations was not tracking writes to end, or beyond the end, of the
file.

Modified:
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessBase.java
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessDirect.java
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessMapped.java
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java

Modified: jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java?rev=1377353&r1=1377352&r2=1377353&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java (original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java Sat Aug 25
20:45:28 2012
@@ -233,9 +233,10 @@ public class StoreConnection
             sConn = new StoreConnection(dsg) ;
             boolean actionTaken = JournalControl.recoverFromJournal(dsg.getConfig(), sConn.transactionManager.getJournal())
;
             
-            if ( actionTaken )
+            if ( false && actionTaken )
             {
-                // Clunky!  Complete reset.
+                // This should be unnecessary because we wrote the journal replay
+                // via the DSG storage configuration.  
                 sConn.transactionManager.closedown() ;
                 sConn.baseDSG.close() ;
                 dsg = DatasetBuilderStd.build(location) ;

Modified: jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessBase.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessBase.java?rev=1377353&r1=1377352&r2=1377353&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessBase.java (original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessBase.java Sat
Aug 25 20:45:28 2012
@@ -68,6 +68,17 @@ public abstract class BlockAccessBase im
     
     final protected void writeNotification(Block block) { isEmpty = false ; }
     
+    final protected void overwriteNotification(Block block)
+    {
+        // Write at end => extend
+        if ( block.getId() >= numFileBlocks )
+        {
+            numFileBlocks = block.getId()+1 ;
+            seq.set(numFileBlocks) ;
+        }
+    }
+
+    
     //@Override 
     final
     //public 

Modified: jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessDirect.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessDirect.java?rev=1377353&r1=1377352&r2=1377353&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessDirect.java
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessDirect.java
Sat Aug 25 20:45:28 2012
@@ -101,9 +101,7 @@ public class BlockAccessDirect extends B
     @Override
     public void overwrite(Block block)
     {
-        // Write at end => extend
-        if ( block.getId() >= numFileBlocks )
-            numFileBlocks = block.getId()+1 ;
+        overwriteNotification(block) ;
         write(block) ;
     }
 

Modified: jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessMapped.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessMapped.java?rev=1377353&r1=1377352&r2=1377353&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessMapped.java
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/BlockAccessMapped.java
Sat Aug 25 20:45:28 2012
@@ -107,10 +107,7 @@ public class BlockAccessMapped extends B
     @Override
     public void overwrite(Block block)
     {
-        // Write at end => extend
-        if ( block.getId() >= numFileBlocks )
-            // Housekeeping.
-            numFileBlocks = block.getId()+1 ;
+        overwriteNotification(block) ;
         write(block, CopyContents.Overwrite) ;
     }
 

Modified: jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java?rev=1377353&r1=1377352&r2=1377353&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java
Sat Aug 25 20:45:28 2012
@@ -266,11 +266,6 @@ public class JournalControl
         {
             case Block:
             {
-                // All-purpose, works for direct and mapped mode, copy of a block.
-                // [TxTDB:PATCH-UP]
-                // Direct: blkMgr.write(e.getBlock()) would work.
-                // Mapped: need to copy over the bytes.
-                
                 BlockMgr blkMgr = sConf.blockMgrs.get(e.getFileRef()) ;
                 Block blk = e.getBlock() ;
                 log.debug("Replay: {} {}",e.getFileRef(), blk) ;



Mime
View raw message