本文整理汇总了Java中org.apache.hadoop.yarn.server.webapp.dao.AppInfo类的典型用法代码示例。如果您正苦于以下问题:Java AppInfo类的具体用法?Java AppInfo怎么用?Java AppInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AppInfo类属于org.apache.hadoop.yarn.server.webapp.dao包,在下文中一共展示了AppInfo类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getApp
import org.apache.hadoop.yarn.server.webapp.dao.AppInfo; //导入依赖的package包/类
public AppInfo getApp(HttpServletRequest req, HttpServletResponse res,
String appId) {
UserGroupInformation callerUGI = getUser(req);
final ApplicationId id = parseApplicationId(appId);
ApplicationReport app = null;
try {
if (callerUGI == null) {
app = appContext.getApplication(id);
} else {
app = callerUGI.doAs(
new PrivilegedExceptionAction<ApplicationReport> () {
@Override
public ApplicationReport run() throws Exception {
return appContext.getApplication(id);
}
});
}
} catch (Exception e) {
rewrapAndThrowException(e);
}
if (app == null) {
throw new NotFoundException("app with id: " + appId + " not found");
}
return new AppInfo(app);
}
示例2: getApp
import org.apache.hadoop.yarn.server.webapp.dao.AppInfo; //导入依赖的package包/类
@GET
@Path("/apps/{appid}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Override
public AppInfo getApp(@Context HttpServletRequest req,
@Context HttpServletResponse res, @PathParam("appid") String appId) {
init(res);
return super.getApp(req, res, appId);
}
示例3: getApp
import org.apache.hadoop.yarn.server.webapp.dao.AppInfo; //导入依赖的package包/类
public AppInfo getApp(HttpServletRequest req, HttpServletResponse res,
String appId) {
ApplicationId id = parseApplicationId(appId);
ApplicationReport app = null;
try {
app = appContext.getApplication(id);
} catch (IOException e) {
throw new WebApplicationException(e);
}
if (app == null) {
throw new NotFoundException("app with id: " + appId + " not found");
}
return new AppInfo(app);
}