Class MetricFileGenerator
- java.lang.Object
-
- org.openstreetmap.atlas.checks.event.FileProcessor<MetricEvent>
-
- org.openstreetmap.atlas.checks.event.MetricFileGenerator
-
- All Implemented Interfaces:
Processor<MetricEvent>
public final class MetricFileGenerator extends FileProcessor<MetricEvent>
AProcessorforMetricEvents to write them into files. By default this supports maximumFileProcessor.BATCH_SIZEmetrics. 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.
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.atlas.checks.event.FileProcessor
BATCH_SIZE
-
-
Constructor Summary
Constructors Constructor Description MetricFileGenerator(java.lang.String label, org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper fileHelper, java.lang.String outputFolder)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetFilename()voidprocess(MetricEvent event)Method to processEvent.voidprocess(ShutdownEvent event)Method to processShutdownEvent.-
Methods inherited from class org.openstreetmap.atlas.checks.event.FileProcessor
doesCompressOutput, getBatchSize, getCount, process, setBatchSize, withCompression, write
-
-
-
-
Constructor Detail
-
MetricFileGenerator
public MetricFileGenerator(java.lang.String label, org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper fileHelper, java.lang.String outputFolder)Default constructor- Parameters:
label- label for the metric filefileHelper-SparkFileHelperfor I/O operationsoutputFolder- output folder path to write files to
-
-
Method Detail
-
process
public void process(MetricEvent event)
Description copied from interface:ProcessorMethod to processEvent. If your method can process multiple events simultaneously, then mark your method with@AllowConcurrentEventsannotation.Please make sure to add@Subscribeannotation to the method that is implementing this method.- Parameters:
event-Eventto process
-
process
public void process(ShutdownEvent event)
Description copied from interface:ProcessorMethod to processShutdownEvent. This method will be called only once.
Please make sure to add@Subscribeannotation to the method that is implementing this method.- Parameters:
event-ShutdownEventto process
-
getFilename
protected java.lang.String getFilename()
- Overrides:
getFilenamein classFileProcessor<MetricEvent>- Returns:
- the name of the file to be used in
#write()method to write files
-
-