private Transport borrowFrom(TransportPool pool, String hostInfo) {
        if (!pool.getJobPoolingKey().equals(jobKey)) {
            throw new EsHadoopIllegalArgumentException("PooledTransportFactory found a pool with a different owner than this job. " +
                    "This could be a different job incorrectly polluting the TransportPool. Bailing out...");
        }
        try {
            return pool.borrowTransport();
        } catch (Exception ex) {
            throw new EsHadoopException(
                    String.format("Could not get a Transport from the Transport Pool for host [%s]", hostInfo),
                    ex
            );
        }
    }
private Transport borrowFrom ( TransportPool pool , String hostInfo ) { if ( ! pool . getJobPoolingKey ( ) . equals ( jobKey ) ) { throw new EsHadoopIllegalArgumentException ( "PooledTransportFactory found a pool with a different owner than this job. " + "This could be a different job incorrectly polluting the TransportPool. Bailing out..." ) ; } try { return pool . borrowTransport ( ) ; } catch ( Exception ex ) { throw new EsHadoopException ( String . format ( "Could not get a Transport from the Transport Pool for host [%s]" , hostInfo ) , ex ) ; } }
Creates a Transport using the given TransportPool.
@param pool Transport is borrowed from
@param hostInfo For logging purposes
@return A Transport backed by a pooled resource