activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r513494 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
Date Thu, 01 Mar 2007 23:25:29 GMT
Author: rajdavies
Date: Thu Mar  1 13:13:40 2007
New Revision: 513494

URL: http://svn.apache.org/viewvc?view=rev&rev=513494
Log:
turbo charge performance ;)

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java?view=diff&rev=513494&r1=513493&r2=513494
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
Thu Mar  1 13:13:40 2007
@@ -106,6 +106,7 @@
 
 	private Runnable periodicCleanupTask;
 	private boolean deleteAllMessages;
+    private boolean syncOnWrite;
 	private File directory = new File(IOHelper.getDefaultDataDirectory() + "/amq");
 
 
@@ -560,12 +561,12 @@
     /**
      * 
      * @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 {
@@ -676,5 +677,15 @@
 	public void setDirectory(File directory) {
 		this.directory = directory;
 	}
+
+    public boolean isSyncOnWrite(){
+        return this.syncOnWrite;
+    }
+
+    public void setSyncOnWrite(boolean syncOnWrite){
+        this.syncOnWrite=syncOnWrite;
+    }
+    
+
 
 }



Mime
View raw message