本文整理汇总了Java中org.apache.hadoop.yarn.webapp.util.WebAppUtils.getAHSWebAppURLWithoutScheme方法的典型用法代码示例。如果您正苦于以下问题:Java WebAppUtils.getAHSWebAppURLWithoutScheme方法的具体用法?Java WebAppUtils.getAHSWebAppURLWithoutScheme怎么用?Java WebAppUtils.getAHSWebAppURLWithoutScheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.yarn.webapp.util.WebAppUtils
的用法示例。
在下文中一共展示了WebAppUtils.getAHSWebAppURLWithoutScheme方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAMContainerInfoForAHSWebService
import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
private List<JSONObject> getAMContainerInfoForAHSWebService(Configuration conf,
String appId) throws ClientHandlerException, UniformInterfaceException,
JSONException {
Client webServiceClient = Client.create();
String webAppAddress =
WebAppUtils.getHttpSchemePrefix(conf)
+ WebAppUtils.getAHSWebAppURLWithoutScheme(conf);
WebResource webResource = webServiceClient.resource(webAppAddress);
ClientResponse response =
webResource.path("ws").path("v1").path("applicationhistory").path("apps")
.path(appId).path("appattempts").accept(MediaType.APPLICATION_JSON)
.get(ClientResponse.class);
JSONObject json = response.getEntity(JSONObject.class);
JSONArray requests = json.getJSONArray("appAttempt");
List<JSONObject> amContainersList = new ArrayList<JSONObject>();
for (int i = 0; i < requests.length(); i++) {
amContainersList.add(requests.getJSONObject(i));
}
Collections.reverse(amContainersList);
return amContainersList;
}
示例2: startWebApp
import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
protected void startWebApp() {
String bindAddress = WebAppUtils.getAHSWebAppURLWithoutScheme(getConfig());
LOG.info("Instantiating AHSWebApp at " + bindAddress);
try {
webApp =
WebApps
.$for("applicationhistory", ApplicationHistoryClientService.class,
ahsClientService, "ws")
.with(getConfig())
.withHttpSpnegoPrincipalKey(
YarnConfiguration.TIMELINE_SERVICE_WEBAPP_SPNEGO_USER_NAME_KEY)
.withHttpSpnegoKeytabKey(
YarnConfiguration.TIMELINE_SERVICE_WEBAPP_SPNEGO_KEYTAB_FILE_KEY)
.at(bindAddress)
.start(new AHSWebApp(historyManager, timelineStore));
} catch (Exception e) {
String msg = "AHSWebApp failed to start.";
LOG.error(msg, e);
throw new YarnRuntimeException(msg, e);
}
}
示例3: setup
import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
@Before
public void setup() {
historyServer = new ApplicationHistoryServer();
Configuration config = new YarnConfiguration();
expectedLogUrl = WebAppUtils.getHttpSchemePrefix(config) +
WebAppUtils.getAHSWebAppURLWithoutScheme(config) +
"/applicationhistory/logs/localhost:0/container_0_0001_01_000001/" +
"container_0_0001_01_000001/test user";
config.setClass(YarnConfiguration.APPLICATION_HISTORY_STORE,
MemoryApplicationHistoryStore.class, ApplicationHistoryStore.class);
historyServer.init(config);
historyServer.start();
store =
((ApplicationHistoryManagerImpl) historyServer.getApplicationHistory())
.getHistoryStore();
}
示例4: serviceInit
import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
@Override
protected void serviceInit(Configuration conf) throws Exception {
LOG.info("ApplicationHistory Init");
historyStore = createApplicationHistoryStore(conf);
historyStore.init(conf);
serverHttpAddress = WebAppUtils.getHttpSchemePrefix(conf) +
WebAppUtils.getAHSWebAppURLWithoutScheme(conf);
super.serviceInit(conf);
}
示例5: serviceInit
import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
@Override
protected void serviceInit(Configuration conf) throws Exception {
serverHttpAddress = WebAppUtils.getHttpSchemePrefix(conf) +
WebAppUtils.getAHSWebAppURLWithoutScheme(conf);
maxLoadedApplications =
conf.getLong(YarnConfiguration.APPLICATION_HISTORY_MAX_APPS,
YarnConfiguration.DEFAULT_APPLICATION_HISTORY_MAX_APPS);
super.serviceInit(conf);
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:10,代码来源:ApplicationHistoryManagerOnTimelineStore.java
示例6: serviceInit
import org.apache.hadoop.yarn.webapp.util.WebAppUtils; //导入方法依赖的package包/类
@Override
protected void serviceInit(Configuration conf) throws Exception {
serverHttpAddress = WebAppUtils.getHttpSchemePrefix(conf) +
WebAppUtils.getAHSWebAppURLWithoutScheme(conf);
super.serviceInit(conf);
}