本文整理汇总了Java中org.apache.hadoop.ha.NodeFencer类的典型用法代码示例。如果您正苦于以下问题:Java NodeFencer类的具体用法?Java NodeFencer怎么用?Java NodeFencer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeFencer类属于org.apache.hadoop.ha包,在下文中一共展示了NodeFencer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JobTrackerHAServiceTarget
import org.apache.hadoop.ha.NodeFencer; //导入依赖的package包/类
public JobTrackerHAServiceTarget(Configuration conf, String jtId) {
this.logicalName = HAUtil.getLogicalName(conf);
this.jtId = jtId;
// Make a copy of the conf, and override configs based on the
// target node -- not the node we happen to be running on.
JobConf targetConf = new JobConf(conf);
HAUtil.setGenericConf(targetConf, logicalName, jtId, HAUtil.JOB_TRACKER_SPECIFIC_KEYS);
this.addr = HAUtil.getJtHaRpcAddress(targetConf, jtId);
this.autoFailoverEnabled = targetConf.getBoolean(
HAUtil.MR_HA_AUTO_FAILOVER_ENABLED_KEY,
HAUtil.MR_HA_AUTO_FAILOVER_ENABLED_DEFAULT);
if (autoFailoverEnabled) {
int port = MRZKFailoverController.getZkfcPort(targetConf);
if (port != 0) {
setZkfcPort(port);
}
}
try {
fencer = NodeFencer.create(targetConf, HAUtil.MR_HA_FENCING_METHODS_KEY);
} catch (BadFencingConfigurationException e) {
this.fenceConfigError = e;
}
}
示例2: getFencer
import org.apache.hadoop.ha.NodeFencer; //导入依赖的package包/类
@Override
public NodeFencer getFencer() {
return null;
}
示例3: getFencer
import org.apache.hadoop.ha.NodeFencer; //导入依赖的package包/类
@Override
public NodeFencer getFencer() {
return fencer;
}