HDFS-3690. BlockPlacementPolicyDefault incorrectly casts LOG. Contributed by Eli Collins

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1363576 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2012-07-19 23:04:01 +00:00
parent 370c65f282
commit 6383679872
2 changed files with 11 additions and 3 deletions

View File

@ -516,6 +516,8 @@ Branch-2 ( Unreleased changes )
HDFS-3605. Block mistakenly marked corrupt during edit log catchup HDFS-3605. Block mistakenly marked corrupt during edit log catchup
phase of failover. (todd and Brahma Reddy Battula via todd) phase of failover. (todd and Brahma Reddy Battula via todd)
HDFS-3690. BlockPlacementPolicyDefault incorrectly casts LOG. (eli)
BREAKDOWN OF HDFS-3042 SUBTASKS BREAKDOWN OF HDFS-3042 SUBTASKS
HDFS-2185. HDFS portion of ZK-based FailoverController (todd) HDFS-2185. HDFS portion of ZK-based FailoverController (todd)

View File

@ -27,7 +27,8 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import org.apache.commons.logging.impl.Log4JLogger; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.DFSConfigKeys;
@ -42,7 +43,8 @@ import org.apache.hadoop.net.NodeBase;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
/** The class is responsible for choosing the desired number of targets /**
* The class is responsible for choosing the desired number of targets
* for placing block replicas. * for placing block replicas.
* The replica placement strategy is that if the writer is on a datanode, * The replica placement strategy is that if the writer is on a datanode,
* the 1st replica is placed on the local machine, * the 1st replica is placed on the local machine,
@ -52,9 +54,13 @@ import com.google.common.annotations.VisibleForTesting;
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
public class BlockPlacementPolicyDefault extends BlockPlacementPolicy { public class BlockPlacementPolicyDefault extends BlockPlacementPolicy {
private static final Log LOG =
LogFactory.getLog(BlockPlacementPolicyDefault.class.getName());
private static final String enableDebugLogging = private static final String enableDebugLogging =
"For more information, please enable DEBUG log level on " "For more information, please enable DEBUG log level on "
+ ((Log4JLogger)LOG).getLogger().getName(); + LOG.getClass().getName();
protected boolean considerLoad; protected boolean considerLoad;
private boolean preferLocalNode = true; private boolean preferLocalNode = true;