private void mergeLocalToBuilder() { if (this.ask != null) { addAsksToProto(); } if (this.release != null) { addReleasesToProto(); } if (this.increaseRequests != null) { addIncreaseRequestsToProto(); } if (this.blacklistRequest != null) { builder.setBlacklistRequest(convertToProtoFormat(this.blacklistRequest)); } }
private void initUpdateRequests() { if (this.updateRequests != null) { return; } AllocateRequestProtoOrBuilder p = viaProto ? proto : builder; List<UpdateContainerRequestProto> list = p.getUpdateRequestsList(); this.updateRequests = new ArrayList<>(); for (UpdateContainerRequestProto c : list) { this.updateRequests.add(convertFromProtoFormat(c)); } }
private void mergeLocalToProto() { if (viaProto) maybeInitBuilder(); mergeLocalToBuilder(); proto = builder.build(); viaProto = true; }
private void mergeLocalToBuilder() { if (this.ask != null) { addAsksToProto(); } if (this.release != null) { addReleasesToProto(); } if (this.updateRequests != null) { addUpdateRequestsToProto(); } if (this.schedulingRequests != null) { addSchedulingRequestsToProto(); } if (this.blacklistRequest != null) { builder.setBlacklistRequest(convertToProtoFormat(this.blacklistRequest)); } if (this.trackingUrl != null) { builder.setTrackingUrl(this.trackingUrl); } }
AllocateRequestPBImpl allocateRequest = new AllocateRequestPBImpl(); List<ContainerId> release = new ArrayList<ContainerId>(); List<ResourceRequest> ask = new ArrayList<ResourceRequest>(); allocateRequest.setReleaseList(release); allocateRequest.setAskList(ask); allocateRequest.setProgress(Float.POSITIVE_INFINITY); am1.allocate(allocateRequest); while(attempt1.getProgress()!=1){ allocateRequest.setProgress(Float.NaN); am1.allocate(allocateRequest); while(attempt1.getProgress()!=0){ allocateRequest.setProgress((float)9); am1.allocate(allocateRequest); while(attempt1.getProgress()!=1){ allocateRequest.setProgress(Float.NEGATIVE_INFINITY); am1.allocate(allocateRequest); while(attempt1.getProgress()!=0){ allocateRequest.setProgress((float)0.5); am1.allocate(allocateRequest); while(attempt1.getProgress()!=0.5){ allocateRequest.setProgress((float)-1); am1.allocate(allocateRequest); while(attempt1.getProgress()!=0){
@Test public void testAllcoateRequestWithoutIncrease() { AllocateRequest r = AllocateRequest.newInstance(123, 0f, null, null, null, null); // serde AllocateRequestProto p = ((AllocateRequestPBImpl) r).getProto(); r = new AllocateRequestPBImpl(p); // check value Assert.assertEquals(123, r.getResponseId()); Assert.assertEquals(0, r.getIncreaseRequests().size()); } }
am1.registerAppAttempt(); AllocateRequestPBImpl allocateRequest = new AllocateRequestPBImpl(); List<ContainerId> release = new ArrayList<ContainerId>(); List<ResourceRequest> ask = new ArrayList<ResourceRequest>(); allocateRequest.setReleaseList(release); allocateRequest.setAskList(ask);
@Override public void setResponseId(int id) { maybeInitBuilder(); builder.setResponseId(id); }
@Override public AllocateResponseProto allocate(RpcController arg0, AllocateRequestProto proto) throws ServiceException { AllocateRequestPBImpl request = new AllocateRequestPBImpl(proto); try { AllocateResponse response = real.allocate(request); return ((AllocateResponsePBImpl)response).getProto(); } catch (YarnException e) { throw new ServiceException(e); } catch (IOException e) { throw new ServiceException(e); } }
app1.getApplicationId()).getOriginalTrackingUrl()); AllocateRequestPBImpl allocateRequest = new AllocateRequestPBImpl(); String newTrackingUrl = "hadoop.apache.org"; allocateRequest.setTrackingUrl(newTrackingUrl);
@Override public List<ResourceRequest> getAskList() { initAsks(); return this.ask; }
@Override public List<ContainerId> getReleaseList() { initReleases(); return this.release; } @Override
AllocateRequestPBImpl allocateRequest = new AllocateRequestPBImpl(); List<ContainerId> release = new ArrayList<ContainerId>(); List<ResourceRequest> ask = new ArrayList<ResourceRequest>(); allocateRequest.setReleaseList(release); allocateRequest.setAskList(ask); allocateRequest.setProgress(Float.POSITIVE_INFINITY); am1.allocate(allocateRequest); while(attempt1.getProgress()!=1){ allocateRequest.setProgress(Float.NaN); am1.allocate(allocateRequest); while(attempt1.getProgress()!=0){ allocateRequest.setProgress((float)9); am1.allocate(allocateRequest); while(attempt1.getProgress()!=1){ allocateRequest.setProgress(Float.NEGATIVE_INFINITY); am1.allocate(allocateRequest); while(attempt1.getProgress()!=0){ allocateRequest.setProgress((float)0.5); am1.allocate(allocateRequest); while(attempt1.getProgress()!=0.5){ allocateRequest.setProgress((float)-1); am1.allocate(allocateRequest); while(attempt1.getProgress()!=0){
@Test public void testAllcoateRequestWithIncrease() { List<ContainerResourceIncreaseRequest> incRequests = new ArrayList<ContainerResourceIncreaseRequest>(); for (int i = 0; i < 3; i++) { incRequests.add(ContainerResourceIncreaseRequest.newInstance(null, Resource.newInstance(0, i))); } AllocateRequest r = AllocateRequest.newInstance(123, 0f, null, null, null, incRequests); // serde AllocateRequestProto p = ((AllocateRequestPBImpl) r).getProto(); r = new AllocateRequestPBImpl(p); // check value Assert.assertEquals(123, r.getResponseId()); Assert.assertEquals(incRequests.size(), r.getIncreaseRequests().size()); for (int i = 0; i < incRequests.size(); i++) { Assert.assertEquals(r.getIncreaseRequests().get(i).getCapability() .getVirtualCores(), incRequests.get(i).getCapability() .getVirtualCores()); } }
am1.registerAppAttempt(); AllocateRequestPBImpl allocateRequest = new AllocateRequestPBImpl(); List<ContainerId> release = new ArrayList<ContainerId>(); List<ResourceRequest> ask = new ArrayList<ResourceRequest>(); allocateRequest.setReleaseList(release); allocateRequest.setAskList(ask);
@Override public void setResourceBlacklistRequest(ResourceBlacklistRequest blacklistRequest) { maybeInitBuilder(); if (blacklistRequest == null) { builder.clearBlacklistRequest(); } this.blacklistRequest = blacklistRequest; }
private void mergeLocalToProto() { if (viaProto) maybeInitBuilder(); mergeLocalToBuilder(); proto = builder.build(); viaProto = true; }
@Override public AllocateResponseProto allocate(RpcController arg0, AllocateRequestProto proto) throws ServiceException { AllocateRequestPBImpl request = new AllocateRequestPBImpl(proto); try { AllocateResponse response = real.allocate(request); return ((AllocateResponsePBImpl)response).getProto(); } catch (YarnException e) { throw new ServiceException(e); } catch (IOException e) { throw new ServiceException(e); } }
am1.registerAppAttempt(); AllocateRequestPBImpl allocateRequest = new AllocateRequestPBImpl(); String newTrackingUrl = "hadoop.apache.org"; allocateRequest.setTrackingUrl(newTrackingUrl);