directory-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1187464&view=rev
Log:
o Added the missing class header
o Some minor cleanup (mainly formating)

Modified:
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/InvalidLogException.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/Log.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchor.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchorComparator.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogScanner.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/UserLogRecord.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnLogManager.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnManager.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractDataChange.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractLogEdit.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/DataChange.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/LogEdit.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/InvalidLogException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/InvalidLogException.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/InvalidLogException.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/InvalidLogException.java
Fri Oct 21 16:54:35 2011
@@ -32,15 +32,16 @@ public class InvalidLogException extends
     {
         super(s);
     }
+    
 
     public InvalidLogException(Throwable cause) 
     {
         super(cause);
     }
+    
 
     public InvalidLogException(String s, Throwable cause) 
     {
         super(s, cause);
     }
-
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/Log.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/Log.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/Log.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/Log.java
Fri Oct 21 16:54:35 2011
@@ -21,6 +21,10 @@ package org.apache.directory.server.core
 
 import java.io.IOException;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public interface Log
 {
     
@@ -34,7 +38,7 @@ public interface Log
      * @throws IOException
      * @throws InvalidLogException
      */
-   public void init( String logFilepath, String suffix, int logBufferSize, long logFileSize
) throws IOException, InvalidLogException;
+    void init( String logFilepath, String suffix, int logBufferSize, long logFileSize ) throws
IOException, InvalidLogException;
     
     /**
      * Logs the given user record to the log. Position in the log files where the record
is logged is returned as part of
@@ -45,16 +49,16 @@ public interface Log
      * @throws IOException
      * @throws InvalidLogException
      */
-    public void log( UserLogRecord userRecord, boolean sync ) throws IOException, InvalidLogException;
+    void log( UserLogRecord userRecord, boolean sync ) throws IOException, InvalidLogException;
     
     
     /**
-     * Starts a san in the logs starting from the given log position
+     * Starts a scan in the logs starting from the given log position
      *
      * @param startPoint starting position of the scan.
      * @return
      */
-    public LogScanner beginScan( LogAnchor startPoint );
+    LogScanner beginScan( LogAnchor startPoint );
     
     
     /**
@@ -63,7 +67,5 @@ public interface Log
      *
      * @param newAnchor
      */
-    public void advanceMinNeededLogPosition( LogAnchor newAnchor );
-
-    
+    void advanceMinNeededLogPosition( LogAnchor newAnchor );
 }

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=1187464&r1=1187463&r2=1187464&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 16:54:35 2011
@@ -37,7 +37,6 @@ public class LogAnchor
     /** Min log file offset */
     public final static long MIN_LOG_OFFSET = 0;
     
-    
     /** log file identifier of the anchor */
     private long logFileNumber = 0 ;
     
@@ -52,6 +51,7 @@ public class LogAnchor
         
     }
     
+    
     public LogAnchor( long logFileNumber, long logFileOffset, long logLSN )
     {
         this.resetLogAnchor( logFileNumber, logFileOffset, logLSN );
@@ -76,6 +76,7 @@ public class LogAnchor
         this.logLSN = logLSN;
     }
     
