use of org.apache.tez.dag.api.records.DAGProtos.DAGPlan in project tez by apache.
the class DAGClientAMProtocolBlockingPBServerImpl method submitDAG.
@Override
public SubmitDAGResponseProto submitDAG(RpcController controller, SubmitDAGRequestProto request) throws ServiceException {
UserGroupInformation user = getRPCUser();
if (!real.getACLManager().checkAMModifyAccess(user)) {
throw new AccessControlException("User " + user + " cannot perform AM modify operation");
}
real.updateLastHeartbeatTime();
try {
if (request.hasSerializedRequestPath()) {
// need to deserialize large request from hdfs
Path requestPath = new Path(request.getSerializedRequestPath());
try (FSDataInputStream fsDataInputStream = stagingFs.open(requestPath)) {
CodedInputStream in = CodedInputStream.newInstance(fsDataInputStream);
in.setSizeLimit(Integer.MAX_VALUE);
request = SubmitDAGRequestProto.parseFrom(in);
} catch (IOException e) {
throw wrapException(e);
}
}
DAGPlan dagPlan = request.getDAGPlan();
Map<String, LocalResource> additionalResources = null;
if (request.hasAdditionalAmResources()) {
additionalResources = DagTypeConverters.convertFromPlanLocalResources(request.getAdditionalAmResources());
}
String dagId = real.submitDAG(dagPlan, additionalResources);
return SubmitDAGResponseProto.newBuilder().setDagId(dagId).build();
} catch (TezException e) {
throw wrapException(e);
}
}
Aggregations