private void mergeLocalToBuilder() { if (this.maximumResourceCapability != null) { builder.setMaximumCapability( convertToProtoFormat(this.maximumResourceCapability)); } if (this.applicationACLS != null) { addApplicationACLs(); } if (this.containersFromPreviousAttempts != null) { addContainersFromPreviousAttemptToProto(); } if (nmTokens != null) { builder.clearNmTokensFromPreviousAttempts(); Iterable<NMTokenProto> iterable = getTokenProtoIterable(nmTokens); builder.addAllNmTokensFromPreviousAttempts(iterable); } if(schedulerResourceTypes != null) { addSchedulerResourceTypes(); } }
private void mergeLocalToBuilder() { if (this.maximumResourceCapability != null) { builder.setMaximumCapability( convertToProtoFormat(this.maximumResourceCapability)); } if (this.applicationACLS != null) { addApplicationACLs(); } if (this.containersFromPreviousAttempts != null) { addContainersFromPreviousAttemptToProto(); } if (nmTokens != null) { builder.clearNmTokensFromPreviousAttempts(); Iterable<NMTokenProto> iterable = getTokenProtoIterable(nmTokens); builder.addAllNmTokensFromPreviousAttempts(iterable); } }
private synchronized void initLocalNewNMTokenList() { RegisterApplicationMasterResponseProtoOrBuilder p = viaProto ? proto : builder; List<NMTokenProto> list = p.getNmTokensFromPreviousAttemptsList(); nmTokens = new ArrayList<NMToken>(); for (NMTokenProto t : list) { nmTokens.add(convertFromProtoFormat(t)); } }
private synchronized Iterable<NMTokenProto> getTokenProtoIterable( final List<NMToken> nmTokenList) { maybeInitBuilder(); return new Iterable<NMTokenProto>() { @Override public synchronized Iterator<NMTokenProto> iterator() { return new Iterator<NMTokenProto>() { Iterator<NMToken> iter = nmTokenList.iterator(); @Override public boolean hasNext() { return iter.hasNext(); } @Override public NMTokenProto next() { return convertToProtoFormat(iter.next()); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; }
private synchronized void initLocalNewNMTokenList() { if (nmTokens != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<NMTokenProto> list = p.getNmTokensList(); nmTokens = new ArrayList<NMToken>(); for (NMTokenProto t : list) { nmTokens.add(convertFromProtoFormat(t)); } }
private NMTokenProto convertToProtoFormat(NMToken token) { return ((NMTokenPBImpl) token).getProto(); }
private NMToken convertFromProtoFormat(NMTokenProto proto) { return new NMTokenPBImpl(proto); }
private synchronized NMTokenProto convertToProtoFormat(NMToken token) { return ((NMTokenPBImpl)token).getProto(); }
private synchronized NMToken convertFromProtoFormat(NMTokenProto proto) { return new NMTokenPBImpl(proto); }