Search in sources :

Example 1 with ProxyBuilder

use of org.apache.drill.exec.store.http.util.HttpProxyConfig.ProxyBuilder in project drill by apache.

the class HttpBatchReader method proxySettings.

protected HttpProxyConfig proxySettings(Config drillConfig, HttpUrl url) {
    final HttpStoragePluginConfig config = subScan.tableSpec().config();
    final ProxyBuilder builder = HttpProxyConfig.builder().fromConfigForURL(drillConfig, url.toString());
    final String proxyType = config.proxyType();
    if (proxyType != null && !"direct".equals(proxyType)) {
        UsernamePasswordCredentials credentials = config.getUsernamePasswordCredentials();
        builder.type(config.proxyType()).host(config.proxyHost()).port(config.proxyPort()).username(credentials.getUsername()).password(credentials.getPassword());
    }
    return builder.build();
}
Also used : ProxyBuilder(org.apache.drill.exec.store.http.util.HttpProxyConfig.ProxyBuilder) UsernamePasswordCredentials(org.apache.drill.exec.store.security.UsernamePasswordCredentials)

Aggregations

ProxyBuilder (org.apache.drill.exec.store.http.util.HttpProxyConfig.ProxyBuilder)1 UsernamePasswordCredentials (org.apache.drill.exec.store.security.UsernamePasswordCredentials)1