public final class CheckFlagGeoJsonProcessor extends java.lang.Object implements Processor<CheckFlagEvent>
Processor for CheckFlagEvents to write them into GeoJson files| Constructor and Description |
|---|
CheckFlagGeoJsonProcessor(org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper fileHelper,
java.lang.String outputFolder)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
computeBatchSize()
Returns bucket size based on the number of Checks we have bucketed so far
|
protected java.lang.String |
getFilename(java.lang.String challenge,
int size) |
void |
process(CheckFlagEvent event)
Method to process
Event. |
void |
process(ShutdownEvent event)
Method to process
ShutdownEvent. |
CheckFlagGeoJsonProcessor |
withBatchSizeOverride(int batchSizeOverride)
Overrides the computed batch size
|
CheckFlagGeoJsonProcessor |
withCompression(boolean compress)
Sets whether or not output files are compressed
|
public CheckFlagGeoJsonProcessor(org.openstreetmap.atlas.generator.tools.spark.utilities.SparkFileHelper fileHelper,
java.lang.String outputFolder)
fileHelper - SparkFileHelper for I/O operationsoutputFolder - output folder path to write files topublic void process(CheckFlagEvent 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.process in interface Processor<CheckFlagEvent>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.process in interface Processor<CheckFlagEvent>event - ShutdownEvent to processpublic CheckFlagGeoJsonProcessor withBatchSizeOverride(int batchSizeOverride)
batchSizeOverride - override batch size valueCheckFlagFileProcessorpublic CheckFlagGeoJsonProcessor withCompression(boolean compress)
compress - value to setCheckFlagFileProcessorprotected int computeBatchSize()
protected java.lang.String getFilename(java.lang.String challenge,
int size)