You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2018/11/19 08:03:45 UTC

[flink] branch master updated: [FLINK-10235][kafka] Explicitly cast custom partitioner classes

This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 2cd4ff4  [FLINK-10235][kafka] Explicitly cast custom partitioner classes
2cd4ff4 is described below

commit 2cd4ff4a61424e6ff5a9a579b0d0b0ae0fd1a7cc
Author: zentol <ch...@apache.org>
AuthorDate: Tue Aug 28 14:21:43 2018 +0200

    [FLINK-10235][kafka] Explicitly cast custom partitioner classes
---
 .../streaming/connectors/kafka/KafkaTableSourceSinkFactoryBase.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSourceSinkFactoryBase.java b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSourceSinkFactoryBase.java
index 72fcdca..542dbd9 100644
--- a/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSourceSinkFactoryBase.java
+++ b/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSourceSinkFactoryBase.java
@@ -335,7 +335,7 @@ public abstract class KafkaTableSourceSinkFactoryBase implements
 					case CONNECTOR_SINK_PARTITIONER_VALUE_CUSTOM:
 						final Class<? extends FlinkKafkaPartitioner> partitionerClass =
 							descriptorProperties.getClass(CONNECTOR_SINK_PARTITIONER_CLASS, FlinkKafkaPartitioner.class);
-						return Optional.of(InstantiationUtil.instantiate(partitionerClass));
+						return Optional.of((FlinkKafkaPartitioner<Row>) InstantiationUtil.instantiate(partitionerClass));
 					default:
 						throw new TableException("Unsupported sink partitioner. Validator should have checked that.");
 				}