public class StaticFileNamingStrategy extends AbstractFileNamingStrategy
FileNamingStrategy which simply uses a static file name.| Constructor and Description |
|---|
StaticFileNamingStrategy()
Instantiates a new static file naming strategy.
|
StaticFileNamingStrategy(java.lang.String name)
Instantiates a new static file naming strategy.
|
StaticFileNamingStrategy(java.lang.String name,
java.lang.String prefix) |
| Modifier and Type | Method and Description |
|---|---|
StaticFileNamingStrategy |
createInstance()
Creates a new instance of
FileNamingStrategy. |
org.apache.hadoop.fs.Path |
init(org.apache.hadoop.fs.Path path)
Initialises a starting state of a strategy.
|
void |
next()
This method should be called to prepare next filename in case
strategy doesn't know how to do it automatically.
|
org.apache.hadoop.fs.Path |
resolve(org.apache.hadoop.fs.Path path)
Resolve a current file path denoted by this strategy.
|
void |
setName(java.lang.String name)
Sets the file name part.
|
void |
setPrefix(java.lang.String prefix)
Sets the prefix preceding name part.
|
getCodecInfo, getOrder, isEnabled, reset, setCodecInfo, setEnabled, setOrderpublic StaticFileNamingStrategy()
public StaticFileNamingStrategy(java.lang.String name)
name - the namepublic StaticFileNamingStrategy(java.lang.String name,
java.lang.String prefix)
public org.apache.hadoop.fs.Path resolve(org.apache.hadoop.fs.Path path)
FileNamingStrategypublic void next()
FileNamingStrategypublic org.apache.hadoop.fs.Path init(org.apache.hadoop.fs.Path path)
FileNamingStrategyPath and
remove its 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.
init in interface FileNamingStrategyinit in class AbstractFileNamingStrategypath - the pathpublic StaticFileNamingStrategy createInstance()
FileNamingStrategyFactoryFileNamingStrategy.createInstance in interface FileNamingStrategyFactory<FileNamingStrategy>createInstance in class AbstractFileNamingStrategypublic void setName(java.lang.String name)
name - the new name partpublic void setPrefix(java.lang.String prefix)
prefix - the new prefix