public HttpClientPipelineFactory(NettyConnectionPool nettyConnectionPool, Timer timer, OrderedMemoryAwareThreadPoolExecutor executor, Duration readTimeout, DataSize maxContentLength) { this.timer = timer; Preconditions.checkNotNull(nettyConnectionPool, "nettyConnectionPool is null"); Preconditions.checkNotNull(executor, "executor is null"); Preconditions.checkNotNull(readTimeout, "readTimeout is null"); Preconditions.checkNotNull(maxContentLength, "maxContentLength is null"); this.nettyConnectionPool = nettyConnectionPool; this.executor = executor; this.timeoutHandler = new ReadTimeoutHandler(this.timer, (long) readTimeout.toMillis(), TimeUnit.MILLISECONDS); this.maxContentLength = Ints.checkedCast(maxContentLength.toBytes()); }
@LegacyConfig(value = "log.max-size-in-bytes", replacedBy = "log.max-size") @Deprecated public LoggingConfiguration setMaxSegmentSizeInBytes(long maxSegmentSizeInBytes) { this.maxSegmentSize = new DataSize(maxSegmentSizeInBytes, Unit.BYTE); return this; }
.put("endpoint_snitch", "org.apache.cassandra.locator.SimpleSnitch") // TODO: make configurable .put("request_scheduler", "org.apache.cassandra.scheduler.NoScheduler") .put("in_memory_compaction_limit_in_mb", (int) config.getInMemoryCompactionLimit().getValue(DataSize.Unit.MEGABYTE)) .put("sliced_buffer_size_in_kb", 64) .put("thrift_framed_transport_size_in_mb", 3) .put("thrift_max_message_length_in_mb", 4) .put("column_index_size_in_kb", (int) config.getColumnIndexSize().getValue(DataSize.Unit.KILOBYTE)) .put("seed_provider", seedProvider) .put("encryption_options", ImmutableMap.of("internode_encryption", "none")) .put("rpc_timeout_in_ms", (int) config.getRpcTimeout().toMillis()) .put("memtable_total_space_in_mb", (int) config.getMemtableTotalSpace().getValue(DataSize.Unit.MEGABYTE)) .build();
connectionFactories.add(new ALPNServerConnectionFactory("h2", "http/1.1")); HTTP2ServerConnectionFactory http2 = new HTTP2ServerConnectionFactory(configuration); http2.setInitialSessionRecvWindow(toIntExact(config.getHttp2InitialSessionReceiveWindowSize().toBytes())); http2.setInitialStreamRecvWindow(toIntExact(config.getHttp2InitialStreamReceiveWindowSize().toBytes())); http2.setMaxConcurrentStreams(config.getHttp2MaxConcurrentStreams()); http2.setInputBufferSize(toIntExact(config.getHttp2InputBufferSize().toBytes())); http2.setStreamIdleTimeout(config.getHttp2StreamIdleTimeout().toMillis()); connectionFactories.add(http2);
baseHttpConfiguration.setSendXPoweredBy(false); if (config.getMaxRequestHeaderSize() != null) { baseHttpConfiguration.setRequestHeaderSize(toIntExact(config.getMaxRequestHeaderSize().toBytes())); HttpConnectionFactory http1 = new HttpConnectionFactory(httpConfiguration); HTTP2CServerConnectionFactory http2c = new HTTP2CServerConnectionFactory(httpConfiguration); http2c.setInitialSessionRecvWindow(toIntExact(config.getHttp2InitialSessionReceiveWindowSize().toBytes())); http2c.setInitialStreamRecvWindow(toIntExact(config.getHttp2InitialStreamReceiveWindowSize().toBytes())); http2c.setMaxConcurrentStreams(config.getHttp2MaxConcurrentStreams()); http2c.setInputBufferSize(toIntExact(config.getHttp2InputBufferSize().toBytes())); http2c.setStreamIdleTimeout(config.getHttp2StreamIdleTimeout().toMillis()); httpConnector = createServerConnector(
requireNonNull(requestFilters, "requestFilters is null"); maxContentLength = config.getMaxContentLength().toBytes(); Duration requestTimeout = config.getRequestTimeout(); if (requestTimeout == null) { if (config.isHttp2Enabled()) { HTTP2Client client = new HTTP2Client(); client.setInitialSessionRecvWindow(toIntExact(config.getHttp2InitialSessionReceiveWindowSize().toBytes())); client.setInitialStreamRecvWindow(toIntExact(config.getHttp2InitialStreamReceiveWindowSize().toBytes())); client.setInputBufferSize(toIntExact(config.getHttp2InputBufferSize().toBytes())); client.setSelectors(config.getSelectorCount()); transport = new HttpClientTransportOverHTTP2(client); httpClient.setRequestBufferSize(toIntExact(config.getRequestBufferSize().toBytes())); httpClient.setResponseBufferSize(toIntExact(config.getResponseBufferSize().toBytes()));