org.apache.hadoop.yarn.server.timeline
Class TimelineDataManager

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.yarn.server.timeline.TimelineDataManager
All Implemented Interfaces:
Closeable, org.apache.hadoop.service.Service

public class TimelineDataManager
extends org.apache.hadoop.service.AbstractService

The class wrap over the timeline store and the ACLs manager. It does some non trivial manipulation of the timeline data before putting or after getting it from the timeline store, and checks the user's access to it.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Field Summary
static String DEFAULT_DOMAIN_ID
           
 
Constructor Summary
TimelineDataManager(TimelineStore store, TimelineACLsManager timelineACLsManager)
           
 
Method Summary
 org.apache.hadoop.yarn.api.records.timeline.TimelineDomain getDomain(String domainId, org.apache.hadoop.security.UserGroupInformation callerUGI)
          Get a single domain of the particular ID.
 org.apache.hadoop.yarn.api.records.timeline.TimelineDomains getDomains(String owner, org.apache.hadoop.security.UserGroupInformation callerUGI)
          Get all the domains that belong to the given owner.
 org.apache.hadoop.yarn.api.records.timeline.TimelineEntities getEntities(String entityType, NameValuePair primaryFilter, Collection<NameValuePair> secondaryFilter, Long windowStart, Long windowEnd, String fromId, Long fromTs, Long limit, EnumSet<TimelineReader.Field> fields, org.apache.hadoop.security.UserGroupInformation callerUGI)
          Get the timeline entities that the given user have access to.
 org.apache.hadoop.yarn.api.records.timeline.TimelineEntity getEntity(String entityType, String entityId, EnumSet<TimelineReader.Field> fields, org.apache.hadoop.security.UserGroupInformation callerUGI)
          Get the single timeline entity that the given user has access to.
 org.apache.hadoop.yarn.api.records.timeline.TimelineEvents getEvents(String entityType, SortedSet<String> entityIds, SortedSet<String> eventTypes, Long windowStart, Long windowEnd, Long limit, org.apache.hadoop.security.UserGroupInformation callerUGI)
          Get the events whose entities the given user has access to.
 org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse postEntities(org.apache.hadoop.yarn.api.records.timeline.TimelineEntities entities, org.apache.hadoop.security.UserGroupInformation callerUGI)
          Store the timeline entities into the store and set the owner of them to the given user.
 void putDomain(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain, org.apache.hadoop.security.UserGroupInformation callerUGI)
          Add or update an domain.
protected  void serviceInit(org.apache.hadoop.conf.Configuration conf)
           
 
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, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DOMAIN_ID

public static final String DEFAULT_DOMAIN_ID
See Also:
Constant Field Values
Constructor Detail

TimelineDataManager

public TimelineDataManager(TimelineStore store,
                           TimelineACLsManager timelineACLsManager)
Method Detail

serviceInit

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

getEntities

public org.apache.hadoop.yarn.api.records.timeline.TimelineEntities getEntities(String entityType,
                                                                                NameValuePair primaryFilter,
                                                                                Collection<NameValuePair> secondaryFilter,
                                                                                Long windowStart,
                                                                                Long windowEnd,
                                                                                String fromId,
                                                                                Long fromTs,
                                                                                Long limit,
                                                                                EnumSet<TimelineReader.Field> fields,
                                                                                org.apache.hadoop.security.UserGroupInformation callerUGI)
                                                                         throws org.apache.hadoop.yarn.exceptions.YarnException,
                                                                                IOException
Get the timeline entities that the given user have access to. The meaning of each argument has been documented with TimelineReader.getEntities(java.lang.String, java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String, java.lang.Long, org.apache.hadoop.yarn.server.timeline.NameValuePair, java.util.Collection, java.util.EnumSet).

Throws:
org.apache.hadoop.yarn.exceptions.YarnException
IOException
See Also:
TimelineReader.getEntities(java.lang.String, java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String, java.lang.Long, org.apache.hadoop.yarn.server.timeline.NameValuePair, java.util.Collection, java.util.EnumSet)

getEntity

public org.apache.hadoop.yarn.api.records.timeline.TimelineEntity getEntity(String entityType,
                                                                            String entityId,
                                                                            EnumSet<TimelineReader.Field> fields,
                                                                            org.apache.hadoop.security.UserGroupInformation callerUGI)
                                                                     throws org.apache.hadoop.yarn.exceptions.YarnException,
                                                                            IOException
Get the single timeline entity that the given user has access to. The meaning of each argument has been documented with TimelineReader.getEntity(java.lang.String, java.lang.String, java.util.EnumSet).

Throws:
org.apache.hadoop.yarn.exceptions.YarnException
IOException
See Also:
TimelineReader.getEntity(java.lang.String, java.lang.String, java.util.EnumSet)

getEvents

public org.apache.hadoop.yarn.api.records.timeline.TimelineEvents getEvents(String entityType,
                                                                            SortedSet<String> entityIds,
                                                                            SortedSet<String> eventTypes,
                                                                            Long windowStart,
                                                                            Long windowEnd,
                                                                            Long limit,
                                                                            org.apache.hadoop.security.UserGroupInformation callerUGI)
                                                                     throws org.apache.hadoop.yarn.exceptions.YarnException,
                                                                            IOException
Get the events whose entities the given user has access to. The meaning of each argument has been documented with TimelineReader.getEntityTimelines(java.lang.String, java.util.SortedSet, java.lang.Long, java.lang.Long, java.lang.Long, java.util.Set).

Throws:
org.apache.hadoop.yarn.exceptions.YarnException
IOException
See Also:
TimelineReader.getEntityTimelines(java.lang.String, java.util.SortedSet, java.lang.Long, java.lang.Long, java.lang.Long, java.util.Set)

postEntities

public org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse postEntities(org.apache.hadoop.yarn.api.records.timeline.TimelineEntities entities,
                                                                                    org.apache.hadoop.security.UserGroupInformation callerUGI)
                                                                             throws org.apache.hadoop.yarn.exceptions.YarnException,
                                                                                    IOException
Store the timeline entities into the store and set the owner of them to the given user.

Throws:
org.apache.hadoop.yarn.exceptions.YarnException
IOException

putDomain

public void putDomain(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain,
                      org.apache.hadoop.security.UserGroupInformation callerUGI)
               throws org.apache.hadoop.yarn.exceptions.YarnException,
                      IOException
Add or update an domain. If the domain already exists, only the owner and the admin can update it.

Throws:
org.apache.hadoop.yarn.exceptions.YarnException
IOException

getDomain

public org.apache.hadoop.yarn.api.records.timeline.TimelineDomain getDomain(String domainId,
                                                                            org.apache.hadoop.security.UserGroupInformation callerUGI)
                                                                     throws org.apache.hadoop.yarn.exceptions.YarnException,
                                                                            IOException
Get a single domain of the particular ID. If callerUGI is not the owner or the admin of the domain, null will be returned.

Throws:
org.apache.hadoop.yarn.exceptions.YarnException
IOException

getDomains

public org.apache.hadoop.yarn.api.records.timeline.TimelineDomains getDomains(String owner,
                                                                              org.apache.hadoop.security.UserGroupInformation callerUGI)
                                                                       throws org.apache.hadoop.yarn.exceptions.YarnException,
                                                                              IOException
Get all the domains that belong to the given owner. If callerUGI is not the owner or the admin of the domain, empty list is going to be returned.

Throws:
org.apache.hadoop.yarn.exceptions.YarnException
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.