org.springframework.data.hadoop.store.output
Class AbstractDataStreamWriter
java.lang.Object
org.springframework.data.hadoop.store.support.LifecycleObjectSupport
org.springframework.data.hadoop.store.support.StoreObjectSupport
org.springframework.data.hadoop.store.support.OutputStoreObjectSupport
org.springframework.data.hadoop.store.output.AbstractDataStreamWriter
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle
- Direct Known Subclasses:
- OutputStreamWriter, TextFileWriter
public abstract class AbstractDataStreamWriter
- extends OutputStoreObjectSupport
A AbstractDataStreamWriter
is a base implementation handling
streams with a raw hdfs files.
- Author:
- Janne Valkealahti
Constructor Summary |
AbstractDataStreamWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
Instantiates a new abstract data stream writer. |
Methods inherited from class org.springframework.data.hadoop.store.support.LifecycleObjectSupport |
afterPropertiesSet, getBeanFactory, getPhase, getStoreEventPublisher, getTaskExecutor, getTaskScheduler, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setStoreEventPublisher, setTaskExecutor, setTaskScheduler, start, stop, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDataStreamWriter
public AbstractDataStreamWriter(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.Path basePath,
CodecInfo codec)
- Instantiates a new abstract data stream writer.
- Parameters:
configuration
- the hadoop configurationbasePath
- the hdfs pathcodec
- the compression codec info
getOutput
protected StreamsHolder<java.io.OutputStream> getOutput()
throws java.io.IOException
- Gets the output.
- Returns:
- the output
- Throws:
java.io.IOException
- Signals that an I/O exception has occurred.
getPosition
protected long getPosition(StreamsHolder<java.io.OutputStream> holder)
throws java.io.IOException
- Gets the current stream writing position.
- Parameters:
holder
- the holder for output streams
- Returns:
- the position
- Throws:
java.io.IOException
- Signals that an I/O exception has occurred.