本文整理汇总了Java中org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest类的典型用法代码示例。如果您正苦于以下问题:Java GetNewApplicationRequest类的具体用法?Java GetNewApplicationRequest怎么用?Java GetNewApplicationRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GetNewApplicationRequest类属于org.apache.hadoop.yarn.api.protocolrecords包,在下文中一共展示了GetNewApplicationRequest类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createNewApplication
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
/**
* Function that actually creates the ApplicationId by calling the
* ClientRMService
*
* @return returns structure containing the app-id and maximum resource
* capabilities
*/
private NewApplication createNewApplication() {
GetNewApplicationRequest req =
recordFactory.newRecordInstance(GetNewApplicationRequest.class);
GetNewApplicationResponse resp;
try {
resp = rm.getClientRMService().getNewApplication(req);
} catch (YarnException e) {
String msg = "Unable to create new app from RM web service";
LOG.error(msg, e);
throw new YarnRuntimeException(msg, e);
}
NewApplication appId =
new NewApplication(resp.getApplicationId().toString(),
new ResourceInfo(resp.getMaximumResourceCapability()));
return appId;
}
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:RMWebServices.java
示例2: Application
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
public Application(String user, String queue, ResourceManager resourceManager)
throws YarnException {
this.user = user;
this.queue = queue;
this.resourceManager = resourceManager;
// register an application
GetNewApplicationRequest request =
Records.newRecord(GetNewApplicationRequest.class);
GetNewApplicationResponse newApp =
this.resourceManager.getClientRMService().getNewApplication(request);
this.applicationId = newApp.getApplicationId();
this.applicationAttemptId =
ApplicationAttemptId.newInstance(this.applicationId,
this.numAttempts.getAndIncrement());
}
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:Application.java
示例3: testRpcCallWithNonValidCert
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
@Test
public void testRpcCallWithNonValidCert() throws Exception {
conf.set(HopsSSLSocketFactory.CryptoKeys.KEY_STORE_FILEPATH_KEY.getValue(), err_clientKeyStore.toString());
conf.set(HopsSSLSocketFactory.CryptoKeys.KEY_STORE_PASSWORD_KEY.getValue(), passwd);
conf.set(HopsSSLSocketFactory.CryptoKeys.KEY_PASSWORD_KEY.getValue(), passwd);
conf.set(HopsSSLSocketFactory.CryptoKeys.TRUST_STORE_FILEPATH_KEY.getValue(), err_clientTrustStore.toString());
conf.set(HopsSSLSocketFactory.CryptoKeys.TRUST_STORE_PASSWORD_KEY.getValue(), passwd);
// Exception will be thrown later. JUnit does not execute the code
// after the exception, so make the call in a separate thread
invoker = new Thread(new Invoker(acClient));
invoker.start();
LOG.debug("Creating the second client");
acClient1 = ClientRMProxy.createRMProxy(conf, ApplicationClientProtocol.class,
true);
GetNewApplicationRequest req1 = GetNewApplicationRequest.newInstance();
if (error_mode.equals(CERT_ERR.NO_CA)) {
rule.expect(SSLException.class);
} else if (error_mode.equals(CERT_ERR.ERR_CN)) {
rule.expect(RpcServerException.class);
}
GetNewApplicationResponse res1 = acClient1.getNewApplication(req1);
}
开发者ID:hopshadoop,项目名称:hops,代码行数:26,代码来源:TestYarnSSLServer.java
示例4: getNewApplication
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
@Override
public GetNewApplicationResponse getNewApplication(
GetNewApplicationRequest request) throws YarnException,
IOException {
GetNewApplicationRequestProto requestProto =
((GetNewApplicationRequestPBImpl) request).getProto();
try {
return new GetNewApplicationResponsePBImpl(proxy.getNewApplication(null,
requestProto));
} catch (ServiceException e) {
RPCUtil.unwrapAndThrowException(e);
return null;
}
}
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:ApplicationClientProtocolPBClientImpl.java
示例5: getNewApplication
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
@Override
public GetNewApplicationResponse getNewApplication(
GetNewApplicationRequest request) throws YarnException {
GetNewApplicationResponse response = recordFactory
.newRecordInstance(GetNewApplicationResponse.class);
response.setApplicationId(getNewApplicationId());
// Pick up min/max resource from scheduler...
response.setMaximumResourceCapability(scheduler
.getMaximumResourceCapability());
return response;
}
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:ClientRMService.java
示例6: submitAppAndGetAppId
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
private ApplicationId submitAppAndGetAppId(String submitter,
String queueName, boolean setupACLs) throws Exception {
GetNewApplicationRequest newAppRequest =
GetNewApplicationRequest.newInstance();
ApplicationClientProtocol submitterClient = getRMClientForUser(submitter);
ApplicationId applicationId =
submitterClient.getNewApplication(newAppRequest).getApplicationId();
Resource resource = BuilderUtils.newResource(1024, 1);
Map<ApplicationAccessType, String> acls = createACLs(submitter, setupACLs);
ContainerLaunchContext amContainerSpec =
ContainerLaunchContext.newInstance(null, null, null, null, null, acls);
ApplicationSubmissionContext appSubmissionContext =
ApplicationSubmissionContext.newInstance(applicationId,
"applicationName", queueName, null, amContainerSpec, false, true, 1,
resource, "applicationType");
appSubmissionContext.setApplicationId(applicationId);
appSubmissionContext.setQueue(queueName);
SubmitApplicationRequest submitRequest =
SubmitApplicationRequest.newInstance(appSubmissionContext);
submitterClient.submitApplication(submitRequest);
resourceManager.waitForState(applicationId, RMAppState.ACCEPTED);
return applicationId;
}
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:QueueACLsTestBase.java
示例7: submitAppAndGetAppId
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private ApplicationId submitAppAndGetAppId(AccessControlList viewACL,
AccessControlList modifyACL) throws Exception {
SubmitApplicationRequest submitRequest = recordFactory
.newRecordInstance(SubmitApplicationRequest.class);
ApplicationSubmissionContext context = recordFactory
.newRecordInstance(ApplicationSubmissionContext.class);
ApplicationId applicationId = rmClient.getNewApplication(
recordFactory.newRecordInstance(GetNewApplicationRequest.class))
.getApplicationId();
context.setApplicationId(applicationId);
Map<ApplicationAccessType, String> acls
= new HashMap<ApplicationAccessType, String>();
acls.put(ApplicationAccessType.VIEW_APP, viewACL.getAclString());
acls.put(ApplicationAccessType.MODIFY_APP, modifyACL.getAclString());
ContainerLaunchContext amContainer = recordFactory
.newRecordInstance(ContainerLaunchContext.class);
Resource resource = BuilderUtils.newResource(1024, 1);
context.setResource(resource);
amContainer.setApplicationACLs(acls);
context.setAMContainerSpec(amContainer);
submitRequest.setApplicationSubmissionContext(context);
rmClient.submitApplication(submitRequest);
resourceManager.waitForState(applicationId, RMAppState.ACCEPTED);
return applicationId;
}
开发者ID:naver,项目名称:hadoop,代码行数:30,代码来源:TestApplicationACLs.java
示例8: getNewApplication
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
@Override
public GetNewApplicationResponse getNewApplication(
GetNewApplicationRequest request) throws YarnException {
resetStartFailoverFlag(true);
// make sure failover has been triggered
Assert.assertTrue(waittingForFailOver());
// create the GetNewApplicationResponse with fake applicationId
GetNewApplicationResponse response =
GetNewApplicationResponse.newInstance(
createFakeAppId(), null, null);
return response;
}
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:ProtocolHATestBase.java
示例9: getNewApplication
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
@Override
public GetNewApplicationResponse getNewApplication(
GetNewApplicationRequest request) throws YarnException, IOException {
NewApplicationResponse newApplication = appClient.getNewApplication();
return GetNewApplicationResponse.newInstance(
newApplication.getApplicationId(), newApplication.getMinCapability(),
newApplication.getMaxCapability());
}
开发者ID:intel-hpdd,项目名称:scheduling-connector-for-hadoop,代码行数:9,代码来源:HPCApplicationClientProtocolImpl.java
示例10: submitAppAndGetAppId
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; //导入依赖的package包/类
private ApplicationId submitAppAndGetAppId(AccessControlList viewACL,
AccessControlList modifyACL) throws Exception {
SubmitApplicationRequest submitRequest = recordFactory
.newRecordInstance(SubmitApplicationRequest.class);
ApplicationSubmissionContext context = recordFactory
.newRecordInstance(ApplicationSubmissionContext.class);
ApplicationId applicationId = rmClient.getNewApplication(
recordFactory.newRecordInstance(GetNewApplicationRequest.class))
.getApplicationId();
context.setApplicationId(applicationId);
Map<ApplicationAccessType, String> acls
= new HashMap<ApplicationAccessType, String>();
acls.put(ApplicationAccessType.VIEW_APP, viewACL.getAclString());
acls.put(ApplicationAccessType.MODIFY_APP, modifyACL.getAclString());
ContainerLaunchContext amContainer = recordFactory
.newRecordInstance(ContainerLaunchContext.class);
Resource resource = BuilderUtils.newResource(1024, 1);
context.setResource(resource);
amContainer.setApplicationACLs(acls);
context.setAMContainerSpec(amContainer);
submitRequest.setApplicationSubmissionContext(context);
rmClient.submitApplication(submitRequest);
resourceManager.waitForState(applicationId, RMAppState.ACCEPTED);
return applicationId;
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:29,代码来源:TestApplicationACLs.java
注:本文中的org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论