use of org.apache.hadoop.ha.protocolPB.HAServiceProtocolClientSideTranslatorPB in project hadoop by apache.
the class HAServiceTarget method getProxyForAddress.
private HAServiceProtocol getProxyForAddress(Configuration conf, int timeoutMs, InetSocketAddress addr) 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 HAServiceProtocolClientSideTranslatorPB(addr, confCopy, factory, timeoutMs);
}
Aggregations