Created
April 24, 2012 10:46
-
-
Save Amareshwari/2478721 to your computer and use it in GitHub Desktop.
Patch for Scribe : Make HDFS file writes to flush after the write
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git src/HdfsFile.cpp src/HdfsFile.cpp | |
index f1ffadf..ac5d134 100644 | |
--- src/HdfsFile.cpp | |
+++ src/HdfsFile.cpp | |
@@ -120,12 +120,15 @@ bool HdfsFile::write(const std::string& data) { | |
tSize bytesWritten = hdfsWrite(fileSys, hfile, data.data(), | |
(tSize) data.length()); | |
bool retVal = (bytesWritten == (tSize) data.length()) ? true : false; | |
+ if (retVal) { | |
+ hdfsHFlush(fileSys, hfile); | |
+ } | |
return retVal; | |
} | |
void HdfsFile::flush() { | |
if (hfile) { | |
- hdfsFlush(fileSys, hfile); | |
+ hdfsHFlush(fileSys, hfile); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment