Skip to content

Commit 566419b

Browse files
committed
Make HDFS file writes to flush after the write
1 parent 0e293f4 commit 566419b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/HdfsFile.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,15 @@ bool HdfsFile::write(const std::string& data) {
120120
tSize bytesWritten = hdfsWrite(fileSys, hfile, data.data(),
121121
(tSize) data.length());
122122
bool retVal = (bytesWritten == (tSize) data.length()) ? true : false;
123+
if (retVal) {
124+
hdfsHFlush(fileSys, hfile);
125+
}
123126
return retVal;
124127
}
125128

126129
void HdfsFile::flush() {
127130
if (hfile) {
128-
hdfsFlush(fileSys, hfile);
131+
hdfsHFlush(fileSys, hfile);
129132
}
130133
}
131134

0 commit comments

Comments
 (0)