Class HdfsAbstractSequenceFileSink<K,V,HdfsK,HdfsV>
java.lang.Object
org.apache.pulsar.io.hdfs2.AbstractHdfsConnector
org.apache.pulsar.io.hdfs2.sink.HdfsAbstractSink<K,V>
org.apache.pulsar.io.hdfs2.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,org.apache.pulsar.io.core.Sink<V>
- Direct Known Subclasses:
HdfsSequentialTextSink,HdfsTextSink
public abstract class HdfsAbstractSequenceFileSink<K,V,HdfsK,HdfsV>
extends HdfsAbstractSink<K,V>
implements org.apache.pulsar.io.core.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.hdfs2.sink.HdfsAbstractSink
hdfsSinkConfig, syncThread, unackedRecordsFields inherited from class org.apache.pulsar.io.hdfs2.AbstractHdfsConnector
compressionCodecFactory, connectorConfig, hdfsResources -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.pulsar.io.hdfs2.sink.HdfsAbstractSink
connectToHdfs, extractKeyValue, getHdfsStream, getPath, launchSyncThread, openMethods inherited from class org.apache.pulsar.io.hdfs2.AbstractHdfsConnector
checkHdfsUriForTimeout, getCompressionCodec, getCompressionCodecFactory, getConfiguration, getEncoding, getFileSystem, getFileSystem, getFileSystemAsUser, getUserGroupInformation, resetHDFSResourcesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.io.core.Sink
open
-
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
- Specified by:
writein interfaceorg.apache.pulsar.io.core.Sink<K>
-
getWriter
- Throws:
IOException
-
getOptions
protected List<org.apache.hadoop.io.SequenceFile.Writer.Option> getOptions() throws IllegalArgumentException, IOException- Throws:
IllegalArgumentExceptionIOException
-