Spring for Apache Hadoop

org.springframework.data.hadoop.store.support
Class StoreObjectSupport

java.lang.Object
  extended by org.springframework.data.hadoop.store.support.LifecycleObjectSupport
      extended by org.springframework.data.hadoop.store.support.StoreObjectSupport
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:
AbstractSequenceFileReader, InputStoreObjectSupport, OutputStoreObjectSupport

public abstract class StoreObjectSupport
extends LifecycleObjectSupport

Base implementation of a store objects sharing a common functionality among store formats.

Author:
Janne Valkealahti

Constructor Summary
StoreObjectSupport(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.Path basePath, CodecInfo codec)
          Instantiates a new abstract store support.
 
Method Summary
protected  void doStart()
          Subclasses may implement this method with the start behaviour.
protected  void doStop()
          Subclasses may implement this method with the stop behaviour.
 CodecInfo getCodec()
          Gets the codec.
 org.apache.hadoop.conf.Configuration getConfiguration()
          Gets the configuration.
 org.apache.hadoop.fs.Path getPath()
          Gets the path.
protected  void handleIdleTimeout()
          Handle idle timeout.
 boolean isCompressed()
          Checks if is compressed.
protected  void onInit()
          Subclasses may implement this for initialization logic.
 void resetIdleTimeout()
          Reset idle timeout.
 void setIdleTimeout(long idleTimeout)
          Sets the idle timeout.
 
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

StoreObjectSupport

public StoreObjectSupport(org.apache.hadoop.conf.Configuration configuration,
                          org.apache.hadoop.fs.Path basePath,
                          CodecInfo codec)
Instantiates a new abstract store support.

Parameters:
configuration - the hadoop configuration
basePath - the hdfs path
codec - the compression codec info
Method Detail

onInit

protected void onInit()
               throws java.lang.Exception
Description copied from class: LifecycleObjectSupport
Subclasses may implement this for initialization logic. Called during the InitializingBean phase. Implementor should always call super method not to break initialization chain.

Overrides:
onInit in class LifecycleObjectSupport
Throws:
java.lang.Exception

doStart

protected void doStart()
Description copied from class: LifecycleObjectSupport
Subclasses may implement this method with the start behaviour. This method will be invoked while holding the LifecycleObjectSupport.lifecycleLock.

Overrides:
doStart in class LifecycleObjectSupport

doStop

protected void doStop()
Description copied from class: LifecycleObjectSupport
Subclasses may implement this method with the stop behaviour. This method will be invoked while holding the LifecycleObjectSupport.lifecycleLock.

Overrides:
doStop in class LifecycleObjectSupport

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Gets the configuration.

Returns:
the configuration

getPath

public org.apache.hadoop.fs.Path getPath()
Gets the path.

Returns:
the path

getCodec

public CodecInfo getCodec()
Gets the codec.

Returns:
the codec

isCompressed

public boolean isCompressed()
Checks if is compressed.

Returns:
true, if is compressed

setIdleTimeout

public void setIdleTimeout(long idleTimeout)
Sets the idle timeout.

Parameters:
idleTimeout - the new idle timeout

resetIdleTimeout

public void resetIdleTimeout()
Reset idle timeout.


handleIdleTimeout

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


Spring for Apache Hadoop