Class TimelineClient

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

@Public @Evolving public abstract class TimelineClient extends org.apache.hadoop.service.CompositeService implements Flushable
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 Timeline V.1.x server versions. Refer TimelineV2Client for ATS V2 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
    abstract void
    cancelDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT)
    Cancel a timeline delegation token.
    Creates an instance of the timeline v.1.x client.
    abstract org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier>
    Get a delegation token so as to be able to talk to the timeline server in a secure way.
    abstract void
    putDomain(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain)
    Send the information of a domain to the timeline server.
    abstract void
    putDomain(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain)
    Send the information of a domain to the timeline server.
    abstract org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse
    putEntities(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId groupId, org.apache.hadoop.yarn.api.records.timeline.TimelineEntity... entities)
    Send the information of a number of conceptual entities to the timeline server.
    abstract org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse
    putEntities(org.apache.hadoop.yarn.api.records.timeline.TimelineEntity... entities)
    Send the information of a number of conceptual entities to the timeline server.
    abstract long
    renewDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT)
    Renew a timeline delegation token.

    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

    Methods inherited from interface java.io.Flushable

    flush
  • Constructor Details

    • TimelineClient

      protected TimelineClient(String name)
  • Method Details

    • createTimelineClient

      @Public public static TimelineClient createTimelineClient()
      Creates an instance of the timeline v.1.x client. The current UGI when the user initialize the client will be used to do the put and the delegation token operations. The current user may use UserGroupInformation.doAs(java.security.PrivilegedAction<T>) another user to construct and initialize a timeline client if the following operations are supposed to be conducted by that user.
      Returns:
      the created timeline client instance
    • putEntities

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

      Send the information of a number of conceptual entities to the timeline server. It is a blocking API. The method will not return until it gets the response from the timeline server.

      Parameters:
      entities - the collection of TimelineEntity
      Returns:
      the error information if the sent entities are not correctly stored
      Throws:
      IOException - if there are I/O errors
      org.apache.hadoop.yarn.exceptions.YarnException - if entities are incomplete/invalid
    • putEntities

      @Public public abstract org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse putEntities(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.timeline.TimelineEntityGroupId groupId, org.apache.hadoop.yarn.api.records.timeline.TimelineEntity... entities) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Send the information of a number of conceptual entities to the timeline server. It is a blocking API. The method will not return until it gets the response from the timeline server. This API is only for timeline service v1.5

      Parameters:
      appAttemptId - ApplicationAttemptId
      groupId - TimelineEntityGroupId
      entities - the collection of TimelineEntity
      Returns:
      the error information if the sent entities are not correctly stored
      Throws:
      IOException - if there are I/O errors
      org.apache.hadoop.yarn.exceptions.YarnException - if entities are incomplete/invalid
    • putDomain

      @Public public abstract void putDomain(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Send the information of a domain to the timeline server. It is a blocking API. The method will not return until it gets the response from the timeline server.

      Parameters:
      domain - an TimelineDomain object
      Throws:
      IOException - io error occur.
      org.apache.hadoop.yarn.exceptions.YarnException - exceptions from yarn servers.
    • putDomain

      @Public public abstract void putDomain(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Send the information of a domain to the timeline server. It is a blocking API. The method will not return until it gets the response from the timeline server. This API is only for timeline service v1.5

      Parameters:
      domain - an TimelineDomain object
      appAttemptId - ApplicationAttemptId
      Throws:
      IOException - io error occur.
      org.apache.hadoop.yarn.exceptions.YarnException - exceptions from yarn servers.
    • getDelegationToken

      @Public public abstract org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> getDelegationToken(String renewer) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Get a delegation token so as to be able to talk to the timeline server in a secure way.

      Parameters:
      renewer - Address of the renewer who can renew these tokens when needed by securely talking to the timeline server
      Returns:
      a delegation token (Token) that can be used to talk to the timeline server
      Throws:
      IOException - io error occur.
      org.apache.hadoop.yarn.exceptions.YarnException - exceptions from yarn servers.
    • renewDelegationToken

      @Public public abstract long renewDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Renew a timeline delegation token.

      Parameters:
      timelineDT - the delegation token to renew
      Returns:
      the new expiration time
      Throws:
      IOException - io error occur.
      org.apache.hadoop.yarn.exceptions.YarnException - exceptions from yarn servers.
    • cancelDelegationToken

      @Public public abstract void cancelDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException

      Cancel a timeline delegation token.

      Parameters:
      timelineDT - the delegation token to cancel
      Throws:
      IOException - io error occur.
      org.apache.hadoop.yarn.exceptions.YarnException - exceptions from yarn servers.