Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HDFS-16119. start balancer with parameters -hotBlockTimeInterval xxx …
Browse files Browse the repository at this point in the history
…is invalid
jiaguodong5 committed Jul 7, 2021
1 parent 9381071 commit 310a266
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -735,7 +735,7 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
public static final String DFS_BALANCER_GETBLOCKS_HOT_TIME_INTERVAL_KEY =
"dfs.balancer.getBlocks.hot-time-interval";
public static final long DFS_BALANCER_GETBLOCKS_HOT_TIME_INTERVAL_DEFAULT =
0;
0L;
public static final String DFS_BALANCER_KEYTAB_ENABLED_KEY = "dfs.balancer.keytab.enabled";
public static final boolean DFS_BALANCER_KEYTAB_ENABLED_DEFAULT = false;
public static final String DFS_BALANCER_ADDRESS_KEY = "dfs.balancer.address";
Original file line number Diff line number Diff line change
@@ -324,10 +324,11 @@ static int getFailedTimesSinceLastSuccessfulBalance() {
* Balancer prefer to get blocks which are belong to the cold files
* created before this time period.
*/
final long hotBlockTimeInterval = conf.getTimeDuration(
DFSConfigKeys.DFS_BALANCER_GETBLOCKS_HOT_TIME_INTERVAL_KEY,
DFSConfigKeys.DFS_BALANCER_GETBLOCKS_HOT_TIME_INTERVAL_DEFAULT,
TimeUnit.MILLISECONDS);
final long hotBlockTimeInterval =
p.getHotBlockTimeInterval() != 0L ? p.getHotBlockTimeInterval() : conf.getTimeDuration(
DFSConfigKeys.DFS_BALANCER_GETBLOCKS_HOT_TIME_INTERVAL_KEY,
DFSConfigKeys.DFS_BALANCER_GETBLOCKS_HOT_TIME_INTERVAL_DEFAULT,
TimeUnit.MILLISECONDS);

// DataNode configuration parameters for balancing
final int maxConcurrentMovesPerNode = getInt(conf,
Original file line number Diff line number Diff line change
@@ -110,6 +110,10 @@ boolean getSortTopNodes() {
return this.sortTopNodes;
}

long getHotBlockTimeInterval() {
return this.hotBlockTimeInterval;
}

@Override
public String toString() {
return String.format("%s.%s [%s," + " threshold = %s,"

0 comments on commit 310a266

Please sign in to comment.