HDDS-1037. Fix the block discard logic in Ozone client. Contributed by Shashikant Banerjee.

This commit is contained in:
Shashikant Banerjee 2019-02-01 20:44:48 +05:30
parent 7f46d13dac
commit 4123353151
1 changed files with 3 additions and 2 deletions

View File

@ -338,8 +338,9 @@ public class KeyOutputStream extends OutputStream {
ListIterator<BlockOutputStreamEntry> streamEntryIterator =
streamEntries.listIterator(currentStreamIndex);
while (streamEntryIterator.hasNext()) {
if (streamEntryIterator.next().getBlockID().getContainerID()
== containerID) {
BlockOutputStreamEntry streamEntry = streamEntryIterator.next();
if (streamEntry.getBlockID().getContainerID()
== containerID && streamEntry.getCurrentPosition() == 0) {
streamEntryIterator.remove();
}
}