@Override public GetNodesToLabelsResponse getNodeToLabels( GetNodesToLabelsRequest request) throws YarnException, IOException { YarnServiceProtos.GetNodesToLabelsRequestProto requestProto = ((GetNodesToLabelsRequestPBImpl) request).getProto(); try { return new GetNodesToLabelsResponsePBImpl(proxy.getNodeToLabels( null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
@Override public GetLabelsToNodesResponse getLabelsToNodes( GetLabelsToNodesRequest request) throws YarnException, IOException { YarnServiceProtos.GetLabelsToNodesRequestProto requestProto = ((GetLabelsToNodesRequestPBImpl) request).getProto(); try { return new GetLabelsToNodesResponsePBImpl(proxy.getLabelsToNodes( null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
@Override public RunSharedCacheCleanerTaskResponse runCleanerTask( RunSharedCacheCleanerTaskRequest request) throws YarnException, IOException { YarnServiceProtos.RunSharedCacheCleanerTaskRequestProto requestProto = ((RunSharedCacheCleanerTaskRequestPBImpl) request).getProto(); try { return new RunSharedCacheCleanerTaskResponsePBImpl(proxy.runCleanerTask(null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
@Override public SignalContainerResponse signalContainer( SignalContainerRequest request) throws YarnException, IOException { YarnServiceProtos.SignalContainerRequestProto requestProto = ((SignalContainerRequestPBImpl) request).getProto(); try { return new SignalContainerResponsePBImpl( proxy.signalContainer(null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
private synchronized void initLocalUpdatedContainerList() { if (this.updatedContainers != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<YarnServiceProtos.UpdatedContainerProto> list = p.getUpdatedContainersList(); updatedContainers = new ArrayList<>(); for (YarnServiceProtos.UpdatedContainerProto c : list) { updatedContainers.add(convertFromProtoFormat(c)); } }
private synchronized void initLocalUpdateErrorsList() { if (updateErrors != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<YarnServiceProtos.UpdateContainerErrorProto> list = p.getUpdateErrorsList(); this.updateErrors = new ArrayList<UpdateContainerError>(); for (YarnServiceProtos.UpdateContainerErrorProto t : list) { updateErrors.add(ProtoUtils.convertFromProtoFormat(t)); } }
private synchronized Iterable<YarnServiceProtos.UpdateContainerErrorProto> getUpdateErrorsIterable( final List<UpdateContainerError> updateErrorsList) { maybeInitBuilder(); return new Iterable<YarnServiceProtos.UpdateContainerErrorProto>() { @Override public synchronized Iterator<YarnServiceProtos .UpdateContainerErrorProto> iterator() { return new Iterator<YarnServiceProtos.UpdateContainerErrorProto>() { private Iterator<UpdateContainerError> iter = updateErrorsList.iterator(); @Override public synchronized boolean hasNext() { return iter.hasNext(); } @Override public synchronized YarnServiceProtos.UpdateContainerErrorProto next() { return ProtoUtils.convertToProtoFormat(iter.next()); } @Override public synchronized void remove() { throw new UnsupportedOperationException(); } }; } }; }
private synchronized Iterable<YarnServiceProtos.UpdatedContainerProto> getUpdatedContainerProtoIterable( final List<UpdatedContainer> newUpdatedContainersList) { maybeInitBuilder(); return new Iterable<YarnServiceProtos.UpdatedContainerProto>() { @Override public synchronized Iterator<YarnServiceProtos.UpdatedContainerProto> iterator() { return new Iterator<YarnServiceProtos.UpdatedContainerProto>() { private Iterator<UpdatedContainer> iter = newUpdatedContainersList.iterator(); @Override public synchronized boolean hasNext() { return iter.hasNext(); } @Override public synchronized YarnServiceProtos.UpdatedContainerProto next() { return convertToProtoFormat(iter.next()); } @Override public synchronized void remove() { throw new UnsupportedOperationException(); } }; } }; }
@Override public ContainerUpdateType getUpdateType() { YarnServiceProtos.UpdatedContainerProtoOrBuilder p = viaProto ? proto : builder; if (!p.hasUpdateType()) { return null; } return ProtoUtils.convertFromProtoFormat(p.getUpdateType()); }
@Override public Container getContainer() { YarnServiceProtos.UpdatedContainerProtoOrBuilder p = viaProto ? proto : builder; if (this.container != null) { return this.container; } if (!p.hasContainer()) { return null; } this.container = ProtoUtils.convertFromProtoFormat(p.getContainer()); return this.container; }
@Override public int getContainerVersion() { YarnServiceProtos.UpdateContainerRequestProtoOrBuilder p = viaProto ? proto : builder; if (!p.hasContainerVersion()) { return 0; } return p.getContainerVersion(); }
@Override public ContainerId getContainerId() { YarnServiceProtos.UpdateContainerRequestProtoOrBuilder p = viaProto ? proto : builder; if (this.existingContainerId != null) { return this.existingContainerId; } if (p.hasContainerId()) { this.existingContainerId = ProtoUtils.convertFromProtoFormat(p.getContainerId()); } return this.existingContainerId; }
@Override public Resource getCapability() { YarnServiceProtos.UpdateContainerRequestProtoOrBuilder p = viaProto ? proto : builder; if (this.targetCapability != null) { return this.targetCapability; } if (p.hasCapability()) { this.targetCapability = ProtoUtils.convertFromProtoFormat(p.getCapability()); } return this.targetCapability; }
@Override public ContainerUpdateType getContainerUpdateType() { YarnServiceProtos.UpdateContainerRequestProtoOrBuilder p = viaProto ? proto : builder; if (!p.hasUpdateType()) { return null; } return ProtoUtils.convertFromProtoFormat(p.getUpdateType()); }
@Override public String getReason() { YarnServiceProtos.UpdateContainerErrorProtoOrBuilder p = viaProto ? proto : builder; if (this.reason != null) { return this.reason; } if (p.hasReason()) { this.reason = p.getReason(); } return this.reason; }
@Override public UpdateContainerRequest getUpdateContainerRequest() { YarnServiceProtos.UpdateContainerErrorProtoOrBuilder p = viaProto ? proto : builder; if (this.updateRequest != null) { return this.updateRequest; } if (p.hasUpdateRequest()) { this.updateRequest = ProtoUtils.convertFromProtoFormat(p.getUpdateRequest()); } return this.updateRequest; }
@Override public GetNewReservationResponse getNewReservation( GetNewReservationRequest request) throws YarnException, IOException { YarnServiceProtos.GetNewReservationRequestProto requestProto = ((GetNewReservationRequestPBImpl) request).getProto(); try { return new GetNewReservationResponsePBImpl(proxy.getNewReservation(null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
@Override public ReservationListResponse listReservations(ReservationListRequest request) throws YarnException, IOException { YarnServiceProtos.ReservationListRequestProto requestProto = ((ReservationListRequestPBImpl) request).getProto(); try { return new ReservationListResponsePBImpl(proxy.listReservations(null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
@Override public SignalContainerResponse signalToContainer( SignalContainerRequest request) throws YarnException, IOException { YarnServiceProtos.SignalContainerRequestProto requestProto = ((SignalContainerRequestPBImpl) request).getProto(); try { return new SignalContainerResponsePBImpl( proxy.signalToContainer(null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
public GetNodesToLabelsRequestPBImpl() { builder = YarnServiceProtos.GetNodesToLabelsRequestProto.newBuilder(); }
public GetNodesToLabelsRequestPBImpl( YarnServiceProtos.GetNodesToLabelsRequestProto proto) { this.proto = proto; viaProto = true; }
public YarnServiceProtos.GetNodesToLabelsRequestProto getProto() { proto = viaProto ? proto : builder.build(); viaProto = true; return proto; }
public static YarnServiceProtos.ApplicationsRequestScopeProto convertToProtoFormat(ApplicationsRequestScope e) { return YarnServiceProtos.ApplicationsRequestScopeProto.valueOf(e.name()); }
public static ApplicationsRequestScope convertFromProtoFormat (YarnServiceProtos.ApplicationsRequestScopeProto e) { return ApplicationsRequestScope.valueOf(e.name()); }