Search in sources :

Example 1 with R2RestResponseHandler

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

the class R2RestWriterBuilder method fromConfig.

@Override
public R2RestWriterBuilder fromConfig(Config config) {
    config = config.withFallback(FALLBACK);
    this.client = createClient(config);
    String urlTemplate = config.getString(HttpConstants.URL_TEMPLATE);
    String verb = config.getString(HttpConstants.VERB);
    String protocolVersion = config.getString(HttpConstants.PROTOCOL_VERSION);
    asyncRequestBuilder = new R2RestRequestBuilder(urlTemplate, verb, protocolVersion);
    Set<String> errorCodeWhitelist = HttpUtils.getErrorCodeWhitelist(config);
    responseHandler = new R2RestResponseHandler(errorCodeWhitelist, metricContext);
    return this;
}
Also used : R2RestResponseHandler(org.apache.gobblin.r2.R2RestResponseHandler) R2RestRequestBuilder(org.apache.gobblin.r2.R2RestRequestBuilder)

Aggregations

R2RestRequestBuilder (org.apache.gobblin.r2.R2RestRequestBuilder)1 R2RestResponseHandler (org.apache.gobblin.r2.R2RestResponseHandler)1