public class JSONBlockWriter extends AbstractProcessor
| Modifier and Type | Field and Description |
|---|---|
(package private) String |
blockFormat |
(package private) int |
blocksCreated |
(package private) ByteSize |
blockSize |
(package private) long |
bytesWritten |
(package private) File |
currentBlock |
(package private) File |
directory |
(package private) SimpleDateFormat |
fmt |
(package private) static org.slf4j.Logger |
log |
(package private) FileOutputStream |
out |
(package private) String |
pattern |
(package private) String |
timeKey |
context| Constructor and Description |
|---|
JSONBlockWriter() |
| Modifier and Type | Method and Description |
|---|---|
ByteSize |
getBlockSize() |
File |
getDirectory() |
String |
getPattern() |
String |
getTimeKey() |
Data |
process(Data input) |
void |
setBlockSize(ByteSize blockSize) |
void |
setDirectory(File directory) |
void |
setPattern(String pattern) |
void |
setTimeKey(String timeKey) |
finish, init, resetStatestatic org.slf4j.Logger log
ByteSize blockSize
File directory
File currentBlock
FileOutputStream out
long bytesWritten
int blocksCreated
String pattern
SimpleDateFormat fmt
String timeKey
String blockFormat
public Data process(Data input)
Processor.process(stream.Data)public ByteSize getBlockSize()
@Parameter(description="The size of the blocks that are to be written. Default is 64M.") public void setBlockSize(ByteSize blockSize)
blockSize - the blockSize to setpublic File getDirectory()
@Parameter(description="The base directory in which the file are to be stored.", required=true) public void setDirectory(File directory)
directory - the directory to setpublic String getPattern()
@Parameter(description="A data-time pattern that is used to create subdirectories where to store blocks (within the base directory). The default pattern is `yyyy/MM/dd/HH00`.") public void setPattern(String pattern)
pattern - the pattern to setpublic String getTimeKey()
@Parameter(description="The key that is used for determining the current time. If not specified, the default key `timestamp` is used. If a data item does not contain a timestamp, the current system time is used.") public void setTimeKey(String timeKey)
timeKey - the timeKey to setCopyright © 2018. All rights reserved.