Class DataLocator<T>

  • Type Parameters:
    T - The type of the data to locate
    All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    AtlasLocator, DataLocator.ResourceLocator

    public abstract class DataLocator<T>
    extends java.lang.Object
    implements java.io.Serializable
    Locate and retrieve resources from a data store.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  DataLocator.ResourceLocator
      Locator that returns Resources.
    • Constructor Summary

      Constructors 
      Constructor Description
      DataLocator​(java.util.Map<java.lang.String,​java.lang.String> sparkContext)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract java.util.Optional<T> readFrom​(org.openstreetmap.atlas.streaming.resource.Resource resource)
      Transform a resource into a fetched object
      java.lang.Iterable<T> retrieve​(java.lang.Iterable<java.lang.String> paths)
      Retrieve some resources
      java.util.Optional<T> retrieve​(java.lang.String path)
      Retrieve a resource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DataLocator

        public DataLocator​(java.util.Map<java.lang.String,​java.lang.String> sparkContext)
    • Method Detail

      • retrieve

        public java.lang.Iterable<T> retrieve​(java.lang.Iterable<java.lang.String> paths)
        Retrieve some resources
        Parameters:
        paths - The paths to get
        Returns:
        The resources
      • retrieve

        public java.util.Optional<T> retrieve​(java.lang.String path)
        Retrieve a resource
        Parameters:
        path - The path of the resource
        Returns:
        The resource option
      • readFrom

        protected abstract java.util.Optional<T> readFrom​(org.openstreetmap.atlas.streaming.resource.Resource resource)
        Transform a resource into a fetched object
        Parameters:
        resource - The resource to read
        Returns:
        The fetched object