Class DataFile
- java.lang.Object
-
- org.apache.activemq.store.kahadb.disk.util.LinkedNode<DataFile>
-
- org.apache.activemq.store.kahadb.disk.journal.DataFile
-
- All Implemented Interfaces:
Comparable<DataFile>
- Direct Known Subclasses:
ReadOnlyDataFile
public class DataFile extends LinkedNode<DataFile> implements Comparable<DataFile>
DataFile
-
-
Field Summary
Fields Modifier and Type Field Description protected RecoverableRandomAccessFile
appendRandomAccessFile
protected SequenceSet
corruptedBlocks
protected Integer
dataFileId
protected File
file
protected int
length
static byte
STANDARD_LOG_FILE
protected int
typeCode
-
Fields inherited from class org.apache.activemq.store.kahadb.disk.util.LinkedNode
list, next, prev
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecoverableRandomAccessFile
appendRandomAccessFile()
void
closeRandomAccessFile(RecoverableRandomAccessFile file)
int
compareTo(DataFile df)
void
decrementLength(int size)
boolean
delete()
boolean
equals(Object o)
SequenceSet
getCorruptedBlocks()
Integer
getDataFileId()
File
getFile()
int
getLength()
int
getTypeCode()
int
hashCode()
void
incrementLength(int size)
void
move(File targetDirectory)
RecoverableRandomAccessFile
openRandomAccessFile()
void
setLength(int length)
void
setTypeCode(int typeCode)
String
toString()
-
Methods inherited from class org.apache.activemq.store.kahadb.disk.util.LinkedNode
getHeadNode, getList, getNext, getNextCircular, getPrevious, getPreviousCircular, getTailNode, isHeadNode, isLinked, isTailNode, linkAfter, linkAfter, linkBefore, linkBefore, linkToHead, linkToTail, splitAfter, splitBefore, unlink
-
-
-
-
Field Detail
-
STANDARD_LOG_FILE
public static final byte STANDARD_LOG_FILE
- See Also:
- Constant Field Values
-
file
protected final File file
-
dataFileId
protected final Integer dataFileId
-
length
protected volatile int length
-
typeCode
protected int typeCode
-
corruptedBlocks
protected final SequenceSet corruptedBlocks
-
appendRandomAccessFile
protected RecoverableRandomAccessFile appendRandomAccessFile
-
-
Method Detail
-
getFile
public File getFile()
-
getDataFileId
public Integer getDataFileId()
-
getTypeCode
public int getTypeCode()
-
setTypeCode
public void setTypeCode(int typeCode)
-
getLength
public int getLength()
-
setLength
public void setLength(int length)
-
incrementLength
public void incrementLength(int size)
-
decrementLength
public void decrementLength(int size)
-
appendRandomAccessFile
public RecoverableRandomAccessFile appendRandomAccessFile() throws IOException
- Throws:
IOException
-
openRandomAccessFile
public RecoverableRandomAccessFile openRandomAccessFile() throws IOException
- Throws:
IOException
-
closeRandomAccessFile
public void closeRandomAccessFile(RecoverableRandomAccessFile file) throws IOException
- Throws:
IOException
-
delete
public boolean delete() throws IOException
- Throws:
IOException
-
move
public void move(File targetDirectory) throws IOException
- Throws:
IOException
-
getCorruptedBlocks
public SequenceSet getCorruptedBlocks()
-
compareTo
public int compareTo(DataFile df)
- Specified by:
compareTo
in interfaceComparable<DataFile>
-
-