git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@676636 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-07-14 15:59:12 +00:00
parent 8a6b0f1cf1
commit 4de4bc65f8
2 changed files with 7 additions and 3 deletions

View File

@ -72,6 +72,7 @@ public class AsyncDataManager {
public static final String DEFAULT_FILE_PREFIX = "data-";
public static final int DEFAULT_MAX_FILE_LENGTH = 1024 * 1024 * 32;
public static final int DEFAULT_CLEANUP_INTERVAL = 1000 * 30;
public static final int PREFERED_DIFF = 1024 * 512;
private static final Log LOG = LogFactory.getLog(AsyncDataManager.class);
@ -85,7 +86,7 @@ public class AsyncDataManager {
protected boolean useNio = true;
protected int maxFileLength = DEFAULT_MAX_FILE_LENGTH;
protected int preferedFileLength = DEFAULT_MAX_FILE_LENGTH - 1024 * 512;
protected int preferedFileLength = DEFAULT_MAX_FILE_LENGTH - PREFERED_DIFF;
protected DataFileAppender appender;
protected DataFileAccessorPool accessorPool = new DataFileAccessorPool(this);
@ -115,6 +116,7 @@ public class AsyncDataManager {
}
started = true;
preferedFileLength=Math.max(PREFERED_DIFF, getMaxFileLength()-PREFERED_DIFF);
lock();
ByteSequence sequence = controlFile.load();
@ -427,11 +429,13 @@ public class AsyncDataManager {
List<DataFile> purgeList = new ArrayList<DataFile>();
for (Integer key : unUsed) {
// Only add files less than the lastFile..
System.err.println("LAST FILE IS: " + lastFile);
if( key.intValue() < lastFile.intValue() ) {
DataFile dataFile = (DataFile)fileMap.get(key);
purgeList.add(dataFile);
}
}
System.err.println("PURGE LIST IS: " + purgeList);
for (DataFile dataFile : purgeList) {
forceRemoveDataFile(dataFile);
}
@ -468,7 +472,7 @@ public class AsyncDataManager {
dataFile.unlink();
if (archiveDataLogs) {
dataFile.move(getDirectoryArchive());
LOG.debug("moved data file " + dataFile + " to "
LOG.info("moved data file " + dataFile + " to "
+ getDirectoryArchive());
} else {
boolean result = dataFile.delete();

View File

@ -231,10 +231,10 @@ public class AMQMessageStore implements MessageStore {
lock.lock();
try {
inFlightTxLocations.remove(location);
removeMessage(ack,location);
}finally {
lock.unlock();
}
removeMessage(ack,location);
}
public void afterRollback() throws Exception {