Class FileDescriptor
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.wal.FileDescriptor
-
- All Implemented Interfaces:
Comparable<FileDescriptor>,AbstractWalRecordsIterator.AbstractFileDescriptor
public class FileDescriptor extends Object implements Comparable<FileDescriptor>, AbstractWalRecordsIterator.AbstractFileDescriptor
WAL file descriptor.
-
-
Constructor Summary
Constructors Constructor Description FileDescriptor(File file)Creates file descriptor.FileDescriptor(File file, @Nullable Long idx)Creates file descriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(FileDescriptor o)booleanequals(Object o)Filefile()static StringfileName(long idx)Getting segment file name.StringgetAbsolutePath()Return absolute pathname string of this file descriptor pathname.longgetIdx()Return absolute WAL segment file index.inthashCode()longidx()booleanisCompressed()SegmentIOtoReadOnlyIO(FileIOFactory fileIOFactory)Make fileIo by this description.StringtoString()
-
-
-
Field Detail
-
file
protected final File file
File represented by this class.
-
idx
protected final long idx
Absolute WAL segment file index.
-
-
Constructor Detail
-
FileDescriptor
public FileDescriptor(File file)
Creates file descriptor. Index is restored from file name.- Parameters:
file- WAL segment file.
-
-
Method Detail
-
fileName
public static String fileName(long idx)
Getting segment file name.- Parameters:
idx- Segment index.- Returns:
- Segment file name.
-
compareTo
public int compareTo(FileDescriptor o)
- Specified by:
compareToin interfaceComparable<FileDescriptor>
-
getIdx
public long getIdx()
Return absolute WAL segment file index.- Returns:
- Absolute WAL segment file index.
-
getAbsolutePath
public String getAbsolutePath()
Return absolute pathname string of this file descriptor pathname.- Returns:
- Absolute pathname string of this file descriptor pathname.
-
isCompressed
public boolean isCompressed()
- Specified by:
isCompressedin interfaceAbstractWalRecordsIterator.AbstractFileDescriptor
-
file
public File file()
- Specified by:
filein interfaceAbstractWalRecordsIterator.AbstractFileDescriptor
-
idx
public long idx()
- Specified by:
idxin interfaceAbstractWalRecordsIterator.AbstractFileDescriptor
-
toReadOnlyIO
public SegmentIO toReadOnlyIO(FileIOFactory fileIOFactory) throws IOException
Make fileIo by this description.- Specified by:
toReadOnlyIOin interfaceAbstractWalRecordsIterator.AbstractFileDescriptor- Parameters:
fileIOFactory- Factory for fileIo creation.- Returns:
- One of implementation of
FileIO. - Throws:
IOException- if creation of fileIo was not success.
-
-