Spring for Apache Hadoop

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

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

public class StaticFileNamingStrategy
extends AbstractFileNamingStrategy

A FileNamingStrategy which simply uses a static file name.

Author:
Janne Valkealahti

Field Summary
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
StaticFileNamingStrategy()
          Instantiates a new static file naming strategy.
StaticFileNamingStrategy(java.lang.String name)
          Instantiates a new static file naming strategy.
 
Method Summary
 org.apache.hadoop.fs.Path init(org.apache.hadoop.fs.Path path)
          Initialises a starting state of a strategy.
 void reset()
          Resets the strategy.
 org.apache.hadoop.fs.Path resolve(org.apache.hadoop.fs.Path path)
          Resolve a current filename.
 void setName(java.lang.String name)
          Sets the file name part.
 void setPrefix(java.lang.String prefix)
          Sets the prefix preceding name part.
 
Methods inherited from class org.springframework.data.hadoop.store.strategy.naming.AbstractFileNamingStrategy
getCodecInfo, getOrder, setCodecInfo, setOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticFileNamingStrategy

public StaticFileNamingStrategy()
Instantiates a new static file naming strategy.


StaticFileNamingStrategy

public StaticFileNamingStrategy(java.lang.String name)
Instantiates a new static file naming strategy.

Parameters:
name - the name
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.

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.


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
Overrides:
init in class AbstractFileNamingStrategy
Parameters:
path - the path
Returns:
the path

setName

public void setName(java.lang.String name)
Sets the file name part.

Parameters:
name - the new name part

setPrefix

public void setPrefix(java.lang.String prefix)
Sets the prefix preceding name part.

Parameters:
prefix - the new prefix

Spring for Apache Hadoop