Package org.apache.hadoop.hdfs.tools
Class NNHAServiceTarget
java.lang.Object
org.apache.hadoop.ha.HAServiceTarget
org.apache.hadoop.hdfs.tools.NNHAServiceTarget
@Private
public class NNHAServiceTarget
extends org.apache.hadoop.ha.HAServiceTarget
One of the NN NameNodes acting as the target of an administrative command
(e.g. failover).
-
Constructor Summary
ConstructorsConstructorDescriptionNNHAServiceTarget(org.apache.hadoop.conf.Configuration conf, String nsId, String nnId) Create a NNHAServiceTarget for a namenode.NNHAServiceTarget(org.apache.hadoop.conf.Configuration conf, String nsId, String nnId, String addr, String lifelineAddr) Create a NNHAServiceTarget for a namenode. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFencingParameters(Map<String, String> ret) voidorg.apache.hadoop.ha.NodeFencerbooleanbooleantoString()Methods inherited from class org.apache.hadoop.ha.HAServiceTarget
getFencingParameters, getHealthMonitorProxy, getHealthMonitorProxy, getProxy, getTransitionTargetHAStatus, getZKFCProxy, setTransitionTargetHAStatus
-
Constructor Details
-
NNHAServiceTarget
Create a NNHAServiceTarget for a namenode. Look up addresses from configuration.- Parameters:
conf- HDFS configuration.nsId- nsId of this nn.nnId- nnId of this nn.
-
NNHAServiceTarget
public NNHAServiceTarget(org.apache.hadoop.conf.Configuration conf, String nsId, String nnId, String addr, String lifelineAddr) Create a NNHAServiceTarget for a namenode. Addresses are provided so we don't need to lookup the config.- Parameters:
conf- HDFS configuration.nsId- nsId of this nn.nnId- nnId of this nn.addr- Provided service address.lifelineAddr- Provided lifeline address.
-
-
Method Details
-
getAddress
- Specified by:
getAddressin classorg.apache.hadoop.ha.HAServiceTarget- Returns:
- the NN's IPC address.
-
getHealthMonitorAddress
- Overrides:
getHealthMonitorAddressin classorg.apache.hadoop.ha.HAServiceTarget
-
getZKFCAddress
- Specified by:
getZKFCAddressin classorg.apache.hadoop.ha.HAServiceTarget
-
checkFencingConfigured
public void checkFencingConfigured() throws org.apache.hadoop.ha.BadFencingConfigurationException- Specified by:
checkFencingConfiguredin classorg.apache.hadoop.ha.HAServiceTarget- Throws:
org.apache.hadoop.ha.BadFencingConfigurationException
-
getFencer
public org.apache.hadoop.ha.NodeFencer getFencer()- Specified by:
getFencerin classorg.apache.hadoop.ha.HAServiceTarget
-
toString
-
getNameServiceId
-
getNameNodeId
-
addFencingParameters
- Overrides:
addFencingParametersin classorg.apache.hadoop.ha.HAServiceTarget
-
isAutoFailoverEnabled
public boolean isAutoFailoverEnabled()- Overrides:
isAutoFailoverEnabledin classorg.apache.hadoop.ha.HAServiceTarget
-
supportObserver
public boolean supportObserver()- Overrides:
supportObserverin classorg.apache.hadoop.ha.HAServiceTarget
-