Class PersistentIOEngine
java.lang.Object
org.apache.hadoop.hbase.io.hfile.bucket.PersistentIOEngine
- All Implemented Interfaces:
- IOEngine
- Direct Known Subclasses:
- FileIOEngine,- FileMmapIOEngine
A class implementing PersistentIOEngine interface supports file integrity verification for
 
BucketCache which use persistent IOEngine- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final PersistentIOEngine.DuFileCommandprotected final String[]private static final org.slf4j.Logger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected byte[]calculateChecksum(String algorithm) Using an encryption algorithm to calculate a checksum, the default encryption algorithm is MD5private static longgetFileSize(String filePath) Using Linux command du to get file's real sizeprotected voidverifyFileIntegrity(byte[] persistentChecksum, String algorithm) Verify cache files's integrityMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.io.hfile.bucket.IOEngineisPersistent, read, shutdown, sync, usesSharedMemory, write, write
- 
Field Details- 
LOG
- 
DU
- 
filePaths
 
- 
- 
Constructor Details- 
PersistentIOEngine
 
- 
- 
Method Details- 
verifyFileIntegrityVerify cache files's integrity- Parameters:
- algorithm- the backingMap persistence path
- Throws:
- IOException
 
- 
calculateChecksumUsing an encryption algorithm to calculate a checksum, the default encryption algorithm is MD5- Returns:
- the checksum which is convert to HexString
- Throws:
- IOException- something happened like file not exists
- NoSuchAlgorithmException- no such algorithm
 
- 
getFileSizeUsing Linux command du to get file's real size- Parameters:
- filePath- the file
- Returns:
- file's real size
- Throws:
- IOException- something happened like file not exists
 
 
-