activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r663032 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: kaha/impl/index/hash/HashIndex.java store/amq/AMQPersistenceAdapter.java store/amq/AMQPersistenceAdapterFactory.java store/amq/AMQTransactionStore.java
Date Wed, 04 Jun 2008 08:35:00 GMT
Author: rajdavies
Date: Wed Jun  4 01:35:00 2008
New Revision: 663032

URL: http://svn.apache.org/viewvc?rev=663032&view=rev
Log:
Fix for https://issues.apache.org/activemq/browse/AMQ-1766

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTransactionStore.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java?rev=663032&r1=663031&r2=663032&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/index/hash/HashIndex.java
Wed Jun  4 01:35:00 2008
@@ -589,7 +589,7 @@
         DEFAULT_PAGE_SIZE = Integer.parseInt(System.getProperty("defaultPageSize", "1024"));
         DEFAULT_KEY_SIZE = Integer.parseInt(System.getProperty("defaultKeySize", "96"));
         DEFAULT_BIN_SIZE= Integer.parseInt(System.getProperty("defaultBinSize", "1024"));
-        MAXIMUM_CAPACITY = Integer.parseInt(System.getProperty("defaultPageSize", "16384"));
+        MAXIMUM_CAPACITY = Integer.parseInt(System.getProperty("maximumCapacity", "16384"));
         DEFAULT_LOAD_FACTOR=Integer.parseInt(System.getProperty("defaultLoadFactor","50"));
     }
 }

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?rev=663032&r1=663031&r2=663032&view=diff
==============================================================================
--- 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
Wed Jun  4 01:35:00 2008
@@ -107,6 +107,7 @@
     private Runnable periodicCleanupTask;
     private boolean deleteAllMessages;
     private boolean syncOnWrite;
+    private boolean syncOnTransaction=true;
     private String brokerName = "";
     private File directory;
     private File directoryArchive;
@@ -650,7 +651,11 @@
      * @throws IOException
      */
     public Location writeCommand(DataStructure command, boolean syncHint) throws IOException
{
-        return asyncDataManager.write(wireFormat.marshal(command), syncHint && syncOnWrite);
+        return writeCommand(command, syncHint,false);
+    }
+    
+    public Location writeCommand(DataStructure command, boolean syncHint,boolean forceSync)
throws IOException {
+        return asyncDataManager.write(wireFormat.marshal(command), (forceSync||(syncHint
&& syncOnWrite)));
     }
 
     private Location writeTraceMessage(String message, boolean sync) throws IOException {
@@ -779,6 +784,14 @@
     public void setSyncOnWrite(boolean syncOnWrite) {
         this.syncOnWrite = syncOnWrite;
     }
+    
+    public boolean isSyncOnTransaction() {
+        return syncOnTransaction;
+    }
+
+    public void setSyncOnTransaction(boolean syncOnTransaction) {
+        this.syncOnTransaction = syncOnTransaction;
+    }
 
     /**
      * @param referenceStoreAdapter the referenceStoreAdapter to set
@@ -998,5 +1011,4 @@
 	           + ".DisableLocking",
 	           "false"));
 	}
-
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java?rev=663032&r1=663031&r2=663032&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapterFactory.java
Wed Jun  4 01:35:00 2008
@@ -40,6 +40,7 @@
     private String brokerName = "localhost";
     private ReferenceStoreAdapter referenceStoreAdapter;
     private boolean syncOnWrite;
+    private boolean syncOnTransaction=true;
     private boolean persistentIndex=true;
     private boolean useNio = true;
     private int maxFileLength = AsyncDataManager.DEFAULT_MAX_FILE_LENGTH;
@@ -154,6 +155,14 @@
 	public void setSyncOnWrite(boolean syncOnWrite) {
 		this.syncOnWrite = syncOnWrite;
 	}
+	
+	public boolean isSyncOnTransaction() {
+        return syncOnTransaction;
+    }
+
+    public void setSyncOnTransaction(boolean syncOnTransaction) {
+        this.syncOnTransaction = syncOnTransaction;
+    }
 
 	public boolean isUseNio() {
 		return useNio;

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTransactionStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTransactionStore.java?rev=663032&r1=663031&r2=663032&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTransactionStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQTransactionStore.java
Wed Jun  4 01:35:00 2008
@@ -112,9 +112,9 @@
             return;
         }
         if (txid.isXATransaction()) {
-            peristenceAdapter.writeCommand(new JournalTransaction(JournalTransaction.XA_COMMIT,
txid, wasPrepared), true);
+            peristenceAdapter.writeCommand(new JournalTransaction(JournalTransaction.XA_COMMIT,
txid, wasPrepared), true,true);
         } else {
-            peristenceAdapter.writeCommand(new JournalTransaction(JournalTransaction.LOCAL_COMMIT,
txid, wasPrepared), true);
+            peristenceAdapter.writeCommand(new JournalTransaction(JournalTransaction.LOCAL_COMMIT,
txid, wasPrepared), true,true);
         }
     }
 
@@ -150,9 +150,9 @@
         }
         if (tx != null) {
             if (txid.isXATransaction()) {
-                peristenceAdapter.writeCommand(new JournalTransaction(JournalTransaction.XA_ROLLBACK,
txid, false), true);
+                peristenceAdapter.writeCommand(new JournalTransaction(JournalTransaction.XA_ROLLBACK,
txid, false), true,true);
             } else {
-                peristenceAdapter.writeCommand(new JournalTransaction(JournalTransaction.LOCAL_ROLLBACK,
txid, false), true);
+                peristenceAdapter.writeCommand(new JournalTransaction(JournalTransaction.LOCAL_ROLLBACK,
txid, false), true,true);
             }
         }
     }



Mime
View raw message