public abstract class PushPulsarSource<T> extends PulsarSource<T>
functionClassLoader, properties, pulsarClient, pulsarSourceConfig, topicSchema| Constructor and Description |
|---|
PushPulsarSource(org.apache.pulsar.client.api.PulsarClient pulsarClient,
PulsarSourceConfig pulsarSourceConfig,
Map<String,String> properties,
ClassLoader functionClassLoader) |
| Modifier and Type | Method and Description |
|---|---|
void |
consume(Record<T> record)
Attach a consumer function to this Source.
|
int |
getQueueLength()
Get length of the queue that records are push onto
Users can override this method to customize the queue length
|
abstract void |
open(Map<String,Object> config,
SourceContext sourceContext)
Open connector with configuration.
|
Record<T> |
read() |
buildPulsarSourceConsumerConfig, buildRecord, createConsumeBuilder, getInputConsumersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic PushPulsarSource(org.apache.pulsar.client.api.PulsarClient pulsarClient,
PulsarSourceConfig pulsarSourceConfig,
Map<String,String> properties,
ClassLoader functionClassLoader)
public abstract void open(Map<String,Object> config, SourceContext sourceContext) throws Exception
config - initialization configsourceContext - environment where the source connector is runningException - IO type exceptions when opening a connectorpublic void consume(Record<T> record)
record - next message from source which should be sent to a Pulsar topicpublic int getQueueLength()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.