Package org.h2.mvstore.cache
Class FilePathCache.FileCache
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.FileChannel
org.h2.store.fs.FileBase
org.h2.mvstore.cache.FilePathCache.FileCache
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,GatheringByteChannel,InterruptibleChannel,ReadableByteChannel,ScatteringByteChannel,SeekableByteChannel,WritableByteChannel
- Enclosing class:
FilePathCache
A file with a read cache.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.nio.channels.FileChannel
FileChannel.MapMode -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FileChannelprivate final CacheLongKeyLIRS<ByteBuffer> private static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidclearCache(ByteBuffer src, long position) voidforce(boolean metaData) private static longgetCachePos(long pos) protected voidlongposition()position(long newPosition) intread(ByteBuffer dst) intread(ByteBuffer dst, long position) longsize()toString()truncate(long newSize) tryLock(long position, long size, boolean shared) intwrite(ByteBuffer src) intwrite(ByteBuffer src, long position) Methods inherited from class org.h2.store.fs.FileBase
lock, map, read, transferFrom, transferTo, writeMethods inherited from class java.nio.channels.FileChannel
lock, map, open, open, read, tryLock, writeMethods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Field Details
-
CACHE_BLOCK_SIZE
private static final int CACHE_BLOCK_SIZE- See Also:
-
base
-
cache
-
-
Constructor Details
-
FileCache
FileCache(FileChannel base)
-
-
Method Details
-
implCloseChannel
- Overrides:
implCloseChannelin classFileBase- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Specified by:
positionin classFileChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Specified by:
positionin classFileChannel- Throws:
IOException
-
read
- Specified by:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Specified by:
readin classFileChannel- Throws:
IOException
-
read
- Overrides:
readin classFileBase- Throws:
IOException
-
getCachePos
private static long getCachePos(long pos) -
size
- Specified by:
sizein interfaceSeekableByteChannel- Specified by:
sizein classFileChannel- Throws:
IOException
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel- Specified by:
truncatein classFileChannel- Throws:
IOException
-
write
- Overrides:
writein classFileBase- Throws:
IOException
-
write
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Specified by:
writein classFileChannel- Throws:
IOException
-
clearCache
-
force
- Overrides:
forcein classFileBase- Throws:
IOException
-
tryLock
- Overrides:
tryLockin classFileBase- Throws:
IOException
-
toString
-