Class DefaultFileNameFormat
java.lang.Object
org.apache.storm.hdfs.bolt.format.DefaultFileNameFormat
- All Implemented Interfaces:
- Serializable,- FileNameFormat
Creates file names with the following format:
 
     {prefix}{componentId}-{taskId}-{rotationNum}-{timestamp}{extension}
 
 For example:
 
     MyBolt-5-7-1390579837830.txt
 
 By default, prefix is empty and extenstion is ".txt".
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetName(long rotation, long timeStamp) Returns the filename the HdfsBolt will create.getPath()voidprepare(Map<String, Object> conf, TopologyContext topologyContext) withExtension(String extension) Overrides the default file extension.withPrefix(String prefix) Overrides the default prefix.
- 
Constructor Details- 
DefaultFileNameFormatpublic DefaultFileNameFormat()
 
- 
- 
Method Details- 
withPrefixOverrides the default prefix.
- 
withExtensionOverrides the default file extension.
- 
withPath
- 
prepare- Specified by:
- preparein interface- FileNameFormat
 
- 
getNameDescription copied from interface:FileNameFormatReturns the filename the HdfsBolt will create.- Specified by:
- getNamein interface- FileNameFormat
- Parameters:
- rotation- the current file rotation number (incremented on every rotation)
- timeStamp- current time in milliseconds when the rotation occurs
 
- 
getPath- Specified by:
- getPathin interface- FileNameFormat
 
 
-