private CoronaTaskTrackerProtocol createClient ( String host , int port ) throws IOException { String staticHost = NetUtils . getStaticResolution ( host ) ; InetSocketAddress s = null ; InetAddress inetAddress = null ; byte [ ] byteArr = null ; if ( staticHost != null ) { inetAddress = InetAddress . getByName ( staticHost ) ; } else { byteArr = Utilities . asBytes ( host ) ; if ( byteArr == null ) { inetAddress = InetAddress . getByName ( host ) ; } else { inetAddress = InetAddress . getByAddress ( byteArr ) ; } } s = new InetSocketAddress ( inetAddress , port ) ; LOG . info ( "Creating client to " + ( staticHost != null ? staticHost : host ) + ":" + s . getPort ( ) ) ; long connectTimeout = conf . getLong ( CoronaJobTracker . TT_CONNECT_TIMEOUT_MSEC_KEY , 10000L ) ; int rpcTimeout = conf . getInt ( CoronaJobTracker . TT_RPC_TIMEOUT_MSEC_KEY , 60000 ) ; return RPC . waitForProxy ( CoronaTaskTrackerProtocol . class , CoronaTaskTrackerProtocol . versionID , s , conf , connectTimeout , rpcTimeout ) ; }
Connect to the task tracker and get the RPC client .