Class FileIOEngine
java.lang.Object
org.apache.hadoop.hbase.io.hfile.bucket.PersistentIOEngine
org.apache.hadoop.hbase.io.hfile.bucket.FileIOEngine
- All Implemented Interfaces:
- IOEngine
IO engine that stores data to a file on the local file system.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprivate static interfaceprivate static classprivate static class
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final longprivate final ReentrantLock[]static final Stringprivate final FileChannel[]private static final org.slf4j.Loggerprivate booleanprivate final RandomAccessFile[]private FileIOEngine.FileReadAccessorprivate final longprivate FileIOEngine.FileWriteAccessorFields inherited from class org.apache.hadoop.hbase.io.hfile.bucket.PersistentIOEnginefilePaths
- 
Constructor SummaryConstructorsConstructorDescriptionFileIOEngine(long capacity, boolean maintainPersistence, String... filePaths) 
- 
Method SummaryModifier and TypeMethodDescriptionprivate voidaccessFile(FileIOEngine.FileAccessor accessor, ByteBuff buff, long globalOffset) (package private) void(package private) voidprivate longgetAbsoluteOffsetInFile(int fileNum, long globalOffset) Get the absolute offset in given file with the relative global offset.(package private) FileChannel[]private intgetFileNum(long offset) booleanFile IO engine is always able to support persistent storage for the cacheread(BucketEntry be) Transfers data from file to the given byte buffer(package private) voidrefreshFileConnection(int accessFileNum, IOException ioe) voidshutdown()Close the filevoidsync()Sync the data to file after writingtoString()voidwrite(ByteBuffer srcBuffer, long offset) Transfers data from the given byte buffer to filevoidTransfers the data from the given MultiByteBuffer to IOEngineMethods inherited from class org.apache.hadoop.hbase.io.hfile.bucket.PersistentIOEnginecalculateChecksum, verifyFileIntegrityMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.io.hfile.bucket.IOEngineusesSharedMemory
- 
Field Details- 
LOG
- 
FILE_DELIMITER- See Also:
 
- 
fileChannels
- 
rafs
- 
channelLocks
- 
sizePerFile
- 
capacity
- 
maintainPersistence
- 
readAccessor
- 
writeAccessor
 
- 
- 
Constructor Details- 
FileIOEnginepublic FileIOEngine(long capacity, boolean maintainPersistence, String... filePaths) throws IOException - Throws:
- IOException
 
 
- 
- 
Method Details- 
toString
- 
isPersistentFile IO engine is always able to support persistent storage for the cache
- 
readTransfers data from file to the given byte buffer- Parameters:
- be- an- BucketEntrywhich maintains an (offset, len, refCnt)
- Returns:
- the Cacheablewith block data inside.
- Throws:
- IOException- if any IO error happen.
 
- 
checkCacheTime- Throws:
- IOException
 
- 
closeFileChannelsvoid closeFileChannels()
- 
writeTransfers data from the given byte buffer to file- Parameters:
- srcBuffer- the given byte buffer from which bytes are to be read
- offset- The offset in the file where the first byte to be written
- Throws:
- IOException
 
- 
syncSync the data to file after writing- Throws:
- IOException
 
- 
shutdownClose the file
- 
writeDescription copied from interface:IOEngineTransfers the data from the given MultiByteBuffer to IOEngine- Parameters:
- srcBuff- the given MultiBytebufffers from which bytes are to be read
- offset- the offset in the IO engine where the first byte to be written
- Throws:
- IOException
 
- 
accessFileprivate void accessFile(FileIOEngine.FileAccessor accessor, ByteBuff buff, long globalOffset) throws IOException - Throws:
- IOException
 
- 
getAbsoluteOffsetInFileGet the absolute offset in given file with the relative global offset.- Returns:
- the absolute offset
 
- 
getFileNum
- 
getFileChannels
- 
refreshFileConnection- Throws:
- IOException
 
 
-