@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.zeebe.gateway.protocol.GatewayOuterClass.Partition)) { return super.equals(obj); } io.zeebe.gateway.protocol.GatewayOuterClass.Partition other = (io.zeebe.gateway.protocol.GatewayOuterClass.Partition) obj; boolean result = true; result = result && (getPartitionId() == other.getPartitionId()); result = result && role_ == other.role_; result = result && unknownFields.equals(other.unknownFields); return result; }
/** * <pre> * list of partitions managed or replicated on this broker * </pre> * * <code>repeated .gateway_protocol.Partition partitions = 4;</code> */ public io.zeebe.gateway.protocol.GatewayOuterClass.Partition.Builder addPartitionsBuilder( int index) { return getPartitionsFieldBuilder().addBuilder( index, io.zeebe.gateway.protocol.GatewayOuterClass.Partition.getDefaultInstance()); } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARTITIONID_FIELD_NUMBER; hash = (53 * hash) + getPartitionId(); hash = (37 * hash) + ROLE_FIELD_NUMBER; hash = (53 * hash) + role_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
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(); }
PartitionInfoImpl(final GatewayOuterClass.Partition partition) { this.partitionId = partition.getPartitionId(); if (partition.getRole() == GatewayOuterClass.Partition.PartitionBrokerRole.LEADER) { this.role = PartitionBrokerRole.LEADER; } else if (partition.getRole() == GatewayOuterClass.Partition.PartitionBrokerRole.FOLLOWER) { this.role = PartitionBrokerRole.FOLLOWER; } else { throw new RuntimeException( String.format( "Unexpected partition broker role %s, should be one of %s", partition.getRole(), Arrays.toString(PartitionBrokerRole.values()))); } }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
PartitionInfoImpl(final GatewayOuterClass.Partition partition) { this.partitionId = partition.getPartitionId(); if (partition.getRole() == GatewayOuterClass.Partition.PartitionBrokerRole.LEADER) { this.role = PartitionBrokerRole.LEADER; } else if (partition.getRole() == GatewayOuterClass.Partition.PartitionBrokerRole.FOLLOWER) { this.role = PartitionBrokerRole.FOLLOWER; } else { throw new RuntimeException( String.format( "Unexpected partition broker role %s, should be one of %s", partition.getRole(), Arrays.toString(PartitionBrokerRole.values()))); } }
@java.lang.Override public io.zeebe.gateway.protocol.GatewayOuterClass.Partition getDefaultInstanceForType() { return io.zeebe.gateway.protocol.GatewayOuterClass.Partition.getDefaultInstance(); }
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return io.zeebe.gateway.protocol.GatewayOuterClass.Partition.getDescriptor().getEnumTypes().get(0); }
/** * <pre> * list of partitions managed or replicated on this broker * </pre> * * <code>repeated .gateway_protocol.Partition partitions = 4;</code> */ public io.zeebe.gateway.protocol.GatewayOuterClass.Partition.Builder addPartitionsBuilder() { return getPartitionsFieldBuilder().addBuilder( io.zeebe.gateway.protocol.GatewayOuterClass.Partition.getDefaultInstance()); } /**
public Builder mergeFrom(io.zeebe.gateway.protocol.GatewayOuterClass.Partition other) { if (other == io.zeebe.gateway.protocol.GatewayOuterClass.Partition.getDefaultInstance()) return this; if (other.getPartitionId() != 0) { setPartitionId(other.getPartitionId()); } if (other.role_ != 0) { setRoleValue(other.getRoleValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public io.zeebe.gateway.protocol.GatewayOuterClass.Partition buildPartial() { io.zeebe.gateway.protocol.GatewayOuterClass.Partition result = new io.zeebe.gateway.protocol.GatewayOuterClass.Partition(this); result.partitionId_ = partitionId_; result.role_ = role_; onBuilt(); return result; }
@java.lang.Override public io.zeebe.gateway.protocol.GatewayOuterClass.Partition build() { io.zeebe.gateway.protocol.GatewayOuterClass.Partition result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }