public final class JournalFile extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
RECYCLED_SUFFIX |
static String |
SUFFIX |
| Constructor and Description |
|---|
JournalFile(int index,
String baseName,
File dataFolder,
File recycledFile,
int writeBufferSize,
int storageSyncMethod)
Constructor (recycled file)
|
JournalFile(int index,
String baseName,
File dataFolder,
long maxJournalSize,
int writeBufferSize,
int storageSyncMethod,
boolean preAllocateFiles)
Constructor (new file)
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeAndDelete()
Close and delete the journal file
|
File |
closeAndRecycle()
Close and recycle the journal file
|
protected void |
complete() |
long |
getLastTransactionId() |
boolean |
isComplete() |
void |
setLastTransactionId(long lastTransactionId) |
long |
size() |
protected void |
sync()
Force file content sync to disk
|
String |
toString() |
void |
write(byte[] data) |
void |
writeByte(int v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
public static final String SUFFIX
public static final String RECYCLED_SUFFIX
public JournalFile(int index,
String baseName,
File dataFolder,
long maxJournalSize,
int writeBufferSize,
int storageSyncMethod,
boolean preAllocateFiles)
throws JournalException
JournalExceptionpublic JournalFile(int index,
String baseName,
File dataFolder,
File recycledFile,
int writeBufferSize,
int storageSyncMethod)
throws JournalException
JournalExceptionprotected void sync()
throws JournalException
JournalExceptionprotected void complete()
throws JournalException
JournalExceptionpublic void write(byte[] data)
throws JournalException
JournalExceptionpublic void writeByte(int v)
throws JournalException
JournalExceptionpublic void writeInt(int v)
throws JournalException
JournalExceptionpublic void writeLong(long v)
throws JournalException
JournalExceptionpublic long size()
public boolean isComplete()
public void setLastTransactionId(long lastTransactionId)
lastTransactionId - the lastTransactionId to setpublic long getLastTransactionId()
public void closeAndDelete()
throws JournalException
JournalExceptionpublic File closeAndRecycle() throws JournalException
JournalExceptionpublic void close()
throws JournalException
JournalExceptionCopyright © 2021. All rights reserved.