Class TimelineClientImpl
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,org.apache.hadoop.service.Service
-
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
org.apache.hadoop.service.Service.STATE -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.hadoop.security.UserGroupInformationprotected Stringprotected org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL.TokenFields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT) Cancel a timeline delegation token.protected TimelineConnectorprotected TimelineWritercreateTimelineWriter(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation ugi, javax.ws.rs.client.Client webClient, URI uri, net.jodah.failsafe.RetryPolicy<Object> retryPolicy) voidflush()org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier>getDelegationToken(String renewer) Get a delegation token so as to be able to talk to the timeline server in a secure way.org.apache.hadoop.security.UserGroupInformationgetUgi()static voidvoidputDomain(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.voidputDomain(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain) Send the information of a domain to the timeline server.org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponseputEntities(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.org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponseputEntities(org.apache.hadoop.yarn.api.records.timeline.TimelineEntity... entities) Send the information of a number of conceptual entities to the timeline server.longrenewDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT) Renew a timeline delegation token.protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) protected voidprotected voidvoidsetTimelineWriter(TimelineWriter writer) toString()Methods inherited from class org.apache.hadoop.yarn.client.api.TimelineClient
createTimelineClientMethods 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, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
token
@VisibleForTesting protected org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL.Token token -
authUgi
@VisibleForTesting protected org.apache.hadoop.security.UserGroupInformation authUgi -
doAsUser
-
-
Constructor Details
-
TimelineClientImpl
public TimelineClientImpl()
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
createTimelineConnector
-
serviceStart
- Overrides:
serviceStartin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
createTimelineWriter
protected TimelineWriter createTimelineWriter(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation ugi, javax.ws.rs.client.Client webClient, URI uri, net.jodah.failsafe.RetryPolicy<Object> retryPolicy) throws IOException - Throws:
IOException
-
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
flush
- Throws:
IOException
-
putEntities
public 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 Description copied from class:TimelineClientSend 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.
- Specified by:
putEntitiesin classTimelineClient- Parameters:
entities- the collection ofTimelineEntity- Returns:
- the error information if the sent entities are not correctly stored
- Throws:
IOException- if there are I/O errorsorg.apache.hadoop.yarn.exceptions.YarnException- if entities are incomplete/invalid
-
putDomain
public void putDomain(org.apache.hadoop.yarn.api.records.timeline.TimelineDomain domain) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Description copied from class:TimelineClientSend 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.
- Specified by:
putDomainin classTimelineClient- Parameters:
domain- anTimelineDomainobject- Throws:
IOException- io error occur.org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.
-
getDelegationToken
public org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> getDelegationToken(String renewer) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Description copied from class:TimelineClientGet a delegation token so as to be able to talk to the timeline server in a secure way.
- Specified by:
getDelegationTokenin classTimelineClient- 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 long renewDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Description copied from class:TimelineClientRenew a timeline delegation token.
- Specified by:
renewDelegationTokenin classTimelineClient- 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 void cancelDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException Description copied from class:TimelineClientCancel a timeline delegation token.
- Specified by:
cancelDelegationTokenin classTimelineClient- Parameters:
timelineDT- the delegation token to cancel- Throws:
IOException- io error occur.org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.
-
toString
- Overrides:
toStringin classorg.apache.hadoop.service.AbstractService
-
main
- Throws:
Exception
-
getUgi
@VisibleForTesting @Private public org.apache.hadoop.security.UserGroupInformation getUgi() -
putEntities
public 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 Description copied from class:TimelineClientSend 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
- Specified by:
putEntitiesin classTimelineClient- 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 errorsorg.apache.hadoop.yarn.exceptions.YarnException- if entities are incomplete/invalid
-
putDomain
public 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 Description copied from class:TimelineClientSend 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
- Specified by:
putDomainin classTimelineClient- Parameters:
appAttemptId-ApplicationAttemptIddomain- anTimelineDomainobject- Throws:
IOException- io error occur.org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.
-
setTimelineWriter
-
getConnector
-