activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1138443 - /activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java
Date Wed, 22 Jun 2011 12:56:20 GMT
Author: dejanb
Date: Wed Jun 22 12:56:20 2011
New Revision: 1138443

URL: http://svn.apache.org/viewvc?rev=1138443&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3374 - long kahadb tx - configurable max size and
better tmp file name

Modified:
    activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java

Modified: activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java
URL: http://svn.apache.org/viewvc/activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java?rev=1138443&r1=1138442&r2=1138443&view=diff
==============================================================================
--- activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java (original)
+++ activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java Wed Jun 22
12:56:20 2011
@@ -30,7 +30,7 @@ public class Transaction implements Iter
 
 
     private RandomAccessFile tmpFile;
-    private File txfFile;
+    private File txFile;
     private int nextLocation = 0;
 
     /**
@@ -91,7 +91,7 @@ public class Transaction implements Iter
     // List of pages freed in this transaction
     private final SequenceSet freeList = new SequenceSet();
 
-    private long maxTransactionSize = 10485760;
+    private long maxTransactionSize = Integer.parseInt(System.getProperty("maxKahaDBTxSize",
"" + 10485760));
 
     private long size = 0;
 
@@ -654,7 +654,7 @@ public class Transaction implements Iter
                     throw new IOException("Can't delete temporary KahaDB transaction file:"
 + getTempFile());
                 }
                 tmpFile = null;
-                txfFile = null;
+                txFile = null;
             }
         }
         size = 0;
@@ -678,7 +678,7 @@ public class Transaction implements Iter
                     throw new IOException("Can't delete temporary KahaDB transaction file:"
 + getTempFile());
                 }
                 tmpFile = null;
-                txfFile = null;
+                txFile = null;
             }
         }
         size = 0;
@@ -693,10 +693,10 @@ public class Transaction implements Iter
 
 
     protected File getTempFile() {
-        if (txfFile == null) {
-            txfFile = new File(getPageFile().getDirectory(), IOHelper.toFileSystemSafeName(Long.toString(getWriteTransactionId()))
+ ".tmp");
+        if (txFile == null) {
+            txFile = new File(getPageFile().getDirectory(), IOHelper.toFileSystemSafeName("tx-"+
Long.toString(getWriteTransactionId()) + "-" + Long.toString(System.currentTimeMillis()) +
".tmp"));
         }
-       return txfFile;
+       return txFile;
     }
 
     /**



Mime
View raw message