Java 类org.apache.hadoop.mapreduce.v2.api.protocolrecords.impl.pb.KillTaskAttemptRequestPBImpl 实例源码

项目:hadoop    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hadoop    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:aliyun-oss-hadoop-fs    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:aliyun-oss-hadoop-fs    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:big-c    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:big-c    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:hadoop-plus    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hadoop-plus    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:FlexMap    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:FlexMap    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:hops    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hops    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:hadoop-TCP    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hadoop-TCP    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:hardfs    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hardfs    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:hadoop-on-lustre2    文件:MRClientProtocolPBServiceImpl.java   
@Override
public KillTaskAttemptResponseProto killTaskAttempt(RpcController controller,
    KillTaskAttemptRequestProto proto) throws ServiceException {
  KillTaskAttemptRequest request = new KillTaskAttemptRequestPBImpl(proto);
  try {
    KillTaskAttemptResponse response = real.killTaskAttempt(request);
    return ((KillTaskAttemptResponsePBImpl)response).getProto();
  } catch (IOException e) {
    throw new ServiceException(e);
  }
}
项目:hadoop-on-lustre2    文件:MRClientProtocolPBClientImpl.java   
@Override
public KillTaskAttemptResponse killTaskAttempt(KillTaskAttemptRequest request)
    throws IOException {
  KillTaskAttemptRequestProto requestProto = ((KillTaskAttemptRequestPBImpl)request).getProto();
  try {
    return new KillTaskAttemptResponsePBImpl(proxy.killTaskAttempt(null, requestProto));
  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
项目:aliyun-oss-hadoop-fs    文件:AMWebServices.java   
protected Response killJobTaskAttempt(TaskAttempt ta,
    UserGroupInformation callerUGI, HttpServletRequest hsr)
        throws IOException, InterruptedException {
  Preconditions.checkNotNull(ta, "ta cannot be null");

  String userName = callerUGI.getUserName();
  final TaskAttemptId attemptId = ta.getID();
  try {
    callerUGI
        .doAs(new PrivilegedExceptionAction<KillTaskAttemptResponse>() {
          @Override
          public KillTaskAttemptResponse run()
              throws IOException, YarnException {
            KillTaskAttemptRequest req =  new KillTaskAttemptRequestPBImpl();
            req.setTaskAttemptId(attemptId);
            return service.forceKillTaskAttempt(req);
          }
        });
  } catch (UndeclaredThrowableException ue) {
    // if the root cause is a permissions issue
    // bubble that up to the user
    if (ue.getCause() instanceof YarnException) {
      YarnException ye = (YarnException) ue.getCause();
      if (ye.getCause() instanceof AccessControlException) {
        String taId = attemptId.toString();
        String msg =
            "Unauthorized attempt to kill task attempt " + taId
                + " by remote user " + userName;
        return Response.status(Status.FORBIDDEN).entity(msg).build();
      } else {
        throw ue;
      }
    } else {
      throw ue;
    }
  }

  JobTaskAttemptState ret = new JobTaskAttemptState();
  ret.setState(TaskAttemptState.KILLED.toString());

  return Response.status(Status.OK).entity(ret).build();
}
项目:hops    文件:AMWebServices.java   
protected Response killJobTaskAttempt(TaskAttempt ta,
    UserGroupInformation callerUGI, HttpServletRequest hsr)
        throws IOException, InterruptedException {
  Preconditions.checkNotNull(ta, "ta cannot be null");

  String userName = callerUGI.getUserName();
  final TaskAttemptId attemptId = ta.getID();
  try {
    callerUGI
        .doAs(new PrivilegedExceptionAction<KillTaskAttemptResponse>() {
          @Override
          public KillTaskAttemptResponse run()
              throws IOException, YarnException {
            KillTaskAttemptRequest req =  new KillTaskAttemptRequestPBImpl();
            req.setTaskAttemptId(attemptId);
            return service.forceKillTaskAttempt(req);
          }
        });
  } catch (UndeclaredThrowableException ue) {
    // if the root cause is a permissions issue
    // bubble that up to the user
    if (ue.getCause() instanceof YarnException) {
      YarnException ye = (YarnException) ue.getCause();
      if (ye.getCause() instanceof AccessControlException) {
        String taId = attemptId.toString();
        String msg =
            "Unauthorized attempt to kill task attempt " + taId
                + " by remote user " + userName;
        return Response.status(Status.FORBIDDEN).entity(msg).build();
      } else {
        throw ue;
      }
    } else {
      throw ue;
    }
  }

  JobTaskAttemptState ret = new JobTaskAttemptState();
  ret.setState(TaskAttemptState.KILLED.toString());

  return Response.status(Status.OK).entity(ret).build();
}