@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NODEID_FIELD_NUMBER; hash = (53 * hash) + getNodeId(); hash = (37 * hash) + HOST_FIELD_NUMBER; hash = (53 * hash) + getHost().hashCode(); hash = (37 * hash) + PORT_FIELD_NUMBER; hash = (53 * hash) + getPort(); if (getPartitionsCount() > 0) { hash = (37 * hash) + PARTITIONS_FIELD_NUMBER; hash = (53 * hash) + getPartitionsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo buildPartial() { io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo result = new io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.nodeId_ = nodeId_; result.host_ = host_; result.port_ = port_; if (partitionsBuilder_ == null) { if (((bitField0_ & 0x00000008) == 0x00000008)) { partitions_ = java.util.Collections.unmodifiableList(partitions_); bitField0_ = (bitField0_ & ~0x00000008); } result.partitions_ = partitions_; } else { result.partitions_ = partitionsBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * <pre> * list of brokers part of this cluster * </pre> * * <code>repeated .gateway_protocol.BrokerInfo brokers = 1;</code> */ public io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo.Builder addBrokersBuilder( int index) { return getBrokersFieldBuilder().addBuilder( index, io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo.getDefaultInstance()); } /**
public Builder mergeFrom(io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo other) { if (other == io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo.getDefaultInstance()) return this; if (other.getNodeId() != 0) { setNodeId(other.getNodeId()); if (!other.getHost().isEmpty()) { host_ = other.host_; onChanged(); if (other.getPort() != 0) { setPort(other.getPort());
public static TopologyResponse toTopologyResponse(long key, TopologyResponseDto brokerResponse) { final TopologyResponse.Builder topologyResponseBuilder = TopologyResponse.newBuilder(); topologyResponseBuilder .setClusterSize(brokerResponse.getClusterSize()) .setPartitionsCount(brokerResponse.getPartitionsCount()) .setReplicationFactor(brokerResponse.getReplicationFactor()); final ArrayList<BrokerInfo> infos = new ArrayList<>(); brokerResponse .brokers() .forEach( broker -> { final Builder brokerInfo = BrokerInfo.newBuilder() .setNodeId(broker.getNodeId()) .setHost(bufferAsString(broker.getHost())) .setPort(broker.getPort()); broker .partitionStates() .forEach( partition -> { final Partition.Builder partitionBuilder = Partition.newBuilder(); partitionBuilder.setPartitionId(partition.getPartitionId()); partitionBuilder.setRole(remapPartitionBrokerRoleEnum(partition)); brokerInfo.addPartitions(partitionBuilder); }); infos.add(brokerInfo.build()); }); topologyResponseBuilder.addAllBrokers(infos); return topologyResponseBuilder.build(); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (nodeId_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, nodeId_); } if (!getHostBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, host_); } if (port_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, port_); } for (int i = 0; i < partitions_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, partitions_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo)) { return super.equals(obj); } io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo other = (io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo) obj; boolean result = true; result = result && (getNodeId() == other.getNodeId()); result = result && getHost() .equals(other.getHost()); result = result && (getPort() == other.getPort()); result = result && getPartitionsList() .equals(other.getPartitionsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (nodeId_ != 0) { output.writeInt32(1, nodeId_); } if (!getHostBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, host_); } if (port_ != 0) { output.writeInt32(3, port_); } for (int i = 0; i < partitions_.size(); i++) { output.writeMessage(4, partitions_.get(i)); } unknownFields.writeTo(output); }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
@java.lang.Override public io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo getDefaultInstanceForType() { return io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo.getDefaultInstance(); }
/** * <pre> * hostname of the broker * </pre> * * <code>string host = 2;</code> */ public Builder clearHost() { host_ = getDefaultInstance().getHost(); onChanged(); return this; } /**
public BrokerInfoImpl(final GatewayOuterClass.BrokerInfo broker) { this.nodeId = broker.getNodeId(); this.host = broker.getHost(); this.port = broker.getPort(); this.partitions = new ArrayList<>(); for (final GatewayOuterClass.Partition partition : broker.getPartitionsList()) { this.partitions.add(new PartitionInfoImpl(partition)); } }
/** * <pre> * list of brokers part of this cluster * </pre> * * <code>repeated .gateway_protocol.BrokerInfo brokers = 1;</code> */ public io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo.Builder addBrokersBuilder() { return getBrokersFieldBuilder().addBuilder( io.zeebe.gateway.protocol.GatewayOuterClass.BrokerInfo.getDefaultInstance()); } /**
public BrokerInfoImpl(final GatewayOuterClass.BrokerInfo broker) { this.nodeId = broker.getNodeId(); this.host = broker.getHost(); this.port = broker.getPort(); this.partitions = new ArrayList<>(); for (final GatewayOuterClass.Partition partition : broker.getPartitionsList()) { this.partitions.add(new PartitionInfoImpl(partition)); } }