public final class MappedFileVolSingle extends ByteBufferVolSingle
Modifier and Type | Field and Description |
---|---|
protected static VolumeFactory |
FACTORY |
protected static VolumeFactory |
FACTORY_WITH_CLEANER_HACK |
protected java.io.File |
file |
protected java.nio.channels.FileLock |
fileLock |
protected java.nio.channels.FileChannel.MapMode |
mapMode |
protected java.io.RandomAccessFile |
raf |
buffer, cleanerHackEnabled, maxSize, readOnly
closed, LOG, UNSAFE_VOL_FACTORY
Constructor and Description |
---|
MappedFileVolSingle(java.io.File file,
boolean readOnly,
long fileLockWait,
long maxSize,
boolean cleanerHackEnabled) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
fileLoad()
If underlying storage is memory-mapped-file, this method will try to
load and precache all file data into disk cache.
|
java.io.File |
getFile()
returns underlying file if it exists
|
boolean |
getFileLocked()
return true if this Volume holds exclusive lock over its file
|
boolean |
isReadOnly() |
long |
length() |
void |
sync() |
void |
truncate(long size) |
clear, copyTo, ensureAvailable, getByte, getData, getDataInput, getDataInputOverlap, getInt, getLong, isSliced, putByte, putData, putData, putDataOverlap, putInt, putLong, sliceSize
assertZeroes, clearOverlap, copyFrom, copyTo, copyTo, deleteFile, finalize, getPackedLong, getSixLong, getUnsignedByte, getUnsignedShort, hash, isClosed, putPackedLong, putSixLong, putUnsignedByte, putUnsignedShort
protected static final VolumeFactory FACTORY
protected static final VolumeFactory FACTORY_WITH_CLEANER_HACK
protected final java.io.File file
protected final java.nio.channels.FileChannel.MapMode mapMode
protected final java.io.RandomAccessFile raf
protected final java.nio.channels.FileLock fileLock
public MappedFileVolSingle(java.io.File file, boolean readOnly, long fileLockWait, long maxSize, boolean cleanerHackEnabled)
public void close()
public boolean isReadOnly()
isReadOnly
in class Volume
public java.io.File getFile()
Volume
public boolean getFileLocked()
Volume
getFileLocked
in class Volume
public boolean fileLoad()
Volume
If underlying storage is memory-mapped-file, this method will try to
load and precache all file data into disk cache.
Most likely it will call MappedByteBuffer.load()
,
but could also read content of entire file etc
This method will not pin data into memory, they might be removed at any time.
Copyright © 2018. All Rights Reserved.