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<String,Object> conf,
TopologyContext topologyContext) |
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<String,Object> conf, TopologyContext topologyContext)
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
$COMPONENT - component id
$TASK - task id
name - file namepublic SimpleFileNameFormat withTimeFormat(String timeFormat)
Copyright © 2021 The Apache Software Foundation. All rights reserved.