Spring for Apache Hadoop

org.springframework.data.hadoop.store.strategy.naming
Class ChainedFileNamingStrategy

java.lang.Object
  extended by org.springframework.data.hadoop.store.strategy.naming.ChainedFileNamingStrategy
All Implemented Interfaces:
FileNamingStrategy

public class ChainedFileNamingStrategy
extends java.lang.Object
implements FileNamingStrategy

A FileNamingStrategy chaining other strategies.

Author:
Janne Valkealahti

Constructor Summary
ChainedFileNamingStrategy()
          Instantiates a new chained rollover strategy.
ChainedFileNamingStrategy(java.util.List<? extends FileNamingStrategy> strategies)
          Instantiates a new chained rollover strategy.
 
Method Summary
 java.util.List<? extends FileNamingStrategy> getStrategies()
          Gets the strategies.
 org.apache.hadoop.fs.Path init(org.apache.hadoop.fs.Path path)
          Initialises a starting state of a strategy.
 void register(FileNamingStrategy strategy)
          Register a new strategy.
 void reset()
          Resets the strategy.
 org.apache.hadoop.fs.Path resolve(org.apache.hadoop.fs.Path path)
          Resolve a current filename.
 void setCodecInfo(CodecInfo codecInfo)
          Sets the codec info.
 void setStrategies(java.util.List<? extends FileNamingStrategy> strategies)
          Sets the list of strategies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainedFileNamingStrategy

public ChainedFileNamingStrategy()
Instantiates a new chained rollover strategy.


ChainedFileNamingStrategy

public ChainedFileNamingStrategy(java.util.List<? extends FileNamingStrategy> strategies)
Instantiates a new chained rollover strategy.

Parameters:
strategies - the strategies
Method Detail

resolve

public org.apache.hadoop.fs.Path resolve(org.apache.hadoop.fs.Path path)
Description copied from interface: FileNamingStrategy
Resolve a current filename.

Specified by:
resolve in interface FileNamingStrategy
Returns:
the filename

reset

public void reset()
Description copied from interface: FileNamingStrategy
Resets the strategy. This method should be called to prepare next filename in case strategy doesn't know how to do it automatically.

Specified by:
reset in interface FileNamingStrategy

init

public org.apache.hadoop.fs.Path init(org.apache.hadoop.fs.Path path)
Description copied from interface: FileNamingStrategy
Initialises a starting state of a strategy. Implementor of this method needs to check the final part of the Path and remove it's own handled part if possible. Returned Path is then passed into next strategy for it to able to do its own initialisation logic.

Path passed to this method may be null indicating that no further processing should be done or simply we don't have information about the initialised path.

Specified by:
init in interface FileNamingStrategy
Parameters:
path - the path
Returns:
the path

setCodecInfo

public void setCodecInfo(CodecInfo codecInfo)
Description copied from interface: FileNamingStrategy
Sets the codec info.

Specified by:
setCodecInfo in interface FileNamingStrategy
Parameters:
codecInfo - the new codec info

setStrategies

public void setStrategies(java.util.List<? extends FileNamingStrategy> strategies)
Sets the list of strategies. This clears all existing strategies.

Parameters:
strategies - the new strategies

register

public void register(FileNamingStrategy strategy)
Register a new strategy.

Parameters:
strategy - the strategy

getStrategies

public java.util.List<? extends FileNamingStrategy> getStrategies()
Gets the strategies.

Returns:
the strategies

Spring for Apache Hadoop