public class ChainedFileNamingStrategy extends java.lang.Object implements FileNamingStrategy
FileNamingStrategy chaining other strategies.| Constructor and Description |
|---|
ChainedFileNamingStrategy()
Instantiates a new chained rollover strategy.
|
ChainedFileNamingStrategy(java.util.List<? extends FileNamingStrategy> strategies)
Instantiates a new chained rollover strategy.
|
| Modifier and Type | Method and Description |
|---|---|
ChainedFileNamingStrategy |
createInstance()
Creates a new instance of
FileNamingStrategy. |
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 |
next()
This method should be called to prepare next filename in case
strategy doesn't know how to do it automatically.
|
void |
register(FileNamingStrategy strategy)
Register a new strategy.
|
void |
reset()
Resets the strategy to its original state.
|
org.apache.hadoop.fs.Path |
resolve(org.apache.hadoop.fs.Path path)
Resolve a current file path denoted by this strategy.
|
void |
setCodecInfo(CodecInfo codecInfo)
Sets the codec info.
|
void |
setStrategies(java.util.List<? extends FileNamingStrategy> strategies)
Sets the list of strategies.
|
public ChainedFileNamingStrategy()
public ChainedFileNamingStrategy(java.util.List<? extends FileNamingStrategy> strategies)
strategies - the strategiespublic org.apache.hadoop.fs.Path resolve(org.apache.hadoop.fs.Path path)
FileNamingStrategyresolve in interface FileNamingStrategypublic void next()
FileNamingStrategynext in interface FileNamingStrategypublic void reset()
FileNamingStrategyreset in interface 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 FileNamingStrategypath - the pathpublic void setCodecInfo(CodecInfo codecInfo)
FileNamingStrategysetCodecInfo in interface FileNamingStrategycodecInfo - the new codec infopublic ChainedFileNamingStrategy createInstance()
FileNamingStrategyFactoryFileNamingStrategy.createInstance in interface FileNamingStrategyFactory<FileNamingStrategy>public void setStrategies(java.util.List<? extends FileNamingStrategy> strategies)
strategies - the new strategiespublic void register(FileNamingStrategy strategy)
strategy - the strategypublic java.util.List<? extends FileNamingStrategy> getStrategies()