HDFS-15573. Only log warning if considerLoad and considerStorageType are both true. Contributed by Stephen O'Donnell

This commit is contained in:
Mingliang Liu 2020-09-12 01:41:38 -07:00
parent aa80bcb1ec
commit 4eccdd950f
No known key found for this signature in database
GPG Key ID: BC2FB8C6908A0C16
1 changed files with 8 additions and 6 deletions

View File

@ -326,12 +326,14 @@ public class DatanodeManager {
this.readConsiderStorageType = conf.getBoolean(
DFSConfigKeys.DFS_NAMENODE_READ_CONSIDERSTORAGETYPE_KEY,
DFSConfigKeys.DFS_NAMENODE_READ_CONSIDERSTORAGETYPE_DEFAULT);
if (readConsiderLoad && readConsiderStorageType) {
LOG.warn(
"{} and {} are incompatible and only one can be enabled. "
+ "Both are currently enabled.",
+ "Both are currently enabled. {} will be ignored.",
DFSConfigKeys.DFS_NAMENODE_READ_CONSIDERLOAD_KEY,
DFSConfigKeys.DFS_NAMENODE_READ_CONSIDERSTORAGETYPE_KEY,
DFSConfigKeys.DFS_NAMENODE_READ_CONSIDERSTORAGETYPE_KEY);
}
this.avoidStaleDataNodesForWrite = conf.getBoolean(
DFSConfigKeys.DFS_NAMENODE_AVOID_STALE_DATANODE_FOR_WRITE_KEY,
DFSConfigKeys.DFS_NAMENODE_AVOID_STALE_DATANODE_FOR_WRITE_DEFAULT);