+    
     public void resetLogAnchor( LogAnchor logAnchor )
     {
         this.resetLogAnchor( logAnchor.getLogFileNumber(), logAnchor.getLogFileOffset(),
logAnchor.getLogLSN() );

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchorComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchorComparator.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchorComparator.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogAnchorComparator.java
Fri Oct 21 16:54:35 2011
@@ -23,6 +23,10 @@ import java.util.Comparator;
 
 import org.apache.directory.server.i18n.I18n;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public class LogAnchorComparator implements Comparator<LogAnchor>
 {
     /**
@@ -70,6 +74,6 @@ public class LogAnchorComparator impleme
         else
         {
             return -1;
-        }     
-     }
+        }
+    }
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogScanner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogScanner.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogScanner.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/LogScanner.java
Fri Oct 21 16:54:35 2011
@@ -21,6 +21,10 @@ package org.apache.directory.server.core
 
 import java.io.IOException;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public interface LogScanner
 {
     /**
@@ -33,7 +37,7 @@ public interface LogScanner
      * throws IOException
      * throws InvalidLogException thrown if the log content is invalid 
      */
-    public boolean getNextRecord(UserLogRecord logRecord) throws IOException, InvalidLogException;
+    boolean getNextRecord(UserLogRecord logRecord) throws IOException, InvalidLogException;
     
     
     /**
@@ -41,19 +45,19 @@ public interface LogScanner
      *
      * @return last successfully read log file number
      */
-    public long getLastGoodFileNumber();
+    long getLastGoodFileNumber();
     
     /**
      * Returns the last successfully read log file number
      *
      * @return last successfully read log file number
      */
-    public long getLastGoodOffset();
+    long getLastGoodOffset();
     
     /**
      * Closes the scanner and releases any
      * resources. 
      *
      */
-    public void close();
+    void close();
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/UserLogRecord.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/UserLogRecord.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/UserLogRecord.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/log/UserLogRecord.java
Fri Oct 21 16:54:35 2011
@@ -32,10 +32,10 @@ public class UserLogRecord
     private byte[] recordHolder;
     
     /** offset int the  byte array where user record starts */
-    int offset;
+    private int offset;
     
     /** length of the user record in the byte array */
-    int length;
+    private int length;
     
     /** Position of the log record in the log */
     private LogAnchor logAnchor = new LogAnchor();
@@ -46,12 +46,13 @@ public class UserLogRecord
         this.length = length;
     }
     
+    
     public byte[] getDataBuffer()
     {
         return recordHolder;
     }
     
-   
+    
     public int getDataLength()
     {
         return length;
@@ -62,5 +63,4 @@ public class UserLogRecord
     {
         return logAnchor;
     }
-    
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnLogManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnLogManager.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnLogManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnLogManager.java
Fri Oct 21 16:54:35 2011
@@ -29,13 +29,17 @@ import org.apache.directory.shared.ldap.
 
 import java.io.IOException;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public interface TxnLogManager<ID>
 {
-    public void log( LogEdit<ID> logEdit, boolean sync ) throws IOException;
+    void log( LogEdit<ID> logEdit, boolean sync ) throws IOException;
     
-    public void log( UserLogRecord logRecord, boolean sync ) throws IOException;
+    void log( UserLogRecord logRecord, boolean sync ) throws IOException;
     
-    public Entry mergeUpdates(Dn partitionDN, ID entryID,  Entry entry );
+    Entry mergeUpdates(Dn partitionDN, ID entryID,  Entry entry );
     
-    public IndexCursor<Object, Entry, ID> wrap( Dn partitionDn, IndexCursor<Object,
Entry, ID> wrappedCursor, IndexComparator<Object,ID> comparator, String attributeOid,
boolean forwardIndex, Object onlyValueKey, ID onlyIDKey ) throws Exception;
+    IndexCursor<Object, Entry, ID> wrap( Dn partitionDn, IndexCursor<Object, Entry,
ID> wrappedCursor, IndexComparator<Object,ID> comparator, String attributeOid, boolean
forwardIndex, Object onlyValueKey, ID onlyIDKey ) throws Exception;
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnManager.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/TxnManager.java
Fri Oct 21 16:54:35 2011
@@ -23,15 +23,19 @@ import java.io.IOException;
 import org.apache.directory.server.core.api.partition.index.Serializer;
 import java.util.Comparator;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public interface TxnManager<ID>
 {
-    public void beginTransaction( boolean readOnly ) throws IOException;
+    void beginTransaction( boolean readOnly ) throws IOException;
    
-    public void commitTransaction() throws IOException;
+    void commitTransaction() throws IOException;
     
-    public void abortTransaction() throws IOException;
+    void abortTransaction() throws IOException;
     
-    public Comparator<ID> getIDComparator();
+    Comparator<ID> getIDComparator();
     
-    public Serializer getIDSerializer();
+    Serializer getIDSerializer();
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractDataChange.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractDataChange.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractDataChange.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractDataChange.java
Fri Oct 21 16:54:35 2011
@@ -19,6 +19,10 @@
  */
 package org.apache.directory.server.core.txn.logedit;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public abstract class AbstractDataChange<ID> implements DataChange<ID>
 {
 

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractLogEdit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractLogEdit.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractLogEdit.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/AbstractLogEdit.java
Fri Oct 21 16:54:35 2011
@@ -21,6 +21,10 @@ package org.apache.directory.server.core
 
 import org.apache.directory.server.core.log.LogAnchor;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public abstract class AbstractLogEdit<ID> implements LogEdit<ID>
 {
     /** position in the wal */

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/DataChange.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/DataChange.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/DataChange.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/DataChange.java
Fri Oct 21 16:54:35 2011
@@ -21,6 +21,10 @@ package org.apache.directory.server.core
 
 import java.io.Externalizable;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public interface DataChange<ID> extends Externalizable
 {
 

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/LogEdit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/LogEdit.java?rev=1187464&r1=1187463&r2=1187464&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/LogEdit.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/txn/logedit/LogEdit.java
Fri Oct 21 16:54:35 2011
@@ -23,6 +23,10 @@ import org.apache.directory.server.core.
 
 import java.io.Externalizable;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public interface LogEdit<ID> extends Externalizable 
 {
     /**
@@ -32,5 +36,5 @@ public interface LogEdit<ID> extends Ext
      *
      * @return position of the log edit in the wal
      */
-    public LogAnchor getLogAnchor();
+    LogAnchor getLogAnchor();
 }

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=1187464&r1=1187463&r2=1187464&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 16:54:35 2011
@@ -29,6 +29,10 @@ import org.junit.rules.TemporaryFolder;
 
 import static org.junit.Assert.assertTrue;
 
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public class LogFlushScanTest
 {
     /** Logger */
@@ -65,9 +69,9 @@ public class LogFlushScanTest
     @After
     public void teardown() throws IOException
     {
-  
     }
     
+    
     @Test
     public void testAppendScan()
     {
@@ -108,6 +112,7 @@ public class LogFlushScanTest
        
             
             LogScanner logScanner = log.beginScan( startingPoint );
+            
             while ( logScanner.getNextRecord( logRecord ) )
             {
                 userRecord = logRecord.getDataBuffer();
@@ -138,6 +143,7 @@ public class LogFlushScanTest
         assertTrue( failed == false );
     }
     
+    
     @Test
     public void testLogSwitchScan()
     {
@@ -156,8 +162,8 @@ public class LogFlushScanTest
         LogAnchor startingPoint = new LogAnchor();
         LogAnchor endPoint = new LogAnchor();
         
-       try
-       {
+        try
+        {
             while ( writtenCounter < maxCounter )
             {
                 for ( idx = 0; idx < dataLength; idx++ )
@@ -187,6 +193,7 @@ public class LogFlushScanTest
             assertTrue( endPoint.getLogFileNumber() > startingPoint.getLogFileNumber()
); 
             
             LogScanner logScanner = log.beginScan( startingPoint );
+            
             while ( logScanner.getNextRecord( logRecord ) )
             {
                 userRecord = logRecord.getDataBuffer();
@@ -201,8 +208,6 @@ public class LogFlushScanTest
             }
             
             assertTrue( writtenCounter == readCounter );
-            
-        
        }
        catch( IOException e )
        {
@@ -214,8 +219,8 @@ public class LogFlushScanTest
            e.printStackTrace();
            failed = true;
        }
-        
     }
+
     
     @Test
     public void testMultiThreadedAppend() throws InterruptedException
@@ -227,8 +232,6 @@ public class LogFlushScanTest
         byte userRecord[];
         boolean failed = false;
         
-        
-        
         LogAnchor startingPoint = new LogAnchor();
         
         for ( idx = 0; idx < dataLength; idx++ )
@@ -257,7 +260,6 @@ public class LogFlushScanTest
         
         startingPoint.resetLogAnchor( logRecord.getLogAnchor() );
         
-        
         byte key = 1;
         int numThreads = 4;
         int numAppends = 64;
@@ -281,7 +283,6 @@ public class LogFlushScanTest
             threads[idx].join();
         }
         
-        
         LogScanner logScanner = log.beginScan( startingPoint );
         
         try
@@ -311,10 +312,10 @@ public class LogFlushScanTest
             failed = true;
         }
         
-        
         assertTrue( sum == expectedSum );
     }
     
+    
     class MultiThreadedAppend extends Thread
     {
         byte key;
@@ -369,6 +370,4 @@ public class LogFlushScanTest
             assertTrue( failed == false );
         }
     }
-    
-    
 }



Mime
View raw message