<li><ahref="#Timeline_Server_Performance_Test_Tool"> Timeline Server Performance Test Tool</a></li></ul>
<section>
<h2><aname="Overview"></a>Overview</h2><section>
<h3><aname="Introduction"></a>Introduction</h3>
<p>The Storage and retrieval of application’s current and historic information in a generic fashion is addressed in YARN through the Timeline Server. It has two responsibilities:</p><section>
<h4><aname="Persisting_Application_Specific_Information"></a>Persisting Application Specific Information</h4>
<p>The collection and retrieval of information completely specific to an application or framework. For example, the Hadoop MapReduce framework can include pieces of information like number of map tasks, reduce tasks, counters…etc. Application developers can publish the specific information to the Timeline server via <code>TimelineClient</code> in the Application Master and/or the application’s containers.</p>
<p>This information is then queryable via REST APIs for rendering by application/framework specific UIs.</p></section><section>
<h4><aname="Persisting_Generic_Information_about_Completed_Applications"></a>Persisting Generic Information about Completed Applications</h4>
<p>Previously this was supported purely for MapReduce jobs by the Application History Server. With the introduction of the timeline server, the Application History Server becomes just one use of the Timeline Server.</p>
<p>Generic information includes application level data such as</p>
<ul>
<li>queue-name,</li>
<li>user information and the like set in the <code>ApplicationSubmissionContext</code>,</li>
<li>a list of application-attempts that ran for an application</li>
<li>information about each application-attempt</li>
<li>the list of containers run under each application-attempt</li>
<li>information about each container.</li>
</ul>
<p>Generic data is published by the YARN Resource Manager to the timeline store and used by its web-UI to display information about completed applications.</p></section></section><section>
<h3><aname="Current_Status_and_Future_Plans"></a><aname="Current_Status"></a>Current Status and Future Plans</h3>
<p>Current status</p>
<olstyle="list-style-type: decimal">
<li>The core functionality of the timeline server has been completed.</li>
<li>It works in both secure and non secure clusters.</li>
<li>The generic history service is built on the timeline store.</li>
<li>The history can be stored in memory or in a leveldb database store; the latter ensures the history is preserved over Timeline Server restarts.</li>
<li>The ability to install framework specific UIs in YARN is not supported.</li>
<li>Application specific information is only available via RESTful APIs using JSON type content.</li>
<li>The “Timeline Server v1” REST API has been declared one of the REST APIs whose compatibility will be maintained in future releases.</li>
<li>The single-server implementation of the Timeline Server places a limit on the scalability of the service; it also prevents the service being High-Availability component of the YARN infrastructure.</li>
</ol>
<p>Future Plans</p>
<olstyle="list-style-type: decimal">
<li>Future releases will introduce a next generation timeline service which is scalable and reliable, <ahref="./TimelineServiceV2.html">“Timeline Service v2”</a>.</li>
<li>The expanded features of this service <i>may not</i> be available to applications using the Timeline Server v1 REST API. That includes extended data structures as well as the ability of the client to failover between Timeline Server instances.</li>
<p>The Timeline Domain offers a namespace for Timeline server allowing users to host multiple entities, isolating them from other users and applications. Timeline server Security is defined at this level.</p>
<p>A “Domain” primarily stores owner info, read and write ACL information, created and modified time stamp information. Each Domain is identified by an ID which must be unique across all users in the YARN cluster.</p></section><section>
<p>A Timeline Entity contains the meta information of a conceptual entity and its related events.</p>
<p>The entity can be an application, an application attempt, a container or any user-defined object.</p>
<p>It contains <b>Primary filters</b> which will be used to index the entities in the Timeline Store. Accordingly, users/applications should carefully choose the information they want to store as the primary filters.</p>
<p>The remaining data can be stored as unindexed information. Each Entity is uniquely identified by an <code>EntityId</code> and <code>EntityType</code>.</p></section><section>
<p>A Timeline Event describes an event that is related to a specific Timeline Entity of an application.</p>
<p>Users are free to define what an event means —such as starting an application, getting allocated a container, an operation failures or other information considered relevant to users and cluster operators.</p></section></section></section><section>
<tdalign="left"> In the server side it indicates whether timeline service is enabled or not. And in the client side, users can enable it to indicate whether client wants to use timeline service. If it’s enabled in the client side along with security, then yarn client tries to fetch the delegation tokens for the timeline server. Defaults to <code>false</code>. </td></tr>
<tdalign="left"> The setting that controls whether or not YARN system metrics are published on the timeline server by RM. Defaults to <code>false</code>. </td></tr>
<tdalign="left"> Indicate to clients whether to query generic application data from timeline history-service or not. If not enabled then application data is queried only from Resource Manager. Defaults to <code>false</code>. </td></tr>
</tbody>
</table></section><section>
<h4><aname="Timeline_store_and_state_store_configuration"></a>Timeline store and state store configuration</h4>
<tdalign="left"> Size of cache for recently read entity start times for leveldb timeline store in number of entities. Defaults to <code>10000</code>. </td></tr>
<tdalign="left"> Size of cache for recently written entity start times for leveldb timeline store in number of entities. Defaults to <code>10000</code>. </td></tr>
<tdalign="left"> Store class name for timeline state store. Defaults to <code>org.apache.hadoop.yarn.server.timeline.recovery.LeveldbTimelineStateStore</code>. </td></tr>
<tdalign="left"> The https address of the Timeline service web application. Defaults to <code>${yarn.timeline-service.hostname}:8190</code>. </td></tr>
<tdalign="left"> The actual address the server will bind to. If this optional address is set, the RPC and webapp servers will bind to this address and the port specified in <code>yarn.timeline-service.address</code> and <code>yarn.timeline-service.webapp.address</code>, respectively. This is most useful for making the service listen on all interfaces by setting to <code>0.0.0.0</code>. </td></tr>
<tdalign="left"> Enables cross-origin support (CORS) for web services where cross-origin web response headers are needed. For example, javascript making a web services request to the timeline server. Defaults to <code>false</code>. </td></tr>
<tdalign="left"> Comma separated list of origins that are allowed. Values prefixed with <code>regex:</code> are interpreted as regular expressions. Values containing wildcards (<code>*</code>) are possible as well, here a regular expression is generated, the use is discouraged and support is only available for backward compatibility. Defaults to <code>*</code>. </td></tr>
<tdalign="left"> Comma separated list of methods that are allowed for web services needing cross-origin (CORS) support. Defaults to <code>GET,POST,HEAD</code>. </td></tr>
<tdalign="left"> Comma separated list of headers that are allowed for web services needing cross-origin (CORS) support. Defaults to <code>X-Requested-With,Content-Type,Accept,Origin</code>. </td></tr>
<tdalign="left"> The number of seconds a pre-flighted request can be cached for web services needing cross-origin (CORS) support. Defaults to <code>1800</code>. </td></tr>
</tbody>
</table>
<p>Note that the selection between the HTTP and HTTPS binding is made in the <code>TimelineClient</code> based upon the value of the YARN-wide configuration option <code>yarn.http.policy</code>; the HTTPS endpoint will be selected if this policy is <code>HTTPS_ONLY</code>.</p></section><section>
<tdalign="left"> The max number of applications could be fetched by using REST API or application history protocol and shown in timeline server web ui. Defaults to <code>10000</code>. </td></tr>
<p>The timeline service can host multiple UIs if enabled. The service can support both static web sites hosted in a directory or war files bundled. The web UI is then hosted on the timeline service HTTP port under the path configured.</p>
<tdalign="left"> For each of the ui-names, an on disk path should be specified to the directory service static content or the location of a web archive (war file). </td></tr>
<tdalign="left"> For each of the ui-names, the web path should be specified relative to the Timeline server root. Paths should begin with a starting slash. </td></tr>
<p>Security can be enabled by setting <code>yarn.timeline-service.http-authentication.type</code> to <code>kerberos</code>, after which the following configuration options are available:</p>
<tdalign="left"> Defines authentication used for the timeline server HTTP endpoint. Supported values are: <code>simple</code> / <code>kerberos</code> / #AUTHENTICATION_HANDLER_CLASSNAME#. Defaults to <code>simple</code>. </td></tr>
<tdalign="left"> Indicates if anonymous requests are allowed by the timeline server when using ‘simple’ authentication. Defaults to <code>true</code>. </td></tr>
<tdalign="left"> Should the failure to obtain a delegation token be considered an application failure (option = false), or should the client attempt to continue to publish information without it (option=true). Default: <code>false</code></td></tr>
</tbody>
</table></section><section>
<h4><aname="Enabling_the_timeline_service_and_the_generic_history_service"></a>Enabling the timeline service and the generic history service</h4>
<p>Following are the basic configuration to start Timeline server.</p>
<divclass="source">
<divclass="source">
<pre><property>
<description>Indicate to clients whether Timeline service is enabled or not.
If enabled, the TimelineClient library used by end-users will post entities
and events to the Timeline server.</description>
<h3><aname="Running_the_Timeline_Server"></a><aname="Running_Timeline_Server"></a> Running the Timeline Server</h3>
<p>Assuming all the aforementioned configurations are set properly admins can start the Timeline server/history service with the following command:</p>
<divclass="source">
<divclass="source">
<pre>yarn timelineserver
</pre></div></div>
<p>To start the Timeline server / history service as a daemon, the command is</p>
<p>Note that the same commands are usable to obtain the corresponding information about running applications.</p></section><section>
<h3><aname="Publishing_application_specific_data"></a><aname="Publishing_of_application_specific_data"></a> Publishing application specific data</h3>
<p>Developers can define what information they want to record for their applications by constructing <code>TimelineEntity</code> and <code>TimelineEvent</code> objects then publishing the entities and events to the Timeline Server via the <code>TimelineClient</code> API.</p>
// In Hadoop 2.6, if attempts submit information to the Timeline Server fail more than the retry limit,
// a RuntimeException will be raised. This may change in future releases, being
// replaced with a IOException that is (or wraps) that which triggered retry failures.
} catch (YarnException e) {
// Handle the exception
} finally {
// Stop the Timeline client
client.stop();
}
</pre></div></div>
<olstyle="list-style-type: decimal">
<li>Publishing of data to Timeline Server is a synchronous operation; the call will not return until successful.</li>
<li>The <code>TimelineClient</code> implementation class is a subclass of the YARN <code>Service</code> API; it can be placed under a <code>CompositeService</code> to ease its lifecycle management.</li>
<li>The result of a <code>putEntities()</code> call is a <code>TimelinePutResponse</code> object. This contains a (hopefully empty) list of those timeline entities reject by the timeline server, along with an error code indicating the cause of each failure.</li>
</ol>
<p>In Hadoop 2.6 and 2.7, the error codes are:</p>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Error Code </th>
<thalign="left"> Description </th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left">1 </td>
<tdalign="left"> No start time </td></tr>
<trclass="a">
<tdalign="left">2 </td>
<tdalign="left"> IOException </td></tr>
<trclass="b">
<tdalign="left">3 </td>
<tdalign="left"> System Filter conflict (reserved filter key used) </td></tr>
<trclass="a">
<tdalign="left">4 </td>
<tdalign="left"> Access Denied </td></tr>
<trclass="b">
<tdalign="left">5 </td>
<tdalign="left"> No domain </td></tr>
<trclass="a">
<tdalign="left">6 </td>
<tdalign="left"> Forbidden relation </td></tr>
</tbody>
</table>
<p>Further error codes may be defined in future.</p>
<p><b>Note</b> : Following are the points which need to be observed when updating a entity.</p>
<ul>
<li>Domain ID should not be modified for already existing entity.</li>
<li>After a modification of a Primary filter value, the new value will be appended to the old value; the original value will not be replaced.</li>
<li>It’s advisable to have same primary filters for all updates on entity. Any on modification of a primary filter by in an update will result in queries with updated primary filter to not fetching the information before the update</li>
</ul>
<h1>Generic Data Web UI</h1>
<p>Users can access the generic historic information of applications via web UI:</p>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/applicationhistory
</pre></div></div>
</section></section><section>
<h2><aname="Timeline_Server_REST_API_V1"></a><aname="Timeline_Server_REST_API_v1"></a>Timeline Server REST API V1</h2>
<p>Querying the timeline server is currently only supported via REST API calls; there is no API client implemented in the YARN libraries. In Java, the Jersey client is effective at querying the server, even in secure mode (provided the caller has the appropriate Kerberos tokens or keytab).</p>
<p>The v1 REST API is implemented at under the path, <code>/ws/v1/timeline/</code> on the Timeline Server web service.</p>
<p>Here is a non-normative description of the API.</p><section>
<h3><aname="Root_path"></a>Root path</h3>
<divclass="source">
<divclass="source">
<pre>GET /ws/v1/timeline/
</pre></div></div>
<p>Returns a JSON object describing the server instance and version information.</p>
timeline-service-build-version: "3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum e9ec74ea3ff7bc9f3d35e9cac694fb",
hadoop-build-version: "3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum 95874b192923b43cdb96a6e483afd60",
<h3><aname="Domain_summary_information_.2Fws.2Fv1.2Ftimeline.2Fdomain"></a>Domain summary information <code>/ws/v1/timeline/domain</code></h3>
<divclass="source">
<divclass="source">
<pre>GET /ws/v1/timeline/domain?owner=$OWNER
</pre></div></div>
<p>Returns a list of domains belonging to a specific user, in the JSON-marshalled <code>TimelineDomains</code> data structure.</p>
<p>The <code>owner</code> MUST be set on a GET which is not authenticated.</p>
<p>On an authenticated request, the <code>owner</code> defaults to the caller.</p>
<divclass="source">
<divclass="source">
<pre>PUT /ws/v1/timeline/domain
</pre></div></div>
<p>A PUT of a serialized <code>TimelineDomain</code> structure to this path will add the domain to the list of domains owned by the specified/current user. A successful operation returns status code of 200 and a <code>TimelinePutResponse</code> containing no errors.</p></section><section>
<h3><aname="Specific_information_about_a_Domain_.2Fws.2Fv1.2Ftimeline.2Fdomain.2F.7BdomainId.7D"></a>Specific information about a Domain <code>/ws/v1/timeline/domain/{domainId}</code></h3>
<p>Returns a JSON-marshalled <code>TimelineDomain</code> structure describing a domain.</p>
<p>If the domain is not found, then an HTTP 404 response is returned.</p></section><section>
<h3><aname="POST_new_domain_.2Fws.2Fv1.2Ftimeline.2Fdomain"></a>POST new domain <code>/ws/v1/timeline/domain</code></h3>
<p>Creates a new timeline domain, or overrides an existing one.</p>
<p>When attempting to create a new domain, the ID in the submission MUST be unique across all domains in the cluster.</p>
<p>When attempting to update an existing domain, the ID of that domain must be set. The submitter must have the appropriate permissions to update the domain.</p>
<p>If the user lacks the permission to list the domains of the specified owner, an <code>TimelineDomains</code> response with no domain listings is returned.</p><section>
<h4><aname="Retrieve_details_of_a_specific_domain:_GET_.2Fws.2Fv1.2Ftimeline.2Fdomain.2F.7BdomainId.7D"></a>Retrieve details of a specific domain: GET <code>/ws/v1/timeline/domain/{domainId}</code></h4>
<p>If the user lacks the permission to query the details of that domain, a 404, not found exception is returned —the same response which is returned if there is no entry with that ID.</p></section></section></section><section>
<p>With the Posting Entities API, you can post the entities and events, which contain the per-framework information you want to record, to the timeline server.</p><section>
<h3><aname="URI:"></a>URI:</h3>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/ws/v1/timeline
<pre>POST http://<timeline server http address:port>/ws/v1/timeline
</pre></div></div>
<p>Request Header:</p>
<divclass="source">
<divclass="source">
<pre>POST /ws/v1/timeline HTTP/1.1
Accept: application/json
Content-Type: application/json
Transfer-Encoding: chunked
</pre></div></div>
<p>Request Body:</p>
<divclass="source">
<divclass="source">
<pre>{
"entities" : [ {
"entity" : "entity id 0",
"entitytype" : "entity type 0",
"relatedentities" : {
"test ref type 2" : [ "test ref id 2" ],
"test ref type 1" : [ "test ref id 1" ]
},
"events" : [ {
"timestamp" : 1395818851590,
"eventtype" : "event type 0",
"eventinfo" : {
"key2" : "val2",
"key1" : "val1"
}
}, {
"timestamp" : 1395818851590,
"eventtype" : "event type 1",
"eventinfo" : {
"key2" : "val2",
"key1" : "val1"
}
} ],
"primaryfilters" : {
"pkey2" : [ "pval2" ],
"pkey1" : [ "pval1" ]
},
"otherinfo" : {
"okey2" : "oval2",
"okey1" : "oval1"
},
"starttime" : 1395818851588
}, {
"entity" : "entity id 1",
"entitytype" : "entity type 0",
"relatedentities" : {
"test ref type 2" : [ "test ref id 2" ],
"test ref type 1" : [ "test ref id 1" ]
},
"events" : [ {
"timestamp" : 1395818851590,
"eventtype" : "event type 0",
"eventinfo" : {
"key2" : "val2",
"key1" : "val1"
}
}, {
"timestamp" : 1395818851590,
"eventtype" : "event type 1",
"eventinfo" : {
"key2" : "val2",
"key1" : "val1"
}
} ],
"primaryfilters" : {
"pkey2" : [ "pval2" ],
"pkey1" : [ "pval1" ]
},
"otherinfo" : {
"okey2" : "oval2",
"okey1" : "oval1"
},
"starttime" : 1395818851590
} ]
}
</pre></div></div>
<p>Required fields</p>
<p>Entity: <code>type</code> and <code>id</code>. <code>starttime</code> is required unless the entity contains one or more event). Event: <code>type</code> and <code>timestamp</code>.</p></section></section></section><section>
<p>With the Timeline Entity List API, you can retrieve a list of entity object, sorted by the starting timestamp for the entity, descending. The starting timestamp of an entity can be a timestamp specified by the your application. If it is not explicitly specified, it will be chosen by the store to be the earliest timestamp of the events received in the first post for the entity.</p><section>
<h3><aname="URI:"></a>URI:</h3>
<p>Use the following URI to obtain all the entity objects of a given <code>entityType</code>.</p>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/ws/v1/timeline/{entityType}
<li><code>limit</code> - A limit on the number of entities to return. If null, defaults to 100.</li>
<li><code>windowStart</code> - The earliest start timestamp to retrieve (exclusive). If null, defaults to retrieving all entities until the limit is reached.</li>
<li><code>windowEnd</code> - The latest start timestamp to retrieve (inclusive). If null, defaults to the max value of Long.</li>
<li><code>fromId</code> - If <code>fromId</code> is not null, retrieve entities earlier than and including the specified ID. If no start time is found for the specified ID, an empty list of entities will be returned. The <code>windowEnd</code> parameter will take precedence if the start time of this entity falls later than <code>windowEnd</code>.</li>
<li><code>fromTs</code> - If <code>fromTs</code> is not null, ignore entities that were inserted into the store after the given timestamp. The entity’s insert timestamp used for this comparison is the store’s system time when the first put for the entity was received (not the entity’s start time).</li>
<li><code>primaryFilter</code> - Retrieves only entities that have the specified primary filter. If null, retrieves all entities. This is an indexed retrieval, and no entities that do not match the filter are scanned.</li>
<li><code>secondaryFilters</code> - Retrieves only entities that have exact matches for all the specified filters in their primary filters or other info. This is not an indexed retrieval, so all entities are scanned but only those matching the filters are returned.</li>
<li>fields - Specifies which fields of the entity object to retrieve: <code>EVENTS</code>, <code>RELATED_ENTITIES</code>, <code>PRIMARY_FILTERS</code>, <code>OTHER_INFO</code>, <code>LAST_EVENT_ONLY</code>. If the set of fields contains <code>LAST_EVENT_ONLY</code> and not <code>EVENTS</code>, the most recent event for each entity is retrieved. If null, retrieves all fields.</li>
</ol>
<p>Note that the value of the key/value pair for <code>primaryFilter</code> and <code>secondaryFilters</code> parameters can be of different data types, and matching is data type sensitive. Users need to format the value properly. For example, <code>123</code> and <code>"123"</code> means an integer and a string respectively. If the entity has a string <code>"123"</code> for <code>primaryFilter</code>, but the parameter is set to the integer <code>123</code>, the entity will not be matched. Similarly, <code>true</code> means a boolean while <code>"true"</code> means a string. In general, the value will be casted as a certain Java type in consistent with <code>jackson</code> library parsing a JSON clip.</p></section><section>
<h3><aname="Elements_of_the_entities_.28Timeline_Entity_List.29_Object"></a>Elements of the <code>entities</code> (Timeline Entity List) Object</h3>
<p>When you make a request for the list of timeline entities, the information will be returned as a collection of container objects. See also <code>Timeline Entity</code> for syntax of the timeline entity object.</p>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Item </th>
<thalign="left"> Data Type </th>
<thalign="left"> Description</th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left"><code>entities</code></td>
<tdalign="left"> array of timeline entity objects(JSON) </td>
<tdalign="left"> The collection of timeline entity objects </td></tr>
<li>fields - Specifies which fields of the entity object to retrieve: <code>EVENTS</code>, <code>RELATED_ENTITIES</code>, <code>PRIMARY_FILTERS</code>, <code>OTHER_INFO</code>, <code>LAST_EVENT_ONLY</code>. If the set of fields contains LAST_EVENT_ONLY and not EVENTS, the most recent event for each entity is retrieved. If null, retrieves all fields.</li>
</ol></section><section>
<h3><aname="Elements_of_the_entity_.28Timeline_Entity.29_Object:"></a>Elements of the <code>entity</code> (Timeline Entity) Object:</h3>
<p>See also <code>Timeline Event List</code> for syntax of the timeline event object. Note that <code>value</code> of <code>primaryfilters</code> and <code>otherinfo</code> is an Object instead of a String.</p>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Item </th>
<thalign="left"> Data Type </th>
<thalign="left"> Description</th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left"><code>entity</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The entity id </td></tr>
<trclass="a">
<tdalign="left"><code>entitytype</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The entity type </td></tr>
<trclass="b">
<tdalign="left"><code>relatedentities</code></td>
<tdalign="left"> map </td>
<tdalign="left"> The related entities’ identifiers, which are organized in a map of entityType : [entity1, entity2, …] </td></tr>
<trclass="a">
<tdalign="left"><code>events</code></td>
<tdalign="left"> list </td>
<tdalign="left"> The events of the entity </td></tr>
<trclass="b">
<tdalign="left"><code>primaryfilters</code></td>
<tdalign="left"> map </td>
<tdalign="left"> The primary filters of the entity, which are organized in a map of key : [value1, value2, …] </td></tr>
<trclass="a">
<tdalign="left"><code>otherinfo</code></td>
<tdalign="left"> map </td>
<tdalign="left"> The other information of the entity, which is organized in a map of key : value </td></tr>
<trclass="b">
<tdalign="left"><code>starttime</code></td>
<tdalign="left"> long </td>
<tdalign="left"> The start time of the entity </td></tr>
<p>With the Timeline Events API, you can retrieve the event objects for a list of entities all of the same entity type. The events for each entity are sorted in order of their timestamps, descending.</p><section>
<h3><aname="URI:"></a>URI:</h3>
<p>Use the following URI to obtain the event objects of the given <code>entityType</code>.</p>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/ws/v1/timeline/{entityType}/events
<li><code>entityId</code> - The entity IDs to retrieve events for. If null, no events will be returned. Multiple entityIds can be given as comma separated values.</li>
<li><code>limit</code> - A limit on the number of events to return for each entity. If null, defaults to 100 events per entity.</li>
<li><code>windowStart</code> - If not null, retrieves only events later than the given time (exclusive)</li>
<li><code>windowEnd</code> - If not null, retrieves only events earlier than the given time (inclusive)</li>
<li><code>eventType</code> - Restricts the events returned to the given types. If null, events of all types will be returned. Multiple eventTypes can be given as comma separated values.</li>
</ol></section><section>
<h3><aname="Elements_of_the_events_.28Timeline_Entity_List.29_Object"></a>Elements of the <code>events</code> (Timeline Entity List) Object</h3>
<p>When you make a request for the list of timeline events, the information will be returned as a collection of event objects.</p>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Item </th>
<thalign="left"> Data Type </th>
<thalign="left"> Description</th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left"><code>events</code></td>
<tdalign="left"> array of timeline event objects(JSON) </td>
<tdalign="left"> The collection of timeline event objects </td></tr>
</tbody>
</table>
<p>Below is the elements of a single event object. Note that <code>value</code> of <code>eventinfo</code> and <code>otherinfo</code> is an Object instead of a String.</p>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Item </th>
<thalign="left"> Data Type </th>
<thalign="left"> Description</th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left"><code>eventtype</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The event type </td></tr>
<trclass="a">
<tdalign="left"><code>eventinfo</code></td>
<tdalign="left"> map </td>
<tdalign="left"> The information of the event, which is orgainzied in a map of <code>key</code> : <code>value</code></td></tr>
<trclass="b">
<tdalign="left"><code>timestamp</code></td>
<tdalign="left"> long </td>
<tdalign="left"> The timestamp of the event </td></tr>
timeline-service-build-version: "3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum e9ec74ea3ff7bc9f3d35e9cac694fb",
hadoop-build-version: "3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum 95874b192923b43cdb96a6e483afd60",
<About>Generic History Service API</About>
<hadoop-build-version>3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum 95874b192923b43cdb96a6e483afd60</hadoop-build-version>
<timeline-service-build-version>3.0.0-SNAPSHOT from fcd0702c10ce574b887280476aba63d6682d5271 by zshen source checksum e9ec74ea3ff7bc9f3d35e9cac694fb</timeline-service-build-version>
<p>With the Application List API, you can obtain a collection of resources, each of which represents an application. When you run a GET operation on this resource, you obtain a collection of application objects.</p><section>
<h3><aname="URI:"></a>URI:</h3>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps
<p><code>states</code> - applications matching the given application states, specified as a comma-separated list</p>
</li>
<li>
<p><code>finalStatus</code> - the final status of the application - reported by the application itself</p>
</li>
<li>
<p><code>user</code> - user name</p>
</li>
<li>
<p><code>queue</code> - queue name</p>
</li>
<li>
<p><code>limit</code> - total number of app objects to be returned</p>
</li>
<li>
<p><code>startedTimeBegin</code> - applications with start time beginning with this time, specified in ms since epoch</p>
</li>
<li>
<p><code>startedTimeEnd</code> - applications with start time ending with this time, specified in ms since epoch</p>
</li>
<li>
<p><code>finishedTimeBegin</code> - applications with finish time beginning with this time, specified in ms since epoch</p>
</li>
<li>
<p><code>finishedTimeEnd</code> - applications with finish time ending with this time, specified in ms since epoch</p>
</li>
<li>
<p><code>applicationTypes</code> - applications matching the given application types, specified as a comma-separated list</p>
</li>
</ol></section><section>
<h3><aname="Elements_of_the_apps_.28Application_List.29_Object"></a>Elements of the <code>apps</code> (Application List) Object</h3>
<p>When you make a request for the list of applications, the information will be returned as a collection of application objects. See also <code>Application</code> for syntax of the application object.</p>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Item </th>
<thalign="left"> Data Type </th>
<thalign="left"> Description </th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left"><code>app</code></td>
<tdalign="left"> array of app objects(JSON)/zero or more application objects(XML) </td>
<tdalign="left"> The collection of application objects </td></tr>
<p>With the Application API, you can get an application resource contains information about a particular application that was running on an YARN cluster.</p>
<p>It is essentially a XML/JSON-serialized form of the YARN <code>ApplicationReport</code> structure.</p><section>
<h3><aname="URI:"></a>URI:</h3>
<p>Use the following URI to obtain an application object identified by the <code>appid</code> value.</p>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}
<h3><aname="Elements_of_the_app_.28Application.29_Object:"></a>Elements of the <code>app</code> (Application) Object:</h3>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Item </th>
<thalign="left"> Data Type </th>
<thalign="left"> Description </th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left"><code>appId</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The application ID </td></tr>
<trclass="a">
<tdalign="left"><code>user</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The user who started the application </td></tr>
<trclass="b">
<tdalign="left"><code>name</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The application name </td></tr>
<trclass="a">
<tdalign="left"><code>type</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The application type </td></tr>
<trclass="b">
<tdalign="left"><code>queue</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The queue to which the application submitted </td></tr>
<trclass="a">
<tdalign="left"><code>appState</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The application state according to the ResourceManager - valid values are members of the YarnApplicationState enum: <code>FINISHED</code>, <code>FAILED</code>, <code>KILLED</code></td></tr>
<trclass="b">
<tdalign="left"><code>finalStatus</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The final status of the application if finished - reported by the application itself - valid values are: <code>UNDEFINED</code>, <code>SUCCEEDED</code>, <code>FAILED</code>, <code>KILLED</code></td></tr>
<trclass="a">
<tdalign="left"><code>progress</code></td>
<tdalign="left"> float </td>
<tdalign="left"> The reported progress of the application as a percent. Long-lived YARN services may not provide a meaninful value here —or use it as a metric of actual vs desired container counts </td></tr>
<trclass="b">
<tdalign="left"><code>trackingUrl</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The web URL of the application (via the RM Proxy) </td></tr>
<tdalign="left">Node Label expression which is used to identify the nodes on which application’s containers are expected to run by default.</td></tr>
<p>With the Application Attempt List API, you can obtain a collection of resources, each of which represents an application attempt. When you run a GET operation on this resource, you obtain a collection of application attempt objects.</p><section>
<h3><aname="URI:"></a>URI:</h3>
<p>Use the following URI to obtain all the attempt objects of an application identified by the <code>appid</code> value.</p>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}/appattempts
<h3><aname="Elements_of_the_appattempts_.28Application_Attempt_List.29_Object"></a>Elements of the <code>appattempts</code> (Application Attempt List) Object</h3>
<p>When you make a request for the list of application attempts, the information will be returned as a collection of application attempt objects. See <ahref="#REST_API_APPLICATION_ATTEMPT">Application Attempt</a> for the syntax of the application attempt object.</p>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Item </th>
<thalign="left"> Data Type </th>
<thalign="left"> Description </th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left"><code>appattempt</code></td>
<tdalign="left"> array of appattempt objects(JSON)/zero or more application attempt objects(XML) </td>
<tdalign="left"> The collection of application attempt objects </td></tr>
<p>With the Application Attempt API, you can get an application attempt resource contains information about a particular application attempt of an application that was running on an YARN cluster.</p><section>
<h3><aname="URI:"></a>URI:</h3>
<p>Use the following URI to obtain an application attempt object identified by the <code>appid</code> value and the <code>appattemptid</code> value.</p>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}/appattempts/{appattemptid}
<h3><aname="Elements_of_the_appattempt_.28Application_Attempt.29_Object:"></a>Elements of the <code>appattempt</code> (Application Attempt) Object:</h3>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Item </th>
<thalign="left"> Data Type </th>
<thalign="left"> Description </th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left"><code>appAttemptId</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The application attempt Id </td></tr>
<trclass="a">
<tdalign="left"><code>amContainerId</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The ApplicationMaster container Id </td></tr>
<trclass="b">
<tdalign="left"><code>appAttemptState</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The application attempt state according to the ResourceManager - valid values are members of the YarnApplicationAttemptState enum: FINISHED, FAILED, KILLED </td></tr>
<trclass="a">
<tdalign="left"><code>trackingUrl</code></td>
<tdalign="left"> string </td>
<tdalign="left"> The web URL that can be used to track the application </td></tr>
<pre>GET http://<timeline server http address:port>/ws/v1/applicationhistory/apps/application_1395789200506_0001/appattempts/appattempt_1395789200506_0001_000001
<p>With the Container List API, you can obtain a collection of resources, each of which represents a container. When you run a GET operation on this resource, you obtain a collection of container objects.</p><section>
<h3><aname="URI:"></a>URI:</h3>
<p>Use the following URI to obtain all the container objects of an application attempt identified by the <code>appid</code> value and the <code>appattemptid</code> value.</p>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}/appattempts/{appattemptid}/containers
<h3><aname="Elements_of_the_containers_.28Container_List.29_Object"></a>Elements of the <code>containers</code> (Container List) Object</h3>
<p>When you make a request for the list of containers, the information will be returned as a collection of container objects. See also <code>Container</code> for syntax of the container object.</p>
<tableborder="0"class="bodyTable">
<thead>
<trclass="a">
<thalign="left"> Item </th>
<thalign="left"> Data Type </th>
<thalign="left"> Description </th></tr>
</thead><tbody>
<trclass="b">
<tdalign="left"><code>container</code></td>
<tdalign="left"> array of container objects(JSON)/zero or more container objects(XML) </td>
<tdalign="left"> The collection of container objects </td></tr>
"diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n",
"diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n",
"diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n",
"diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n",
"diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n",
"diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n",
<p>With the Container API, you can get a container resource contains information about a particular container of an application attempt of an application that was running on an YARN cluster.</p><section>
<h3><aname="URI:"></a>URI:</h3>
<p>Use the following URI to obtain a container object identified by the <code>appid</code> value, the <code>appattemptid</code> value and the <code>containerid</code> value.</p>
<divclass="source">
<divclass="source">
<pre>http(s)://<timeline server http(s) address:port>/ws/v1/applicationhistory/apps/{appid}/appattempts/{appattemptid}/containers/{containerid}
<li>Queries where a domain, entity type, entity ID or similar cannot be resolved result in HTTP 404, “Not Found” responses.</li>
<li>Requests in which the path, parameters or values are invalid result in Bad Request, 400, responses.</li>
<li>In a secure cluster, a 401, “Forbidden”, response is generated when attempting to perform operations to which the caller does not have the sufficient rights. There is an exception to this when querying some entities, such as Domains; here the API deliberately downgrades permission-denied outcomes as empty and not-founds responses. This hides details of other domains from an unauthorized caller.</li>
<li>If the content of timeline entity PUT operations is invalid, this failure <i>will not</i> result in an HTTP error code being retured. A status code of 200 will be returned —however, there will be an error code in the list of failed entities for each entity which could not be added.</li>
</ol></section></section><section>
<h2><aname="Timeline_Server_Performance_Test_Tool"></a><aname="TIMELINE_SERVER_PERFORMANCE_TEST_TOOL"></a> Timeline Server Performance Test Tool</h2><section>
<p>The timeline server performance test tool helps measure timeline server’s write performance. The test launches SimpleEntityWriter mappers or JobHistoryFileReplay mappers to write timeline entities to the timeline server. At the end, the transaction rate(ops/s) per mapper and the total transaction rate will be measured and printed out. Running the test with SimpleEntityWriter mappers will also measure and show the IO rate(KB/s) per mapper and the total IO rate.</p></section><section>
<li>SimpleEntityWriter mapper Each mapper writes a user-specified number of timeline entities with a user-specified size to the timeline server. SimpleEntityWrite is a default mapper of the performance test tool.
<olstyle="list-style-type: decimal">
<li>JobHistoryFileReplay mapper Each mapper replays jobhistory files under a specified directory (both the jhist file and its corresponding conf.xml are required to be present in order to be replayed. The number of mappers should be no more than the number of jobhistory files). Each mapper will get assigned some jobhistory files to replay. For each job history file, a mapper will parse it to get jobinfo and then create timeline entities. Each mapper also has the choice to write all the timeline entities created at once or one at a time.</li>
</ol>
</li>
</ol>
<p>Options:</p>
<divclass="source">
<divclass="source">
<pre>[-m <maps>] number of mappers (default: 1)
[-v] timeline service version
[-mtype <mapper type in integer>]
1. simple entity write mapper (default)
2. jobhistory files replay mapper
[-s <(KBs)test>] number of KB per put (mtype=1, default: 1 KB)
[-t] package sending iterations per mapper (mtype=1, default: 100)
[-d <path>] root path of job history files (mtype=2)
[-r <replay mode>] (mtype=2)
1. write all entities for a job in one put (default)