use of org.apache.hadoop.ha.protocolPB.ZKFCProtocolClientSideTranslatorPB in project hadoop by apache.
the class HAServiceTarget method getZKFCProxy.
/**
* @return a proxy to the ZKFC which is associated with this HA service.
*/
public ZKFCProtocol getZKFCProxy(Configuration conf, int timeoutMs) throws IOException {
Configuration confCopy = new Configuration(conf);
// Lower the timeout so we quickly fail to connect
confCopy.setInt(CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, 1);
SocketFactory factory = NetUtils.getDefaultSocketFactory(confCopy);
return new ZKFCProtocolClientSideTranslatorPB(getZKFCAddress(), confCopy, factory, timeoutMs);
}
Aggregations