directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1178796 - in /directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl: DefaultLog.java LogScannerInternal.java
Date Tue, 04 Oct 2011 14:00:37 GMT
Author: saya
Date: Tue Oct  4 14:00:36 2011
New Revision: 1178796

URL: http://svn.apache.org/viewvc?rev=1178796&view=rev
Log:
an implementation for the Log interface 

Added:
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/DefaultLog.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/LogScannerInternal.java

Added: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/DefaultLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/DefaultLog.java?rev=1178796&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/DefaultLog.java
(added)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/DefaultLog.java
Tue Oct  4 14:00:36 2011
@@ -0,0 +1,64 @@
+
+package org.apache.directory.server.log.impl;
+
+import java.io.IOException;
+
+import org.apache.directory.server.log.InvalidLogException;
+import org.apache.directory.server.log.Log;
+import org.apache.directory.server.log.LogAnchor;
+import org.apache.directory.server.log.LogScanner;
+import org.apache.directory.server.log.UserLogRecord;
+
+public class DefaultLog implements Log
+{
+    /** Log manager */
+    LogManager logManager;
+    
+    /** Log File Manager */
+    LogFileManager logFileManager;
+    
+    
+    /** LogFlushManager */
+    LogFlushManager logFlushManager;
+    
+    /**
+     * {@inheritDoc}
+     */
+   public void init( String logFilepath, String suffix, int logBufferSize, long logFileSize
) throws IOException, InvalidLogException
+   {
+       logFileManager = new DefaultLogFileManager();
+       logFileManager.init( logFilepath, suffix );
+       
+       logManager = new LogManager( logFileManager );
+       logManager.initLogManager();
+       
+       logFlushManager = new LogFlushManager( logManager, logBufferSize, logFileSize );
+   }
+    
+   /**
+    * {@inheritDoc}
+    */
+    public void log( UserLogRecord userRecord, boolean sync ) throws IOException, InvalidLogException
+    {
+        logFlushManager.append( userRecord, sync );
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public LogScanner beginScan( LogAnchor startPoint )
+    {
+        LogScannerInternal logScanner = new DefaultLogScanner();
+        logScanner.init( startPoint, logFileManager );
+        return logScanner;
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    public void advanceMinNeededLogPosition( LogAnchor newAnchor )
+    {
+       logManager.advanceMinLogAnchor( newAnchor ); 
+    }
+}

Added: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/LogScannerInternal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/LogScannerInternal.java?rev=1178796&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/LogScannerInternal.java
(added)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/log/impl/LogScannerInternal.java
Tue Oct  4 14:00:36 2011
@@ -0,0 +1,16 @@
+
+package org.apache.directory.server.log.impl;
+
+import org.apache.directory.server.log.LogScanner;
+import org.apache.directory.server.log.LogAnchor;
+
+public interface LogScannerInternal extends LogScanner
+{
+    /**
+     * Initializes the scanner
+     *
+     * @param startingPoint
+     * @param logFileManager log file manager to use 
+     */
+    public void init( LogAnchor startingPoint, LogFileManager logFileManager );
+}



Mime
View raw message