hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasIdentifier()) { hash = (37 * hash) + IDENTIFIER_FIELD_NUMBER; hash = (53 * hash) + getIdentifier().hashCode(); if (hasHostName()) { hash = (37 * hash) + HOST_NAME_FIELD_NUMBER; hash = (53 * hash) + getHostName().hashCode(); if (hasPort()) { hash = (37 * hash) + PORT_FIELD_NUMBER; hash = (53 * hash) + getPort(); if (hasMemorySize()) { hash = (37 * hash) + MEMORY_SIZE_FIELD_NUMBER; hash = (53 * hash) + getMemorySize(); if (hasRackName()) { hash = (37 * hash) + RACK_NAME_FIELD_NUMBER; hash = (53 * hash) + getRackName().hashCode(); 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 .computeBytesSize(2, getHostNameBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, port_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(4, memorySize_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(5, getRackNameBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
result = result && (hasIdentifier() == other.hasIdentifier()); if (hasIdentifier()) { result = result && getIdentifier() .equals(other.getIdentifier()); result = result && (hasHostName() == other.hasHostName()); if (hasHostName()) { result = result && getHostName() .equals(other.getHostName()); result = result && (hasPort() == other.hasPort()); if (hasPort()) { result = result && (getPort() == other.getPort()); result = result && (hasMemorySize() == other.hasMemorySize()); if (hasMemorySize()) { result = result && (getMemorySize() == other.getMemorySize()); result = result && (hasRackName() == other.hasRackName()); if (hasRackName()) { result = result && getRackName() .equals(other.getRackName()); getUnknownFields().equals(other.getUnknownFields()); return result;
public com.microsoft.reef.proto.DriverRuntimeProtocol.NodeDescriptorProto buildPartial() { com.microsoft.reef.proto.DriverRuntimeProtocol.NodeDescriptorProto result = new com.microsoft.reef.proto.DriverRuntimeProtocol.NodeDescriptorProto(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.hostName_ = hostName_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.port_ = port_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.memorySize_ = memorySize_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.rackName_ = rackName_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder mergeFrom(com.microsoft.reef.proto.DriverRuntimeProtocol.NodeDescriptorProto other) { if (other == com.microsoft.reef.proto.DriverRuntimeProtocol.NodeDescriptorProto.getDefaultInstance()) return this; if (other.hasIdentifier()) { bitField0_ |= 0x00000001; identifier_ = other.identifier_; onChanged(); } if (other.hasHostName()) { bitField0_ |= 0x00000002; hostName_ = other.hostName_; onChanged(); } if (other.hasPort()) { setPort(other.getPort()); } if (other.hasMemorySize()) { setMemorySize(other.getMemorySize()); } if (other.hasRackName()) { bitField0_ |= 0x00000010; rackName_ = other.rackName_; onChanged(); } 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.writeBytes(2, getHostNameBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt32(3, port_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt32(4, memorySize_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeBytes(5, getRackNameBytes()); } getUnknownFields().writeTo(output); }
public Builder toBuilder() { return newBuilder(this); }
public synchronized final void handle(final NodeDescriptorProto node) { final String rack_name = (node.hasRackName() ? node.getRackName() : DEFAULT_RACK); LOG.log(Level.FINEST, "Catalog new node: id[{0}], rack[{1}], host[{2}], port[{3}], memory[{4}]", new Object[]{node.getIdentifier(), rack_name, node.getHostName(), node.getPort(), node.getMemorySize()} ); if (!this.racks.containsKey(rack_name)) { final RackDescriptorImpl rack = new RackDescriptorImpl(rack_name); this.racks.put(rack_name, rack); } final RackDescriptorImpl rack = this.racks.get(rack_name); final InetSocketAddress address = new InetSocketAddress(node.getHostName(), node.getPort()); final NodeDescriptorImpl nodeDescriptor = new NodeDescriptorImpl(node.getIdentifier(), address, rack, node.getMemorySize()); this.nodes.put(nodeDescriptor.getId(), nodeDescriptor); } }
public com.microsoft.reef.proto.DriverRuntimeProtocol.NodeDescriptorProto getDefaultInstanceForType() { return com.microsoft.reef.proto.DriverRuntimeProtocol.NodeDescriptorProto.getDefaultInstance(); }
private void sendNodeDescriptors() { final IDMaker idmaker = new IDMaker("Node-"); for (int i = 0; i < capacity; i++) { final String id = idmaker.getNextID(); this.freeNodeList.add(id); nodeDescriptorHandler.onNext(DriverRuntimeProtocol.NodeDescriptorProto.newBuilder() .setIdentifier(id) .setRackName("/default-rack") .setHostName(NetUtils.getLocalAddress()) .setPort(i) .setMemorySize(512) // TODO: Find the actual system memory on this machine. .build()); } }
/** * <code>required string host_name = 2;</code> * * <pre> * e.g., IP address * </pre> */ public Builder clearHostName() { bitField0_ = (bitField0_ & ~0x00000002); hostName_ = getDefaultInstance().getHostName(); onChanged(); return this; } /**
/** * <code>optional string rack_name = 5;</code> * * <pre> * e.g., /default-rack * </pre> */ public Builder clearRackName() { bitField0_ = (bitField0_ & ~0x00000010); rackName_ = getDefaultInstance().getRackName(); onChanged(); return this; } /**
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.microsoft.reef.proto.DriverRuntimeProtocol.NodeDescriptorProto prototype) {
private void onNodeReport(final NodeReport nodeReport) { LOG.log(Level.FINE, "Send node descriptor: {0}", nodeReport); this.reefEventHandlers.onNodeDescriptor(NodeDescriptorProto.newBuilder() .setIdentifier(nodeReport.getNodeId().toString()) .setHostName(nodeReport.getNodeId().getHost()) .setPort(nodeReport.getNodeId().getPort()) .setMemorySize(nodeReport.getCapability().getMemory()) .setRackName(nodeReport.getRackName()) .build()); }
public static Builder newBuilder(com.microsoft.reef.proto.DriverRuntimeProtocol.NodeDescriptorProto prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
/** * <code>required string identifier = 1;</code> */ public Builder clearIdentifier() { bitField0_ = (bitField0_ & ~0x00000001); identifier_ = getDefaultInstance().getIdentifier(); onChanged(); return this; } /**