public class SimpleFileNameFormat extends Object implements FileNameFormat
| Constructor and Description |
|---|
SimpleFileNameFormat() |
| Modifier and Type | Method and Description |
|---|---|
String |
getName(long rotation,
long timeStamp)
Returns the filename the HdfsBolt will create.
|
String |
getPath() |
void |
prepare(Map conf,
int partitionIndex,
int numPartitions) |
SimpleFileNameFormat |
withName(String name)
support parameters:
$TIME - current time. |
SimpleFileNameFormat |
withPath(String path) |
SimpleFileNameFormat |
withTimeFormat(String timeFormat) |
public String getName(long rotation, long timeStamp)
FileNameFormatReturns the filename the HdfsBolt will create.
getName in interface FileNameFormatrotation - the current file rotation number (incremented on every rotation)timeStamp - current time in milliseconds when the rotation occurspublic String getPath()
getPath in interface FileNameFormatpublic void prepare(Map conf, int partitionIndex, int numPartitions)
prepare in interface FileNameFormatpublic SimpleFileNameFormat withPath(String path)
public SimpleFileNameFormat withName(String name)
support parameters:
$TIME - current time. use withTimeFormat to format.
$NUM - rotation number
$HOST - local host name
$PARTITION - partition index
name - file namepublic SimpleFileNameFormat withTimeFormat(String timeFormat)
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.