You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/02/09 15:55:50 UTC

[GitHub] [pinot] walterddr commented on a change in pull request #8180: simulate rsvps for realtime quickstart

walterddr commented on a change in pull request #8180:
URL: https://github.com/apache/pinot/pull/8180#discussion_r802815636



##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/streams/MeetupRsvpStream.java
##########
@@ -63,77 +67,87 @@ public MeetupRsvpStream(boolean partitionByKey)
     properties.put("serializer.class", "kafka.serializer.DefaultEncoder");
     properties.put("request.required.acks", "1");
     _producer = StreamDataProvider.getStreamDataProducer(KafkaStarterUtils.KAFKA_PRODUCER_CLASS_NAME, properties);
-  }
-
-  public MeetupRsvpStream(boolean partitionByKey, StreamDataProducer producer, String topicName) {
-    _partitionByKey = partitionByKey;
-    _producer = producer;
-    _topicName = topicName;
+    _source = new Source(createConsumer());
   }
 
   public void run()
       throws Exception {
-    _client = ClientManager.createClient();
-    _keepPublishing = true;
-
-    _client.connectToServer(new Endpoint() {
-      @Override
-      public void onOpen(Session session, EndpointConfig config) {
-        session.addMessageHandler(String.class, getMessageHandler());
-      }
-    }, ClientEndpointConfig.Builder.create().build(), new URI("wss://stream.meetup.com/2/rsvps"));
+    _source.start();

Review comment:
       i felt like this original construct was to demonstrate how to create a listening client against some public API and redirect data into pinot.
   
   If we are not doing such it this can simply be a periodic task that runs `_producer.produce(createMessage)` without the source/consumer wrapper




-- 
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-unsubscribe@pinot.apache.org

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



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