Class MetricFileGenerator

  • All Implemented Interfaces:
    org.openstreetmap.atlas.event.Processor<MetricEvent>

    public final class MetricFileGenerator
    extends FileProcessor<MetricEvent>
    A 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.
    • 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 file
        fileHelper - SparkFileHelper for I/O operations
        outputFolder - output folder path to write files to
    • Method Detail

      • process

        public void process​(org.openstreetmap.atlas.event.ShutdownEvent event)
      • getFilename

        protected java.lang.String getFilename()
        Overrides:
        getFilename in class FileProcessor<MetricEvent>
        Returns:
        the name of the file to be used in #write() method to write files