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 Iterable<ContainerResourceIncreaseProto> getIncreaseProtoIterable( final List<ContainerResourceIncrease> newContainersList) { maybeInitBuilder(); return new Iterable<ContainerResourceIncreaseProto>() { @Override public synchronized Iterator<ContainerResourceIncreaseProto> iterator() { return new Iterator<ContainerResourceIncreaseProto>() { Iterator<ContainerResourceIncrease> iter = newContainersList .iterator(); @Override public synchronized boolean hasNext() { return iter.hasNext(); } @Override public synchronized ContainerResourceIncreaseProto next() { return convertToProtoFormat(iter.next()); } @Override public synchronized void remove() { throw new UnsupportedOperationException(); } }; } }; }
private synchronized ContainerResourceIncrease convertFromProtoFormat( ContainerResourceIncreaseProto p) { return new ContainerResourceIncreasePBImpl(p); }
private synchronized ContainerResourceIncreaseProto convertToProtoFormat( ContainerResourceIncrease t) { return ((ContainerResourceIncreasePBImpl) t).getProto(); }
public ContainerResourceIncreasePBImpl() { builder = ContainerResourceIncreaseProto.newBuilder(); }
public ContainerResourceIncreasePBImpl(ContainerResourceIncreaseProto proto) { this.proto = proto; viaProto = true; }
public ContainerResourceIncreaseProto getProto() { mergeLocalToProto(); proto = viaProto ? proto : builder.build(); viaProto = true; return proto; }
private void maybeInitBuilder() { if (viaProto || builder == null) { builder = ContainerResourceIncreaseProto.newBuilder(proto); } viaProto = false; }