Class SimpleFileNameFormat
- java.lang.Object
-
- org.apache.storm.hdfs.trident.format.SimpleFileNameFormat
-
- All Implemented Interfaces:
Serializable,FileNameFormat
public class SimpleFileNameFormat extends Object implements FileNameFormat
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleFileNameFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName(long rotation, long timeStamp)Returns the filename the HdfsBolt will create.StringgetPath()voidprepare(Map<String,Object> conf, int partitionIndex, int numPartitions)SimpleFileNameFormatwithName(String name)support parameters:
$TIME - current time.SimpleFileNameFormatwithPath(String path)SimpleFileNameFormatwithTimeFormat(String timeFormat)
-
-
-
Method Detail
-
getName
public String getName(long rotation, long timeStamp)
Description copied from interface:FileNameFormatReturns the filename the HdfsBolt will create.- Specified by:
getNamein interfaceFileNameFormat- Parameters:
rotation- the current file rotation number (incremented on every rotation)timeStamp- current time in milliseconds when the rotation occurs
-
getPath
public String getPath()
- Specified by:
getPathin interfaceFileNameFormat
-
prepare
public void prepare(Map<String,Object> conf, int partitionIndex, int numPartitions)
- Specified by:
preparein interfaceFileNameFormat
-
withPath
public SimpleFileNameFormat withPath(String path)
-
withName
public SimpleFileNameFormat withName(String name)
support parameters:
$TIME - current time. usewithTimeFormatto format.
$NUM - rotation number
$HOST - local host name
$PARTITION - partition index- Parameters:
name- file name
-
withTimeFormat
public SimpleFileNameFormat withTimeFormat(String timeFormat)
-
-