activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r425474 - in /incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src: main/java/org/apache/activeio/journal/active/ test/java/org/apache/activeio/journal/ test/java/org/apache/activeio/journal/active/
Date Tue, 25 Jul 2006 18:17:58 GMT
Author: chirino
Date: Tue Jul 25 11:17:57 2006
New Revision: 425474

URL: http://svn.apache.org/viewvc?rev=425474&view=rev
Log:
Merged in fixes from trunk

Added:
    incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalLockedException.java
      - copied unchanged from r425473, incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalLockedException.java
Modified:
    incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java
    incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalImpl.java
    incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/JournalPerfToolSupport.java
    incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/active/JournalPerfTool.java

Modified: incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java?rev=425474&r1=425473&r2=425474&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java
(original)
+++ incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/ControlFile.java
Tue Jul 25 11:17:57 2006
@@ -73,14 +73,14 @@
         synchronized (set) {
             if (lock == null) {
                 if (!set.add(canonicalPath)) {
-                    throw new IOException("Journal is already opened by this application.");
+                    throw new JournalLockedException("Journal is already opened by this application.");
                 }
 
                 if( !brokenFileLock ) {
                     lock = channel.tryLock();
                     if (lock == null) {
                         set.remove(canonicalPath);
-                        throw new IOException("Journal is already opened by another application");
+                        throw new JournalLockedException("Journal is already opened by another
application");
                     }
                 }
             }

Modified: incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalImpl.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalImpl.java?rev=425474&r1=425473&r2=425474&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalImpl.java
(original)
+++ incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/main/java/org/apache/activeio/journal/active/JournalImpl.java
Tue Jul 25 11:17:57 2006
@@ -86,7 +86,8 @@
     private ByteBufferPacketPool packetPool;
     private long overflowNotificationTime = System.currentTimeMillis();
     private Packet markPacket = new ByteArrayPacket(new byte[Location.SERIALIZED_SIZE]);
-
+    private boolean doingNotification=false;
+    
     public JournalImpl(File logDirectory) throws IOException {
         this(new LogFileManager(logDirectory));
     }
@@ -267,13 +268,17 @@
 
         // See if we need to issue an overflow notification.
         if (eventListener != null && file.isPastHalfActive()
-                && overflowNotificationTime + OVERFLOW_RENOTIFICATION_DELAY <
System.currentTimeMillis()) {
-
-            // We need to send an overflow notification to free up
-            // some logFiles.
-            Location safeSpot = file.getFirstRecordLocationOfSecondActiveLogFile();
-            eventListener.overflowNotification(safeSpot);
-            overflowNotificationTime = System.currentTimeMillis();
+                && overflowNotificationTime + OVERFLOW_RENOTIFICATION_DELAY <
System.currentTimeMillis() && !doingNotification ) {
+            doingNotification = true;
+            try {
+                // We need to send an overflow notification to free up
+                // some logFiles.
+                Location safeSpot = file.getFirstRecordLocationOfSecondActiveLogFile();
+                eventListener.overflowNotification(safeSpot);
+                overflowNotificationTime = System.currentTimeMillis();
+            } finally {
+                doingNotification = false;
+            }
         }
 
         // Is it time to roll over?

Modified: incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/JournalPerfToolSupport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/JournalPerfToolSupport.java?rev=425474&r1=425473&r2=425474&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/JournalPerfToolSupport.java
(original)
+++ incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/JournalPerfToolSupport.java
Tue Jul 25 11:17:57 2006
@@ -153,7 +153,7 @@
     
 	public void overflowNotification(RecordLocation safeLocation) {
 		try {
-			System.out.println("Mark set: "+safeLocation);
+			// System.out.println("Mark set: "+safeLocation);
 			journal.setMark(safeLocation, false);
 		} catch (InvalidRecordLocationException e) {
 			e.printStackTrace();

Modified: incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/active/JournalPerfTool.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/active/JournalPerfTool.java?rev=425474&r1=425473&r2=425474&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/active/JournalPerfTool.java
(original)
+++ incubator/activemq/branches/activemq-4.0/activeio/activeio-core/src/test/java/org/apache/activeio/journal/active/JournalPerfTool.java
Tue Jul 25 11:17:57 2006
@@ -30,11 +30,16 @@
  */
 public class JournalPerfTool extends JournalPerfToolSupport {
 	
-	private int logFileSize = 1024*1000*5;
+	private int logFileSize = 1024*1024*50;
     private int logFileCount = 4;
 	
 	public static void main(String[] args) throws Exception {
 		JournalPerfTool tool = new JournalPerfTool();
+        tool.syncFrequency=15;
+        tool.workerIncrement=50;
+        tool.workerThinkTime=0;
+        tool.verbose=false;
+
 		if( args.length > 0 ) {
 			tool.journalDirectory = new File(args[0]);
 		}



Mime
View raw message