org.apache.hadoop.yarn.client.api.impl
Class TimelineClientImpl

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.yarn.client.api.TimelineClient
          extended by org.apache.hadoop.yarn.client.api.impl.TimelineClientImpl
All Implemented Interfaces:
Closeable, org.apache.hadoop.service.Service

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class TimelineClientImpl
extends TimelineClient


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Field Summary
static int DEFAULT_SOCKET_TIMEOUT
           
 
Constructor Summary
TimelineClientImpl()
           
 
Method Summary
 void cancelDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT)
           Cancel a timeline delegation token.
 com.sun.jersey.api.client.ClientResponse doPostingObject(Object object, String path)
           
 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.
static void main(String[] argv)
           
 void putDomain(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.TimelinePutResponse putEntities(org.apache.hadoop.yarn.api.records.timeline.TimelineEntity... entities)
           Send the information of a number of conceptual entities to the timeline server.
 long renewDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT)
           Renew a timeline delegation token.
protected  void serviceInit(org.apache.hadoop.conf.Configuration conf)
           
 
Methods inherited from class org.apache.hadoop.yarn.client.api.TimelineClient
createTimelineClient
 
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_SOCKET_TIMEOUT

public static final int DEFAULT_SOCKET_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

TimelineClientImpl

public TimelineClientImpl()
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

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: TimelineClient

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.

Specified by:
putEntities in class TimelineClient
Parameters:
entities - the collection of TimelineEntity
Returns:
the error information if the sent entities are not correctly stored
Throws:
IOException
org.apache.hadoop.yarn.exceptions.YarnException

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: TimelineClient

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.

Specified by:
putDomain in class TimelineClient
Parameters:
domain - an TimelineDomain object
Throws:
IOException
org.apache.hadoop.yarn.exceptions.YarnException

getDelegationToken

public org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> getDelegationToken(String renewer)
                                                                                             throws IOException,
                                                                                                    org.apache.hadoop.yarn.exceptions.YarnException
Description copied from class: TimelineClient

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

Specified by:
getDelegationToken in class TimelineClient
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
org.apache.hadoop.yarn.exceptions.YarnException

renewDelegationToken

public long renewDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT)
                          throws IOException,
                                 org.apache.hadoop.yarn.exceptions.YarnException
Description copied from class: TimelineClient

Renew a timeline delegation token.

Specified by:
renewDelegationToken in class TimelineClient
Parameters:
timelineDT - the delegation token to renew
Returns:
the new expiration time
Throws:
IOException
org.apache.hadoop.yarn.exceptions.YarnException

cancelDelegationToken

public void cancelDelegationToken(org.apache.hadoop.security.token.Token<TimelineDelegationTokenIdentifier> timelineDT)
                           throws IOException,
                                  org.apache.hadoop.yarn.exceptions.YarnException
Description copied from class: TimelineClient

Cancel a timeline delegation token.

Specified by:
cancelDelegationToken in class TimelineClient
Parameters:
timelineDT - the delegation token to cancel
Throws:
IOException
org.apache.hadoop.yarn.exceptions.YarnException

doPostingObject

@InterfaceAudience.Private
public com.sun.jersey.api.client.ClientResponse doPostingObject(Object object,
                                                                                          String path)

main

public static void main(String[] argv)
                 throws Exception
Throws:
Exception


Copyright © 2014 Apache Software Foundation. All Rights Reserved.