.setIdentifier(container.getId().toString()) .setNodeId(container.getNodeId().toString()) .setResourceMemory(container.getResource().getMemory()) .setVirtualCores(container.getResource().getVirtualCores()) .build());
/** * Checks the allocation queue for new allocations and if there are any * satisfies them. */ private void checkRequestQueue() { if (this.theContainers.hasContainerAvailable() && this.requestQueue.hasOutStandingRequests()) { // Record the satisfaction of one request and get its details. final DriverRuntimeProtocol.ResourceRequestProto requestProto = this.requestQueue.satisfyOne(); // Allocate a Container final Container container = this.theContainers.allocateOne( requestProto.hasMemorySize() ? requestProto.getMemorySize() : this.defaultMemorySize, requestProto.hasVirtualCores() ? requestProto.getVirtualCores() : this.defaultNumberOfCores); // Tell the receivers about it final DriverRuntimeProtocol.ResourceAllocationProto alloc = DriverRuntimeProtocol.ResourceAllocationProto.newBuilder() .setIdentifier(container.getContainerID()) .setNodeId(container.getNodeID()) .setResourceMemory(container.getMemory()) .setVirtualCores(container.getNumberOfCores()) .build(); LOG.log(Level.FINEST, "Allocating container: {0}", container); this.allocationHandler.onNext(alloc); // update REEF this.sendRuntimeStatus(); // Check whether we can satisfy another one. this.checkRequestQueue(); } else { this.sendRuntimeStatus(); } }
public Builder mergeFrom(com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto other) { if (other == com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto.getDefaultInstance()) return this; if (other.hasIdentifier()) { bitField0_ |= 0x00000001; identifier_ = other.identifier_; onChanged(); } if (other.hasResourceMemory()) { setResourceMemory(other.getResourceMemory()); } if (other.hasNodeId()) { bitField0_ |= 0x00000004; nodeId_ = other.nodeId_; onChanged(); } if (other.hasVirtualCores()) { setVirtualCores(other.getVirtualCores()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder clone() { return create().mergeFrom(buildPartial()); }
public com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto build() { com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public final boolean isInitialized() { if (!hasIdentifier()) { return false; } if (!hasResourceMemory()) { return false; } if (!hasNodeId()) { return false; } return true; }
private static Builder create() { return new Builder(); }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**