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 RecoverableRandomAccessFileappendRandomAccessFileprotected SequenceSetcorruptedBlocksprotected IntegerdataFileIdprotected Filefileprotected intlengthstatic byteSTANDARD_LOG_FILEprotected inttypeCode-
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 RecoverableRandomAccessFileappendRandomAccessFile()voidcloseRandomAccessFile(RecoverableRandomAccessFile file)intcompareTo(DataFile df)voiddecrementLength(int size)booleandelete()booleanequals(Object o)SequenceSetgetCorruptedBlocks()IntegergetDataFileId()FilegetFile()intgetLength()intgetTypeCode()inthashCode()voidincrementLength(int size)voidmove(File targetDirectory)RecoverableRandomAccessFileopenRandomAccessFile()voidsetLength(int length)voidsetTypeCode(int typeCode)StringtoString()-
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:
compareToin interfaceComparable<DataFile>
-
-