expose journal writeBatchSize and tidy up xbean annotations

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@813469 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-09-10 15:05:55 +00:00
parent 561cda1e45
commit 356c39dcfc
10 changed files with 47 additions and 31 deletions

View File

@ -286,6 +286,7 @@ public class PolicyEntry extends DestinationMapEntry {
} }
/** /**
* When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor" * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
*/ */
public void setMemoryLimit(long memoryLimit) { public void setMemoryLimit(long memoryLimit) {

View File

@ -30,6 +30,7 @@ import org.apache.commons.logging.LogFactory;
* *
* Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent * Useful, if you have set the broker usage policy to process ONLY persistent or ONLY non-persistent
* messages. * messages.
* @org.apache.xbean.XBean element="forcePersistencyModeBroker"
*/ */
public class ForcePersistencyModeBroker extends BrokerFilter{ public class ForcePersistencyModeBroker extends BrokerFilter{
public static Log log = LogFactory.getLog(ForcePersistencyModeBroker.class); public static Log log = LogFactory.getLog(ForcePersistencyModeBroker.class);

View File

@ -799,10 +799,8 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
} }
/** /**
* When set using XBean, you can use values such as: "20 * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
* mb", "1024 kb", or "1 gb" * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryIntPropertyEditor"
*
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
*/ */
public void setMaxCheckpointMessageAddSize(int maxCheckpointMessageAddSize) { public void setMaxCheckpointMessageAddSize(int maxCheckpointMessageAddSize) {
this.maxCheckpointMessageAddSize = maxCheckpointMessageAddSize; this.maxCheckpointMessageAddSize = maxCheckpointMessageAddSize;
@ -857,9 +855,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
} }
/** /**
* When set using XBean, you can use values such as: "20 * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
* mb", "1024 kb", or "1 gb"
*
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor" * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
*/ */
public void setMaxFileLength(int maxFileLength) { public void setMaxFileLength(int maxFileLength) {
@ -911,9 +907,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
} }
/** /**
* When set using XBean, you can use values such as: "20 * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
* mb", "1024 kb", or "1 gb"
*
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor" * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
*/ */
public void setIndexPageSize(int indexPageSize) { public void setIndexPageSize(int indexPageSize) {
@ -933,9 +927,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
} }
/** /**
* When set using XBean, you can use values such as: "20 * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
* mb", "1024 kb", or "1 gb"
*
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor" * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
*/ */
public void setMaxReferenceFileLength(int maxReferenceFileLength) { public void setMaxReferenceFileLength(int maxReferenceFileLength) {

View File

@ -81,7 +81,7 @@ public class JournalPersistenceAdapterFactory extends DataSourceSupport implemen
/** /**
* Sets the size of the journal log files * Sets the size of the journal log files
* * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryIntPropertyEditor" * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryIntPropertyEditor"
*/ */
public void setJournalLogFileSize(int journalLogFileSize) { public void setJournalLogFileSize(int journalLogFileSize) {

View File

@ -282,7 +282,7 @@ public class KahaPersistenceAdapter implements PersistenceAdapter {
} }
/** /**
* @param maxDataFileLength the maxDataFileLength to set * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor" * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
*/ */
public void setMaxDataFileLength(long maxDataFileLength) { public void setMaxDataFileLength(long maxDataFileLength) {

View File

@ -34,7 +34,7 @@ import java.util.Set;
* {@link Journal} and then check pointing asynchronously on a timeout with some * {@link Journal} and then check pointing asynchronously on a timeout with some
* other long term persistent storage. * other long term persistent storage.
* *
* @org.apache.xbean.XBean element="KahaDB" * @org.apache.xbean.XBean element="kahaDB"
* @version $Revision: 1.17 $ * @version $Revision: 1.17 $
*/ */
public class KahaDBPersistenceAdapter implements PersistenceAdapter { public class KahaDBPersistenceAdapter implements PersistenceAdapter {
@ -193,19 +193,16 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter {
* Get the journalMaxFileLength * Get the journalMaxFileLength
* @return the journalMaxFileLength * @return the journalMaxFileLength
*/ */
public long getJournalMaxFileLength() { public int getJournalMaxFileLength() {
return this.letter.getJournalMaxFileLength(); return this.letter.getJournalMaxFileLength();
} }
/** /**
* @param journalMaxFileLength which is rounded to an integer * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
* When set using XBean, you can use values such as: "20 * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryIntPropertyEditor"
* mb", "1024 kb", or "1 gb"
*
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
*/ */
public void setJournalMaxFileLength(long journalMaxFileLength) { public void setJournalMaxFileLength(int journalMaxFileLength) {
this.letter.setJournalMaxFileLength(Long.valueOf(journalMaxFileLength).intValue()); this.letter.setJournalMaxFileLength(journalMaxFileLength);
} }
/** /**
@ -256,6 +253,22 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter {
this.letter.setIndexWriteBatchSize(indexWriteBatchSize); this.letter.setIndexWriteBatchSize(indexWriteBatchSize);
} }
/**
* Get the journalMaxWriteBatchSize
* @return the journalMaxWriteBatchSize
*/
public int getJournalMaxWriteBatchSize() {
return this.letter.getJournalMaxWriteBatchSize();
}
/**
* Set the journalMaxWriteBatchSize
* @param journalMaxWriteBatchSize the journalMaxWriteBatchSize to set
*/
public void setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize) {
this.letter.setJournalMaxWriteBatchSize(journalMaxWriteBatchSize);
}
/** /**
* Get the enableIndexWriteAsync * Get the enableIndexWriteAsync
* @return the enableIndexWriteAsync * @return the enableIndexWriteAsync

View File

@ -25,7 +25,6 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.Map.Entry; import java.util.Map.Entry;
import org.apache.activeio.journal.Journal;
import org.apache.activemq.broker.ConnectionContext; import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQQueue;

View File

@ -142,6 +142,7 @@ public class MessageDatabase {
long checkpointInterval = 5*1000; long checkpointInterval = 5*1000;
long cleanupInterval = 30*1000; long cleanupInterval = 30*1000;
int journalMaxFileLength = Journal.DEFAULT_MAX_FILE_LENGTH; int journalMaxFileLength = Journal.DEFAULT_MAX_FILE_LENGTH;
int journalMaxWriteBatchSize = Journal.DEFAULT_MAX_WRITE_BATCH_SIZE;
boolean enableIndexWriteAsync = false; boolean enableIndexWriteAsync = false;
int setIndexWriteBatchSize = PageFile.DEFAULT_WRITE_BATCH_SIZE; int setIndexWriteBatchSize = PageFile.DEFAULT_WRITE_BATCH_SIZE;
@ -1337,9 +1338,18 @@ public class MessageDatabase {
Journal manager = new Journal(); Journal manager = new Journal();
manager.setDirectory(directory); manager.setDirectory(directory);
manager.setMaxFileLength(getJournalMaxFileLength()); manager.setMaxFileLength(getJournalMaxFileLength());
manager.setWriteBatchSize(getJournalMaxWriteBatchSize());
return manager; return manager;
} }
public int getJournalMaxWriteBatchSize() {
return journalMaxWriteBatchSize;
}
public void setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize) {
this.journalMaxWriteBatchSize = journalMaxWriteBatchSize;
}
public File getDirectory() { public File getDirectory() {
return directory; return directory;
} }

View File

@ -134,8 +134,8 @@ public abstract class Usage<T extends Usage> implements Service {
/** /**
* Sets the memory limit in bytes. Setting the limit in bytes will set the * Sets the memory limit in bytes. Setting the limit in bytes will set the
* usagePortion to 0 since the UsageManager is not going to be portion based * usagePortion to 0 since the UsageManager is not going to be portion based
* off the parent. When set using XBean, you can use values such as: "20 * off the parent.
* mb", "1024 kb", or "1 gb" * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
* *
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor" * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
*/ */