@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; }
/** * 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); }
result = result && (getVirtualCores() == other.getVirtualCores());
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; }