Package org.apache.bookkeeper.bookie
Class DefaultFileChannel
- java.lang.Object
-
- org.apache.bookkeeper.bookie.DefaultFileChannel
-
- All Implemented Interfaces:
BookieFileChannel
public class DefaultFileChannel extends java.lang.Object implements BookieFileChannel
Default FileChannel for bookie to read and write.
-
-
Constructor Summary
Constructors Constructor Description DefaultFileChannel(java.io.File file, ServerConfiguration serverConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close file channel and release all resources.boolean
fileExists(java.io.File file)
Check the given file if exists.java.io.FileDescriptor
getFD()
Get the file descriptor of the opened file.java.nio.channels.FileChannel
getFileChannel()
An interface for get the FileChannel from the provider.
-
-
-
Constructor Detail
-
DefaultFileChannel
DefaultFileChannel(java.io.File file, ServerConfiguration serverConfiguration) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getFileChannel
public java.nio.channels.FileChannel getFileChannel() throws java.io.FileNotFoundException
Description copied from interface:BookieFileChannel
An interface for get the FileChannel from the provider.- Specified by:
getFileChannel
in interfaceBookieFileChannel
- Returns:
- Throws:
java.io.FileNotFoundException
-
fileExists
public boolean fileExists(java.io.File file)
Description copied from interface:BookieFileChannel
Check the given file if exists.- Specified by:
fileExists
in interfaceBookieFileChannel
- Returns:
-
getFD
public java.io.FileDescriptor getFD() throws java.io.IOException
Description copied from interface:BookieFileChannel
Get the file descriptor of the opened file.- Specified by:
getFD
in interfaceBookieFileChannel
- Returns:
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
Description copied from interface:BookieFileChannel
Close file channel and release all resources.- Specified by:
close
in interfaceBookieFileChannel
- Throws:
java.io.IOException
-
-