org.codehaus.activemq.journal.impl
Class LogFile
java.lang.Object
org.codehaus.activemq.journal.impl.LogFile
- public final class LogFile
- extends Object
Provides a logical view of many seperate files as one single long
log file. The seperate files that compose the LogFile are Segements
of the LogFile.
This class is not thread safe.
- Version:
- $Revision: 1.7 $
Constructor Summary |
LogFile(File logDirectory)
|
LogFile(File logDirectory,
int onlineSegmentCount,
int initialSegmentSize)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
LogFile
public LogFile(File logDirectory)
throws IOException
LogFile
public LogFile(File logDirectory,
int onlineSegmentCount,
int initialSegmentSize)
throws IOException
close
public void close()
throws IOException
- Throws:
IOException
appendAndForce
public void appendAndForce(BatchedWrite write)
throws IOException
- Parameters:
write
-
- Throws:
IOException
readRecordLocation
public RecordLocationImpl readRecordLocation(RecordLocationImpl location)
throws IOException,
InvalidRecordLocationException
- Parameters:
location
-
- Returns:
-
- Throws:
InvalidRecordLocationException
IOException
getNextDataRecordLocation
public RecordLocationImpl getNextDataRecordLocation(RecordLocationImpl lastLocation)
throws IOException,
InvalidRecordLocationException
- Parameters:
lastLocation
-
- Returns:
-
- Throws:
IOException
InvalidRecordLocationException
readData
public byte[] readData(int segmentIndex,
int segmentOffset)
throws IOException
- Parameters:
segmentIndex
- segmentOffset
-
- Returns:
-
- Throws:
IOException
getInitialSegmentSize
public int getInitialSegmentSize()
isSegmentIndexActive
public boolean isSegmentIndexActive(byte i)
getFirstSequenceIdOfSegementIndex
public long getFirstSequenceIdOfSegementIndex(byte i)
canActivateNextSegment
public boolean canActivateNextSegment()
getFirstActiveSegmentIndex
public byte getFirstActiveSegmentIndex()
activateNextSegment
void activateNextSegment()
throws IOException
- Throws:
IOException
getAppendSegmentIndex
public byte getAppendSegmentIndex()
- Returns:
getAppendSegmentOffset
public int getAppendSegmentOffset()
- Returns:
getTotalSegements
int getTotalSegements()
getLastSequenceId
public long getLastSequenceId()
getFirstRecordLocationOfSecondActiveSegment
public RecordLocationImpl getFirstRecordLocationOfSecondActiveSegment(byte fm)
- Returns:
getLogDirectory
public File getLogDirectory()
- Returns:
- Returns the logDirectory.
getLastMarkedRecordLocation
public RecordLocationImpl getLastMarkedRecordLocation(byte fm)
- Returns:
- Returns the lastMark.
Copyright © 2004 Protique, Ltd.. All Rights Reserved.