mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3374 - long kahadb tx - configurable max size and better tmp file name
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1138443 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
40ae055f37
commit
5bcd417f4b
|
@ -30,7 +30,7 @@ public class Transaction implements Iterable<Page> {
|
|||
|
||||
|
||||
private RandomAccessFile tmpFile;
|
||||
private File txfFile;
|
||||
private File txFile;
|
||||
private int nextLocation = 0;
|
||||
|
||||
/**
|
||||
|
@ -91,7 +91,7 @@ public class Transaction implements Iterable<Page> {
|
|||
// 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 Iterable<Page> {
|
|||
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 Iterable<Page> {
|
|||
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 Iterable<Page> {
|
|||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue