Package org.h2.store.fs.split
Class FileSplit
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.FileChannel
org.h2.store.fs.FileBase
org.h2.store.fs.FileBaseDefault
org.h2.store.fs.split.FileSplit
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ByteChannel
,Channel
,GatheringByteChannel
,InterruptibleChannel
,ReadableByteChannel
,ScatteringByteChannel
,SeekableByteChannel
,WritableByteChannel
A file that may be split into multiple smaller files.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.nio.channels.FileChannel
FileChannel.MapMode
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FilePathSplit
private long
private FileChannel[]
private final long
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionFileSplit
(FilePathSplit file, String mode, FileChannel[] list, long length, long maxLength) -
Method Summary
Modifier and TypeMethodDescriptionvoid
force
(boolean metaData) private FileChannel
getFileChannel
(long position) void
protected void
implTruncate
(long newLength) The truncate implementation.int
read
(ByteBuffer dst, long position) long
size()
toString()
tryLock
(long position, long size, boolean shared) int
write
(ByteBuffer src, long position) Methods inherited from class org.h2.store.fs.FileBaseDefault
position, position, read, truncate, write
Methods inherited from class org.h2.store.fs.FileBase
lock, map, read, transferFrom, transferTo, write
Methods inherited from class java.nio.channels.FileChannel
lock, map, open, open, read, tryLock, write
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Field Details
-
filePath
-
mode
-
maxLength
private final long maxLength -
list
-
length
private volatile long length
-
-
Constructor Details
-
FileSplit
FileSplit(FilePathSplit file, String mode, FileChannel[] list, long length, long maxLength)
-
-
Method Details
-
implCloseChannel
- Overrides:
implCloseChannel
in classFileBase
- Throws:
IOException
-
size
public long size()- Specified by:
size
in interfaceSeekableByteChannel
- Specified by:
size
in classFileChannel
-
read
- Overrides:
read
in classFileBase
- Throws:
IOException
-
getFileChannel
- Throws:
IOException
-
implTruncate
Description copied from class:FileBaseDefault
The truncate implementation.- Specified by:
implTruncate
in classFileBaseDefault
- Parameters:
newLength
- the new size- Throws:
IOException
- on failure
-
force
- Overrides:
force
in classFileBase
- Throws:
IOException
-
write
- Overrides:
write
in classFileBase
- Throws:
IOException
-
tryLock
- Overrides:
tryLock
in classFileBase
- Throws:
IOException
-
toString
-