org.apache.activeio.journal.active
Class LogFileManager
java.lang.Object
org.apache.activeio.journal.active.LogFileManager
public final class LogFileManager
- extends Object
Provides a logical view of many separate files as one single long log file.
The separate files that compose the LogFile are Segments of the LogFile.
This class is not thread safe.
- Version:
- $Revision: 1.1 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_LOGFILE_COUNT
public static final int DEFAULT_LOGFILE_COUNT
DEFAULT_LOGFILE_SIZE
public static final int DEFAULT_LOGFILE_SIZE
SERIALIZED_SIZE
public static final int SERIALIZED_SIZE
- See Also:
- Constant Field Values
DATA_RECORD_TYPE
public static final byte DATA_RECORD_TYPE
- See Also:
- Constant Field Values
MARK_RECORD_TYPE
public static final byte MARK_RECORD_TYPE
- See Also:
- Constant Field Values
LogFileManager
public LogFileManager(File logDirectory)
throws IOException
- Throws:
IOException
LogFileManager
public LogFileManager(File logDirectory,
int onlineLogFileCount,
int initialLogFileSize,
File archiveDirectory)
throws IOException
- Throws:
IOException
dispose
public void dispose()
append
public void append(BatchedWrite write)
throws IOException
- Parameters:
write
-
- Throws:
IOException
getNextDataRecordLocation
public Location getNextDataRecordLocation(Location lastLocation)
throws IOException,
InvalidRecordLocationException
- Parameters:
lastLocation
-
- Returns:
-
- Throws:
IOException
InvalidRecordLocationException
readPacket
public Packet readPacket(Location location)
throws IOException,
InvalidRecordLocationException
- Parameters:
logFileIndex
- logFileOffset
-
- Returns:
-
- Throws:
IOException
InvalidRecordLocationException
getInitialLogFileSize
public int getInitialLogFileSize()
getFirstActiveLogLocation
public Location getFirstActiveLogLocation()
getLogDirectory
public File getLogDirectory()
- Returns:
- Returns the logDirectory.
getLastMarkedRecordLocation
public Location getLastMarkedRecordLocation()
- Returns:
- Returns the lastMark.
getNextAppendLocation
public Location getNextAppendLocation()
getOnlineLogFileCount
public int getOnlineLogFileCount()
- Returns:
- Returns the onlineLogFileCount.
isPastHalfActive
public boolean isPastHalfActive()
getFirstRecordLocationOfSecondActiveLogFile
public Location getFirstRecordLocationOfSecondActiveLogFile()
canActivateNextLogFile
public boolean canActivateNextLogFile()
Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.