pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat commented on a change in pull request #2266: Integrate functions and io with schema registry
Date Thu, 16 Aug 2018 06:42:57 GMT
merlimat commented on a change in pull request #2266: Integrate functions and io with schema
registry
URL: https://github.com/apache/incubator-pulsar/pull/2266#discussion_r210490454
 
 

 ##########
 File path: pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSink.java
 ##########
 @@ -30,59 +30,60 @@
 import org.apache.commons.lang3.StringUtils;
 import org.apache.pulsar.client.api.Consumer;
 import org.apache.pulsar.client.api.ConsumerEventListener;
-import org.apache.pulsar.client.api.Message;
-import org.apache.pulsar.client.api.MessageBuilder;
 import org.apache.pulsar.client.api.Producer;
 import org.apache.pulsar.client.api.PulsarClient;
 import org.apache.pulsar.client.api.PulsarClientException;
+import org.apache.pulsar.client.api.Schema;
+import org.apache.pulsar.client.api.TypedMessageBuilder;
 import org.apache.pulsar.functions.api.Record;
-import org.apache.pulsar.functions.api.SerDe;
-import org.apache.pulsar.functions.api.utils.DefaultSerDe;
-import org.apache.pulsar.functions.instance.InstanceUtils;
 import org.apache.pulsar.functions.instance.SinkRecord;
 import org.apache.pulsar.functions.instance.producers.AbstractOneOuputTopicProducers;
 import org.apache.pulsar.functions.instance.producers.MultiConsumersOneOuputTopicProducers;
 import org.apache.pulsar.functions.instance.producers.Producers;
 import org.apache.pulsar.functions.source.PulsarRecord;
+import org.apache.pulsar.functions.source.TopicSchema;
 import org.apache.pulsar.functions.utils.FunctionConfig;
 import org.apache.pulsar.functions.utils.Reflections;
 import org.apache.pulsar.io.core.Sink;
 import org.apache.pulsar.io.core.SinkContext;
 
-import net.jodah.typetools.TypeResolver;
-
 @Slf4j
 public class PulsarSink<T> implements Sink<T> {
 
-    private PulsarClient client;
-    private PulsarSinkConfig pulsarSinkConfig;
-    private SerDe<T> outputSerDe;
+    private final PulsarClient client;
+    private final PulsarSinkConfig pulsarSinkConfig;
+
+    private PulsarSinkProcessor<T> pulsarSinkProcessor;
 
-    private PulsarSinkProcessor pulsarSinkProcessor;
+    private final TopicSchema topicSchema;
 
     private interface PulsarSinkProcessor<T> {
-        void initializeOutputProducer(String outputTopic) throws Exception;
+        void initializeOutputProducer(String outputTopic, Schema<T> schema) throws
Exception;
 
 Review comment:
   In this PR I mostly just added schema argument to the sink processor. I'd leave adding
comment on these interfaces for a separated PR.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message