activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject git commit: Fixes AMQ-5115: LevelDB sync=true is not being honored.
Date Fri, 21 Mar 2014 16:55:03 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 2ccc34954 -> db321727c


Fixes AMQ-5115: LevelDB sync=true is not being honored.

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/db321727
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/db321727
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/db321727

Branch: refs/heads/trunk
Commit: db321727c9d68156cd82d92b74f3752cc118c0cd
Parents: 2ccc349
Author: Hiram Chirino <hiram@hiramchirino.com>
Authored: Fri Mar 21 12:54:55 2014 -0400
Committer: Hiram Chirino <hiram@hiramchirino.com>
Committed: Fri Mar 21 12:54:55 2014 -0400

----------------------------------------------------------------------
 .../scala/org/apache/activemq/leveldb/RecordLog.scala | 14 ++++----------
 .../leveldb/replicated/MasterLevelDBStore.scala       |  1 +
 2 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/db321727/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala
----------------------------------------------------------------------
diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala
b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala
index 08f18a7..daef103 100644
--- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala
+++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/RecordLog.scala
@@ -76,8 +76,6 @@ case class RecordLog(directory: File, logSuffix:String) {
   var logSize = 1024 * 1024 * 100L
   var current_appender:LogAppender = _
   var verify_checksums = false
-  var sync = false
-
   val log_infos = new TreeMap[Long, LogInfo]()
 
   object log_mutex
@@ -130,20 +128,16 @@ case class RecordLog(directory: File, logSuffix:String) {
       channel.position(logSize-1)
       channel.write(new Buffer(1).toByteBuffer)
       channel.force(true)
-      if( sync ) {
-        channel.position(0)
-      }
+      channel.position(0)
     }
 
     val write_buffer = new DataByteArrayOutputStream(BUFFER_SIZE+LOG_HEADER_SIZE)
 
     def force = {
       flush
-      if(sync) {
-        max_log_flush_latency {
-          // only need to update the file metadata if the file size changes..
-          channel.force(append_offset > logSize)
-        }
+      max_log_flush_latency {
+        // only need to update the file metadata if the file size changes..
+        channel.force(append_offset > logSize)
       }
     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/db321727/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterLevelDBStore.scala
----------------------------------------------------------------------
diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterLevelDBStore.scala
b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterLevelDBStore.scala
index 249e0c4..6de5f63 100644
--- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterLevelDBStore.scala
+++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/MasterLevelDBStore.scala
@@ -345,6 +345,7 @@ class MasterLevelDBStore extends LevelDBStore with ReplicatedLevelDBStoreTrait
{
           val value = new LogWrite
           value.file = position;
           value.offset = offset;
+          value.sync = (syncToMask & SYNC_TO_REMOTE_DISK)!=0
           value.length = fileTransferFrame.length
           value.date = date
           encoded = JsonCodec.encode(value)


Mime
View raw message