T - The type of data to write to target databaseR - Pulsar message type, such as GenericRecordpublic abstract class BatchSink<T,R> extends Object implements Sink<R>
| Constructor and Description |
|---|
BatchSink() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
buildPoint(org.apache.pulsar.functions.api.Record<R> message) |
void |
close() |
protected Object |
getFiled(org.apache.pulsar.client.api.schema.GenericRecord record,
String fieldName) |
protected void |
init(long batchTimeMs,
int batchSize) |
void |
write(org.apache.pulsar.functions.api.Record<R> record) |
protected abstract void |
writePoints(List<T> points) |
protected void init(long batchTimeMs,
int batchSize)
public final void write(org.apache.pulsar.functions.api.Record<R> record)
public void close()
throws Exception
close in interface AutoCloseableExceptionprotected Object getFiled(org.apache.pulsar.client.api.schema.GenericRecord record, String fieldName)
protected abstract T buildPoint(org.apache.pulsar.functions.api.Record<R> message) throws Exception
ExceptionCopyright © 2017–2021 Apache Software Foundation. All rights reserved.