umamaheswararao commented on a change in pull request #2849:
URL: https://github.com/apache/ozone/pull/2849#discussion_r758747010
##########
File path:
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java
##########
@@ -351,38 +363,27 @@ private void handleOutputStreamWrite(int currIdx, long
len,
try {
// Since it's a fullcell, let's write all content from buffer.
writeToOutputStream(current, len, bytesToWrite.array(),
- bytesToWrite.array().length, 0, current.getWrittenDataLength(),
- isParity);
+ bytesToWrite.array().length, 0, isParity);
} catch (Exception e) {
markStreamAsFailed(e);
}
}
}
private int writeToOutputStream(BlockOutputStreamEntry current, long len,
- byte[] b, int writeLen, int off, long currentPos, boolean isParity)
+ byte[] b, int writeLen, int off, boolean isParity)
throws IOException {
try {
current.write(b, off, writeLen);
if (!isParity) {
offset += writeLen;
}
} catch (IOException ioe) {
- // for the current iteration, totalDataWritten - currentPos gives the
- // amount of data already written to the buffer
-
- // In the retryPath, the total data to be written will always be equal
- // to or less than the max length of the buffer allocated.
- // The len specified here is the combined sum of the data length of
- // the buffers
- Preconditions.checkState(len <= config.getStreamBufferMaxSize());
- int dataWritten = (int) (current.getWrittenDataLength() - currentPos);
- writeLen = dataWritten;
-
if (!isParity) {
Review comment:
Sure, I can move that part to above try block. Since the error checking
and retrying within the stream is not implemented yet, all the length
adjustments happen at the time of handleStripeFailure. So, we will just
increment the length here and if there is an exception, setIOException would be
invoked inside handleException. Later before and after putBlock, we will check
stream failure statuses.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]