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 ClassesModifier and TypeClassDescriptionstatic enumApplication states,Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHookNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATENested classes/interfaces inherited from interface org.apache.hadoop.yarn.server.timeline.TimelineReader
org.apache.hadoop.yarn.server.timeline.TimelineReader.FieldNested 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_SERVICESFields inherited from interface org.apache.hadoop.yarn.server.timeline.TimelineReader
DEFAULT_LIMIT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.hadoop.yarn.client.api.YarnClientcreateAndInitYarnClient(org.apache.hadoop.conf.Configuration conf) Create and initialize the YARN Client.protected EntityGroupFSTimelineStore.AppStategetAppState(org.apache.hadoop.yarn.api.records.ApplicationId appId) Get the application state.org.apache.hadoop.yarn.api.records.timeline.TimelineDomainorg.apache.hadoop.yarn.api.records.timeline.TimelineDomainsgetDomains(String owner) org.apache.hadoop.yarn.api.records.timeline.TimelineEntitiesgetEntities(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.TimelineEntitygetEntity(String entityId, String entityType, EnumSet<org.apache.hadoop.yarn.server.timeline.TimelineReader.Field> fieldsToRetrieve) org.apache.hadoop.yarn.api.records.timeline.TimelineEventsgetEntityTimelines(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) voidput(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain) org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponseput(org.apache.hadoop.yarn.api.records.timeline.TimelineEntities data) protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) protected voidprotected voidMethods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeServiceMethods 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, waitForServiceToStopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
- Overrides:
serviceInitin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
serviceStart
- Overrides:
serviceStartin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
serviceStop
- Overrides:
serviceStopin classorg.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, thengetAppState(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.UNKNOWNif 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:
getEntitiesin interfaceorg.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:
getEntityin interfaceorg.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:
getEntityTimelinesin interfaceorg.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:
getDomainin interfaceorg.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:
getDomainsin interfaceorg.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:
putin interfaceorg.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:
putin interfaceorg.apache.hadoop.yarn.server.timeline.TimelineWriter- Throws:
IOException
-