本文整理汇总了Java中org.apache.hadoop.ha.protocolPB.ZKFCProtocolPB类的典型用法代码示例。如果您正苦于以下问题:Java ZKFCProtocolPB类的具体用法?Java ZKFCProtocolPB怎么用?Java ZKFCProtocolPB使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ZKFCProtocolPB类属于org.apache.hadoop.ha.protocolPB包,在下文中一共展示了ZKFCProtocolPB类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ZKFCRpcServer
import org.apache.hadoop.ha.protocolPB.ZKFCProtocolPB; //导入依赖的package包/类
ZKFCRpcServer(Configuration conf,
InetSocketAddress bindAddr,
ZKFailoverController zkfc,
PolicyProvider policy) throws IOException {
this.zkfc = zkfc;
RPC.setProtocolEngine(conf, ZKFCProtocolPB.class,
ProtobufRpcEngine.class);
ZKFCProtocolServerSideTranslatorPB translator =
new ZKFCProtocolServerSideTranslatorPB(this);
BlockingService service = ZKFCProtocolService
.newReflectiveBlockingService(translator);
this.server = new RPC.Builder(conf).setProtocol(ZKFCProtocolPB.class)
.setInstance(service).setBindAddress(bindAddr.getHostName())
.setPort(bindAddr.getPort()).setNumHandlers(HANDLER_COUNT)
.setVerbose(false).build();
// set service-level authorization security policy
if (conf.getBoolean(
CommonConfigurationKeys.HADOOP_SECURITY_AUTHORIZATION, false)) {
server.refreshServiceAcl(conf, policy);
}
}