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 Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final PersistentIOEngine.DuFileCommand
protected final String[]
private static final org.slf4j.Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]
calculateChecksum
(String algorithm) Using an encryption algorithm to calculate a checksum, the default encryption algorithm is MD5private static long
getFileSize
(String filePath) Using Linux command du to get file's real sizeprotected void
verifyFileIntegrity
(byte[] persistentChecksum, String algorithm) Verify cache files's integrityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.io.hfile.bucket.IOEngine
isPersistent, read, shutdown, sync, usesSharedMemory, write, write
-
Field Details
-
LOG
-
DU
-
filePaths
-
-
Constructor Details
-
PersistentIOEngine
-
-
Method Details
-
verifyFileIntegrity
Verify cache files's integrity- Parameters:
algorithm
- the backingMap persistence path- Throws:
IOException
-
calculateChecksum
Using 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 existsNoSuchAlgorithmException
- no such algorithm
-
getFileSize
Using 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
-