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,
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)
FileNameFormat
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, int partitionIndex, int numPartitions)
prepare
in interface FileNameFormat
public SimpleFileNameFormat withPath(String path)
public SimpleFileNameFormat withName(String name)
withTimeFormat
to format.name
- file namepublic SimpleFileNameFormat withTimeFormat(String timeFormat)
Copyright © 2023 The Apache Software Foundation. All rights reserved.