/** * <pre> * list of partitions managed or replicated on this broker * </pre> * * <code>repeated .gateway_protocol.Partition partitions = 4;</code> */ public Builder addPartitions( int index, io.zeebe.gateway.protocol.GatewayOuterClass.Partition.Builder builderForValue) { if (partitionsBuilder_ == null) { ensurePartitionsIsMutable(); partitions_.add(index, builderForValue.build()); onChanged(); } else { partitionsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { io.zeebe.gateway.protocol.GatewayOuterClass.Partition parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.zeebe.gateway.protocol.GatewayOuterClass.Partition) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * <pre> * the role of the broker for this partition * </pre> * * <code>.gateway_protocol.Partition.PartitionBrokerRole role = 3;</code> */ public Builder setRole(io.zeebe.gateway.protocol.GatewayOuterClass.Partition.PartitionBrokerRole value) { if (value == null) { throw new NullPointerException(); } role_ = value.getNumber(); onChanged(); return this; } /**
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(); }
/** * <pre> * list of partitions managed or replicated on this broker * </pre> * * <code>repeated .gateway_protocol.Partition partitions = 4;</code> */ public Builder addPartitions( io.zeebe.gateway.protocol.GatewayOuterClass.Partition.Builder builderForValue) { if (partitionsBuilder_ == null) { ensurePartitionsIsMutable(); partitions_.add(builderForValue.build()); onChanged(); } else { partitionsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <pre> * list of partitions managed or replicated on this broker * </pre> * * <code>repeated .gateway_protocol.Partition partitions = 4;</code> */ public Builder setPartitions( int index, io.zeebe.gateway.protocol.GatewayOuterClass.Partition.Builder builderForValue) { if (partitionsBuilder_ == null) { ensurePartitionsIsMutable(); partitions_.set(index, builderForValue.build()); onChanged(); } else { partitionsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <pre> * the unique ID of this partition * </pre> * * <code>int32 partitionId = 1;</code> */ public Builder setPartitionId(int value) { partitionId_ = value; onChanged(); return this; } /**
private Builder() { maybeForceBuilderInitialization(); }
public static Builder newBuilder(io.zeebe.gateway.protocol.GatewayOuterClass.Partition prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override
/** * <pre> * the role of the broker for this partition * </pre> * * <code>.gateway_protocol.Partition.PartitionBrokerRole role = 3;</code> */ public Builder clearRole() { role_ = 0; onChanged(); return this; } @java.lang.Override
/** * <pre> * the role of the broker for this partition * </pre> * * <code>.gateway_protocol.Partition.PartitionBrokerRole role = 3;</code> */ public Builder setRoleValue(int value) { role_ = value; onChanged(); return this; } /**
private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() {
/** * <pre> * the unique ID of this partition * </pre> * * <code>int32 partitionId = 1;</code> */ public Builder clearPartitionId() { partitionId_ = 0; onChanged(); return this; }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
@java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof io.zeebe.gateway.protocol.GatewayOuterClass.Partition) { return mergeFrom((io.zeebe.gateway.protocol.GatewayOuterClass.Partition)other); } else { super.mergeFrom(other); 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; }
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; }