Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ private void executePutBlock(boolean close,
} else {
byteBufferList = null;
}
flush();
waitFuturesComplete();
if (close) {
dataStreamCloseReply = out.closeAsync();
}
Expand Down Expand Up @@ -485,8 +485,16 @@ private void executePutBlock(boolean close,

@Override
public void flush() throws IOException {
if (xceiverClientFactory != null && xceiverClient != null
&& !config.isStreamBufferFlushDelay()) {
waitFuturesComplete();
}
}

public void waitFuturesComplete() throws IOException {
try {
CompletableFuture.allOf(futures.toArray(EMPTY_FUTURE_ARRAY)).get();
futures.clear();
} catch (Exception e) {
LOG.warn("Failed to write all chunks through stream: " + e);
throw new IOException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public static void init() throws Exception {
blockSize = 2 * maxFlushSize;

OzoneClientConfig clientConfig = conf.getObject(OzoneClientConfig.class);
clientConfig.setStreamBufferFlushDelay(false);
conf.setFromObject(clientConfig);

conf.setTimeDuration(HDDS_SCM_WATCHER_TIMEOUT, 1000, TimeUnit.MILLISECONDS);
Expand Down