Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private static ChannelBuilder create(SecurityProtocol securityProtocol,
switch (securityProtocol) {
case SSL:
requireNonNullMode(connectionMode, securityProtocol);
channelBuilder = new SslChannelBuilder(connectionMode, listenerName, isInterBrokerListener, logContext);
channelBuilder = new SslChannelBuilder(connectionMode, listenerName, isInterBrokerListener);
break;
case SASL_SSL:
case SASL_PLAINTEXT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.kafka.common.security.auth.SslAuthenticationContext;
import org.apache.kafka.common.security.ssl.SslFactory;
import org.apache.kafka.common.security.ssl.SslPrincipalMapper;
import org.apache.kafka.common.utils.LogContext;
import org.apache.kafka.common.utils.Utils;

import java.io.Closeable;
Expand All @@ -53,8 +52,7 @@ public class SslChannelBuilder implements ChannelBuilder, ListenerReconfigurable
*/
public SslChannelBuilder(ConnectionMode connectionMode,
ListenerName listenerName,
boolean isInterBrokerListener,
LogContext logContext) {
boolean isInterBrokerListener) {
this.connectionMode = connectionMode;
this.listenerName = listenerName;
this.isInterBrokerListener = isInterBrokerListener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ public void setUp() throws Exception {
this.server.start();
this.time = new MockTime();
sslClientConfigs = createSslClientConfigs(trustStoreFile);
LogContext logContext = new LogContext();
this.channelBuilder = new SslChannelBuilder(ConnectionMode.CLIENT, null, false, logContext);
this.channelBuilder = new SslChannelBuilder(ConnectionMode.CLIENT, null, false);
this.channelBuilder.configure(sslClientConfigs);
this.metrics = new Metrics();
this.selector = new Selector(5000, metrics, time, "MetricGroup", channelBuilder, logContext);
this.selector = new Selector(5000, metrics, time, "MetricGroup", channelBuilder, new LogContext());
}

protected abstract Map<String, Object> createSslClientConfigs(File trustStoreFile) throws GeneralSecurityException, IOException;
Expand Down Expand Up @@ -255,7 +254,7 @@ public void testMuteOnOOM() throws Exception {
.tlsProtocol(tlsProtocol)
.createNewTrustStore(trustStoreFile)
.build();
channelBuilder = new SslChannelBuilder(ConnectionMode.SERVER, null, false, new LogContext());
channelBuilder = new SslChannelBuilder(ConnectionMode.SERVER, null, false);
channelBuilder.configure(sslServerConfigs);
selector = new Selector(NetworkReceive.UNLIMITED, 5000, metrics, time, "MetricGroup",
new HashMap<>(), true, false, channelBuilder, pool, new LogContext());
Expand Down Expand Up @@ -342,7 +341,7 @@ private SslSender createSender(String tlsProtocol, InetSocketAddress serverAddre
private static class TestSslChannelBuilder extends SslChannelBuilder {

public TestSslChannelBuilder(ConnectionMode connectionMode) {
super(connectionMode, null, false, new LogContext());
super(connectionMode, null, false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,10 @@ public void testApplicationBufferResize(Args args) throws Exception {
@ParameterizedTest
@ArgumentsSource(SslTransportLayerArgumentsProvider.class)
public void testNetworkThreadTimeRecorded(Args args) throws Exception {
LogContext logContext = new LogContext();
ChannelBuilder channelBuilder = new SslChannelBuilder(ConnectionMode.CLIENT, null, false, logContext);
ChannelBuilder channelBuilder = new SslChannelBuilder(ConnectionMode.CLIENT, null, false);
channelBuilder.configure(args.sslClientConfigs);
try (Selector selector = new Selector(NetworkReceive.UNLIMITED, Selector.NO_IDLE_TIMEOUT_MS, new Metrics(), Time.SYSTEM,
"MetricGroup", new HashMap<>(), false, true, channelBuilder, MemoryPool.NONE, logContext)) {
"MetricGroup", new HashMap<>(), false, true, channelBuilder, MemoryPool.NONE, new LogContext())) {

String node = "0";
server = createEchoServer(args, SecurityProtocol.SSL);
Expand Down Expand Up @@ -967,7 +966,7 @@ public void testClosePlaintext(Args args) throws Exception {
}

private SslChannelBuilder newClientChannelBuilder() {
return new SslChannelBuilder(ConnectionMode.CLIENT, null, false, new LogContext());
return new SslChannelBuilder(ConnectionMode.CLIENT, null, false);
}

private void testClose(Args args, SecurityProtocol securityProtocol, ChannelBuilder clientChannelBuilder) throws Exception {
Expand Down Expand Up @@ -1311,10 +1310,9 @@ private NioEchoServer createEchoServer(Args args, SecurityProtocol securityProto
}

private Selector createSelector(Args args) {
LogContext logContext = new LogContext();
ChannelBuilder channelBuilder = new SslChannelBuilder(ConnectionMode.CLIENT, null, false, logContext);
ChannelBuilder channelBuilder = new SslChannelBuilder(ConnectionMode.CLIENT, null, false);
channelBuilder.configure(args.sslClientConfigs);
selector = new Selector(5000, new Metrics(), TIME, "MetricGroup", channelBuilder, logContext);
selector = new Selector(5000, new Metrics(), TIME, "MetricGroup", channelBuilder, new LogContext());
return selector;
}

Expand Down Expand Up @@ -1371,7 +1369,7 @@ static class TestSslChannelBuilder extends SslChannelBuilder {
int flushDelayCount = 0;

public TestSslChannelBuilder(ConnectionMode connectionMode) {
super(connectionMode, null, false, new LogContext());
super(connectionMode, null, false);
}

public void configureBufferSizes(Integer netReadBufSize, Integer netWriteBufSize, Integer appBufSize) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ public void setup() throws Exception {
sslServerConfigs = serverCertStores.getTrustingConfig(clientCertStores);
sslClientConfigs = clientCertStores.getTrustingConfig(serverCertStores);

LogContext logContext = new LogContext();
ChannelBuilder channelBuilder = new SslChannelBuilder(ConnectionMode.CLIENT, null, false, logContext);
ChannelBuilder channelBuilder = new SslChannelBuilder(ConnectionMode.CLIENT, null, false);
channelBuilder.configure(sslClientConfigs);
this.selector = new Selector(5000, new Metrics(), TIME, "MetricGroup", channelBuilder, logContext);
this.selector = new Selector(5000, new Metrics(), TIME, "MetricGroup", channelBuilder, new LogContext());
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1923,11 +1923,6 @@ public void onHighWatermarkUpdated(
*/
private final String logPrefix;

/**
* The log context.
*/
private final LogContext logContext;

/**
* The logger.
*/
Expand Down Expand Up @@ -2054,7 +2049,6 @@ private CoordinatorRuntime(
ExecutorService executorService
) {
this.logPrefix = logPrefix;
this.logContext = logContext;
this.log = logContext.logger(CoordinatorRuntime.class);
this.time = time;
this.timer = timer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public static class DeadlineAndEpoch {
}
}

private final LogContext logContext;
private final Logger log;

/**
Expand Down Expand Up @@ -217,7 +216,6 @@ public StreamsGroup(
String groupId
) {
this.log = logContext.logger(StreamsGroup.class);
this.logContext = logContext;
this.snapshotRegistry = Objects.requireNonNull(snapshotRegistry);
this.groupId = Objects.requireNonNull(groupId);
this.state = new TimelineObject<>(snapshotRegistry, EMPTY);
Expand Down
Loading