Skip to content

Commit a33f405

Browse files
author
fuchaohong
committed
fix checkstyle.
1 parent 140f55f commit a33f405

File tree

8 files changed

+19
-20
lines changed

8 files changed

+19
-20
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,8 +2481,9 @@ public void setBalancerBandwidth(long bandwidth) throws IOException {
24812481

24822482
/**
24832483
* Requests the namenode to tell all datanodes to use a new bandwidth value.
2484-
* See {@link ClientProtocol#setDataNodeBandwidth(long, String)}
2485-
* for more details.
2484+
* @param bandwidth Bandwidth in bytes per second for this datanode.
2485+
* @param type DataNode bandwidth type.
2486+
* @throws IOException If an I/O error occurred
24862487
*
24872488
* @see ClientProtocol#setDataNodeBandwidth(long, String)
24882489
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2088,7 +2088,7 @@ public Token<DelegationTokenIdentifier> getDelegationToken(String renewer)
20882088
* bandwidth to be used by a datanode during balancing.
20892089
*
20902090
* @param bandwidth Balancer bandwidth in bytes per second for all datanodes.
2091-
* @throws IOException
2091+
* @throws IOException If an I/O error occurred
20922092
*/
20932093
public void setBalancerBandwidth(long bandwidth) throws IOException {
20942094
dfs.setBalancerBandwidth(bandwidth);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ CorruptFileBlocks listCorruptFileBlocks(String path, String cookie)
10551055
*
10561056
* @param bandwidth Bandwidth in bytes per second for this datanode.
10571057
* @param type DataNode bandwidth type.
1058-
* @throws IOException
1058+
* @throws IOException If an I/O error occurred
10591059
*/
10601060
@Idempotent
10611061
void setDataNodeBandwidth(long bandwidth, String type) throws IOException;

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeDescriptor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,11 +1037,11 @@ public synchronized Map<String, Long> getDataNodeBandwidth() {
10371037
}
10381038

10391039
/**
1040-
* @param bandwidth Bandwidth in bytes per second for this datanode
1040+
* @param dnBandwidth Bandwidth in bytes per second for this datanode
10411041
* @param type DataNode bandwidth type.
10421042
*/
1043-
public synchronized void setDataNodeBandwidth(long bandwidth, String type) {
1044-
this.throttlers.put(type, bandwidth);
1043+
public synchronized void setDataNodeBandwidth(long dnBandwidth, String type) {
1044+
this.throttlers.put(type, dnBandwidth);
10451045
}
10461046

10471047
@Override

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,8 +1930,7 @@ public DatanodeCommand[] handleHeartbeat(DatanodeRegistration nodeReg,
19301930
if (!pendingList.isEmpty()) {
19311931
// If the block is deleted, the block size will become
19321932
// BlockCommand.NO_ACK (LONG.MAX_VALUE) . This kind of block we don't
1933-
// need
1934-
// to send for replication or reconstruction
1933+
// need to send for replication or reconstruction
19351934
Iterator<BlockTargetPair> iterator = pendingList.iterator();
19361935
while (iterator.hasNext()) {
19371936
BlockTargetPair cmd = iterator.next();
@@ -1962,9 +1961,7 @@ public DatanodeCommand[] handleHeartbeat(DatanodeRegistration nodeReg,
19621961
cmds.add(new BlockCommand(DatanodeProtocol.DNA_INVALIDATE, blockPoolId,
19631962
blks));
19641963
}
1965-
// cache commands
19661964
addCacheCommands(blockPoolId, nodeinfo, cmds);
1967-
// key update command
19681965
blockManager.addKeyUpdateCommand(cmds, nodeinfo);
19691966

19701967
// check for balancer bandwidth update
@@ -1974,7 +1971,6 @@ public DatanodeCommand[] handleHeartbeat(DatanodeRegistration nodeReg,
19741971
nodeinfo.setBalancerBandwidth(0);
19751972
}
19761973

1977-
// check for datanode bandwidth update
19781974
if (!nodeinfo.getDataNodeBandwidth().isEmpty()) {
19791975
for (Map.Entry<String, Long> entry : nodeinfo.getDataNodeBandwidth().entrySet()){
19801976
cmds.add(new DataNodeBandwidthCommand(entry.getValue(), entry.getKey()));
@@ -2102,7 +2098,7 @@ public void setBalancerBandwidth(long bandwidth) throws IOException {
21022098
*
21032099
* @param bandwidth Bandwidth in bytes per second for all datanodes.
21042100
* @param type DataNode bandwidth type.
2105-
* @throws IOException
2101+
* @throws IOException If an I/O error occurred
21062102
*/
21072103
public void setDataNodeBandwidth(long bandwidth, String type) throws IOException {
21082104
synchronized(this) {

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ public void setBalancerBandwidth(long bandwidth) throws IOException {
15041504
* Tell all datanodes to reset the bandwidth of the specified type.
15051505
* @param bandwidth Bandwidth in bytes per second for all datanodes.
15061506
* @param type DataNode bandwidth type.
1507-
* @throws IOException
1507+
* @throws IOException If an I/O error occurred
15081508
*/
15091509
@Override // ClientProtocol
15101510
public void setDataNodeBandwidth(long bandwidth, String type) throws IOException {

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/DatanodeProtocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public interface DatanodeProtocol {
8181
final static int DNA_ERASURE_CODING_RECONSTRUCTION = 11; // erasure coding reconstruction command
8282
int DNA_BLOCK_STORAGE_MOVEMENT = 12; // block storage movement command
8383
int DNA_DROP_SPS_WORK_COMMAND = 13; // drop sps work command
84-
final static int DNA_DATANODEBANDWIDTHUPDATE = 14; // update datanode bandwidth
84+
int DNA_DATANODEBANDWIDTHUPDATE = 14; // update datanode bandwidth
8585

8686
/**
8787
* Register Datanode.

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static int run(DistributedFileSystem dfs, String[] argv, int idx) throws IOExcep
461461
"\t[-getVolumeReport datanode_host:ipc_port]\n" +
462462
"\t[-deleteBlockPool datanode_host:ipc_port blockpoolId [force]]\n"+
463463
"\t[-setBalancerBandwidth <bandwidth in bytes per second>]\n" +
464-
"\t[-setDataNodeBandwidth <bandwidth in bytes per second> -type <transfer|write|read>]\n" +
464+
"\t[-setDataNodeBandwidth <bandwidth in bytes per second> -type <transfer|write|read>]\n" +
465465
"\t[-getBalancerBandwidth <datanode_host:ipc_port>]\n" +
466466
"\t[-fetchImage <local directory>]\n" +
467467
"\t[-allowSnapshot <snapshotDir>]\n" +
@@ -1137,7 +1137,7 @@ public int setBalancerBandwidth(String[] argv, int idx) throws IOException {
11371137
* Usage: hdfs dfsadmin -setDataNodeBandwidth bandwidth -type <transfer|write|read>
11381138
* @param argv List of of command line parameters.
11391139
* @param idx The index of the command that is being processed.
1140-
* @exception IOException
1140+
* @exception IOException If an I/O error occurred
11411141
*/
11421142
public int setDataNodeBandwidth(String[] argv, int idx) throws IOException {
11431143

@@ -1148,12 +1148,13 @@ public int setDataNodeBandwidth(String[] argv, int idx) throws IOException {
11481148

11491149
try {
11501150
List<String> args = new ArrayList<>(Arrays.asList(argv));
1151-
type = StringUtils.popOptionWithArgument("-type", args);;
1151+
type = StringUtils.popOptionWithArgument("-type", args);
11521152
bandwidth = StringUtils.TraditionalBinaryPrefix.string2long(argv[idx]);
11531153
} catch (Exception e) {
11541154
System.err.println("Exception: " + e.getMessage());
11551155
System.err.println("Usage: hdfs dfsadmin"
1156-
+ " [-setDataNodeBandwidth <bandwidth in bytes per second> [-type <transfer|write|read>]]");
1156+
+ " [-setDataNodeBandwidth <bandwidth in bytes per second>"
1157+
+ " [-type <transfer|write|read>]]");
11571158
return exitCode;
11581159
}
11591160

@@ -2411,7 +2412,8 @@ private static void printUsage(String cmd) {
24112412
+ " [-setBalancerBandwidth <bandwidth in bytes per second>]");
24122413
} else if ("-setDataNodeBandwidth".equals(cmd)) {
24132414
System.err.println("Usage: hdfs dfsadmin"
2414-
+ " [-setDataNodeBandwidth <bandwidth in bytes per second> [-type <transfer|write|read>]]");
2415+
+ " [-setDataNodeBandwidth <bandwidth in bytes per second>"
2416+
+ " [-type <transfer|write|read>]]");
24152417
} else if ("-getBalancerBandwidth".equalsIgnoreCase(cmd)) {
24162418
System.err.println("Usage: hdfs dfsadmin"
24172419
+ " [-getBalancerBandwidth <datanode_host:ipc_port>]");

0 commit comments

Comments
 (0)