public static final class Volume.MappedFileVol extends Volume.ByteBufferVol
Volume.ByteArrayVol, Volume.ByteBufferVol, Volume.ByteBufferVolSingle, Volume.FileChannelVol, Volume.MappedFileVol, Volume.MappedFileVolSingle, Volume.MemoryVol, Volume.MemoryVolSingle, Volume.RandomAccessFileVol, Volume.ReadOnly, Volume.SingleByteArrayVol, Volume.VolumeFactory| Modifier and Type | Field and Description |
|---|---|
static Volume.VolumeFactory |
FACTORY |
static Volume.VolumeFactory |
FACTORY_WITH_CLEANER_HACK |
protected File |
file |
protected FileChannel |
fileChannel |
protected FileLock |
fileLock |
protected FileChannel.MapMode |
mapMode |
protected RandomAccessFile |
raf |
cleanerHackEnabled, growLock, readOnly, slices, sliceShift, sliceSize, sliceSizeModMaskclosed, LOG, UNSAFE_VOL_FACTORY| Constructor and Description |
|---|
Volume.MappedFileVol(File file,
boolean readOnly,
boolean fileLockDisable,
int sliceShift,
boolean cleanerHackEnabled,
long initSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
ensureAvailable(long offset)
Check space allocated by Volume is bigger or equal to given offset.
|
boolean |
fileLoad()
If underlying storage is memory-mapped-file, this method will try to
load and precache all file data into disk cache.
|
File |
getFile()
returns underlying file if it exists
|
boolean |
getFileLocked()
return true if this Volume holds exclusive lock over its file
|
long |
length() |
void |
sync() |
void |
truncate(long size) |
clear, getByte, getData, getDataInput, getDataInputOverlap, getInt, getLong, getPackedLong, getSixLong, getSlice, getUnsignedByte, getUnsignedShort, isSliced, putByte, putData, putData, putDataOverlap, putInt, putLong, putPackedLong, putSixLong, putUnsignedByte, putUnsignedShort, sliceSize, toByte, toByte, transferInto, unmapassertZeroes, copyEntireVolumeTo, deleteFile, finalize, getLongPackBidi, getLongPackBidiReverse, hash, isClosed, putLongPackBidi, volumeTransferpublic static final Volume.VolumeFactory FACTORY
public static final Volume.VolumeFactory FACTORY_WITH_CLEANER_HACK
protected final File file
protected final FileChannel fileChannel
protected final FileChannel.MapMode mapMode
protected final RandomAccessFile raf
protected final FileLock fileLock
public Volume.MappedFileVol(File file, boolean readOnly, boolean fileLockDisable, int sliceShift, boolean cleanerHackEnabled, long initSize)
public final void ensureAvailable(long offset)
VolumeensureAvailable in class Volumepublic void close()
public File getFile()
Volumepublic boolean getFileLocked()
VolumegetFileLocked in class Volumepublic 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 © 2015. All Rights Reserved.