directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1189836 - in /directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log: DefaultLogScanner.java LogFlushManager.java
Date Thu, 27 Oct 2011 16:23:12 GMT
Author: elecharny
Date: Thu Oct 27 16:23:12 2011
New Revision: 1189836

URL: http://svn.apache.org/viewvc?rev=1189836&view=rev
Log:
Fixed an ArrayOutOfBound exception : the append() method should take the footer size as third
parameter, not the magic number

Modified:
    directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogScanner.java
    directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogFlushManager.java

Modified: directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogScanner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogScanner.java?rev=1189836&r1=1189835&r2=1189836&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogScanner.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogScanner.java
Thu Oct 27 16:23:12 2011
@@ -361,8 +361,6 @@ public class DefaultLogScanner implement
             markScanInvalid( null );
         }
         
-        
-        
         // Everything is fine advance last good offset and return
         prevLogFileOffset = LogFileRecords.LOG_FILE_HEADER_SIZE;
         

Modified: directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogFlushManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogFlushManager.java?rev=1189836&r1=1189835&r2=1189836&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogFlushManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogFlushManager.java
Thu Oct 27 16:23:12 2011
@@ -349,7 +349,7 @@ import org.apache.directory.server.i18n.
         {
             flushedLSN = doFlush( uptoLSN, appendLockHeld );
             
-            // Now if there is a user buffer, flush from that        
+            // Now if there is a user buffer, flush from that
             if ( userBuffer != null )
             {
                 ByteBuffer headerFooterHead = logBuffer.headerFooterHead;
@@ -357,7 +357,7 @@ import org.apache.directory.server.i18n.
                 
                 headerFooterHead.rewind();
                 writeHeader( headerFooterHead, recordSize, flushLSN );
-                currentLogFile.append( logBuffer.headerFooterBuffer, 0, LogFileRecords.RECORD_HEADER_MAGIC_NUMBER
);
+                currentLogFile.append( logBuffer.headerFooterBuffer, 0, LogFileRecords.RECORD_HEADER_SIZE
);
                 
                 currentLogFile.append( userBuffer, offset, length );   
                 
@@ -609,4 +609,15 @@ import org.apache.directory.server.i18n.
         /** Keeps track of the number of waiters */
         int numWaiters;
     }
+    
+    
+    /**
+     * Flush the pending data on disk.
+     * @throws IOException If there is an IO issue
+     * @throws InvalidLogException If the log is invalid
+     */
+    public void sync() throws IOException, InvalidLogException
+    {
+        flush( flushStatus.uptoLSN, null, 0, 0, false );
+    }
 }



Mime
View raw message