Class TimelineClient
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,Service
TimelineV2Client for ATS V2 interface.-
Nested Class Summary
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
Service.STATE -
Field Summary
Fields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcancelDelegationToken(Token<TimelineDelegationTokenIdentifier> timelineDT) Cancel a timeline delegation token.static TimelineClientCreates an instance of the timeline v.1.x client.abstract Token<TimelineDelegationTokenIdentifier>getDelegationToken(String renewer) Get a delegation token so as to be able to talk to the timeline server in a secure way.abstract voidputDomain(ApplicationAttemptId appAttemptId, TimelineDomain domain) Send the information of a domain to the timeline server.abstract voidputDomain(TimelineDomain domain) Send the information of a domain to the timeline server.abstract TimelinePutResponseputEntities(ApplicationAttemptId appAttemptId, TimelineEntityGroupId groupId, TimelineEntity... entities) Send the information of a number of conceptual entities to the timeline server.abstract TimelinePutResponseputEntities(TimelineEntity... entities) Send the information of a number of conceptual entities to the timeline server.abstract longrenewDelegationToken(Token<TimelineDelegationTokenIdentifier> timelineDT) Renew a timeline delegation token.Methods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeService, serviceInit, serviceStart, serviceStopMethods 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
-
Constructor Details
-
TimelineClient
-
-
Method Details
-
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 useUserGroupInformation.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 TimelinePutResponse putEntities(TimelineEntity... entities) throws IOException, 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 ofTimelineEntity- Returns:
- the error information if the sent entities are not correctly stored
- Throws:
IOException- if there are I/O errorsYarnException- if entities are incomplete/invalid
-
putEntities
@Public public abstract TimelinePutResponse putEntities(ApplicationAttemptId appAttemptId, TimelineEntityGroupId groupId, TimelineEntity... entities) throws IOException, 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-ApplicationAttemptIdgroupId-TimelineEntityGroupIdentities- the collection ofTimelineEntity- Returns:
- the error information if the sent entities are not correctly stored
- Throws:
IOException- if there are I/O errorsYarnException- if entities are incomplete/invalid
-
putDomain
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- anTimelineDomainobject- Throws:
IOException- io error occur.YarnException- exceptions from yarn servers.
-
putDomain
@Public public abstract void putDomain(ApplicationAttemptId appAttemptId, TimelineDomain domain) throws IOException, 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- anTimelineDomainobjectappAttemptId-ApplicationAttemptId- Throws:
IOException- io error occur.YarnException- exceptions from yarn servers.
-
getDelegationToken
@Public public abstract Token<TimelineDelegationTokenIdentifier> getDelegationToken(String renewer) throws IOException, 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.YarnException- exceptions from yarn servers.
-
renewDelegationToken
@Public public abstract long renewDelegationToken(Token<TimelineDelegationTokenIdentifier> timelineDT) throws IOException, YarnException Renew a timeline delegation token.
- Parameters:
timelineDT- the delegation token to renew- Returns:
- the new expiration time
- Throws:
IOException- io error occur.YarnException- exceptions from yarn servers.
-
cancelDelegationToken
@Public public abstract void cancelDelegationToken(Token<TimelineDelegationTokenIdentifier> timelineDT) throws IOException, YarnException Cancel a timeline delegation token.
- Parameters:
timelineDT- the delegation token to cancel- Throws:
IOException- io error occur.YarnException- exceptions from yarn servers.
-