public class ChunkFileOut extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
File |
file |
static int |
FSYNC_INTERVAL_BYTES |
| Constructor and Description |
|---|
ChunkFileOut(File file,
MutatorCatchup mc) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Flushes any remaining data to the file, executes
fsync on it as indicated by the
needsFsyncBeforeClosing flag, and closes the file. |
void |
flagForFsyncOnClose(boolean fsyncOnClose)
Sets whether to execute an
fsync operation on the chunk file before closing it. |
void |
fsync() |
void |
writeTombstone(long seq,
long prefix,
byte[] key)
Writes a tombstone record to the chunk file.
|
void |
writeTombstone(long seq,
long prefix,
ByteBuffer keyBuf,
int keySize)
Writes a tombstone record to the chunk file.
|
void |
writeValueRecord(long seq,
long prefix,
byte[] key,
byte[] value)
Writes a value record to the chunk file.
|
void |
writeValueRecord(Record r,
long keyPrefix,
ByteBuffer keyBuf,
ByteBuffer valBuf)
Writes a value record to the chunk file.
|
public static final int FSYNC_INTERVAL_BYTES
public final File file
public ChunkFileOut(File file, MutatorCatchup mc) throws FileNotFoundException
FileNotFoundExceptionpublic void writeValueRecord(long seq,
long prefix,
byte[] key,
byte[] value)
seq - record seqprefix - key prefixkey - key blobvalue - value blobpublic void writeValueRecord(Record r, long keyPrefix, ByteBuffer keyBuf, ByteBuffer valBuf)
r - Record instance corresponding to the record to be writtenkeyPrefix - key prefixkeyBuf - byte buffer with key blobvalBuf - byte buffer with value blobpublic void writeTombstone(long seq,
long prefix,
byte[] key)
seq - record seqprefix - key prefixkey - key blobpublic void writeTombstone(long seq,
long prefix,
ByteBuffer keyBuf,
int keySize)
seq - record seqprefix - key prefixkeyBuf - byte buffer containing, among other data, the key blob and positioned at itkeySize - size of the keypublic void flagForFsyncOnClose(boolean fsyncOnClose)
fsync operation on the chunk file before closing it.public void fsync()
public void close()
fsync on it as indicated by the
needsFsyncBeforeClosing flag, and closes the file.close in interface Closeableclose in interface AutoCloseableCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.