@Override public synchronized AMCommand getAMCommand() { AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; if (!p.hasAMCommand()) { return null; } return ProtoUtils.convertFromProtoFormat(p.getAMCommand()); }
@Override public synchronized Resource getAvailableResources() { if (this.limit != null) { return this.limit; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; if (!p.hasLimit()) { return null; } this.limit = convertFromProtoFormat(p.getLimit()); return this.limit; }
@Override public synchronized PreemptionMessage getPreemptionMessage() { AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; if (this.preempt != null) { return this.preempt; } if (!p.hasPreempt()) { return null; } this.preempt = convertFromProtoFormat(p.getPreempt()); return this.preempt; }
@Override public synchronized Token getAMRMToken() { AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; if (amrmToken != null) { return amrmToken; } if (!p.hasAmRmToken()) { return null; } this.amrmToken = convertFromProtoFormat(p.getAmRmToken()); return amrmToken; }
private synchronized void initLocalIncreasedContainerList() { if (this.increasedContainers != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<ContainerResourceIncreaseProto> list = p.getIncreasedContainersList(); increasedContainers = new ArrayList<ContainerResourceIncrease>(); for (ContainerResourceIncreaseProto c : list) { increasedContainers.add(convertFromProtoFormat(c)); } }
private synchronized void initLocalDecreasedContainerList() { if (this.decreasedContainers != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<ContainerResourceDecreaseProto> list = p.getDecreasedContainersList(); decreasedContainers = new ArrayList<ContainerResourceDecrease>(); for (ContainerResourceDecreaseProto c : list) { decreasedContainers.add(convertFromProtoFormat(c)); } }
private synchronized void initLocalNewNodeReportList() { if (this.updatedNodes != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<NodeReportProto> list = p.getUpdatedNodesList(); updatedNodes = new ArrayList<NodeReport>(list.size()); for (NodeReportProto n : list) { updatedNodes.add(convertFromProtoFormat(n)); } }
private synchronized void initLocalNewContainerList() { if (this.allocatedContainers != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<ContainerProto> list = p.getAllocatedContainersList(); allocatedContainers = new ArrayList<Container>(); for (ContainerProto c : list) { allocatedContainers.add(convertFromProtoFormat(c)); } }
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 synchronized void initLocalFinishedContainerList() { if (this.completedContainersStatuses != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<ContainerStatusProto> list = p.getCompletedContainerStatusesList(); completedContainersStatuses = new ArrayList<ContainerStatus>(); for (ContainerStatusProto c : list) { completedContainersStatuses.add(convertFromProtoFormat(c)); } }
@Override public synchronized Priority getApplicationPriority() { AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; if (this.appPriority != null) { return this.appPriority; } if (!p.hasApplicationPriority()) { return null; } this.appPriority = convertFromProtoFormat(p.getApplicationPriority()); return this.appPriority; }
private synchronized void initLocalIncreasedContainerList() { if (this.increasedContainers != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<ContainerProto> list = p.getIncreasedContainersList(); increasedContainers = new ArrayList<>(); for (ContainerProto c : list) { increasedContainers.add(convertFromProtoFormat(c)); } }
private synchronized void initLocalDecreasedContainerList() { if (this.decreasedContainers != null) { return; } AllocateResponseProtoOrBuilder p = viaProto ? proto : builder; List<ContainerProto> list = p.getDecreasedContainersList(); decreasedContainers = new ArrayList<>(); for (ContainerProto c : list) { decreasedContainers.add(convertFromProtoFormat(c)); } }