Reidddddd commented on a change in pull request #633: HBASE-22890 Verify the
file integrity in persistent IOEngine
URL: https://github.com/apache/hbase/pull/633#discussion_r326014760
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java
##########
@@ -267,6 +310,76 @@ void refreshFileConnection(int accessFileNum, IOException
ioe) throws IOExceptio
}
}
+ /**
+ * Delete bucketcache files
+ */
+ @Override
+ public void deleteCacheDataFile() {
+ if (filePaths == null) {
+ return;
+ }
+ for (String file : filePaths) {
+ new File(file).delete();
+ }
+ }
+
+ @Override
+ public byte[] calculateChecksum(String algorithm) throws IOException{
+ if (filePaths == null) {
+ return null;
+ }
+ StringBuilder sb = new StringBuilder();
+ for (String filePath : filePaths){
+ File file = new File(filePath);
+ if (file.exists()){
+ sb.append(filePath);
+ sb.append(getFileSize(filePath));
+ sb.append(file.lastModified());
+ } else {
+ throw new IOException("Cache file: " + filePath + " is not exists.");
Review comment:
In fact, after FileIOE inited, the file path must be exist anyway. I know's
it's the complaining in code check, so can we just swallow this IOE in this
method, instead of throw to upper caller?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services