Class TimelineV2Client

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.yarn.client.api.TimelineV2Client
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service
Direct Known Subclasses:
TimelineV2ClientImpl

public abstract class TimelineV2Client extends org.apache.hadoop.service.CompositeService
A client library that can be used to post some information in terms of a number of conceptual entities. This client library needs to be used along with time line v.2 server version. Refer TimelineClient for ATS V1 interface.
  • Nested Class Summary

    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
  • Field Summary

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

    STOP_ONLY_STARTED_SERVICES
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    createTimelineClient(org.apache.hadoop.yarn.api.records.ApplicationId appId)
    Creates an instance of the timeline v.2 client.
    abstract void
    putEntities(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity... entities)
    Send the information of a number of conceptual entities within the scope of YARN application to the timeline service v.2 collector.
    abstract void
    putEntitiesAsync(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity... entities)
    Send the information of a number of conceptual entities within the scope of YARN application to the timeline service v.2 collector.
    abstract void
    putSubAppEntities(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity... entities)
    Send the information of a number of conceptual entities within the scope of a sub-application to the timeline service v.2 collector.
    abstract void
    putSubAppEntitiesAsync(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity... entities)
    Send the information of a number of conceptual entities within the scope of a sub-application to the timeline service v.2 collector.
    abstract void
    setTimelineCollectorInfo(org.apache.hadoop.yarn.api.records.CollectorInfo collectorInfo)
    Update collector info received in AllocateResponse which contains the timeline service address where the request will be sent to and the timeline delegation token which will be used to send the request.

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

    addIfService, addService, getServices, removeService, serviceInit, serviceStart, serviceStop

    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
  • Constructor Details

    • TimelineV2Client

      protected TimelineV2Client(String name)
  • Method Details

    • createTimelineClient

      @Public public static TimelineV2Client createTimelineClient(org.apache.hadoop.yarn.api.records.ApplicationId appId)
      Creates an instance of the timeline v.2 client.
      Parameters:
      appId - the application id with which the timeline client is associated
      Returns:
      the created timeline client instance
    • putEntities

      @Public public abstract void putEntities(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity... entities) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Send the information of a number of conceptual entities within the scope of YARN application to the timeline service v.2 collector. It is a blocking API. The method will not return until all the put entities have been persisted.

      Parameters:
      entities - the collection of TimelineEntity
      Throws:
      IOException - if there are I/O errors
      org.apache.hadoop.yarn.exceptions.YarnException - if entities are incomplete/invalid
    • putEntitiesAsync

      @Public public abstract void putEntitiesAsync(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity... entities) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Send the information of a number of conceptual entities within the scope of YARN application to the timeline service v.2 collector. It is an asynchronous API. The method will return once all the entities are received.

      Parameters:
      entities - the collection of TimelineEntity
      Throws:
      IOException - if there are I/O errors
      org.apache.hadoop.yarn.exceptions.YarnException - if entities are incomplete/invalid
    • setTimelineCollectorInfo

      public abstract void setTimelineCollectorInfo(org.apache.hadoop.yarn.api.records.CollectorInfo collectorInfo)

      Update collector info received in AllocateResponse which contains the timeline service address where the request will be sent to and the timeline delegation token which will be used to send the request.

      Parameters:
      collectorInfo - Collector info which contains the timeline service address and timeline delegation token.
    • putSubAppEntities

      @Public public abstract void putSubAppEntities(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity... entities) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Send the information of a number of conceptual entities within the scope of a sub-application to the timeline service v.2 collector. It is a blocking API. The method will not return until all the put entities have been persisted.

      Parameters:
      entities - the collection of TimelineEntity
      Throws:
      IOException - if there are I/O errors
      org.apache.hadoop.yarn.exceptions.YarnException - if entities are incomplete/invalid
    • putSubAppEntitiesAsync

      @Public public abstract void putSubAppEntitiesAsync(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity... entities) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Send the information of a number of conceptual entities within the scope of a sub-application to the timeline service v.2 collector. It is an asynchronous API. The method will return once all the entities are received .

      Parameters:
      entities - the collection of TimelineEntity
      Throws:
      IOException - if there are I/O errors
      org.apache.hadoop.yarn.exceptions.YarnException - if entities are incomplete/invalid