Package org.h2.store.fs.retry
Class FileRetryOnInterrupt
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.FileChannel
org.h2.store.fs.FileBase
org.h2.store.fs.retry.FileRetryOnInterrupt
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,GatheringByteChannel,InterruptibleChannel,ReadableByteChannel,ScatteringByteChannel,SeekableByteChannel,WritableByteChannel
A file object that re-opens and re-tries the operation if the file was
closed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classA wrapped file lock.Nested classes/interfaces inherited from class java.nio.channels.FileChannel
FileChannel.MapMode -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforce(boolean metaData) voidprivate voidopen()longposition()position(long pos) intread(ByteBuffer dst) intread(ByteBuffer dst, long position) private voidreLock()private voidreopen(int i, IOException e) longsize()toString()truncate(long newLength) 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
-
fileName
-
mode
-
channel
-
lock
-
-
Constructor Details
-
FileRetryOnInterrupt
FileRetryOnInterrupt(String fileName, String mode) throws IOException - Throws:
IOException
-
-
Method Details
-
open
- Throws:
IOException
-
reopen
- Throws:
IOException
-
reLock
- Throws:
IOException
-
implCloseChannel
- Overrides:
implCloseChannelin classFileBase- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Specified by:
positionin classFileChannel- Throws:
IOException
-
size
- Specified by:
sizein interfaceSeekableByteChannel- Specified by:
sizein classFileChannel- Throws:
IOException
-
read
- Specified by:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Specified by:
readin classFileChannel- Throws:
IOException
-
read
- Overrides:
readin classFileBase- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Specified by:
positionin classFileChannel- Throws:
IOException
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel- Specified by:
truncatein classFileChannel- Throws:
IOException
-
force
- Overrides:
forcein classFileBase- Throws:
IOException
-
write
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Specified by:
writein classFileChannel- Throws:
IOException
-
write
- Overrides:
writein classFileBase- Throws:
IOException
-
tryLock
- Overrides:
tryLockin classFileBase- Throws:
IOException
-
toString
-