Search in sources :

Example 1 with R2ClientFactory

use of org.apache.gobblin.r2.R2ClientFactory 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)

Example 2 with R2ClientFactory

use of org.apache.gobblin.r2.R2ClientFactory in project incubator-gobblin by apache.

the class R2RestWriterBuilder method createClient.

protected R2Client createClient(Config config) {
    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, getBroker());
}
Also used : R2Client(org.apache.gobblin.r2.R2Client) 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)2 R2Client (org.apache.gobblin.r2.R2Client)2 R2ClientFactory (org.apache.gobblin.r2.R2ClientFactory)2 HttpClient (org.apache.gobblin.http.HttpClient)1