Package org.apache.pulsar.io.hdfs3.sink
Class HdfsAbstractSink<K,V>
java.lang.Object
org.apache.pulsar.io.hdfs3.AbstractHdfsConnector
org.apache.pulsar.io.hdfs3.sink.HdfsAbstractSink<K,V>
- All Implemented Interfaces:
AutoCloseable,Sink<V>
- Direct Known Subclasses:
HdfsAbstractSequenceFileSink,HdfsAbstractTextFileSink
A Simple abstract class for HDFS sink.
Users need to implement extractKeyValue function to use this sink.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HdfsSinkConfigprotected HdfsSyncThread<V>protected BlockingQueue<org.apache.pulsar.functions.api.Record<V>>Fields inherited from class org.apache.pulsar.io.hdfs3.AbstractHdfsConnector
compressionCodecFactory, connectorConfig, hdfsResources -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected final voidprotected abstract voidextractKeyValue(org.apache.pulsar.functions.api.Record<V> record) protected org.apache.hadoop.fs.FSDataOutputStreamprotected final org.apache.hadoop.fs.FSDataOutputStreamBuilderprotected final org.apache.hadoop.fs.PathgetPath()protected final voidvoidopen(Map<String, Object> config, SinkContext sinkContext) Methods inherited from class org.apache.pulsar.io.hdfs3.AbstractHdfsConnector
checkHdfsUriForTimeout, getCompressionCodec, getCompressionCodecFactory, getConfiguration, getEncoding, getFileSystem, getFileSystem, getFileSystemAsUser, getUserGroupInformation, resetHDFSResources
-
Field Details
-
hdfsSinkConfig
-
unackedRecords
-
syncThread
-
-
Constructor Details
-
HdfsAbstractSink
public HdfsAbstractSink()
-
-
Method Details
-
extractKeyValue
-
createWriter
- Throws:
IOException
-
open
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
connectToHdfs
- Throws:
IOException
-
getOutputStreamBuilder
protected final org.apache.hadoop.fs.FSDataOutputStreamBuilder getOutputStreamBuilder() throws IOException- Throws:
IOException
-
getHdfsStream
protected org.apache.hadoop.fs.FSDataOutputStream getHdfsStream() throws IllegalArgumentException, IOException- Throws:
IllegalArgumentExceptionIOException
-
getPath
protected final org.apache.hadoop.fs.Path getPath() -
launchSyncThread
- Throws:
IOException
-