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)
FileNameFormat
Returns the filename the HdfsBolt will create.
getName
in interface FileNameFormat
rotation
- the current file rotation number (incremented on every rotation)timeStamp
- current time in milliseconds when the rotation occurspublic String getPath()
getPath
in interface FileNameFormat
public void prepare(Map<String,Object> conf, TopologyContext topologyContext)
prepare
in interface FileNameFormat
public 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 © 2020 The Apache Software Foundation. All rights reserved.