HDFS-13712. BlockReaderRemote.read() logging improvement. Contributed by Gergo Repas.
This commit is contained in:
parent
d9ba6f3656
commit
344f324710
@ -129,16 +129,22 @@ public Peer getPeer() {
|
|||||||
@Override
|
@Override
|
||||||
public synchronized int read(byte[] buf, int off, int len)
|
public synchronized int read(byte[] buf, int off, int len)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
UUID randomId = (LOG.isTraceEnabled() ? UUID.randomUUID() : null);
|
boolean logTraceEnabled = LOG.isTraceEnabled();
|
||||||
|
UUID randomId = null;
|
||||||
|
if (logTraceEnabled) {
|
||||||
|
randomId = UUID.randomUUID();
|
||||||
LOG.trace("Starting read #{} file {} from datanode {}",
|
LOG.trace("Starting read #{} file {} from datanode {}",
|
||||||
randomId, filename, datanodeID.getHostName());
|
randomId, filename, datanodeID.getHostName());
|
||||||
|
}
|
||||||
|
|
||||||
if (curDataSlice == null ||
|
if (curDataSlice == null ||
|
||||||
curDataSlice.remaining() == 0 && bytesNeededToFinish > 0) {
|
curDataSlice.remaining() == 0 && bytesNeededToFinish > 0) {
|
||||||
readNextPacket();
|
readNextPacket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (logTraceEnabled) {
|
||||||
LOG.trace("Finishing read #{}", randomId);
|
LOG.trace("Finishing read #{}", randomId);
|
||||||
|
}
|
||||||
|
|
||||||
if (curDataSlice.remaining() == 0) {
|
if (curDataSlice.remaining() == 0) {
|
||||||
// we're at EOF now
|
// we're at EOF now
|
||||||
|
Loading…
Reference in New Issue
Block a user