You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/09/26 18:48:51 UTC
[03/17] activemq-artemis git commit: ARTEMIS-1224 - change the
journal file size to nearest multiple
ARTEMIS-1224 - change the journal file size to nearest multiple
https://issues.apache.org/jira/browse/ARTEMIS-1224
(cherry picked from commit 30a6ac703efe3539d13152f9311bedd7fd68aa9d)
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2c892870
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2c892870
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2c892870
Branch: refs/heads/1.x
Commit: 2c892870092e716fdae0ca4ec8eb6bc1ecea5826
Parents: 31fa758
Author: Andy Taylor <an...@gmail.com>
Authored: Mon Jun 12 16:20:43 2017 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Sep 26 14:28:05 2017 -0400
----------------------------------------------------------------------
.../core/persistence/impl/journal/JournalStorageManager.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2c892870/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java
index c286e67..e79a9cb 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java
@@ -145,8 +145,9 @@ public class JournalStorageManager extends AbstractJournalStorageManager {
int fileSize = config.getJournalFileSize();
// we need to correct the file size if its not a multiple of the alignement
- if (fileSize % journalFF.getAlignment() != 0) {
- int difference = fileSize % journalFF.getAlignment();
+ int modulus = fileSize % journalFF.getAlignment();
+ if (modulus != 0) {
+ int difference = modulus;
int low = config.getJournalFileSize() - difference;
int high = low + journalFF.getAlignment();
fileSize = difference < journalFF.getAlignment() / 2 ? low : high;