amaechler commented on code in PR #13296:
URL: https://github.com/apache/druid/pull/13296#discussion_r1011099106
##########
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.");
+ bytesIterator = null;
+ return;
+ }
+ }
Review Comment:
Would it make sense to combine these?
```suggestion
if (terminationTime != null && System.currentTimeMillis() >
terminationTime) {
LOG.info("Configured sampler timeout has been exceeded,
returning without a bytesIterator.");
bytesIterator = null;
return;
}
```
--
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]