jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1147178 - in /incubator/jena/Experimental/TxTDB/trunk: ./ src/main/java/com/hp/hpl/jena/tdb/transaction/ src/test/java/com/hp/hpl/jena/tdb/transaction/
Date Fri, 15 Jul 2011 15:00:18 GMT
Author: andy
Date: Fri Jul 15 15:00:17 2011
New Revision: 1147178

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

Added:
    incubator/jena/Experimental/TxTDB/trunk/assembly-testing.xml   (with props)
Modified:
    incubator/jena/Experimental/TxTDB/trunk/log4j.properties
    incubator/jena/Experimental/TxTDB/trunk/pom.xml
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Journal.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestObjectFileTrans.java

Added: incubator/jena/Experimental/TxTDB/trunk/assembly-testing.xml
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/assembly-testing.xml?rev=1147178&view=auto
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/assembly-testing.xml (added)
+++ incubator/jena/Experimental/TxTDB/trunk/assembly-testing.xml Fri Jul 15 15:00:17 2011
@@ -0,0 +1,30 @@
+<!-- The testing data files -->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="xmlns=http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1
http://maven.apache.org/xsd/assembly-1.1.1.xsd">
+  <id>tests</id>
+  <baseDirectory>${project.name}-${project.version}</baseDirectory>
+  <formats>
+    <!--
+      <format>tar.gz</format>
+      <format>tar.bz2</format>
+    -->
+    <format>zip</format>
+  </formats>
+
+  <fileSets>
+
+    <fileSet>
+      <directory>testing</directory>
+    </fileSet>
+
+    <fileSet>
+      <includes>
+       <include>test.sh</include>
+      </includes>
+    </fileSet>
+
+  </fileSets>
+
+</assembly>

Propchange: incubator/jena/Experimental/TxTDB/trunk/assembly-testing.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/jena/Experimental/TxTDB/trunk/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/log4j.properties?rev=1147178&r1=1147177&r2=1147178&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/log4j.properties (original)
+++ incubator/jena/Experimental/TxTDB/trunk/log4j.properties Fri Jul 15 15:00:17 2011
@@ -18,8 +18,7 @@ log4j.logger.org.openjena.riot=INFO
 
 # TDB 
 log4j.logger.com.hp.hpl.jena.tdb=INFO
-log4j.logger.com.hp.hpl.jena.tdb.transaction=ALL
-log4j.logger.com.hp.hpl.jena.sparql.core.DatasetPrefixStorage=INFO
+#log4j.logger.com.hp.hpl.jena.tdb.transaction=ALL
 
 # Joseki server
 log4j.logger.org.joseki=INFO

Modified: incubator/jena/Experimental/TxTDB/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/pom.xml?rev=1147178&r1=1147177&r2=1147178&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/pom.xml (original)
+++ incubator/jena/Experimental/TxTDB/trunk/pom.xml Fri Jul 15 15:00:17 2011
@@ -16,9 +16,10 @@
   <url>http://openjena.org/TDB</url>
 
   <organization>
-    <name>OpenJena</name>
-    <url>http://www.openjena.org/</url>
+    <name>Apache Jena</name>
+    <url>http://incubator.apache.org/jena</url>
   </organization>
+
   <developers>
     <developer>
       <name>Andy Seaborne</name>
@@ -30,14 +31,18 @@
 
   <licenses>
     <license>
-      <name>BSD-style license</name>
-      <url>http://openjena.org/license.html</url>
+      <name>Apache 2.0 License</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
     </license>
   </licenses>
 
   <scm>
-    <connection>scm:svn:https://jena.svn.sourceforge.net/svnroot/jena/TDB/</connection>
-    <url>http://jena.svn.sourceforge.net/viewvc/jena/TDB/</url>
+    <!--
+      <connection>scm:svn:https://svn.apache.org/repos/asf/incubator/jena/Jena2/TDB/</connection>
+      <url>https://svn.apache.org/repos/asf/incubator/jena/Jena2/TDB/</url>
+    -->
+    <connection>scm:svn:https://svn.apache.org/repos/asf/incubator/jena/Experimental/TxTDB/</connection>
+    <url>http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/</url>
   </scm>
 
   <properties>
@@ -401,7 +406,6 @@ build.time.txt=${build.time.txt}
   </repositories>
 
   <distributionManagement>
-    <downloadUrl>http://openjena.org/repo-dev</downloadUrl>
 
     <repository>
       <id>jena-repo</id>
