directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1187475 - in /directory/apacheds/branches/apacheds-txns: core-api/src/main/java/org/apache/directory/server/core/log/ core/src/main/java/org/apache/directory/server/core/log/ core/src/test/java/org/apache/directory/server/core/log/
Date Fri, 21 Oct 2011 17:29:17 GMT
Author: elecharny
Date: Fri Oct 21 17:29:16 2011
New Revision: 1187475

URL: http://svn.apache.org/viewvc?rev=1187475&view=rev
Log:
o Used the File.separatorChar instead of '/', as it won't work on windows
o Declared some fields private
o SOme other minor refactoring

Modified:
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchor.java
    directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogFileManager.java
    directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogManager.java
    directory/apacheds/branches/apacheds-txns/core/src/test/java/org/apache/directory/server/core/log/LogFlushScanTest.java

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchor.java?rev=1187475&r1=1187474&r2=1187475&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchor.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchor.java
Fri Oct 21 17:29:16 2011
@@ -48,7 +48,6 @@ public class LogAnchor
     
     public LogAnchor()
     {
-        
     }
     
     

Modified: directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogFileManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogFileManager.java?rev=1187475&r1=1187474&r2=1187475&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogFileManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/DefaultLogFileManager.java
Fri Oct 21 17:29:16 2011
@@ -137,8 +137,7 @@ import java.io.RandomAccessFile;
     
     private File makeLogFileName( long logFileNumber )
     {
-        
-        return new File( logFilePath + "/" + LogFileManager.LOG_NAME_PREFIX + logFileNumber
+ "." + suffix );
+        return new File( logFilePath + File.separatorChar + LogFileManager.LOG_NAME_PREFIX
+ logFileNumber + "." + suffix );
     }
     
     static class LogFileReader implements LogFileManager.LogFileReader

Modified: directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogManager.java?rev=1187475&r1=1187474&r2=1187475&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/log/LogManager.java
Fri Oct 21 17:29:16 2011
@@ -49,34 +49,34 @@ import org.apache.directory.server.i18n.
     private final static long CONTROLFILE_SHADOW_LOG_FILE_NUMBER = -2;
     
     /** buffer used to do IO on controlfile */
-    byte controlFileBuffer[] = new byte[CONTROLFILE_RECORD_SIZE];
+    private byte controlFileBuffer[] = new byte[CONTROLFILE_RECORD_SIZE];
     
     /** ByteBuffer used to to IO on checkpoint file */
-    ByteBuffer controlFileMarker = ByteBuffer.wrap( controlFileBuffer );
+    private ByteBuffer controlFileMarker = ByteBuffer.wrap( controlFileBuffer );
     
     /** Current checkpoint record in memory */
-    ControlFileRecord controlFileRecord = new ControlFileRecord();
+    private ControlFileRecord controlFileRecord = new ControlFileRecord();
     
     /** Min neeeded point in the log */
-    LogAnchor minLogAnchor = new LogAnchor();
+    private LogAnchor minLogAnchor = new LogAnchor();
     
     /** Protects minLogAchor */
-    Lock minLogAnchorLock = new ReentrantLock();
+    private Lock minLogAnchorLock = new ReentrantLock();
     
     /** Log file manager */
-    LogFileManager logFileManager;
+    private LogFileManager logFileManager;
         
     /** Log Anchor comparator */
-    LogAnchorComparator anchorComparator = new LogAnchorComparator();
+    private LogAnchorComparator anchorComparator = new LogAnchorComparator();
     
     /** Current log file */
     private long currentLogFileNumber;
     
     /** Buffer used to read log file markers */
-    byte markerBuffer[] = new byte[LogFileRecords.LOG_FILE_HEADER_SIZE];
+    private byte markerBuffer[] = new byte[LogFileRecords.LOG_FILE_HEADER_SIZE];
     
     /** ByteBuffer wrapper for the marker buffer */
-    ByteBuffer markerHead = ByteBuffer.wrap( markerBuffer );
+    private ByteBuffer markerHead = ByteBuffer.wrap( markerBuffer );
     
     
     public LogManager( LogFileManager logFileManager )
@@ -98,10 +98,8 @@ import org.apache.directory.server.i18n.
     {
         LogAnchor scanPoint = new LogAnchor();
         LogScannerInternal scanner;
-        UserLogRecord logRecord;        
+        UserLogRecord logRecord;
         LogFileManager.LogFileReader reader;
-
-        
         
         // Read and verify control file
         boolean controlFileExists = true;

Modified: directory/apacheds/branches/apacheds-txns/core/src/test/java/org/apache/directory/server/core/log/LogFlushScanTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core/src/test/java/org/apache/directory/server/core/log/LogFlushScanTest.java?rev=1187475&r1=1187474&r2=1187475&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core/src/test/java/org/apache/directory/server/core/log/LogFlushScanTest.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core/src/test/java/org/apache/directory/server/core/log/LogFlushScanTest.java
Fri Oct 21 17:29:16 2011
@@ -38,22 +38,26 @@ public class LogFlushScanTest
     /** Logger */
     private Log log;
     
-    /** Log buffer size */
+    /** Log buffer size : 4096 bytes */
     private int logBufferSize = 1 << 12;
     
-    /** Log File Size */
+    /** Log File Size : 8192 bytes */
     private long logFileSize = 1 << 13;
     
     /** log suffix */
-    private String logSuffix = "log";
+    private static String LOG_SUFFIX = "log";
     
     @Rule
     public TemporaryFolder folder = new TemporaryFolder();
 
 
+    /**
+     * Get the Log folder
+     */
     private String getLogFoler( ) throws IOException
     {
-        String file = folder.newFolder( "log" ).getAbsolutePath();
+        String file = folder.newFolder( LOG_SUFFIX ).getAbsolutePath();
+        
         return file;
     }
 
@@ -62,7 +66,7 @@ public class LogFlushScanTest
     public void setup() throws IOException, InvalidLogException
     {
         log = new DefaultLog();
-        log.init( this.getLogFoler(), logSuffix, logBufferSize, logFileSize );
+        log.init( getLogFoler(), LOG_SUFFIX, logBufferSize, logFileSize );
     }
 
 



Mime
View raw message