this.reefEventHandlers.onResourceAllocation(ResourceAllocationProto.newBuilder() .setIdentifier(container.getId().toString()) .setNodeId(container.getNodeId().toString())
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasIdentifier()) { hash = (37 * hash) + IDENTIFIER_FIELD_NUMBER; hash = (53 * hash) + getIdentifier().hashCode(); } if (hasResourceMemory()) { hash = (37 * hash) + RESOURCE_MEMORY_FIELD_NUMBER; hash = (53 * hash) + getResourceMemory(); } if (hasNodeId()) { hash = (37 * hash) + NODE_ID_FIELD_NUMBER; hash = (53 * hash) + getNodeId().hashCode(); } if (hasVirtualCores()) { hash = (37 * hash) + VIRTUAL_CORES_FIELD_NUMBER; hash = (53 * hash) + getVirtualCores(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getIdentifierBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, resourceMemory_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, getNodeIdBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(4, virtualCores_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
result = result && (hasIdentifier() == other.hasIdentifier()); if (hasIdentifier()) { result = result && getIdentifier() .equals(other.getIdentifier()); result = result && (hasResourceMemory() == other.hasResourceMemory()); if (hasResourceMemory()) { result = result && (getResourceMemory() == other.getResourceMemory()); result = result && (hasNodeId() == other.hasNodeId()); if (hasNodeId()) { result = result && getNodeId() .equals(other.getNodeId()); result = result && (hasVirtualCores() == other.hasVirtualCores()); if (hasVirtualCores()) { result = result && (getVirtualCores() == other.getVirtualCores()); getUnknownFields().equals(other.getUnknownFields()); return result;
/** * 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 com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto buildPartial() { com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto result = new com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.identifier_ = identifier_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.resourceMemory_ = resourceMemory_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.nodeId_ = nodeId_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.virtualCores_ = virtualCores_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
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 void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getIdentifierBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt32(2, resourceMemory_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getNodeIdBytes()); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt32(4, virtualCores_); } getUnknownFields().writeTo(output); }
public Builder toBuilder() { return newBuilder(this); }
/** * Instantiates a new EvaluatorManager based on a resource allocation. * * @param resourceAllocationProto * @return */ public final EvaluatorManager getNewEvaluatorManager(final DriverRuntimeProtocol.ResourceAllocationProto resourceAllocationProto) { final NodeDescriptor nodeDescriptor = this.resourceCatalog.getNode(resourceAllocationProto.getNodeId()); if (nodeDescriptor == null) { throw new RuntimeException("Unknown resource: " + resourceAllocationProto.getNodeId()); } final EvaluatorDescriptorImpl evaluatorDescriptor = new EvaluatorDescriptorImpl(nodeDescriptor, EvaluatorType.UNDECIDED, resourceAllocationProto.getResourceMemory(), resourceAllocationProto.getVirtualCores()); LOG.log(Level.FINEST, "Resource allocation: new evaluator id[{0}]", resourceAllocationProto.getIdentifier()); return this.getNewEvaluatorManagerInstance(resourceAllocationProto.getIdentifier(), evaluatorDescriptor); }
public com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto getDefaultInstanceForType() { return com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto.getDefaultInstance(); }
/** * <code>required string identifier = 1;</code> * * <pre> * e.g., the container id, or the thread id * </pre> */ public Builder clearIdentifier() { bitField0_ = (bitField0_ & ~0x00000001); identifier_ = getDefaultInstance().getIdentifier(); onChanged(); return this; } /**
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto prototype) {
public static Builder newBuilder(com.microsoft.reef.proto.DriverRuntimeProtocol.ResourceAllocationProto prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
/** * <code>required string node_id = 3;</code> */ public Builder clearNodeId() { bitField0_ = (bitField0_ & ~0x00000004); nodeId_ = getDefaultInstance().getNodeId(); onChanged(); return this; } /**