public abstract class AbstractFileNamingStrategy extends java.lang.Object implements FileNamingStrategy, org.springframework.core.Ordered
FileNamingStrategy
implementations.
Also implements Ordered
interface to be useful with
ChainedFileNamingStrategy
and OrderedComposite
.
Enable information from method isEnabled()
can be used in cases
where strategy needs to be in place but perhaps should not be activated.
Constructor and Description |
---|
AbstractFileNamingStrategy() |
Modifier and Type | Method and Description |
---|---|
abstract FileNamingStrategy |
createInstance()
Creates a new instance of
FileNamingStrategy . |
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.
|
boolean |
isEnabled()
Checks if strategy is enabled.
|
void |
reset()
Resets the strategy to its original state.
|
void |
setCodecInfo(CodecInfo codecInfo)
Sets the codec info.
|
void |
setEnabled(boolean enabled)
Sets if this strategy is enabled.
|
void |
setOrder(int order)
Sets the order.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
next, resolve
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
Ordered.getOrder()
public void setCodecInfo(CodecInfo codecInfo)
FileNamingStrategy
setCodecInfo
in interface FileNamingStrategy
codecInfo
- the new codec infopublic org.apache.hadoop.fs.Path init(org.apache.hadoop.fs.Path path)
FileNamingStrategy
Path
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 FileNamingStrategy
path
- the pathpublic void reset()
FileNamingStrategy
reset
in interface FileNamingStrategy
public abstract FileNamingStrategy createInstance()
FileNamingStrategyFactory
FileNamingStrategy
.createInstance
in interface FileNamingStrategyFactory<FileNamingStrategy>
public void setOrder(int order)
order
- the new orderOrdered
public CodecInfo getCodecInfo()
public void setEnabled(boolean enabled)
enabled
- the new enabledpublic boolean isEnabled()