Class ClientUtils
- java.lang.Object
-
- org.apache.kafka.streams.processor.internals.ClientUtils
-
public class ClientUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClientUtils.QuietAdminClientConfig
-
Constructor Summary
Constructors Constructor Description ClientUtils()
-
Method Summary
-
-
-
Method Detail
-
getTaskProducerClientId
public static String getTaskProducerClientId(String threadClientId, TaskId taskId)
-
consumerMetrics
public static Map<MetricName,Metric> consumerMetrics(Consumer<byte[],byte[]> mainConsumer, Consumer<byte[],byte[]> restoreConsumer)
-
adminClientMetrics
public static Map<MetricName,Metric> adminClientMetrics(Admin adminClient)
-
producerMetrics
public static Map<MetricName,Metric> producerMetrics(Collection<StreamsProducer> producers)
-
fetchCommittedOffsets
public static Map<TopicPartition,Long> fetchCommittedOffsets(Set<TopicPartition> partitions, Consumer<byte[],byte[]> consumer)
- Throws:
StreamsException
- if the consumer throws an exceptionTimeoutException
- if the request times out
-
fetchEndOffsetsFuture
public static KafkaFuture<Map<TopicPartition,ListOffsetsResult.ListOffsetsResultInfo>> fetchEndOffsetsFuture(Collection<TopicPartition> partitions, Admin adminClient)
-
getEndOffsets
public static Map<TopicPartition,ListOffsetsResult.ListOffsetsResultInfo> getEndOffsets(KafkaFuture<Map<TopicPartition,ListOffsetsResult.ListOffsetsResultInfo>> endOffsetsFuture)
A helper method that wraps theFuture#get
call and rethrows any thrown exception as a StreamsException- Throws:
StreamsException
- if the admin client request throws an exception
-
fetchEndOffsets
public static Map<TopicPartition,ListOffsetsResult.ListOffsetsResultInfo> fetchEndOffsets(Collection<TopicPartition> partitions, Admin adminClient)
- Throws:
StreamsException
- if the admin client request throws an exception
-
-