Search in sources :

Example 1 with HttpClient

use of org.apache.gobblin.http.HttpClient in project incubator-gobblin by apache.

the class AvroR2JoinConverter method createHttpClient.

@Override
protected HttpClient<RestRequest, RestResponse> createHttpClient(Config config, SharedResourcesBroker<GobblinScopeTypes> broker) {
    String urlTemplate = config.getString(HttpConstants.URL_TEMPLATE);
    // By default, use http schema
    R2ClientFactory.Schema schema = R2ClientFactory.Schema.HTTP;
    if (urlTemplate.startsWith(HttpConstants.SCHEMA_D2)) {
        schema = R2ClientFactory.Schema.D2;
    }
    R2ClientFactory factory = new R2ClientFactory(schema);
    Client client = factory.createInstance(config);
    return new R2Client(client, config, broker);
}
Also used : R2Client(org.apache.gobblin.r2.R2Client) HttpClient(org.apache.gobblin.http.HttpClient) R2Client(org.apache.gobblin.r2.R2Client) Client(com.linkedin.r2.transport.common.Client) R2ClientFactory(org.apache.gobblin.r2.R2ClientFactory)

Aggregations

Client (com.linkedin.r2.transport.common.Client)1 HttpClient (org.apache.gobblin.http.HttpClient)1 R2Client (org.apache.gobblin.r2.R2Client)1 R2ClientFactory (org.apache.gobblin.r2.R2ClientFactory)1