use of org.apache.gobblin.r2.R2Client 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());
}
use of org.apache.gobblin.r2.R2Client 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);
}
Aggregations