mirror of
https://github.com/apache/druid.git
synced 2025-02-20 00:47:40 +00:00
eliminate extra object instantiation (#11345)
This commit is contained in:
parent
18b8ac5349
commit
2236cf2234
@ -46,7 +46,7 @@ import javax.annotation.Nullable;
|
|||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.ArrayList;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -91,19 +91,19 @@ public class IncrementalPublishingKafkaIndexTaskRunner extends SeekableStreamInd
|
|||||||
TaskToolbox toolbox
|
TaskToolbox toolbox
|
||||||
) throws Exception
|
) throws Exception
|
||||||
{
|
{
|
||||||
// Handles OffsetOutOfRangeException, which is thrown if the seeked-to
|
|
||||||
// offset is not present in the topic-partition. This can happen if we're asking a task to read from data
|
|
||||||
// that has not been written yet (which is totally legitimate). So let's wait for it to show up.
|
|
||||||
List<OrderedPartitionableRecord<Integer, Long, KafkaRecordEntity>> records = new ArrayList<>();
|
|
||||||
try {
|
try {
|
||||||
records = recordSupplier.poll(task.getIOConfig().getPollTimeout());
|
return recordSupplier.poll(task.getIOConfig().getPollTimeout());
|
||||||
}
|
}
|
||||||
catch (OffsetOutOfRangeException e) {
|
catch (OffsetOutOfRangeException e) {
|
||||||
|
//
|
||||||
|
// Handles OffsetOutOfRangeException, which is thrown if the seeked-to
|
||||||
|
// offset is not present in the topic-partition. This can happen if we're asking a task to read from data
|
||||||
|
// that has not been written yet (which is totally legitimate). So let's wait for it to show up
|
||||||
|
//
|
||||||
log.warn("OffsetOutOfRangeException with message [%s]", e.getMessage());
|
log.warn("OffsetOutOfRangeException with message [%s]", e.getMessage());
|
||||||
possiblyResetOffsetsOrWait(e.offsetOutOfRangePartitions(), recordSupplier, toolbox);
|
possiblyResetOffsetsOrWait(e.offsetOutOfRangePartitions(), recordSupplier, toolbox);
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return records;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user