本文整理汇总了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;
}
示例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());
}
示例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);
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}