org.codehaus.activemq.journal.impl
Class Segment
java.lang.Object
org.codehaus.activemq.journal.impl.Segment
- public class Segment
- extends Object
Allows read/append access to a segment of a LogFile.
- Version:
- $Revision: 1.2 $
Constructor Summary |
Segment(File file,
int initialSize,
byte index)
|
SEGMENT_HEADER_SIZE
public static final int SEGMENT_HEADER_SIZE
- See Also:
- Constant Field Values
Segment
public Segment(File file,
int initialSize,
byte index)
throws IOException
seek
public void seek(int newPos)
throws IOException
- Throws:
IOException
force
public void force()
throws IOException
- Throws:
IOException
reinitialize
public void reinitialize()
throws IOException
- Throws:
IOException
setReadOnly
public void setReadOnly(boolean enable)
throws IOException
- Throws:
IOException
activate
public void activate(int id)
throws IOException
- Throws:
IOException
hashCode
public int hashCode()
getId
public int getId()
isActive
public boolean isActive()
getFirstSequenceId
public long getFirstSequenceId()
getLastMark
public Mark getLastMark()
getLastSequenceId
public long getLastSequenceId()
getAppendOffset
public int getAppendOffset()
isAtAppendOffset
public boolean isAtAppendOffset()
throws IOException
- Throws:
IOException
write
public void write(BatchedWrite write)
throws IOException
- Parameters:
write
-
- Throws:
IOException
write
public void write(ByteBuffer byteBuffer)
throws IOException
- Throws:
IOException
readRecordHeader
public void readRecordHeader(RecordHeader seekedRecordHeader)
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Throws:
IOException
read
public void read(byte[] answer)
throws IOException
- Throws:
IOException
isReadOnly
public boolean isReadOnly()
- Returns:
getIndex
public byte getIndex()
toString
public String toString()
getFirstRecordLocation
public RecordLocationImpl getFirstRecordLocation(byte fm)
- Returns:
Copyright © 2004 Protique, Ltd.. All Rights Reserved.