|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.storm.hdfs.trident.format.DefaultFileNameFormat
public class DefaultFileNameFormat
Creates file names with the following format:
{prefix}-{partitionId}-{rotationNum}-{timestamp}{extension}For example:
MyBolt-5-7-1390579837830.txtBy default, prefix is empty and extenstion is ".txt".
Constructor Summary | |
---|---|
DefaultFileNameFormat()
|
Method Summary | |
---|---|
String |
getName(long rotation,
long timeStamp)
Returns the filename the HdfsBolt will create. |
String |
getPath()
|
void |
prepare(Map conf,
int partitionIndex,
int numPartitions)
|
DefaultFileNameFormat |
withExtension(String extension)
Overrides the default file extension. |
DefaultFileNameFormat |
withPath(String path)
|
DefaultFileNameFormat |
withPrefix(String prefix)
Overrides the default prefix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFileNameFormat()
Method Detail |
---|
public DefaultFileNameFormat withPrefix(String prefix)
prefix
-
public DefaultFileNameFormat withExtension(String extension)
extension
-
public DefaultFileNameFormat withPath(String path)
public void prepare(Map conf, int partitionIndex, int numPartitions)
prepare
in interface FileNameFormat
public String getName(long rotation, long timeStamp)
FileNameFormat
getName
in interface FileNameFormat
rotation
- the current file rotation number (incremented on every rotation)timeStamp
- current time in milliseconds when the rotation occurs
public String getPath()
getPath
in interface FileNameFormat
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |