liaoxin01 commented on code in PR #33502:
URL: https://github.com/apache/doris/pull/33502#discussion_r1565106784


##########
gensrc/proto/internal_service.proto:
##########
@@ -412,6 +412,7 @@ message PKafkaMetaProxyRequest {
 
 message PProxyRequest {
     optional PKafkaMetaProxyRequest kafka_meta_request = 1;
+    optional int64 timeout = 2;

Review Comment:
   ```suggestion
       optional int64 timeout_secs = 2;
   ```



##########
be/src/runtime/routine_load/data_consumer.cpp:
##########
@@ -384,13 +384,21 @@ Status KafkaDataConsumer::get_offsets_for_times(const 
std::vector<PIntegerPair>&
 
 // get latest offsets for given partitions
 Status KafkaDataConsumer::get_latest_offsets_for_partitions(
-        const std::vector<int32_t>& partition_ids, std::vector<PIntegerPair>* 
offsets) {
+        const std::vector<int32_t>& partition_ids, std::vector<PIntegerPair>* 
offsets,
+        int timeout) {
+    MonotonicStopWatch watch;
+    watch.start();
     for (int32_t partition_id : partition_ids) {
         int64_t low = 0;
         int64_t high = 0;
+        auto timeout_ms = timeout - watch.elapsed_time() / 1000 / 1000;

Review Comment:
   watch.elapsed_time() return uint64_t, implicit type conversion may lead to 
unexpected issues.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to