Search in sources :

Example 1 with HAServiceProtocolClientSideTranslatorPB

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);
}
Also used : HAServiceProtocolClientSideTranslatorPB(org.apache.hadoop.ha.protocolPB.HAServiceProtocolClientSideTranslatorPB) Configuration(org.apache.hadoop.conf.Configuration) SocketFactory(javax.net.SocketFactory)

Aggregations

SocketFactory (javax.net.SocketFactory)1 Configuration (org.apache.hadoop.conf.Configuration)1 HAServiceProtocolClientSideTranslatorPB (org.apache.hadoop.ha.protocolPB.HAServiceProtocolClientSideTranslatorPB)1