org.apache.activemq.store.kahadb.disk.journal
Class DataFile

java.lang.Object
  extended by org.apache.activemq.store.kahadb.disk.util.LinkedNode<DataFile>
      extended by 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
protected  SequenceSet corruptedBlocks
           
protected  Integer dataFileId
           
protected  File file
           
protected  int length
           
 
Fields inherited from class org.apache.activemq.store.kahadb.disk.util.LinkedNode
list, next, prev
 
Method Summary
 void closeRandomAccessFile(RandomAccessFile file)
           
 int compareTo(DataFile df)
           
 boolean delete()
           
 boolean equals(Object o)
           
 SequenceSet getCorruptedBlocks()
           
 Integer getDataFileId()
           
 File getFile()
           
 int getLength()
           
 int hashCode()
           
 void incrementLength(int size)
           
 void move(File targetDirectory)
           
 RandomAccessFile openRandomAccessFile()
           
 void setLength(int length)
           
 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

file

protected final File file

dataFileId

protected final Integer dataFileId

length

protected volatile int length

corruptedBlocks

protected final SequenceSet corruptedBlocks
Method Detail

getFile

public File getFile()

getDataFileId

public Integer getDataFileId()

getLength

public int getLength()

setLength

public void setLength(int length)

incrementLength

public void incrementLength(int size)

toString

public String toString()
Overrides:
toString in class Object

openRandomAccessFile

public RandomAccessFile openRandomAccessFile()
                                      throws IOException
Throws:
IOException

closeRandomAccessFile

public void closeRandomAccessFile(RandomAccessFile 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 interface Comparable<DataFile>

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.