Search in sources :

Example 1 with ZKFCProtocolClientSideTranslatorPB

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

Aggregations

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