Class HdfsAbstractSequenceFileSink<K,V,HdfsK,HdfsV>
java.lang.Object
org.apache.pulsar.io.hdfs3.AbstractHdfsConnector
org.apache.pulsar.io.hdfs3.sink.HdfsAbstractSink<K,V>
org.apache.pulsar.io.hdfs3.sink.seq.HdfsAbstractSequenceFileSink<K,V,HdfsK,HdfsV>
- Type Parameters:
K- - The incoming Key typeV- - The incoming Value typeHdfsK- - The HDFS Key typeHdfsV- - The HDFS Value type
- All Implemented Interfaces:
AutoCloseable,Sink<V>
- Direct Known Subclasses:
HdfsSequentialTextSink,HdfsTextSink
public abstract class HdfsAbstractSequenceFileSink<K,V,HdfsK,HdfsV>
extends HdfsAbstractSink<K,V>
implements Sink<V>
HDFS Sink that writes it contents to HDFS as Sequence Files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicLongprotected org.apache.hadoop.fs.FSDataOutputStreamprotected org.apache.hadoop.io.SequenceFile.WriterFields inherited from class org.apache.pulsar.io.hdfs3.sink.HdfsAbstractSink
hdfsSinkConfig, syncThread, unackedRecordsFields inherited from class org.apache.pulsar.io.hdfs3.AbstractHdfsConnector
compressionCodecFactory, connectorConfig, hdfsResources -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.pulsar.io.hdfs3.sink.HdfsAbstractSink
connectToHdfs, extractKeyValue, getHdfsStream, getOutputStreamBuilder, getPath, launchSyncThread, openMethods inherited from class org.apache.pulsar.io.hdfs3.AbstractHdfsConnector
checkHdfsUriForTimeout, getCompressionCodec, getCompressionCodecFactory, getConfiguration, getEncoding, getFileSystem, getFileSystem, getFileSystemAsUser, getUserGroupInformation, resetHDFSResources
-
Field Details
-
counter
-
hdfsStream
protected org.apache.hadoop.fs.FSDataOutputStream hdfsStream -
writer
protected org.apache.hadoop.io.SequenceFile.Writer writer
-
-
Constructor Details
-
HdfsAbstractSequenceFileSink
public HdfsAbstractSequenceFileSink()
-
-
Method Details
-
convert
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classHdfsAbstractSink<K,V> - Throws:
Exception
-
createWriter
- Specified by:
createWriterin classHdfsAbstractSink<K,V> - Throws:
IOException
-
write
-
getWriter
- Throws:
IOException
-
getOptions
protected List<org.apache.hadoop.io.SequenceFile.Writer.Option> getOptions() throws IllegalArgumentException, IOException- Throws:
IllegalArgumentExceptionIOException
-