[
https://issues.apache.org/jira/browse/GOBBLIN-2118?focusedWorklogId=928885&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-928885
]
ASF GitHub Bot logged work on GOBBLIN-2118:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 06/Aug/24 10:46
Start Date: 06/Aug/24 10:46
Worklog Time Spent: 10m
Work Description: arpit09 commented on code in PR #4009:
URL: https://github.com/apache/gobblin/pull/4009#discussion_r1705320733
##########
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/kafka/client/GobblinKafkaConsumerClient.java:
##########
@@ -66,6 +66,25 @@ public interface GobblinKafkaConsumerClient extends
Closeable {
*/
public long getEarliestOffset(KafkaPartition partition) throws
KafkaOffsetRetrievalFailureException;
+ /**
+ * Get the earliest available offset for a {@link Collection} of {@link
KafkaPartition}s. NOTE: The default implementation
+ * is not efficient i.e. it will make a getEarliest() call for every {@link
KafkaPartition}. Individual implementations
+ * of {@link GobblinKafkaConsumerClient} should override this method to use
more advanced APIs of the underlying KafkaConsumer
+ * to retrieve the latest offsets for a collection of partitions.
+ *
+ * @param partitions for which earliest offset is retrieved
+ *
+ * @throws KafkaOffsetRetrievalFailureException - If the underlying
kafka-client does not support getting the earliest offset
+ */
+ public default Map<KafkaPartition, Long>
getEarliestOffsets(Collection<KafkaPartition> partitions)
Review Comment:
Done
Issue Time Tracking
-------------------
Worklog Id: (was: 928885)
Time Spent: 0.5h (was: 20m)
> Reduce no of network calls while fetching kafka offsets during startup
> ----------------------------------------------------------------------
>
> Key: GOBBLIN-2118
> URL: https://issues.apache.org/jira/browse/GOBBLIN-2118
> Project: Apache Gobblin
> Issue Type: Improvement
> Reporter: Arpit Varshney
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> During starting while creating work unit, in Kafkasource there are network
> calls that tries to fetch the kafka offsets (both earliest and latest) to
> find out the watermark (to find the offsets where the gobblin job will start
> consuming from)
> These calls are fetched for each topic and each partition in the topic. For
> each partition, there is a separate call that goes to kafka client, which
> increases the no of network calls. If there are cross colo calls (calls to
> different datacenters in different regions) this increase the time to fetch
> and results in timeout which leads to skipping of the topic partition to
> fetch leading to starvation.
> This ticket targets to reduce the no of network calls, rather than doing a
> call for each partition. Utilize kafka source to fetch the offsets for all
> the paritions at once from kafka.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)