Class CheckFlagGeoJsonProcessor
- java.lang.Object
-
- org.openstreetmap.atlas.checks.event.CheckFlagGeoJsonProcessor
-
- All Implemented Interfaces:
Processor<CheckFlagEvent>
public final class CheckFlagGeoJsonProcessor extends java.lang.Object implements Processor<CheckFlagEvent>
AProcessorforCheckFlagEvents to write them into GeoJson files
-
-
Constructor Summary
Constructors Constructor Description CheckFlagGeoJsonProcessor(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 intcomputeBatchSize()Returns bucket size based on the number of Checks we have bucketed so farprotected java.lang.StringgetFilename(java.lang.String challenge, int size)voidprocess(CheckFlagEvent event)Method to processEvent.voidprocess(ShutdownEvent event)Method to processShutdownEvent.CheckFlagGeoJsonProcessorwithBatchSizeOverride(int batchSizeOverride)Overrides the computed batch sizeCheckFlagGeoJsonProcessorwithCompression(boolean compress)Sets whether or not output files are compressed
-
-
-
Constructor Detail
-
CheckFlagGeoJsonProcessor
public CheckFlagGeoJsonProcessor(org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper fileHelper, java.lang.String outputFolder)Default constructor- Parameters:
fileHelper-SparkFileHelperfor I/O operationsoutputFolder- output folder path to write files to
-
-
Method Detail
-
process
public void process(CheckFlagEvent 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.- Specified by:
processin interfaceProcessor<CheckFlagEvent>- 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.- Specified by:
processin interfaceProcessor<CheckFlagEvent>- Parameters:
event-ShutdownEventto process
-
withBatchSizeOverride
public CheckFlagGeoJsonProcessor withBatchSizeOverride(int batchSizeOverride)
Overrides the computed batch size- Parameters:
batchSizeOverride- override batch size value- Returns:
- the
CheckFlagFileProcessor
-
withCompression
public CheckFlagGeoJsonProcessor withCompression(boolean compress)
Sets whether or not output files are compressed- Parameters:
compress- value to set- Returns:
- the
CheckFlagFileProcessor
-
computeBatchSize
protected int computeBatchSize()
Returns bucket size based on the number of Checks we have bucketed so far- Returns:
- batch size
-
getFilename
protected java.lang.String getFilename(java.lang.String challenge, int size)
-
-