mirror of
https://github.com/apache/druid.git
synced 2025-03-01 14:59:08 +00:00
parent
4e5f9cdacf
commit
bf863343f8
@ -89,63 +89,6 @@ public class HttpClientConfig
|
|||||||
private final CompressionCodec compressionCodec;
|
private final CompressionCodec compressionCodec;
|
||||||
private final Duration unusedConnectionTimeoutDuration;
|
private final Duration unusedConnectionTimeoutDuration;
|
||||||
|
|
||||||
@Deprecated // Use the builder instead
|
|
||||||
public HttpClientConfig(
|
|
||||||
int numConnections,
|
|
||||||
SSLContext sslContext
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this(
|
|
||||||
numConnections,
|
|
||||||
sslContext,
|
|
||||||
Duration.ZERO,
|
|
||||||
null,
|
|
||||||
DEFAULT_BOSS_COUNT,
|
|
||||||
DEFAULT_WORKER_COUNT,
|
|
||||||
DEFAULT_COMPRESSION_CODEC,
|
|
||||||
DEFAULT_UNUSED_CONNECTION_TIMEOUT_DURATION
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated // Use the builder instead
|
|
||||||
public HttpClientConfig(
|
|
||||||
int numConnections,
|
|
||||||
SSLContext sslContext,
|
|
||||||
Duration readTimeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this(
|
|
||||||
numConnections,
|
|
||||||
sslContext,
|
|
||||||
readTimeout,
|
|
||||||
null,
|
|
||||||
DEFAULT_BOSS_COUNT,
|
|
||||||
DEFAULT_WORKER_COUNT,
|
|
||||||
DEFAULT_COMPRESSION_CODEC,
|
|
||||||
DEFAULT_UNUSED_CONNECTION_TIMEOUT_DURATION
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated // Use the builder instead
|
|
||||||
public HttpClientConfig(
|
|
||||||
int numConnections,
|
|
||||||
SSLContext sslContext,
|
|
||||||
Duration readTimeout,
|
|
||||||
Duration sslHandshakeTimeout
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this(
|
|
||||||
numConnections,
|
|
||||||
sslContext,
|
|
||||||
readTimeout,
|
|
||||||
sslHandshakeTimeout,
|
|
||||||
DEFAULT_BOSS_COUNT,
|
|
||||||
DEFAULT_WORKER_COUNT,
|
|
||||||
DEFAULT_COMPRESSION_CODEC,
|
|
||||||
DEFAULT_UNUSED_CONNECTION_TIMEOUT_DURATION
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private HttpClientConfig(
|
private HttpClientConfig(
|
||||||
int numConnections,
|
int numConnections,
|
||||||
SSLContext sslContext,
|
SSLContext sslContext,
|
||||||
|
@ -35,7 +35,6 @@ import org.jboss.netty.logging.Slf4JLoggerFactory;
|
|||||||
import org.jboss.netty.util.HashedWheelTimer;
|
import org.jboss.netty.util.HashedWheelTimer;
|
||||||
import org.jboss.netty.util.ThreadNameDeterminer;
|
import org.jboss.netty.util.ThreadNameDeterminer;
|
||||||
import org.jboss.netty.util.Timer;
|
import org.jboss.netty.util.Timer;
|
||||||
import org.joda.time.Duration;
|
|
||||||
|
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import javax.net.ssl.TrustManagerFactory;
|
import javax.net.ssl.TrustManagerFactory;
|
||||||
@ -109,29 +108,6 @@ public class HttpClientInit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static HttpClient createClient(ResourcePoolConfig config, final SSLContext sslContext, Lifecycle lifecycle)
|
|
||||||
{
|
|
||||||
return createClient(
|
|
||||||
new HttpClientConfig(config.getMaxPerKey(), sslContext, Duration.ZERO),
|
|
||||||
lifecycle
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated // use createClient directly
|
|
||||||
public static ClientBootstrap createBootstrap(Lifecycle lifecycle, Timer timer)
|
|
||||||
{
|
|
||||||
final HttpClientConfig defaultConfig = HttpClientConfig.builder().build();
|
|
||||||
return createBootstrap(lifecycle, timer, defaultConfig.getBossPoolSize(), defaultConfig.getWorkerPoolSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated // use createClient directly
|
|
||||||
public static ClientBootstrap createBootstrap(Lifecycle lifecycle)
|
|
||||||
{
|
|
||||||
final Timer timer = new HashedWheelTimer(new ThreadFactoryBuilder().setDaemon(true).build());
|
|
||||||
return createBootstrap(lifecycle, timer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SSLContext sslContextWithTrustedKeyStore(final String keyStorePath, final String keyStorePassword)
|
public static SSLContext sslContextWithTrustedKeyStore(final String keyStorePath, final String keyStorePassword)
|
||||||
{
|
{
|
||||||
FileInputStream in = null;
|
FileInputStream in = null;
|
||||||
|
@ -122,7 +122,7 @@ public abstract class BaseJettyTest
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
this.client = HttpClientInit.createClient(
|
this.client = HttpClientInit.createClient(
|
||||||
new HttpClientConfig(maxClientConnections, SSLContext.getDefault(), Duration.ZERO),
|
HttpClientConfig.builder().withNumConnections(maxClientConnections).withSslContext(SSLContext.getDefault()).withReadTimeout(Duration.ZERO).build(),
|
||||||
druidLifecycle
|
druidLifecycle
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user