delete some code (#11552)

Co-authored-by: yuanyi <yuanyi@freewheel.tv>
This commit is contained in:
Yi Yuan 2021-08-17 01:40:40 +08:00 committed by GitHub
parent 4e5f9cdacf
commit bf863343f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 82 deletions

View File

@ -89,63 +89,6 @@ public class HttpClientConfig
private final CompressionCodec compressionCodec;
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(
int numConnections,
SSLContext sslContext,

View File

@ -35,7 +35,6 @@ import org.jboss.netty.logging.Slf4JLoggerFactory;
import org.jboss.netty.util.HashedWheelTimer;
import org.jboss.netty.util.ThreadNameDeterminer;
import org.jboss.netty.util.Timer;
import org.joda.time.Duration;
import javax.net.ssl.SSLContext;
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)
{
FileInputStream in = null;

View File

@ -122,7 +122,7 @@ public abstract class BaseJettyTest
try {
this.client = HttpClientInit.createClient(
new HttpClientConfig(maxClientConnections, SSLContext.getDefault(), Duration.ZERO),
HttpClientConfig.builder().withNumConnections(maxClientConnections).withSslContext(SSLContext.getDefault()).withReadTimeout(Duration.ZERO).build(),
druidLifecycle
);
}