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"
*/
public void setMemoryLimit(long memoryLimit) {

View File

@ -27,7 +27,7 @@ import org.apache.commons.logging.LogFactory;
/**
* @author Filip Hanik
* @org.apache.xbean.XBean element="discardingDLQBrokerPlugin"
* @org.apache.xbean.XBean element="discardingDLQBrokerPlugin"
* @version 1.0
*/
public class DiscardingDLQBrokerPlugin implements BrokerPlugin {

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
* messages.
* @org.apache.xbean.XBean element="forcePersistencyModeBroker"
*/
public class ForcePersistencyModeBroker extends BrokerFilter{
public static Log log = LogFactory.getLog(ForcePersistencyModeBroker.class);

View File

@ -798,11 +798,9 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
return maxCheckpointMessageAddSize;
}
/**
* When set using XBean, you can use values such as: "20
* mb", "1024 kb", or "1 gb"
*
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
/**
* 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"
*/
public void setMaxCheckpointMessageAddSize(int maxCheckpointMessageAddSize) {
this.maxCheckpointMessageAddSize = maxCheckpointMessageAddSize;
@ -857,11 +855,9 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
}
/**
* When set using XBean, you can use values such as: "20
* mb", "1024 kb", or "1 gb"
*
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
*/
* 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"
*/
public void setMaxFileLength(int maxFileLength) {
this.maxFileLength = maxFileLength;
}
@ -911,9 +907,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
}
/**
* When set using XBean, you can use values such as: "20
* 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"
*/
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
* 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"
*/
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
*
* 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"
*/
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"
*/
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
* other long term persistent storage.
*
* @org.apache.xbean.XBean element="KahaDB"
* @org.apache.xbean.XBean element="kahaDB"
* @version $Revision: 1.17 $
*/
public class KahaDBPersistenceAdapter implements PersistenceAdapter {
@ -193,19 +193,16 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter {
* Get the journalMaxFileLength
* @return the journalMaxFileLength
*/
public long getJournalMaxFileLength() {
public int getJournalMaxFileLength() {
return this.letter.getJournalMaxFileLength();
}
/**
* @param journalMaxFileLength which is rounded to an integer
* When set using XBean, you can use values such as: "20
* mb", "1024 kb", or "1 gb"
*
* @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
* 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"
*/
public void setJournalMaxFileLength(long journalMaxFileLength) {
this.letter.setJournalMaxFileLength(Long.valueOf(journalMaxFileLength).intValue());
public void setJournalMaxFileLength(int journalMaxFileLength) {
this.letter.setJournalMaxFileLength(journalMaxFileLength);
}
/**
@ -256,6 +253,22 @@ public class KahaDBPersistenceAdapter implements PersistenceAdapter {
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
* @return the enableIndexWriteAsync

View File

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

View File

@ -142,6 +142,7 @@ public class MessageDatabase {
long checkpointInterval = 5*1000;
long cleanupInterval = 30*1000;
int journalMaxFileLength = Journal.DEFAULT_MAX_FILE_LENGTH;
int journalMaxWriteBatchSize = Journal.DEFAULT_MAX_WRITE_BATCH_SIZE;
boolean enableIndexWriteAsync = false;
int setIndexWriteBatchSize = PageFile.DEFAULT_WRITE_BATCH_SIZE;
@ -1337,9 +1338,18 @@ public class MessageDatabase {
Journal manager = new Journal();
manager.setDirectory(directory);
manager.setMaxFileLength(getJournalMaxFileLength());
manager.setWriteBatchSize(getJournalMaxWriteBatchSize());
return manager;
}
public int getJournalMaxWriteBatchSize() {
return journalMaxWriteBatchSize;
}
public void setJournalMaxWriteBatchSize(int journalMaxWriteBatchSize) {
this.journalMaxWriteBatchSize = journalMaxWriteBatchSize;
}
public File getDirectory() {
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
* 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
* mb", "1024 kb", or "1 gb"
* off the parent.
* 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"
*/