public static final class Volume.MappedFileVolSingle extends Volume.ByteBufferVolSingle
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 |
|---|---|
protected static Volume.VolumeFactory |
FACTORY |
protected static Volume.VolumeFactory |
FACTORY_WITH_CLEANER_HACK |
protected File |
file |
protected FileLock |
fileLock |
protected FileChannel.MapMode |
mapMode |
protected RandomAccessFile |
raf |
buffer, cleanerHackEnabled, maxSize, readOnlyclosed, LOG, UNSAFE_VOL_FACTORY| Constructor and Description |
|---|
Volume.MappedFileVolSingle(File file,
boolean readOnly,
boolean fileLockDisabled,
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.
|
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, ensureAvailable, getByte, getData, getDataInput, getDataInputOverlap, getInt, getLong, isSliced, putByte, putData, putData, putDataOverlap, putInt, putLong, sliceSize, transferIntoassertZeroes, copyEntireVolumeTo, deleteFile, finalize, getLongPackBidi, getLongPackBidiReverse, getPackedLong, getSixLong, getUnsignedByte, getUnsignedShort, hash, isClosed, putLongPackBidi, putPackedLong, putSixLong, putUnsignedByte, putUnsignedShort, volumeTransferprotected static final Volume.VolumeFactory FACTORY
protected static final Volume.VolumeFactory FACTORY_WITH_CLEANER_HACK
protected final File file
protected final FileChannel.MapMode mapMode
protected final RandomAccessFile raf
protected final FileLock fileLock
public Volume.MappedFileVolSingle(File file, boolean readOnly, boolean fileLockDisabled, long maxSize, boolean cleanerHackEnabled)
public 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.