Tools needed to build Ambari
- JDK 1.6.0
- Apache Maven
- Python 2.6
- Python setuptools - Download and run: sh setuptools-0.6c11-py2.6.egg
- rpmbuild (rpm-build package)
- g++ (gcc-c++ package)
- NodeJS
- Brunch 1.5.3 (to install it, run the following command after NodeJS is installed): npm install -g brunch@1.5.3
script如下,
peicheng/ambari_build_env · GitHub
https://github.com/peicheng/ambari_build_env
#------------------------------
peicheng 發表在 痞客邦 留言(0) 人氣()
近期在看 ambari REST API ,與ambari server 互動的這個區塊。
很多設計都是基於原本framework所提供的特性去設計的。
在REST API 這層中, 大量的使用了,JAX-RS 來省掉一些複雜的過程。
/**
* Handles POST /clusters/{clusterID}/hosts/{hostID}
* Create a specific host.
*
* @param body http body
* @param headers http headers
* @param ui uri info
* @param hostName host id
*
* @return host resource representation
*/
@POST
@Path("{hostName}")
@Produces("text/plain")
public Response createHost(String body, @Context HttpHeaders headers, @Context UriInfo ui,
@PathParam("hostName") String hostName) {
return handleRequest(headers, body, ui, Request.Type.POST,
createHostResource(m_clusterName, hostName, ui));
}
javax.ws.rs.core.Response |
createHost(java.lang.String body, javax.ws.rs.core.HttpHeaders headers, javax.ws.rs.core.UriInfo ui, java.lang.String hostName)
Handles POST /clusters/{clusterID}/hosts/{hostID} Create a specific host.以django , web.py來解釋的話, |
可以透過這個機制去取得REST的參數,作為程式內部的變數。
peicheng 發表在 痞客邦 留言(0) 人氣()