jon-wei commented on code in PR #13296:
URL: https://github.com/apache/druid/pull/13296#discussion_r1011327598


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/RecordSupplierInputSource.java:
##########
@@ -123,13 +129,23 @@ CloseableIterator<InputEntity> createEntityIterator()
       private Iterator<OrderedPartitionableRecord<PartitionIdType, 
SequenceOffsetType, RecordType>> recordIterator;
       private Iterator<? extends ByteEntity> bytesIterator;
       private volatile boolean closed;
+      private long createTime = System.currentTimeMillis();
+      private Long terminationTime = samplerConfigTimeoutMs != null ? 
createTime + samplerConfigTimeoutMs : null;

Review Comment:
   I had made it accept a null which was this was for, but changed this to 
check for 0 to be consistent with the way it's used elsewhere (to indicate no 
timeout specified)



##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/RecordSupplierInputSource.java:
##########
@@ -123,13 +129,23 @@ CloseableIterator<InputEntity> createEntityIterator()
       private Iterator<OrderedPartitionableRecord<PartitionIdType, 
SequenceOffsetType, RecordType>> recordIterator;
       private Iterator<? extends ByteEntity> bytesIterator;
       private volatile boolean closed;
+      private long createTime = System.currentTimeMillis();
+      private Long terminationTime = samplerConfigTimeoutMs != null ? 
createTime + samplerConfigTimeoutMs : null;
 
       private void waitNextIteratorIfNecessary()
       {
         while (!closed && (bytesIterator == null || !bytesIterator.hasNext())) 
{
           while (!closed && (recordIterator == null || 
!recordIterator.hasNext())) {
+            if (terminationTime != null) {
+              if (System.currentTimeMillis() > terminationTime) {
+                LOG.info("Configured sampler timeout has been exceeded, 
returning without a bytesIterator.");

Review Comment:
   Added the timeout ms to the log



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to