rajagopr opened a new pull request, #11769:
URL: https://github.com/apache/pinot/pull/11769
Changes are to prevent the NPE and provide a meaningful error message to the
user when there is a failure to fetch the partition information.
NPE seen by the end user who created a Kafka topic without any partitions in
a third-party managed Kafka cluster.
```
Caused by: java.lang.NullPointerException
at
org.apache.pinot.plugin.stream.kafka20.KafkaStreamMetadataProvider.fetchPartitionCount(KafkaStreamMetadataProvider.java:60)
~[startree-write-api-0.13.0-ST.98.3-shaded.jar:0.13.0-ST.98.3-1eb9c04b445be445d976f47c790dddaed274298d]
at
org.apache.pinot.spi.stream.StreamMetadataProvider.computePartitionGroupMetadata(StreamMetadataProvider.java:68)
~[startree-pinot-all-0.13.0-ST.98.3-jar-with-dependencies.jar:0.13.0-ST.98.3-1eb9c04b445be445d976f47c790dddaed274298d]
at
org.apache.pinot.spi.stream.PartitionGroupMetadataFetcher.call(PartitionGroupMetadataFetcher.java:70)
~[startree-pinot-all-0.13.0-ST.98.3-jar-with-dependencies.jar:0.13.0-ST.98.3-1eb9c04b445be445d976f47c790dddaed274298d]
at
org.apache.pinot.spi.stream.PartitionGroupMetadataFetcher.call(PartitionGroupMetadataFetcher.java:31)
~[startree-pinot-all-0.13.0-ST.98.3-jar-with-dependencies.jar:0.13.0-ST.98.3-1eb9c04b445be445d976f47c790dddaed274298d]
at
org.apache.pinot.spi.utils.retry.BaseRetryPolicy.attempt(BaseRetryPolicy.java:50)
~[startree-pinot-all-0.13.0-ST.98.3-jar-with-dependencies.jar:0.13.0-ST.98.3-1eb9c04b445be445d976f47c790dddaed274298d]
at
org.apache.pinot.controller.helix.core.PinotTableIdealStateBuilder.getPartitionGroupMetadataList(PinotTableIdealStateBuilder.java:160)
~[startree-pinot-all-0.13.0-ST.98.3-jar-with-dependencies.jar:0.13.0-ST.98.3-1eb9c04b445be445d976f47c790dddaed274298d]
... 31 more
```
**Notes:** Unable to add a test using mocks as the class
`KafkaPartitionLevelConnectionHandler` declares the consumer as final within
it's constructor. Additionally, the Kafka library always creates a default
partition (`0`) when creating the Kafka topic.
--
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]