public class TextFileWriter extends AbstractDataStreamWriter implements DataStoreWriter<String>
TextFileWriter is a DataStoreWriter implementation
able to write Strings into raw hdfs files.DEFAULT_MAX_OPEN_ATTEMPTS| Constructor and Description |
|---|
TextFileWriter(Configuration configuration,
Path basePath,
CodecInfo codec)
Instantiates a new text file writer.
|
TextFileWriter(Configuration configuration,
Path basePath,
CodecInfo codec,
byte[] delimiter)
Instantiates a new text file writer.
|
TextFileWriter(Configuration configuration,
Path basePath,
CodecInfo codec,
byte[] delimiter,
long idleTimeout)
Instantiates a new text file writer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
protected void |
handleTimeout()
Handle idle timeout.
|
void |
write(String entity)
Write an entity.
|
getOutput, getPosition, setMaxOpenAttemptsfindInitFiles, getOutputContext, getResolvedPath, initOutputContext, isAppendable, isFileWriteable, isOverwrite, isSyncable, onInit, renameFile, setAppendable, setFileNamingStrategy, setInWritingPrefix, setInWritingSuffix, setOverwrite, setRolloverStrategy, setSyncable, setWritePositiondoStart, doStop, getCodec, getConfiguration, getPath, isCompressed, resetIdleTimeout, setCloseTimeout, setIdleTimeoutafterPropertiesSet, getBeanFactory, getPhase, getStoreEventPublisher, getTaskExecutor, getTaskScheduler, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setStoreEventPublisher, setTaskExecutor, setTaskScheduler, start, stop, stoppublic TextFileWriter(Configuration configuration, Path basePath, CodecInfo codec)
configuration - the hadoop configurationbasePath - the hdfs pathcodec - the compression codec infopublic TextFileWriter(Configuration configuration, Path basePath, CodecInfo codec, byte[] delimiter)
configuration - the hadoop configurationbasePath - the hdfs pathcodec - the compression codec infodelimiter - the delimiterpublic TextFileWriter(Configuration configuration, Path basePath, CodecInfo codec, byte[] delimiter, long idleTimeout)
configuration - the hadoop configurationbasePath - the hdfs pathcodec - the compression codec infodelimiter - the delimiteridleTimeout - the idle timeoutpublic void flush()
throws IOException
flush in interface FlushableIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void write(String entity) throws IOException
DataWriterwrite in interface DataWriter<String>entity - the entity to writeIOException - if an I/O error occursprotected void handleTimeout()
StoreObjectSupporthandleTimeout in class StoreObjectSupport