activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r694348 - /activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java
Date Thu, 11 Sep 2008 16:58:07 GMT
Author: chirino
Date: Thu Sep 11 09:58:06 2008
New Revision: 694348

URL: http://svn.apache.org/viewvc?rev=694348&view=rev
Log:
Adding an option to diable waiting for disk syncs.


Modified:
    activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java

Modified: activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java?rev=694348&r1=694347&r2=694348&view=diff
==============================================================================
--- activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java (original)
+++ activemq/sandbox/kahadb/src/main/java/org/apache/kahadb/store/MessageDatabase.java Thu
Sep 11 09:58:06 2008
@@ -149,6 +149,8 @@
     protected File directory;
     protected boolean recovering;
     protected Thread checkpointThread;
+    protected boolean syncWrites;
+    
     protected AtomicBoolean started = new AtomicBoolean();
 
     public MessageDatabase() {
@@ -392,7 +394,7 @@
         DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1);
         os.writeByte(data.type().getNumber());
         data.writeTo(os);
-        Location location = asyncDataManager.write(os.getByteSequence(), sync);
+        Location location = asyncDataManager.write(os.getByteSequence(), syncWrites &&
sync);
         process(data, location);
         if( !recovering ) {
             metadata.lastUpdate = location;
@@ -1048,4 +1050,12 @@
         this.deleteAllMessages = deleteAllMessages;
     }
 
+    public boolean isSyncWrites() {
+        return syncWrites;
+    }
+
+    public void setSyncWrites(boolean syncWrites) {
+        this.syncWrites = syncWrites;
+    }
+
 }



Mime
View raw message