Spring for Apache Hadoop

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

java.lang.Object
  extended by org.springframework.data.hadoop.store.strategy.naming.AbstractFileNamingStrategy
All Implemented Interfaces:
org.springframework.core.Ordered, FileNamingStrategy
Direct Known Subclasses:
CodecFileNamingStrategy, RollingFileNamingStrategy, StaticFileNamingStrategy

public abstract class AbstractFileNamingStrategy
extends java.lang.Object
implements FileNamingStrategy, org.springframework.core.Ordered

Base class for FileNamingStrategy implementations. This class also implements Ordered interface to be useful with ChainedFileNamingStrategy and OrderedComposite.

Author:
Janne Valkealahti

Field Summary
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
AbstractFileNamingStrategy()
           
 
Method Summary
 CodecInfo getCodecInfo()
          Gets the codec info.
 int getOrder()
          Implementation should override this method to define a chaining order.
 org.apache.hadoop.fs.Path init(org.apache.hadoop.fs.Path path)
          Initialises a starting state of a strategy.
 void setCodecInfo(CodecInfo codecInfo)
          Sets the codec info.
 void setOrder(int order)
          Sets the order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.data.hadoop.store.strategy.naming.FileNamingStrategy
reset, resolve
 

Constructor Detail

AbstractFileNamingStrategy

public AbstractFileNamingStrategy()
Method Detail

getOrder

public int getOrder()
Implementation should override this method to define a chaining order.

Specified by:
getOrder in interface org.springframework.core.Ordered
Returns:
the order value
See Also:
Ordered.getOrder()

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

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

setOrder

public void setOrder(int order)
Sets the order.

Parameters:
order - the new order
See Also:
Ordered

getCodecInfo

public CodecInfo getCodecInfo()
Gets the codec info.

Returns:
the codec info

Spring for Apache Hadoop