public class TextFileWriter extends AbstractDataStreamWriter implements DataStoreWriter<java.lang.String>
TextFileWriter is a DataStoreWriter implementation
able to write Strings into raw hdfs files.| Constructor and Description |
|---|
TextFileWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
Instantiates a new text file writer.
|
TextFileWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
byte[] delimiter)
Instantiates a new text file writer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
protected void |
handleIdleTimeout()
Handle idle timeout.
|
void |
write(java.lang.String entity)
Write an entity.
|
getOutput, getPositiongetOutputContext, getResolvedPath, onInit, renameFile, setFileNamingStrategy, setInWritingPrefix, setInWritingSuffix, setOverwrite, setRolloverStrategy, setWritePositiondoStart, doStop, getCodec, getConfiguration, getPath, isCompressed, resetIdleTimeout, setIdleTimeoutafterPropertiesSet, getBeanFactory, getPhase, getStoreEventPublisher, getTaskExecutor, getTaskScheduler, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setStoreEventPublisher, setTaskExecutor, setTaskScheduler, start, stop, stoppublic TextFileWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
configuration - the hadoop configurationbasePath - the hdfs pathcodec - the compression codec infopublic TextFileWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec,
byte[] delimiter)
configuration - the hadoop configurationbasePath - the hdfs pathcodec - the compression codec infodelimiter - the delimiterpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushablejava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void write(java.lang.String entity)
throws java.io.IOException
DataWriterwrite in interface DataWriter<java.lang.String>java.io.IOException - if an I/O error occursprotected void handleIdleTimeout()
StoreObjectSupporthandleIdleTimeout in class StoreObjectSupport