Spring for Apache Hadoop

org.springframework.data.hadoop.store.output
Class AbstractDataStreamWriter

java.lang.Object
  extended by org.springframework.data.hadoop.store.support.LifecycleObjectSupport
      extended by org.springframework.data.hadoop.store.support.StoreObjectSupport
          extended by org.springframework.data.hadoop.store.support.OutputStoreObjectSupport
              extended by 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.
 
Method Summary
protected  StreamsHolder<java.io.OutputStream> getOutput()
          Gets the output.
protected  long getPosition(StreamsHolder<java.io.OutputStream> holder)
          Gets the current stream writing position.
 
Methods inherited from class org.springframework.data.hadoop.store.support.OutputStoreObjectSupport
getOutputContext, getResolvedPath, onInit, renameFile, setFileNamingStrategy, setInWritingPrefix, setInWritingSuffix, setOverwrite, setRolloverStrategy, setWritePosition
 
Methods inherited from class org.springframework.data.hadoop.store.support.StoreObjectSupport
doStart, doStop, getCodec, getConfiguration, getPath, handleIdleTimeout, isCompressed, resetIdleTimeout, setIdleTimeout
 
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
 

Constructor Detail

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 configuration
basePath - the hdfs path
codec - the compression codec info
Method Detail

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.

Spring for Apache Hadoop