public final class MetricFileGenerator extends FileProcessor<MetricEvent>
Processor for MetricEvents to write them into files. By default this supports
maximum FileProcessor.BATCH_SIZE metrics. If number of metrics go beyond that limit, the
newest metrics will override the previous ones in the file, because the file name is going to be
the same for both write operations.BATCH_SIZE| Constructor and Description |
|---|
MetricFileGenerator(java.lang.String label,
org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper fileHelper,
java.lang.String outputFolder)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getFilename() |
void |
process(MetricEvent event)
Method to process
Event. |
void |
process(ShutdownEvent event)
Method to process
ShutdownEvent. |
doesCompressOutput, getBatchSize, getCount, process, setBatchSize, withCompression, writepublic MetricFileGenerator(java.lang.String label,
org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper fileHelper,
java.lang.String outputFolder)
label - label for the metric filefileHelper - SparkFileHelper for I/O operationsoutputFolder - output folder path to write files topublic void process(MetricEvent event)
ProcessorEvent. If your method can process multiple events simultaneously,
then mark your method with @AllowConcurrentEvents annotation.Please make sure
to add @Subscribe annotation to the method that is implementing this method.event - Event to processpublic void process(ShutdownEvent event)
ProcessorShutdownEvent. This method will be called only once.@Subscribe annotation to the method that is
implementing this method.event - ShutdownEvent to processprotected java.lang.String getFilename()
getFilename in class FileProcessor<MetricEvent>#write() method to write files