public abstract class AbstractDataStreamWriter extends OutputStoreObjectSupport
AbstractDataStreamWriter
is a base implementation handling streams
with a raw hdfs files.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_OPEN_ATTEMPTS |
Constructor and Description |
---|
AbstractDataStreamWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
Instantiates a new abstract data stream writer.
|
Modifier and Type | Method and Description |
---|---|
protected StreamsHolder<java.io.OutputStream> |
getOutput()
Gets the output.
|
protected long |
getPosition(StreamsHolder<java.io.OutputStream> holder)
Gets the current stream writing position.
|
void |
setMaxOpenAttempts(int maxOpenAttempts)
Sets the max open attempts trying to find a suitable path for output
stream.
|
findInitFiles, getOutputContext, getResolvedPath, initOutputContext, isAppendable, isFileWriteable, isOverwrite, isSyncable, onInit, renameFile, setAppendable, setFileNamingStrategy, setInWritingPrefix, setInWritingSuffix, setOverwrite, setRolloverStrategy, setSyncable, setWritePosition
doStart, doStop, flushTimeout, getCodec, getConfiguration, getPath, handleTimeout, isCompressed, resetIdleTimeout, setCloseTimeout, setFlushTimeout, setIdleTimeout
afterPropertiesSet, getBeanFactory, getPhase, getStoreEventPublisher, getTaskExecutor, getTaskScheduler, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setStoreEventPublisher, setTaskExecutor, setTaskScheduler, start, stop, stop
public static final int DEFAULT_MAX_OPEN_ATTEMPTS
public AbstractDataStreamWriter(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 void setMaxOpenAttempts(int maxOpenAttempts)
maxOpenAttempts
- the new max open attemptsprotected StreamsHolder<java.io.OutputStream> getOutput() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.protected long getPosition(StreamsHolder<java.io.OutputStream> holder) throws java.io.IOException
holder
- the holder for output streamsjava.io.IOException
- Signals that an I/O exception has occurred.