sijie closed pull request #2199: Cleanup unnecessary casting and creating
variables
URL: https://github.com/apache/incubator-pulsar/pull/2199
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java
index f70100d268..df9946068b 100644
---
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java
+++
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java
@@ -91,18 +91,13 @@ public void open(Map<String, Object> config, SourceContext
sourceContext) throws
org.apache.pulsar.client.api.Message<byte[]> message =
this.inputConsumer.receive();
String topicName;
- int partitionId;
// If more than one topics are being read than the Message return by
the consumer will be TopicMessageImpl
// If there is only topic being read then the Message returned by the
consumer wil be MessageImpl
if (message instanceof TopicMessageImpl) {
topicName = ((TopicMessageImpl<?>) message).getTopicName();
- TopicMessageIdImpl topicMessageId = (TopicMessageIdImpl)
message.getMessageId();
- MessageIdImpl messageId = (MessageIdImpl)
topicMessageId.getInnerMessageId();
- partitionId = messageId.getPartitionIndex();
} else {
topicName =
this.pulsarSourceConfig.getTopicSerdeClassNameMap().keySet().iterator().next();
- partitionId = ((MessageIdImpl)
message.getMessageId()).getPartitionIndex();
}
Object object;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services