public abstract class HdfsAbstractSink<K,V> extends AbstractHdfsConnector implements Sink<V>
| Modifier and Type | Field and Description |
|---|---|
protected HdfsSinkConfig |
hdfsSinkConfig |
protected HdfsSyncThread<V> |
syncThread |
protected BlockingQueue<org.apache.pulsar.functions.api.Record<V>> |
unackedRecords |
compressionCodecFactory, connectorConfig, hdfsResources| Constructor and Description |
|---|
HdfsAbstractSink() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
connectToHdfs() |
protected abstract void |
createWriter() |
abstract KeyValue<K,V> |
extractKeyValue(org.apache.pulsar.functions.api.Record<V> record) |
protected org.apache.hadoop.fs.FSDataOutputStream |
getHdfsStream() |
protected org.apache.hadoop.fs.FSDataOutputStreamBuilder |
getOutputStreamBuilder() |
protected org.apache.hadoop.fs.Path |
getPath() |
protected void |
launchSyncThread() |
void |
open(Map<String,Object> config,
SinkContext sinkContext) |
checkHdfsUriForTimeout, getCompressionCodec, getCompressionCodecFactory, getConfiguration, getEncoding, getFileSystem, getFileSystem, getFileSystemAsUser, getUserGroupInformation, resetHDFSResourcesprotected HdfsSinkConfig hdfsSinkConfig
protected BlockingQueue<org.apache.pulsar.functions.api.Record<V>> unackedRecords
protected HdfsSyncThread<V> syncThread
public abstract KeyValue<K,V> extractKeyValue(org.apache.pulsar.functions.api.Record<V> record)
protected abstract void createWriter()
throws IOException
IOExceptionpublic void open(Map<String,Object> config, SinkContext sinkContext) throws Exception
public void close()
throws Exception
close in interface AutoCloseableExceptionprotected final void connectToHdfs()
throws IOException
IOExceptionprotected final org.apache.hadoop.fs.FSDataOutputStreamBuilder getOutputStreamBuilder()
throws IOException
IOExceptionprotected org.apache.hadoop.fs.FSDataOutputStream getHdfsStream()
throws IllegalArgumentException,
IOException
IllegalArgumentExceptionIOExceptionprotected final org.apache.hadoop.fs.Path getPath()
protected final void launchSyncThread()
throws IOException
IOExceptionCopyright © 2017–2021 Apache Software Foundation. All rights reserved.