Skip to content

Commit ba4cbb7

Browse files
authored
dirty flush only work when open flush (#70)
Co-authored-by: alantong(佟明达) <[email protected]>
1 parent b949102 commit ba4cbb7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/apache/hadoop/fs/CosNFSDataOutputStream.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ public synchronized void flush() throws IOException {
178178

179179
private void innerFlush(boolean closeStream) throws IOException {
180180
this.checkOpened();
181-
if (!this.dirty) {
181+
// when close flush data to cos, each time data not upload,
182+
// at this time if we close stream, it is not dirty but also has data need to upload
183+
// so the dirty flag only useful when flush cos enabled.
184+
if (!this.dirty && this.flushCOSEnabled) {
182185
LOG.debug("The stream is up-to-date, no need to refresh.");
183186
return;
184187
}

0 commit comments

Comments
 (0)