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/09/13 19:20:06 UTC

svn commit: r1170252 - in /incubator/jena/Experimental/TxTDB/trunk/src-dev/tx: DevTx.java TransBlob.java TxMain.java

Author: andy
Date: Tue Sep 13 17:20:05 2011
New Revision: 1170252

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

Modified:
    incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java
    incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TransBlob.java
    incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.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=1170252&r1=1170251&r2=1170252&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java Tue Sep 13 17:20:05 2011
@@ -3,7 +3,9 @@ package tx;
 
 public class DevTx
 {
-    // Don't require .close for write.
+    // 1-- Dataset-based API for transactions.
+    // 2-- Compatibility/migration?
+    // 3-- Events per txn
     
     // --------
     // * Version per dataset

Modified: incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TransBlob.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TransBlob.java?rev=1170252&r1=1170251&r2=1170252&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TransBlob.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TransBlob.java Tue Sep 13 17:20:05 2011
@@ -20,6 +20,7 @@ package tx;
 
 import java.nio.ByteBuffer ;
 
+import com.hp.hpl.jena.tdb.base.block.Block ;
 import com.hp.hpl.jena.tdb.base.file.BufferChannel ;
 import com.hp.hpl.jena.tdb.sys.FileRef ;
 import com.hp.hpl.jena.tdb.transaction.Journal ;
@@ -30,7 +31,11 @@ import com.hp.hpl.jena.tdb.transaction.T
 /** Write a blob, transactional */
 public class TransBlob implements TransactionLifecycle
 {
-    // And need a block mgr
+    // BUG?: BufferChannel does not record length written
+    // What happnes if it chnages length (specifically, shortens)   
+    // Need a "variable block" abstraction over BufefrChannel.
+    //   or split BlockMgrBase intio fixed and not fixed sizes.
+    //   Consider putting length in a write.
     
     private boolean changed ; 
     private ByteBuffer bytes ;
@@ -72,7 +77,7 @@ public class TransBlob implements Transa
         Journal journal = txn.getJournal() ;
         //Block blk = new Block(0, bytes) ;
         //JournalEntry entry = new JournalEntry(file, blk) ;
-        journal.writeJournal(JournalEntryType.Buffer, file, bytes) ;
+        journal.write(JournalEntryType.Buffer, file, new Block(0,bytes)) ;
     }
 
     @Override

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=1170252&r1=1170251&r2=1170252&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java Tue Sep 13 17:20:05 2011
@@ -44,7 +44,6 @@ import com.hp.hpl.jena.tdb.store.Dataset
 import com.hp.hpl.jena.tdb.sys.FileRef ;
 import com.hp.hpl.jena.tdb.transaction.Journal ;
 import com.hp.hpl.jena.tdb.transaction.JournalControl ;
-import com.hp.hpl.jena.tdb.transaction.JournalEntry ;
 import com.hp.hpl.jena.tdb.transaction.JournalEntryType ;
 import com.hp.hpl.jena.tdb.transaction.Transaction ;
 import com.hp.hpl.jena.update.UpdateAction ;
@@ -103,8 +102,7 @@ public class TxMain
         blob.commitPrepare(txn) ;
         
         // Journal commit.
-        JournalEntry entry = new JournalEntry(JournalEntryType.Commit, FileRef.Journal, null) ;
-        journal.writeJournal(entry) ;
+        journal.write(JournalEntryType.Commit, FileRef.Journal, null) ;
         journal.sync() ;        // Commit point.
         
         JournalControl.replay(journal, dsg) ;