use of org.apache.kafka.common.requests.ByteBufferChannel in project kafka by apache.
the class MockSelector method completeSend.
private void completeSend(NetworkSend send) throws IOException {
// Consume the send so that we will be able to send more requests to the destination
try (ByteBufferChannel discardChannel = new ByteBufferChannel(send.size())) {
while (!send.completed()) {
send.writeTo(discardChannel);
}
completedSends.add(send);
completedSendBuffers.add(discardChannel);
}
}
use of org.apache.kafka.common.requests.ByteBufferChannel in project kafka by apache.
the class FetchResponseBenchmark method testSerializeFetchResponse.
@Benchmark
public int testSerializeFetchResponse() throws IOException {
Send send = fetchResponse.toSend(header, ApiKeys.FETCH.latestVersion());
ByteBufferChannel channel = new ByteBufferChannel(send.size());
send.writeTo(channel);
return channel.buffer().limit();
}
use of org.apache.kafka.common.requests.ByteBufferChannel in project kafka by apache.
the class FetchRequestBenchmark method testSerializeFetchRequestForReplica.
@Benchmark
public int testSerializeFetchRequestForReplica() throws IOException {
Send send = replicaRequest.toSend(header);
ByteBufferChannel channel = new ByteBufferChannel(send.size());
send.writeTo(channel);
return channel.buffer().limit();
}
use of org.apache.kafka.common.requests.ByteBufferChannel in project apache-kafka-on-k8s by banzaicloud.
the class MockSelector method completeSend.
private void completeSend(Send send) throws IOException {
// Consume the send so that we will be able to send more requests to the destination
ByteBufferChannel discardChannel = new ByteBufferChannel(send.size());
while (!send.completed()) {
send.writeTo(discardChannel);
}
completedSends.add(send);
}
use of org.apache.kafka.common.requests.ByteBufferChannel in project kafka by apache.
the class FetchRequestBenchmark method testSerializeFetchRequestForConsumer.
@Benchmark
public int testSerializeFetchRequestForConsumer() throws IOException {
Send send = consumerRequest.toSend(header);
ByteBufferChannel channel = new ByteBufferChannel(send.size());
send.writeTo(channel);
return channel.buffer().limit();
}
Aggregations