T - type that is going to be processedpublic abstract class FileProcessor<T extends Event> extends java.lang.Object implements Processor<T>
| Modifier and Type | Field and Description |
|---|---|
static int |
BATCH_SIZE |
| Constructor and Description |
|---|
FileProcessor(org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper fileHelper,
java.lang.String directory)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
doesCompressOutput() |
int |
getBatchSize() |
int |
getCount() |
protected java.lang.String |
getFilename() |
void |
process(java.lang.String event)
Processes given String and writes batched events into a file if needed
|
void |
setBatchSize(int batchSize)
Sets batch size to given value
|
FileProcessor<T> |
withCompression(boolean compress)
Sets whether or not output files are compressed
|
protected void |
write()
Writes a new file with the cached in String buffer
|
public static final int BATCH_SIZE
public FileProcessor(org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper fileHelper,
java.lang.String directory)
fileHelper - SparkFileHelper instance for I/O operationsdirectory - directory path to write files topublic int getBatchSize()
public final int getCount()
public boolean doesCompressOutput()
public void process(java.lang.String event)
event - a character set to processpublic void setBatchSize(int batchSize)
batchSize - New batch sizepublic FileProcessor<T> withCompression(boolean compress)
compress - value to setFileProcessorprotected java.lang.String getFilename()
#write() method to write filesprotected void write()