@@ -414,14 +418,59 @@ build.time.txt=${build.time.txt}
       <layout>default</layout>
     </repository> 
 
+    <!--
+    <snapshotRepository>
+      <id>apache.snapshots.https</id>
+      <name>Apache Development Snapshot Repository</name>
+      <url>https://repository.apache.org/content/repositories/snapshots</url>
+    </snapshotRepository>
+    -->
+
     <snapshotRepository>
       <id>jena-repo-dev</id>
       <name>Jena development repo</name>
       <url>sftp://openjena.org/var/repo-dev</url>
-      <!--<url>file:tmp</url>-->
       <layout>default</layout>
     </snapshotRepository>
 
   </distributionManagement>
 
+  <issueManagement>
+    <system>JIRA</system>
+    <url>http://issues.apache.org/jira/browse/JENA</url>
+  </issueManagement>
+  
+  <mailingLists>
+    <mailingList>
+      <name>Users</name>
+      <post>jena-users@incubator.apache.org</post>
+      <subscribe>jena-users-subscribe@incubator.apache.org</subscribe>
+      <unsubscribe>jena-users-unsubscribe@incubator.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/mod_mbox/incubator-jena-users/</archive>
+      <otherArchives>
+	<otherArchive>http://incubator.apache.org/mail/jena-users/</otherArchive>
+      </otherArchives>
+    </mailingList>
+    <mailingList>
+      <name>Development</name>
+      <post>jena-dev@incubator.apache.org</post>
+      <subscribe>jena-dev-subscribe@incubator.apache.org</subscribe>
+      <unsubscribe>jena-dev-unsubscribe@incubator.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/mod_mbox/incubator-jena-dev/</archive>
+      <otherArchives>
+	<otherArchive>http://incubator.apache.org/mail/jena-dev/</otherArchive>
+      </otherArchives>
+    </mailingList>
+    <mailingList>
+      <name>Commits</name>
+      <post>jena-commits@incubator.apache.org</post>
+      <subscribe>jena-commits-subscribe@incubator.apache.org</subscribe>
+      <unsubscribe>jena-commits-unsubscribe@incubator.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/mod_mbox/incubator-jena-commits/</archive>
+      <otherArchives>
+	<otherArchive>http://incubator.apache.org/mail/jena-commits/</otherArchive>
+      </otherArchives>
+    </mailingList>
+  </mailingLists>
+
 </project>

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Journal.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Journal.java?rev=1147178&r1=1147177&r2=1147178&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Journal.java
(original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Journal.java
Fri Jul 15 15:00:17 2011
@@ -14,6 +14,7 @@ import java.util.Iterator ;
 
 import org.openjena.atlas.iterator.IteratorSlotted ;
 import org.openjena.atlas.lib.Closeable ;
+import org.openjena.atlas.lib.FileOps ;
 import org.openjena.atlas.lib.Sync ;
 import org.slf4j.Logger ;
 import org.slf4j.LoggerFactory ;
@@ -21,7 +22,10 @@ import org.slf4j.LoggerFactory ;
 import com.hp.hpl.jena.tdb.base.block.Block ;
 import com.hp.hpl.jena.tdb.base.file.BufferChannel ;
 import com.hp.hpl.jena.tdb.base.file.BufferChannelFile ;
+import com.hp.hpl.jena.tdb.base.file.BufferChannelMem ;
+import com.hp.hpl.jena.tdb.base.file.Location ;
 import com.hp.hpl.jena.tdb.sys.FileRef ;
+import com.hp.hpl.jena.tdb.sys.Names ;
 
 /** The Journal is slightly odd - it is append-only for write but random read.
  *  The write performance is more important than read; reads only happen
@@ -45,14 +49,32 @@ class Journal implements Iterable<Journa
     private long position ;
     // Length, type, fileRef, [block id]
     // Length is length of variable part.
-    public static int Overhead = 4*SizeOfInt ;
-    public static final int NoId = 5 ;
+    private static int Overhead = 4*SizeOfInt ;
+    private static final int NoId = 5 ;
     
 //    byte[] _buffer = new byte[Overhead] ;
 //    ByteBuffer header = ByteBuffer.wrap(_buffer) ;
-    ByteBuffer header = ByteBuffer.allocate(Overhead) ;
+    private ByteBuffer header = ByteBuffer.allocate(Overhead) ;
     
-    public Journal(String filename)
+    public static boolean exists(Location location)
+    {
+        if ( location.isMem() ) return false ;
+        return FileOps.exists(journalFilename(location)) ;
+    }
+    
+    public static Journal create(Location location)
+    {
+        BufferChannel chan ;
+        if ( location.isMem() )
+            chan = BufferChannelMem.create() ;
+        else
+            chan = new BufferChannelFile(journalFilename(location)) ;
+        return new Journal(chan) ;
+    }
+    
+    private static String journalFilename(Location location) { return location.absolute(Names.journalFile)
; }
+    
+    private Journal(String filename)
     {
         this(new BufferChannelFile(filename)) ;
     }

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java?rev=1147178&r1=1147177&r2=1147178&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java
(original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java
Fri Jul 15 15:00:17 2011
@@ -71,7 +71,7 @@ public class JournalControl
         //if ( FileOps.exists(journalFilename)
         if ( f.exists() && f.isFile() && f.length() > 0 )
         {
-            Journal jrnl = new Journal(journalFilename) ;
+            Journal jrnl = Journal.create(loc) ;
             // Scan for commit.
             boolean committed = false ;
             for ( JournalEntry e : jrnl )

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java?rev=1147178&r1=1147177&r2=1147178&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java
(original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java
Fri Jul 15 15:00:17 2011
@@ -51,7 +51,7 @@ public class Transaction
         this.txnMgr = txnMgr ;
         this.basedsg = dsg ;
         this.mode = mode ;
-        this.journal = txnMgr.getJournal() ;
+        this.journal = ( txnMgr == null ) ? null : txnMgr.getJournal() ;
         activedsg = null ;      // Don't know yet.
         this.iterators = new ArrayList<Iterator<?>>() ;
         state = TxnState.ACTIVE ;

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=1147178&r1=1147177&r2=1147178&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
Fri Jul 15 15:00:17 2011
@@ -24,11 +24,7 @@ import org.slf4j.LoggerFactory ;
 
 import com.hp.hpl.jena.tdb.DatasetGraphTxn ;
 import com.hp.hpl.jena.tdb.ReadWrite ;
-import com.hp.hpl.jena.tdb.base.file.BufferChannel ;
-import com.hp.hpl.jena.tdb.base.file.BufferChannelFile ;
-import com.hp.hpl.jena.tdb.base.file.BufferChannelMem ;
 import com.hp.hpl.jena.tdb.store.DatasetGraphTDB ;
-import com.hp.hpl.jena.tdb.sys.Names ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
 
 public class TransactionManager
@@ -68,16 +64,8 @@ public class TransactionManager
     
     public TransactionManager(DatasetGraphTDB dsg)
     {
-//        if ( ! ( dsg instanceof DatasetGraphTDB ) )
-//            throw new TDBException("Not a TDB-backed dataset") ;
         this.baseDataset = dsg ; 
-        
-        BufferChannel chan ;
-        if ( dsg.getLocation().isMem() )
-            chan = BufferChannelMem.create() ;
-        else
-            chan = new BufferChannelFile(dsg.getLocation().absolute(Names.journalFile)) ;
-        this.journal = new Journal(chan) ;
+        this.journal = Journal.create(dsg.getLocation()) ;
         // LATER
 //        Committer c = new Committer() ;
 //        this.committerThread = new Thread(c) ;
@@ -206,7 +194,7 @@ public class TransactionManager
         // Process any pending commits held up due to a reader. 
         if ( readers == 0 && writers == 0 ) 
         {
-            // Given this is sync'ed to the TransactionManager, 
+            // Given this is sync'ed to this TransactionManager, 
             // the query never blocks, nor does it need to be concurrent-safe.
             // later ...
             while ( queue.size() > 0 )
@@ -236,7 +224,6 @@ public class TransactionManager
         else
             writers-- ;
         activeTransactions.remove(transaction) ;
-        
     }
     
     public Journal getJournal()

Modified: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestObjectFileTrans.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestObjectFileTrans.java?rev=1147178&r1=1147177&r2=1147178&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestObjectFileTrans.java
(original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestObjectFileTrans.java
Fri Jul 15 15:00:17 2011
@@ -32,10 +32,12 @@ public abstract class AbstractTestObject
     abstract ObjectFile createFile(String basename) ;
     abstract void deleteFile(String basename) ;
     
+    TransactionManager tm = null ;
+    
     @Before
     public void setup()
     {
-        txn = new Transaction(null, WRITE, ++count, null, null) ;
+        txn = new Transaction(null, WRITE, ++count, null, tm) ;
         file1 = createFile("base") ;
         file2 = createFile("log") ;
     }



Mime
View raw message