Class EntityGroupFSTimelineStore

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.yarn.server.timeline.EntityGroupFSTimelineStore
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service, org.apache.hadoop.yarn.server.timeline.TimelineReader, org.apache.hadoop.yarn.server.timeline.TimelineStore, org.apache.hadoop.yarn.server.timeline.TimelineWriter

public class EntityGroupFSTimelineStore extends org.apache.hadoop.service.CompositeService implements org.apache.hadoop.yarn.server.timeline.TimelineStore
Plugin timeline storage to support timeline server v1.5 API. This storage uses a file system to store timeline entities in their groups.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Application states,

    Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService

    org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHook

    Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service

    org.apache.hadoop.service.Service.STATE

    Nested classes/interfaces inherited from interface org.apache.hadoop.yarn.server.timeline.TimelineReader

    org.apache.hadoop.yarn.server.timeline.TimelineReader.Field

    Nested classes/interfaces inherited from interface org.apache.hadoop.yarn.server.timeline.TimelineStore

    org.apache.hadoop.yarn.server.timeline.TimelineStore.SystemFilter
  • Field Summary

    Fields inherited from class org.apache.hadoop.service.CompositeService

    STOP_ONLY_STARTED_SERVICES

    Fields inherited from interface org.apache.hadoop.yarn.server.timeline.TimelineReader

    DEFAULT_LIMIT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.hadoop.yarn.client.api.YarnClient
    createAndInitYarnClient(org.apache.hadoop.conf.Configuration conf)
    Create and initialize the YARN Client.
    getAppState(org.apache.hadoop.yarn.api.records.ApplicationId appId)
    Get the application state.
    org.apache.hadoop.yarn.api.records.timeline.TimelineDomain
    getDomain(String domainId)
     
    org.apache.hadoop.yarn.api.records.timeline.TimelineDomains
     
    org.apache.hadoop.yarn.api.records.timeline.TimelineEntities
    getEntities(String entityType, Long limit, Long windowStart, Long windowEnd, String fromId, Long fromTs, org.apache.hadoop.yarn.server.timeline.NameValuePair primaryFilter, Collection<org.apache.hadoop.yarn.server.timeline.NameValuePair> secondaryFilters, EnumSet<org.apache.hadoop.yarn.server.timeline.TimelineReader.Field> fieldsToRetrieve, org.apache.hadoop.yarn.server.timeline.TimelineDataManager.CheckAcl checkAcl)
     
    org.apache.hadoop.yarn.api.records.timeline.TimelineEntity
    getEntity(String entityId, String entityType, EnumSet<org.apache.hadoop.yarn.server.timeline.TimelineReader.Field> fieldsToRetrieve)
     
    org.apache.hadoop.yarn.api.records.timeline.TimelineEvents
    getEntityTimelines(String entityType, SortedSet<String> entityIds, Long limit, Long windowStart, Long windowEnd, Set<String> eventTypes)
     
    protected List<org.apache.hadoop.yarn.server.timeline.TimelineStore>
    getTimelineStoresForRead(String entityId, String entityType, List<EntityCacheItem> cacheItems)
     
    void
    put(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain)
     
    org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse
    put(org.apache.hadoop.yarn.api.records.timeline.TimelineEntities data)
     
    protected void
    serviceInit(org.apache.hadoop.conf.Configuration conf)
     
    protected void
     
    protected void
     

    Methods inherited from class org.apache.hadoop.service.CompositeService

    addIfService, addService, getServices, removeService

    Methods inherited from class org.apache.hadoop.service.AbstractService

    close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.hadoop.service.Service

    close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop
  • Constructor Details

    • EntityGroupFSTimelineStore

      public EntityGroupFSTimelineStore()
  • Method Details

    • serviceInit

      protected void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
      Overrides:
      serviceInit in class org.apache.hadoop.service.CompositeService
      Throws:
      Exception
    • serviceStart

      protected void serviceStart() throws Exception
      Overrides:
      serviceStart in class org.apache.hadoop.service.CompositeService
      Throws:
      Exception
    • serviceStop

      protected void serviceStop() throws Exception
      Overrides:
      serviceStop in class org.apache.hadoop.service.CompositeService
      Throws:
      Exception
    • createAndInitYarnClient

      @VisibleForTesting protected org.apache.hadoop.yarn.client.api.YarnClient createAndInitYarnClient(org.apache.hadoop.conf.Configuration conf)
      Create and initialize the YARN Client. Tests may override/mock this. If they return null, then getAppState(ApplicationId) MUST also be overridden
      Parameters:
      conf - configuration
      Returns:
      the yarn client, or null.
    • getAppState

      @VisibleForTesting protected EntityGroupFSTimelineStore.AppState getAppState(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
      Get the application state.
      Parameters:
      appId - application ID
      Returns:
      the state or EntityGroupFSTimelineStore.AppState.UNKNOWN if it could not be determined
      Throws:
      IOException - on IO problems
    • getTimelineStoresForRead

      protected List<org.apache.hadoop.yarn.server.timeline.TimelineStore> getTimelineStoresForRead(String entityId, String entityType, List<EntityCacheItem> cacheItems) throws IOException
      Throws:
      IOException
    • getEntities

      public org.apache.hadoop.yarn.api.records.timeline.TimelineEntities getEntities(String entityType, Long limit, Long windowStart, Long windowEnd, String fromId, Long fromTs, org.apache.hadoop.yarn.server.timeline.NameValuePair primaryFilter, Collection<org.apache.hadoop.yarn.server.timeline.NameValuePair> secondaryFilters, EnumSet<org.apache.hadoop.yarn.server.timeline.TimelineReader.Field> fieldsToRetrieve, org.apache.hadoop.yarn.server.timeline.TimelineDataManager.CheckAcl checkAcl) throws IOException
      Specified by:
      getEntities in interface org.apache.hadoop.yarn.server.timeline.TimelineReader
      Throws:
      IOException
    • getEntity

      public org.apache.hadoop.yarn.api.records.timeline.TimelineEntity getEntity(String entityId, String entityType, EnumSet<org.apache.hadoop.yarn.server.timeline.TimelineReader.Field> fieldsToRetrieve) throws IOException
      Specified by:
      getEntity in interface org.apache.hadoop.yarn.server.timeline.TimelineReader
      Throws:
      IOException
    • getEntityTimelines

      public org.apache.hadoop.yarn.api.records.timeline.TimelineEvents getEntityTimelines(String entityType, SortedSet<String> entityIds, Long limit, Long windowStart, Long windowEnd, Set<String> eventTypes) throws IOException
      Specified by:
      getEntityTimelines in interface org.apache.hadoop.yarn.server.timeline.TimelineReader
      Throws:
      IOException
    • getDomain

      public org.apache.hadoop.yarn.api.records.timeline.TimelineDomain getDomain(String domainId) throws IOException
      Specified by:
      getDomain in interface org.apache.hadoop.yarn.server.timeline.TimelineReader
      Throws:
      IOException
    • getDomains

      public org.apache.hadoop.yarn.api.records.timeline.TimelineDomains getDomains(String owner) throws IOException
      Specified by:
      getDomains in interface org.apache.hadoop.yarn.server.timeline.TimelineReader
      Throws:
      IOException
    • put

      public org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse put(org.apache.hadoop.yarn.api.records.timeline.TimelineEntities data) throws IOException
      Specified by:
      put in interface org.apache.hadoop.yarn.server.timeline.TimelineWriter
      Throws:
      IOException
    • put

      public void put(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain) throws IOException
      Specified by:
      put in interface org.apache.hadoop.yarn.server.timeline.TimelineWriter
      Throws:
      IOException