Skip to content

Commit 6fdcaee

Browse files
committed
fix review opinions.
1 parent 19f6f08 commit 6fdcaee

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status.SUCCESS;
2121

2222
import java.io.BufferedOutputStream;
23-
import java.io.Closeable;
2423
import java.io.DataInputStream;
2524
import java.io.DataOutputStream;
2625
import java.io.IOException;
@@ -30,7 +29,6 @@
3029
import java.net.InetAddress;
3130
import java.net.InetSocketAddress;
3231
import java.net.Socket;
33-
import java.net.UnknownHostException;
3432
import java.nio.channels.ClosedChannelException;
3533
import java.util.ArrayList;
3634
import java.util.Arrays;
@@ -154,7 +152,7 @@ void recordFailure(final InvalidEncryptionKeyException e)
154152
}
155153
}
156154

157-
private class StreamerStreams implements Closeable {
155+
private class StreamerStreams implements java.io.Closeable {
158156
private Socket sock = null;
159157
private DataOutputStream out = null;
160158
private DataInputStream in = null;
@@ -575,17 +573,17 @@ private DataStreamer(HdfsFileStatus stat, ExtendedBlock block,
575573
if (congestionBackOffMeanTimeInMs <= 0 || congestionBackOffMaxTimeInMs <= 0 ||
576574
congestionBackOffMaxTimeInMs < congestionBackOffMeanTimeInMs) {
577575
if (congestionBackOffMeanTimeInMs <= 0) {
578-
LOG.warn("Configuration: {} is not appropriate, use default value: {}",
576+
LOG.warn("Configuration: {} is not appropriate, using default value: {}",
579577
HdfsClientConfigKeys.DFS_CLIENT_CONGESTION_BACKOFF_MEAN_TIME,
580578
HdfsClientConfigKeys.DFS_CLIENT_CONGESTION_BACKOFF_MEAN_TIME_DEFAULT);
581579
}
582580
if (congestionBackOffMaxTimeInMs <= 0) {
583-
LOG.warn("Configuration: {} is not appropriate, use default value: {}",
581+
LOG.warn("Configuration: {} is not appropriate, using default value: {}",
584582
HdfsClientConfigKeys.DFS_CLIENT_CONGESTION_BACKOFF_MAX_TIME,
585583
HdfsClientConfigKeys.DFS_CLIENT_CONGESTION_BACKOFF_MAX_TIME_DEFAULT);
586584
}
587585
if (congestionBackOffMaxTimeInMs < congestionBackOffMeanTimeInMs) {
588-
LOG.warn("Configuration: {} can not less than {}, use their default values.",
586+
LOG.warn("Configuration: {} can not less than {}, using their default values.",
589587
HdfsClientConfigKeys.DFS_CLIENT_CONGESTION_BACKOFF_MAX_TIME,
590588
HdfsClientConfigKeys.DFS_CLIENT_CONGESTION_BACKOFF_MEAN_TIME);
591589
}
@@ -1143,7 +1141,7 @@ boolean shouldWaitForRestart(int index) {
11431141
InetAddress addr = null;
11441142
try {
11451143
addr = InetAddress.getByName(nodes[index].getIpAddr());
1146-
} catch (UnknownHostException e) {
1144+
} catch (java.net.UnknownHostException e) {
11471145
// we are passing an ip address. this should not happen.
11481146
assert false;
11491147
}

hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6525,6 +6525,21 @@
65256525
If the namespace is DEFAULT, it's best to change this conf to other value.
65266526
</description>
65276527
</property>
6528+
<property>
6529+
<name>dfs.client.congestion.backoff.mean.time</name>
6530+
<value>5000</value>
6531+
<description>
6532+
The mean milliseconds which is used to compute client congestion backoff sleep time.
6533+
</description>
6534+
</property>
6535+
<property>
6536+
<name>dfs.client.congestion.backoff.max.time</name>
6537+
<value>50000</value>
6538+
<description>
6539+
The max milliseconds which is used to
6540+
restrict the upper limit backoff sleep time for client.
6541+
</description>
6542+
</property>
65286543
<property>
65296544
<name>dfs.client.rbf.observer.read.enable</name>
65306545
<value>false</value>

0 commit comments

Comments
 (0)