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 voidclose()Close file channel and release all resources.booleanfileExists(java.io.File file)Check the given file if exists.java.io.FileDescriptorgetFD()Get the file descriptor of the opened file.java.nio.channels.FileChannelgetFileChannel()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.FileNotFoundExceptionDescription copied from interface:BookieFileChannelAn interface for get the FileChannel from the provider.- Specified by:
getFileChannelin interfaceBookieFileChannel- Returns:
- Throws:
java.io.FileNotFoundException
-
fileExists
public boolean fileExists(java.io.File file)
Description copied from interface:BookieFileChannelCheck the given file if exists.- Specified by:
fileExistsin interfaceBookieFileChannel- Returns:
-
getFD
public java.io.FileDescriptor getFD() throws java.io.IOExceptionDescription copied from interface:BookieFileChannelGet the file descriptor of the opened file.- Specified by:
getFDin interfaceBookieFileChannel- Returns:
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:BookieFileChannelClose file channel and release all resources.- Specified by:
closein interfaceBookieFileChannel- Throws:
java.io.IOException
-
-