Class AtlasMutationLevel
- java.lang.Object
-
- org.openstreetmap.atlas.mutator.configuration.AtlasMutationLevel
-
- All Implemented Interfaces:
java.io.Serializable
public class AtlasMutationLevel extends java.lang.Object implements java.io.SerializableClass that holds level and country specific configuration for anAtlasMutator- See Also:
- Serialized Form
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AtlasMutationLevel(AtlasMutatorConfiguration atlasMutatorConfiguration, java.lang.String countryGroup, java.util.Set<java.lang.String> countries, java.util.Set<ConfiguredAtlasChangeGenerator> mutators, int levelIndex, int maximumLevelIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBroadcastVariable(java.lang.String name, org.apache.spark.broadcast.Broadcast<?> broadcast)voidaddDebugWhiteListedMutator(java.lang.String name)voidaddDebugWhiteListedShard(java.lang.String name)booleancanPreloadAtlasRDD()booleancanRequestSourceAtlasObjectsFromRDD()booleancanSourceAtlasObjectsFromRDD()java.lang.Stringdetails()booleanequals(java.lang.Object other)java.util.Optional<InputDependency>getApplicationInputDependencyToRequest()org.openstreetmap.atlas.geography.atlas.dynamic.policy.DynamicAtlasPolicygetApplicationPolicy(org.openstreetmap.atlas.geography.sharding.CountryShard countryShard)java.util.function.Function<org.openstreetmap.atlas.geography.sharding.CountryShard,java.util.Set<org.openstreetmap.atlas.geography.sharding.CountryShard>>getApplicationShardExplorer()AtlasMutatorConfigurationgetAtlasMutatorConfiguration()java.util.Map<java.lang.String,java.lang.Object>getBroadcastVariables()ConfiguredDynamicAtlasPolicygetConfiguredApplicationPolicy()ConfiguredDynamicAtlasPolicygetConfiguredGenerationPolicy()java.util.Set<java.lang.String>getCountries()java.lang.StringgetCountryGroup()java.util.Set<java.lang.String>getDebugIncludeListedMutators()java.util.Set<java.lang.String>getDebugIncludeListedShards()java.util.Optional<InputDependency>getGenerationInputDependencyToRequest()org.openstreetmap.atlas.geography.atlas.dynamic.policy.DynamicAtlasPolicygetGenerationPolicy(org.openstreetmap.atlas.geography.sharding.CountryShard countryShard)java.util.function.Function<org.openstreetmap.atlas.geography.sharding.CountryShard,java.util.Set<org.openstreetmap.atlas.geography.sharding.CountryShard>>getGenerationShardExplorer()java.util.Set<InputDependency>getInputDependenciesToProvide()java.util.Set<InputDependency>getInputDependenciesToRequest()intgetLevelIndex()java.lang.StringgetLevelSourceType()intgetMaximumLevelIndex()java.util.Set<ConfiguredAtlasChangeGenerator>getMutators()java.lang.StringgetOutputAtlasPath()java.lang.StringgetOutputAtlasPath(InputDependency inputDependency)org.openstreetmap.atlas.geography.atlas.dynamic.policy.DynamicAtlasPolicygetRDDBasedApplicationPolicy(org.openstreetmap.atlas.geography.sharding.CountryShard countryShard, java.util.Map<org.openstreetmap.atlas.geography.sharding.CountryShard,org.openstreetmap.atlas.geography.atlas.packed.PackedAtlas> shardToAtlasMap)org.openstreetmap.atlas.geography.atlas.dynamic.policy.DynamicAtlasPolicygetRDDBasedGenerationPolicy(org.openstreetmap.atlas.geography.sharding.CountryShard countryShard, java.util.Map<org.openstreetmap.atlas.geography.sharding.CountryShard,org.openstreetmap.atlas.geography.atlas.packed.PackedAtlas> shardToAtlasMap)java.util.function.Function<org.openstreetmap.atlas.geography.sharding.CountryShard,java.util.Optional<org.openstreetmap.atlas.geography.atlas.Atlas>>getSourceFetcher()java.lang.StringgroupAndIndex()inthashCode()booleanisAddMutationTags()booleanisChildCanPreloadRDDInput()booleanisChildNeedsRDDInput()booleanisLast()booleanisParentNeedsRDDInput()booleanisSimilarTo(AtlasMutationLevel other)AtlasMutationLevelmerge(AtlasMutationLevel other, java.lang.String groupName)voidnotifyOfChildLevel(AtlasMutationLevel childLevel)voidnotifyOfParentLevel(AtlasMutationLevel parentLevel)booleanrequestSourceAtlasObjectsFromRDD()voidsetAddMutationTags(boolean addMutationTags)voidsetAllowRDD(boolean allowRDD)voidsetPreloadRDD(boolean preloadRDD)java.util.List<org.openstreetmap.atlas.geography.sharding.CountryShard>shards()com.google.gson.JsonObjecttoJson()java.lang.StringtoString()
-
-
-
Field Detail
-
COUNTRY_INDEX_SEPARATOR
public static final java.lang.String COUNTRY_INDEX_SEPARATOR
- See Also:
- Constant Field Values
-
INTERMEDIATE_FOLDER_NAME
public static final java.lang.String INTERMEDIATE_FOLDER_NAME
- See Also:
- Constant Field Values
-
TYPE_JSON_PROPERTY_VALUE
public static final java.lang.String TYPE_JSON_PROPERTY_VALUE
- See Also:
- Constant Field Values
-
COUNTRY_OR_GROUP_JSON_PROPERTY
public static final java.lang.String COUNTRY_OR_GROUP_JSON_PROPERTY
- See Also:
- Constant Field Values
-
GROUP_CONTENTS_JSON_PROPERTY
public static final java.lang.String GROUP_CONTENTS_JSON_PROPERTY
- See Also:
- Constant Field Values
-
LEVEL_INDEX_JSON_PROPERTY
public static final java.lang.String LEVEL_INDEX_JSON_PROPERTY
- See Also:
- Constant Field Values
-
LEVEL_SOURCE_TYPE_JSON_PROPERTY
public static final java.lang.String LEVEL_SOURCE_TYPE_JSON_PROPERTY
- See Also:
- Constant Field Values
-
MUTATORS_JSON_PROPERTY
public static final java.lang.String MUTATORS_JSON_PROPERTY
- See Also:
- Constant Field Values
-
INPUT_DEPENDENCIES_PROVIDE_JSON_PROPERTY
public static final java.lang.String INPUT_DEPENDENCIES_PROVIDE_JSON_PROPERTY
- See Also:
- Constant Field Values
-
INPUT_DEPENDENCIES_REQUEST_JSON_PROPERTY
public static final java.lang.String INPUT_DEPENDENCIES_REQUEST_JSON_PROPERTY
- See Also:
- Constant Field Values
-
DYNAMIC_ATLAS_POLICY_GENERATION_JSON_PROPERTY
public static final java.lang.String DYNAMIC_ATLAS_POLICY_GENERATION_JSON_PROPERTY
- See Also:
- Constant Field Values
-
DYNAMIC_ATLAS_POLICY_APPLICATION_JSON_PROPERTY
public static final java.lang.String DYNAMIC_ATLAS_POLICY_APPLICATION_JSON_PROPERTY
- See Also:
- Constant Field Values
-
PARENT_NEEDS_RDD_INPUT_JSON_PROPERTY
public static final java.lang.String PARENT_NEEDS_RDD_INPUT_JSON_PROPERTY
- See Also:
- Constant Field Values
-
CHILD_NEEDS_RDD_INPUT_JSON_PROPERTY
public static final java.lang.String CHILD_NEEDS_RDD_INPUT_JSON_PROPERTY
- See Also:
- Constant Field Values
-
CHILD_CAN_PRELOAD_RDD_INPUT_JSON_PROPERTY
public static final java.lang.String CHILD_CAN_PRELOAD_RDD_INPUT_JSON_PROPERTY
- See Also:
- Constant Field Values
-
MAX_LEVEL_INDEX_JSON_PROPERTY
public static final java.lang.String MAX_LEVEL_INDEX_JSON_PROPERTY
- See Also:
- Constant Field Values
-
ADD_MUTATION_TAGS_JSON_PROPERTY
public static final java.lang.String ADD_MUTATION_TAGS_JSON_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AtlasMutationLevel
public AtlasMutationLevel(AtlasMutatorConfiguration atlasMutatorConfiguration, java.lang.String countryGroup, java.util.Set<java.lang.String> countries, java.util.Set<ConfiguredAtlasChangeGenerator> mutators, int levelIndex, int maximumLevelIndex)
-
-
Method Detail
-
addBroadcastVariable
public void addBroadcastVariable(java.lang.String name, org.apache.spark.broadcast.Broadcast<?> broadcast)
-
addDebugWhiteListedMutator
public void addDebugWhiteListedMutator(java.lang.String name)
-
addDebugWhiteListedShard
public void addDebugWhiteListedShard(java.lang.String name)
-
canPreloadAtlasRDD
public boolean canPreloadAtlasRDD()
-
canRequestSourceAtlasObjectsFromRDD
public boolean canRequestSourceAtlasObjectsFromRDD()
-
canSourceAtlasObjectsFromRDD
public boolean canSourceAtlasObjectsFromRDD()
-
details
public java.lang.String details()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
getApplicationInputDependencyToRequest
public java.util.Optional<InputDependency> getApplicationInputDependencyToRequest()
-
getApplicationPolicy
public org.openstreetmap.atlas.geography.atlas.dynamic.policy.DynamicAtlasPolicy getApplicationPolicy(org.openstreetmap.atlas.geography.sharding.CountryShard countryShard)
-
getApplicationShardExplorer
public java.util.function.Function<org.openstreetmap.atlas.geography.sharding.CountryShard,java.util.Set<org.openstreetmap.atlas.geography.sharding.CountryShard>> getApplicationShardExplorer()
-
getAtlasMutatorConfiguration
public AtlasMutatorConfiguration getAtlasMutatorConfiguration()
-
getBroadcastVariables
public java.util.Map<java.lang.String,java.lang.Object> getBroadcastVariables()
-
getConfiguredApplicationPolicy
public ConfiguredDynamicAtlasPolicy getConfiguredApplicationPolicy()
-
getConfiguredGenerationPolicy
public ConfiguredDynamicAtlasPolicy getConfiguredGenerationPolicy()
-
getCountries
public java.util.Set<java.lang.String> getCountries()
-
getCountryGroup
public java.lang.String getCountryGroup()
-
getDebugIncludeListedMutators
public java.util.Set<java.lang.String> getDebugIncludeListedMutators()
-
getDebugIncludeListedShards
public java.util.Set<java.lang.String> getDebugIncludeListedShards()
-
getGenerationInputDependencyToRequest
public java.util.Optional<InputDependency> getGenerationInputDependencyToRequest()
-
getGenerationPolicy
public org.openstreetmap.atlas.geography.atlas.dynamic.policy.DynamicAtlasPolicy getGenerationPolicy(org.openstreetmap.atlas.geography.sharding.CountryShard countryShard)
-
getGenerationShardExplorer
public java.util.function.Function<org.openstreetmap.atlas.geography.sharding.CountryShard,java.util.Set<org.openstreetmap.atlas.geography.sharding.CountryShard>> getGenerationShardExplorer()
-
getInputDependenciesToProvide
public java.util.Set<InputDependency> getInputDependenciesToProvide()
-
getInputDependenciesToRequest
public java.util.Set<InputDependency> getInputDependenciesToRequest()
-
getLevelIndex
public int getLevelIndex()
-
getLevelSourceType
public java.lang.String getLevelSourceType()
-
getMaximumLevelIndex
public int getMaximumLevelIndex()
-
getMutators
public java.util.Set<ConfiguredAtlasChangeGenerator> getMutators()
-
getOutputAtlasPath
public java.lang.String getOutputAtlasPath()
-
getOutputAtlasPath
public java.lang.String getOutputAtlasPath(InputDependency inputDependency)
-
getRDDBasedApplicationPolicy
public org.openstreetmap.atlas.geography.atlas.dynamic.policy.DynamicAtlasPolicy getRDDBasedApplicationPolicy(org.openstreetmap.atlas.geography.sharding.CountryShard countryShard, java.util.Map<org.openstreetmap.atlas.geography.sharding.CountryShard,org.openstreetmap.atlas.geography.atlas.packed.PackedAtlas> shardToAtlasMap)
-
getRDDBasedGenerationPolicy
public org.openstreetmap.atlas.geography.atlas.dynamic.policy.DynamicAtlasPolicy getRDDBasedGenerationPolicy(org.openstreetmap.atlas.geography.sharding.CountryShard countryShard, java.util.Map<org.openstreetmap.atlas.geography.sharding.CountryShard,org.openstreetmap.atlas.geography.atlas.packed.PackedAtlas> shardToAtlasMap)
-
getSourceFetcher
public java.util.function.Function<org.openstreetmap.atlas.geography.sharding.CountryShard,java.util.Optional<org.openstreetmap.atlas.geography.atlas.Atlas>> getSourceFetcher()
-
groupAndIndex
public java.lang.String groupAndIndex()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
isAddMutationTags
public boolean isAddMutationTags()
-
isChildCanPreloadRDDInput
public boolean isChildCanPreloadRDDInput()
- Returns:
- True when the next level has a dynamic atlas policy deterministic enough where it could read input Atlas data from a pre-loaded RDD of Atlas, or from the current level's result atlas RDD.
-
isChildNeedsRDDInput
public boolean isChildNeedsRDDInput()
- Returns:
- True when the next level will need the current level's result RDD to read from
-
isLast
public boolean isLast()
- Returns:
- True when there are no levels after this one.
-
isParentNeedsRDDInput
public boolean isParentNeedsRDDInput()
- Returns:
- True if the level before this one already read its input from its previous level's output RDD.
-
isSimilarTo
public boolean isSimilarTo(AtlasMutationLevel other)
-
merge
public AtlasMutationLevel merge(AtlasMutationLevel other, java.lang.String groupName)
-
notifyOfChildLevel
public void notifyOfChildLevel(AtlasMutationLevel childLevel)
-
notifyOfParentLevel
public void notifyOfParentLevel(AtlasMutationLevel parentLevel)
- Parameters:
parentLevel- The parent level to notify.
-
requestSourceAtlasObjectsFromRDD
public boolean requestSourceAtlasObjectsFromRDD()
-
setAddMutationTags
public void setAddMutationTags(boolean addMutationTags)
-
setAllowRDD
public void setAllowRDD(boolean allowRDD)
-
setPreloadRDD
public void setPreloadRDD(boolean preloadRDD)
-
shards
public java.util.List<org.openstreetmap.atlas.geography.sharding.CountryShard> shards()
-
toJson
public com.google.gson.JsonObject toJson()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-