Package org.jgroups.raft.filelog
Class FileStorage
java.lang.Object
org.jgroups.raft.filelog.FileStorage
- All Implemented Interfaces:
Closeable,AutoCloseable
Base class to store data in a file.
- Since:
- 0.5.4
- Author:
- Pedro Ruivo
-
Constructor Summary
ConstructorsConstructorDescriptionFileStorage(File storageFile) FileStorage(File storageFile, int writeAheadBytes) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddelete()voidflush()longioBufferWith(int requiredCapacity) booleanisOpened()voidopen()read(long position, int expectedLength) voidtruncateFrom(long position) voidtruncateTo(long size) intwrite(long position)
-
Constructor Details
-
FileStorage
-
FileStorage
-
-
Method Details
-
ioBufferWith
-
getCachedFileSize
public long getCachedFileSize() -
getStorageFile
-
open
- Throws:
IOException
-
write
- Throws:
IOException
-
read
- Throws:
IOException
-
isOpened
public boolean isOpened() -
flush
- Throws:
IOException
-
truncateTo
- Throws:
IOException
-
truncateFrom
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
delete
- Throws:
IOException
-