mirror of https://github.com/apache/activemq.git
turbo charge performance ;)
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@513494 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9fd9189a17
commit
c0cd83870c
|
@ -106,6 +106,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener
|
|||
|
||||
private Runnable periodicCleanupTask;
|
||||
private boolean deleteAllMessages;
|
||||
private boolean syncOnWrite;
|
||||
private File directory = new File(IOHelper.getDefaultDataDirectory() + "/amq");
|
||||
|
||||
|
||||
|
@ -560,12 +561,12 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener
|
|||
/**
|
||||
*
|
||||
* @param command
|
||||
* @param sync
|
||||
* @param syncHint
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public Location writeCommand(DataStructure command, boolean sync) throws IOException {
|
||||
return asyncDataManager.write(wireFormat.marshal(command), sync);
|
||||
public Location writeCommand(DataStructure command, boolean syncHint) throws IOException {
|
||||
return asyncDataManager.write(wireFormat.marshal(command), (syncHint && syncOnWrite));
|
||||
}
|
||||
|
||||
private Location writeTraceMessage(String message, boolean sync) throws IOException {
|
||||
|
@ -677,4 +678,14 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener
|
|||
this.directory = directory;
|
||||
}
|
||||
|
||||
public boolean isSyncOnWrite(){
|
||||
return this.syncOnWrite;
|
||||
}
|
||||
|
||||
public void setSyncOnWrite(boolean syncOnWrite){
|
||||
this.syncOnWrite=syncOnWrite;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue