private void mergeLocalToBuilder() { if (this.containersToUpdate != null) { addUpdateContainersToProto(); } }
@Override public List<Token> getContainersToUpdate() { if (containersToUpdate != null) { return containersToUpdate; } ContainerUpdateRequestProtoOrBuilder p = viaProto ? proto : builder; List<TokenProto> list = p.getUpdateContainerTokenList(); containersToUpdate = new ArrayList<>(); for (TokenProto c : list) { containersToUpdate.add(convertFromProtoFormat(c)); } return containersToUpdate; }
private void mergeLocalToProto() { if (viaProto) { maybeInitBuilder(); } mergeLocalToBuilder(); proto = builder.build(); viaProto = true; }
@Override public void setContainersToUpdate(List<Token> containersToUpdate) { maybeInitBuilder(); if (containersToUpdate == null) { builder.clearUpdateContainerToken(); } this.containersToUpdate = containersToUpdate; }
public ContainerUpdateRequestProto getProto() { mergeLocalToProto(); proto = viaProto ? proto : builder.build(); viaProto = true; return proto; }
@Override public ContainerUpdateResponseProto updateContainer( RpcController controller, ContainerUpdateRequestProto proto) throws ServiceException { ContainerUpdateRequestPBImpl request = new ContainerUpdateRequestPBImpl(proto); try { ContainerUpdateResponse response = real.updateContainer(request); return ((ContainerUpdateResponsePBImpl)response).getProto(); } catch (YarnException e) { throw new ServiceException(e); } catch (IOException e) { throw new ServiceException(e); } }
private void addUpdateContainersToProto() { maybeInitBuilder(); builder.clearUpdateContainerToken(); if (this.containersToUpdate == null) {
@Override public String toString() { return TextFormat.shortDebugString(getProto()); }
@Override public int hashCode() { return getProto().hashCode(); }
@Override public ContainerUpdateResponse updateContainer(ContainerUpdateRequest request) throws YarnException, IOException { ContainerUpdateRequestProto requestProto = ((ContainerUpdateRequestPBImpl)request).getProto(); try { return new ContainerUpdateResponsePBImpl( proxy.updateContainer(null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
@Override @Deprecated public IncreaseContainersResourceResponse increaseContainersResource( IncreaseContainersResourceRequest request) throws YarnException, IOException { try { ContainerUpdateRequest req = ContainerUpdateRequest.newInstance(request.getContainersToIncrease()); ContainerUpdateRequestProto reqProto = ((ContainerUpdateRequestPBImpl) req).getProto(); ContainerUpdateResponse resp = new ContainerUpdateResponsePBImpl( proxy.updateContainer(null, reqProto)); return IncreaseContainersResourceResponse .newInstance(resp.getSuccessfullyUpdatedContainers(), resp.getFailedRequests()); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }