Skip to content

Commit

Permalink
fix checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
xiezhineng committed Nov 6, 2023
1 parent 5366ce9 commit e471564
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.hadoop.fs.ChecksumException;
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy;
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
import org.apache.hadoop.hdfs.protocol.LocatedBlock;
import org.apache.hadoop.hdfs.util.StripedBlockUtil;
import org.apache.hadoop.hdfs.util.StripedBlockUtil.BlockReadStats;
Expand Down Expand Up @@ -120,7 +119,7 @@ void skip() {
protected final RawErasureDecoder decoder;
protected final DFSStripedInputStream dfsStripedInputStream;
private long readTo = -1;
protected final int readDNMaxAttempts;
private final int readDNMaxAttempts;

protected ECChunk[] decodeInputs;

Expand Down Expand Up @@ -240,6 +239,7 @@ private int readToBuffer(BlockReader blockReader,
final int targetLength = strategy.getTargetLength();
int curAttempts = 0;
while (curAttempts < readDNMaxAttempts) {
curAttempts++;
int length = 0;
try {
while (length < targetLength) {
Expand All @@ -262,8 +262,7 @@ private int readToBuffer(BlockReader blockReader,
} catch (IOException e) {
//Clear buffer to make next decode success
strategy.getReadBuffer().clear();
if (curAttempts < readDNMaxAttempts - 1) {
curAttempts++;
if (curAttempts < readDNMaxAttempts) {
if (readerInfos[chunkIndex].reader != null) {
readerInfos[chunkIndex].reader.close();
}
Expand All @@ -276,14 +275,16 @@ private int readToBuffer(BlockReader blockReader,
DFSClient.LOG.warn(msg);
continue;
}
DFSClient.LOG.warn("Exception while reading from "
+ currentBlock + " of " + dfsStripedInputStream.getSrc() + " from "
+ currentNode, e);
throw e;
DFSClient.LOG.warn("Exception while reading from "
+ currentBlock + " of " + dfsStripedInputStream.getSrc() + " from "
+ currentNode, e);
throw e;
}
}
}
}
return -1;
throw new IOException("Read request interrupted. " +
currentBlock + " of " + dfsStripedInputStream.getSrc() + " from "
+ currentNode);
}

private Callable<BlockReadStats> readCells(final BlockReader reader,
Expand Down

0 comments on commit e471564

Please sign in to comment.