use of org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient in project kafka by apache.
the class WorkerCoordinatorIncrementalTest method setup.
@Before
public void setup() {
LogContext loggerFactory = new LogContext();
this.time = new MockTime();
this.metadata = new Metadata(0, Long.MAX_VALUE, loggerFactory, new ClusterResourceListeners());
this.client = new MockClient(time, metadata);
this.client.updateMetadata(RequestTestUtils.metadataUpdateWith(1, Collections.singletonMap("topic", 1)));
this.node = metadata.fetch().nodes().get(0);
this.consumerClient = new ConsumerNetworkClient(loggerFactory, client, metadata, time, retryBackoffMs, requestTimeoutMs, heartbeatIntervalMs);
this.metrics = new Metrics(time);
this.rebalanceListener = new MockRebalanceListener();
this.leaderId = "worker1";
this.memberId = "worker2";
this.anotherMemberId = "worker3";
this.leaderUrl = expectedUrl(leaderId);
this.memberUrl = expectedUrl(memberId);
this.anotherMemberUrl = expectedUrl(anotherMemberId);
this.generationId = 3;
this.offset = 10L;
this.configStorageCalls = 0;
this.rebalanceConfig = new GroupRebalanceConfig(sessionTimeoutMs, rebalanceTimeoutMs, heartbeatIntervalMs, groupId, Optional.empty(), retryBackoffMs, true);
this.coordinator = new WorkerCoordinator(rebalanceConfig, loggerFactory, consumerClient, metrics, "worker" + groupId, time, expectedUrl(leaderId), configStorage, rebalanceListener, compatibility, rebalanceDelay);
configState1 = clusterConfigState(offset, 2, 4);
}
Aggregations