Class AtlasMutationLevel

  • All Implemented Interfaces:
    java.io.Serializable

    public class AtlasMutationLevel
    extends java.lang.Object
    implements java.io.Serializable
    Class that holds level and country specific configuration for an AtlasMutator
    See Also:
    Serialized Form
    • 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:
        equals in class java.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()
      • getBroadcastVariables

        public java.util.Map<java.lang.String,​java.lang.Object> getBroadcastVariables()
      • 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()
      • 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:
        hashCode in class java.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.
      • 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:
        toString in class java.lang.Object