Skip to content

Instantly share code, notes, and snippets.

@Amareshwari
Amareshwari / scribe-flush-change
Created April 24, 2012 10:46
Patch for Scribe : Make HDFS file writes to flush after the write
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);