Github user pnowojski commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6387#discussion_r204406421
  
    --- Diff: 
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSink.java
 ---
    @@ -40,27 +45,68 @@
     @Internal
     public abstract class KafkaTableSink implements AppendStreamTableSink<Row> 
{
     
    +   // TODO make all attributes final and mandatory once we drop support 
for format-specific table sinks
    +
    +   /** The schema of the table. */
    +   private final Optional<TableSchema> schema;
    +
    +   /** The Kafka topic to write to. */
        protected final String topic;
    +
    +   /** Properties for the Kafka producer. */
        protected final Properties properties;
    -   protected SerializationSchema<Row> serializationSchema;
    +
    +   /** Serialization schema for encoding records to Kafka. */
    +   protected Optional<SerializationSchema<Row>> serializationSchema;
    +
    +   /** Partitioner to select Kafka partition for each item. */
        protected final FlinkKafkaPartitioner<Row> partitioner;
    +
    +   // legacy variables
        protected String[] fieldNames;
        protected TypeInformation[] fieldTypes;
     
    +   /**
    --- End diff --
    
    More comments can harm in three ways:
    1. comments can (and very often do) become obsolete, since there is no way 
like tests/compile errors to make sure that they stay up to date. Especially 
true for same comments duplicated in many places 
    2. more lines of code to support in case of refactoring/renaming/extending
    3. minor issue of more clogged code and more lines of code to read
     
    there is a full chapter about this in clean code:
    http://apdevblog.com/comments-in-code/


---

Reply via email to