quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jianq...@apache.org
Subject [31/50] [abbrv] incubator-quickstep git commit: Avoid crash due to an error in deleting a file in HDFS.
Date Tue, 21 Feb 2017 03:38:14 GMT
Avoid crash due to an error in deleting a file in HDFS.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/9a95c23b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/9a95c23b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/9a95c23b

Branch: refs/heads/LIP-time-decomposition
Commit: 9a95c23bdfebe877288f325b3844b3a01c77c08a
Parents: f46ae15
Author: Zuyu Zhang <zuyuz@apache.org>
Authored: Tue Feb 7 23:23:50 2017 -0800
Committer: Zuyu Zhang <zuyuz@apache.org>
Committed: Tue Feb 7 23:23:50 2017 -0800

----------------------------------------------------------------------
 storage/FileManagerHdfs.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/9a95c23b/storage/FileManagerHdfs.cpp
----------------------------------------------------------------------
diff --git a/storage/FileManagerHdfs.cpp b/storage/FileManagerHdfs.cpp
index 937750a..3a5167c 100644
--- a/storage/FileManagerHdfs.cpp
+++ b/storage/FileManagerHdfs.cpp
@@ -117,12 +117,17 @@ size_t FileManagerHdfs::numSlots(const block_id block) const {
 bool FileManagerHdfs::deleteBlockOrBlob(const block_id block) {
   const string filename(blockFilename(block));
 
-  if ((hdfsDelete(hdfs_, filename.c_str(), 0) == 0) || (errno == ENOENT)) {
-    return true;
-  } else {
-    LOG(ERROR) << "Failed to delete file " << filename << " with error:
" << strerror(errno);
-    return false;
+  if (hdfsDelete(hdfs_, filename.c_str(), 0)) {
+    switch (errno) {
+      case EINPROGRESS:
+      case ENOENT:
+        break;
+      default:
+        LOG(ERROR) << "Failed to delete file " << filename << " with error:
" << strerror(errno);
+    }
   }
+
+  return true;
 }
 
 bool FileManagerHdfs::readBlockOrBlob(const block_id block,


Mime
View raw message