Spring for Apache Hadoop

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

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
                  extended by org.springframework.data.hadoop.store.output.OutputStreamWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, 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, DataStoreWriter<byte[]>, DataWriter<byte[]>

public class OutputStreamWriter
extends AbstractDataStreamWriter
implements DataStoreWriter<byte[]>

A OutputStreamWriter is a DataStoreWriter implementation able to write byte[]s into raw hdfs files.

Author:
Janne Valkealahti

Constructor Summary
OutputStreamWriter(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.Path basePath, CodecInfo codec)
          Instantiates a new output stream writer.
 
Method Summary
 void close()
           
 void flush()
           
protected  void handleIdleTimeout()
          Handle idle timeout.
 void write(byte[] entity)
          Write an entity.
 
Methods inherited from class org.springframework.data.hadoop.store.output.AbstractDataStreamWriter
getOutput, getPosition
 
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, 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

OutputStreamWriter

public OutputStreamWriter(org.apache.hadoop.conf.Configuration configuration,
                          org.apache.hadoop.fs.Path basePath,
                          CodecInfo codec)
Instantiates a new output stream writer.

Parameters:
configuration - the configuration
basePath - the base path
codec - the codec
Method Detail

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException

write

public void write(byte[] entity)
           throws java.io.IOException
Description copied from interface: DataWriter
Write an entity.

Specified by:
write in interface DataWriter<byte[]>
Throws:
java.io.IOException - if an I/O error occurs

handleIdleTimeout

protected void handleIdleTimeout()
Description copied from class: StoreObjectSupport
Handle idle timeout. This method should be overriden to be notified of idle timeouts. Default implementation doesn't do anything.

Overrides:
handleIdleTimeout in class StoreObjectSupport

Spring for Apache Hadoop