Jackie-Jiang commented on code in PR #12981:
URL: https://github.com/apache/pinot/pull/12981#discussion_r1575052394


##########
pinot-spi/src/main/java/org/apache/pinot/spi/stream/StreamMessageDecoder.java:
##########
@@ -46,9 +47,25 @@ public interface StreamMessageDecoder<T> {
    * @param topicName Topic name of the stream
    * @throws Exception If an error occurs
    */
+  @Deprecated
   void init(Map<String, String> props, Set<String> fieldsToRead, String 
topicName)
       throws Exception;
 
+  /**
+   * Initializes the decoder. This is the new interface that should be 
implemented by all decoders.
+   *
+   * @param props Decoder properties extracted from the {@link StreamConfig}
+   * @param fieldsToRead The fields to read from the source stream. If blank, 
reads all fields (only for AVRO/JSON
+   *                     currently)
+   * @param topicName Topic name of the stream
+   * @param tableSchema Pinot schema of the table
+   * @throws Exception If an error occurs
+   */
+  default void init(Map<String, String> props, Set<String> fieldsToRead, 
String topicName, Schema tableSchema)

Review Comment:
   Let's just pass in `void init(StreamConfig streamConfig, TableConfig 
tableConfig, Schema schema)` since everything is extracted from them.



##########
pinot-spi/src/main/java/org/apache/pinot/spi/stream/StreamMessageDecoder.java:
##########
@@ -46,9 +47,25 @@ public interface StreamMessageDecoder<T> {
    * @param topicName Topic name of the stream
    * @throws Exception If an error occurs
    */
+  @Deprecated

Review Comment:
   Since we are deprecating it, add a default implementation which throws 
`UnsupportedOperationException`, then we can only choose to implement one of 
the `init()` and clean up the decoders maintained within the code base



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to