/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/dataflow/v1beta3/streaming.proto

package com.google.dataflow.v1beta3;

/**
 *
 *
 * <pre>
 * Global topology of the streaming Dataflow job, including all
 * computations and their sharded locations.
 * </pre>
 *
 * Protobuf type {@code google.dataflow.v1beta3.TopologyConfig}
 */
public final class TopologyConfig extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.dataflow.v1beta3.TopologyConfig)
    TopologyConfigOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use TopologyConfig.newBuilder() to construct.
  private TopologyConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private TopologyConfig() {
    computations_ = java.util.Collections.emptyList();
    dataDiskAssignments_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new TopologyConfig();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.dataflow.v1beta3.StreamingProto
        .internal_static_google_dataflow_v1beta3_TopologyConfig_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(int number) {
    switch (number) {
      case 3:
        return internalGetUserStageToComputationNameMap();
      default:
        throw new RuntimeException("Invalid map field number: " + number);
    }
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.dataflow.v1beta3.StreamingProto
        .internal_static_google_dataflow_v1beta3_TopologyConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.dataflow.v1beta3.TopologyConfig.class,
            com.google.dataflow.v1beta3.TopologyConfig.Builder.class);
  }

  public static final int COMPUTATIONS_FIELD_NUMBER = 1;
  private java.util.List<com.google.dataflow.v1beta3.ComputationTopology> computations_;
  /**
   *
   *
   * <pre>
   * The computations associated with a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.dataflow.v1beta3.ComputationTopology> getComputationsList() {
    return computations_;
  }
  /**
   *
   *
   * <pre>
   * The computations associated with a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.dataflow.v1beta3.ComputationTopologyOrBuilder>
      getComputationsOrBuilderList() {
    return computations_;
  }
  /**
   *
   *
   * <pre>
   * The computations associated with a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
   */
  @java.lang.Override
  public int getComputationsCount() {
    return computations_.size();
  }
  /**
   *
   *
   * <pre>
   * The computations associated with a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.ComputationTopology getComputations(int index) {
    return computations_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The computations associated with a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.ComputationTopologyOrBuilder getComputationsOrBuilder(
      int index) {
    return computations_.get(index);
  }

  public static final int DATA_DISK_ASSIGNMENTS_FIELD_NUMBER = 2;
  private java.util.List<com.google.dataflow.v1beta3.DataDiskAssignment> dataDiskAssignments_;
  /**
   *
   *
   * <pre>
   * The disks assigned to a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.dataflow.v1beta3.DataDiskAssignment>
      getDataDiskAssignmentsList() {
    return dataDiskAssignments_;
  }
  /**
   *
   *
   * <pre>
   * The disks assigned to a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.dataflow.v1beta3.DataDiskAssignmentOrBuilder>
      getDataDiskAssignmentsOrBuilderList() {
    return dataDiskAssignments_;
  }
  /**
   *
   *
   * <pre>
   * The disks assigned to a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
   */
  @java.lang.Override
  public int getDataDiskAssignmentsCount() {
    return dataDiskAssignments_.size();
  }
  /**
   *
   *
   * <pre>
   * The disks assigned to a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.DataDiskAssignment getDataDiskAssignments(int index) {
    return dataDiskAssignments_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The disks assigned to a streaming Dataflow job.
   * </pre>
   *
   * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.DataDiskAssignmentOrBuilder getDataDiskAssignmentsOrBuilder(
      int index) {
    return dataDiskAssignments_.get(index);
  }

  public static final int USER_STAGE_TO_COMPUTATION_NAME_MAP_FIELD_NUMBER = 3;

  private static final class UserStageToComputationNameMapDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
        com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
            com.google.dataflow.v1beta3.StreamingProto
                .internal_static_google_dataflow_v1beta3_TopologyConfig_UserStageToComputationNameMapEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

  private com.google.protobuf.MapField<java.lang.String, java.lang.String>
      userStageToComputationNameMap_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String>
      internalGetUserStageToComputationNameMap() {
    if (userStageToComputationNameMap_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          UserStageToComputationNameMapDefaultEntryHolder.defaultEntry);
    }
    return userStageToComputationNameMap_;
  }

  public int getUserStageToComputationNameMapCount() {
    return internalGetUserStageToComputationNameMap().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * Maps user stage names to stable computation names.
   * </pre>
   *
   * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
   */
  @java.lang.Override
  public boolean containsUserStageToComputationNameMap(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetUserStageToComputationNameMap().getMap().containsKey(key);
  }
  /** Use {@link #getUserStageToComputationNameMapMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getUserStageToComputationNameMap() {
    return getUserStageToComputationNameMapMap();
  }
  /**
   *
   *
   * <pre>
   * Maps user stage names to stable computation names.
   * </pre>
   *
   * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getUserStageToComputationNameMapMap() {
    return internalGetUserStageToComputationNameMap().getMap();
  }
  /**
   *
   *
   * <pre>
   * Maps user stage names to stable computation names.
   * </pre>
   *
   * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
   */
  @java.lang.Override
  public java.lang.String getUserStageToComputationNameMapOrDefault(
      java.lang.String key, java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetUserStageToComputationNameMap().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * Maps user stage names to stable computation names.
   * </pre>
   *
   * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
   */
  @java.lang.Override
  public java.lang.String getUserStageToComputationNameMapOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetUserStageToComputationNameMap().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int FORWARDING_KEY_BITS_FIELD_NUMBER = 4;
  private int forwardingKeyBits_;
  /**
   *
   *
   * <pre>
   * The size (in bits) of keys that will be assigned to source messages.
   * </pre>
   *
   * <code>int32 forwarding_key_bits = 4;</code>
   *
   * @return The forwardingKeyBits.
   */
  @java.lang.Override
  public int getForwardingKeyBits() {
    return forwardingKeyBits_;
  }

  public static final int PERSISTENT_STATE_VERSION_FIELD_NUMBER = 5;
  private int persistentStateVersion_;
  /**
   *
   *
   * <pre>
   * Version number for persistent state.
   * </pre>
   *
   * <code>int32 persistent_state_version = 5;</code>
   *
   * @return The persistentStateVersion.
   */
  @java.lang.Override
  public int getPersistentStateVersion() {
    return persistentStateVersion_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    for (int i = 0; i < computations_.size(); i++) {
      output.writeMessage(1, computations_.get(i));
    }
    for (int i = 0; i < dataDiskAssignments_.size(); i++) {
      output.writeMessage(2, dataDiskAssignments_.get(i));
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output,
        internalGetUserStageToComputationNameMap(),
        UserStageToComputationNameMapDefaultEntryHolder.defaultEntry,
        3);
    if (forwardingKeyBits_ != 0) {
      output.writeInt32(4, forwardingKeyBits_);
    }
    if (persistentStateVersion_ != 0) {
      output.writeInt32(5, persistentStateVersion_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    for (int i = 0; i < computations_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, computations_.get(i));
    }
    for (int i = 0; i < dataDiskAssignments_.size(); i++) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(2, dataDiskAssignments_.get(i));
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetUserStageToComputationNameMap().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
          userStageToComputationNameMap__ =
              UserStageToComputationNameMapDefaultEntryHolder.defaultEntry
                  .newBuilderForType()
                  .setKey(entry.getKey())
                  .setValue(entry.getValue())
                  .build();
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              3, userStageToComputationNameMap__);
    }
    if (forwardingKeyBits_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, forwardingKeyBits_);
    }
    if (persistentStateVersion_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, persistentStateVersion_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.dataflow.v1beta3.TopologyConfig)) {
      return super.equals(obj);
    }
    com.google.dataflow.v1beta3.TopologyConfig other =
        (com.google.dataflow.v1beta3.TopologyConfig) obj;

    if (!getComputationsList().equals(other.getComputationsList())) return false;
    if (!getDataDiskAssignmentsList().equals(other.getDataDiskAssignmentsList())) return false;
    if (!internalGetUserStageToComputationNameMap()
        .equals(other.internalGetUserStageToComputationNameMap())) return false;
    if (getForwardingKeyBits() != other.getForwardingKeyBits()) return false;
    if (getPersistentStateVersion() != other.getPersistentStateVersion()) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getComputationsCount() > 0) {
      hash = (37 * hash) + COMPUTATIONS_FIELD_NUMBER;
      hash = (53 * hash) + getComputationsList().hashCode();
    }
    if (getDataDiskAssignmentsCount() > 0) {
      hash = (37 * hash) + DATA_DISK_ASSIGNMENTS_FIELD_NUMBER;
      hash = (53 * hash) + getDataDiskAssignmentsList().hashCode();
    }
    if (!internalGetUserStageToComputationNameMap().getMap().isEmpty()) {
      hash = (37 * hash) + USER_STAGE_TO_COMPUTATION_NAME_MAP_FIELD_NUMBER;
      hash = (53 * hash) + internalGetUserStageToComputationNameMap().hashCode();
    }
    hash = (37 * hash) + FORWARDING_KEY_BITS_FIELD_NUMBER;
    hash = (53 * hash) + getForwardingKeyBits();
    hash = (37 * hash) + PERSISTENT_STATE_VERSION_FIELD_NUMBER;
    hash = (53 * hash) + getPersistentStateVersion();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.dataflow.v1beta3.TopologyConfig parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.dataflow.v1beta3.TopologyConfig prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Global topology of the streaming Dataflow job, including all
   * computations and their sharded locations.
   * </pre>
   *
   * Protobuf type {@code google.dataflow.v1beta3.TopologyConfig}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.dataflow.v1beta3.TopologyConfig)
      com.google.dataflow.v1beta3.TopologyConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.dataflow.v1beta3.StreamingProto
          .internal_static_google_dataflow_v1beta3_TopologyConfig_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 3:
          return internalGetUserStageToComputationNameMap();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
      switch (number) {
        case 3:
          return internalGetMutableUserStageToComputationNameMap();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.dataflow.v1beta3.StreamingProto
          .internal_static_google_dataflow_v1beta3_TopologyConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.dataflow.v1beta3.TopologyConfig.class,
              com.google.dataflow.v1beta3.TopologyConfig.Builder.class);
    }

    // Construct using com.google.dataflow.v1beta3.TopologyConfig.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (computationsBuilder_ == null) {
        computations_ = java.util.Collections.emptyList();
      } else {
        computations_ = null;
        computationsBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      if (dataDiskAssignmentsBuilder_ == null) {
        dataDiskAssignments_ = java.util.Collections.emptyList();
      } else {
        dataDiskAssignments_ = null;
        dataDiskAssignmentsBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000002);
      internalGetMutableUserStageToComputationNameMap().clear();
      forwardingKeyBits_ = 0;

      persistentStateVersion_ = 0;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.dataflow.v1beta3.StreamingProto
          .internal_static_google_dataflow_v1beta3_TopologyConfig_descriptor;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.TopologyConfig getDefaultInstanceForType() {
      return com.google.dataflow.v1beta3.TopologyConfig.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.TopologyConfig build() {
      com.google.dataflow.v1beta3.TopologyConfig result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.TopologyConfig buildPartial() {
      com.google.dataflow.v1beta3.TopologyConfig result =
          new com.google.dataflow.v1beta3.TopologyConfig(this);
      int from_bitField0_ = bitField0_;
      if (computationsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          computations_ = java.util.Collections.unmodifiableList(computations_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.computations_ = computations_;
      } else {
        result.computations_ = computationsBuilder_.build();
      }
      if (dataDiskAssignmentsBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)) {
          dataDiskAssignments_ = java.util.Collections.unmodifiableList(dataDiskAssignments_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.dataDiskAssignments_ = dataDiskAssignments_;
      } else {
        result.dataDiskAssignments_ = dataDiskAssignmentsBuilder_.build();
      }
      result.userStageToComputationNameMap_ = internalGetUserStageToComputationNameMap();
      result.userStageToComputationNameMap_.makeImmutable();
      result.forwardingKeyBits_ = forwardingKeyBits_;
      result.persistentStateVersion_ = persistentStateVersion_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.dataflow.v1beta3.TopologyConfig) {
        return mergeFrom((com.google.dataflow.v1beta3.TopologyConfig) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.dataflow.v1beta3.TopologyConfig other) {
      if (other == com.google.dataflow.v1beta3.TopologyConfig.getDefaultInstance()) return this;
      if (computationsBuilder_ == null) {
        if (!other.computations_.isEmpty()) {
          if (computations_.isEmpty()) {
            computations_ = other.computations_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureComputationsIsMutable();
            computations_.addAll(other.computations_);
          }
          onChanged();
        }
      } else {
        if (!other.computations_.isEmpty()) {
          if (computationsBuilder_.isEmpty()) {
            computationsBuilder_.dispose();
            computationsBuilder_ = null;
            computations_ = other.computations_;
            bitField0_ = (bitField0_ & ~0x00000001);
            computationsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getComputationsFieldBuilder()
                    : null;
          } else {
            computationsBuilder_.addAllMessages(other.computations_);
          }
        }
      }
      if (dataDiskAssignmentsBuilder_ == null) {
        if (!other.dataDiskAssignments_.isEmpty()) {
          if (dataDiskAssignments_.isEmpty()) {
            dataDiskAssignments_ = other.dataDiskAssignments_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureDataDiskAssignmentsIsMutable();
            dataDiskAssignments_.addAll(other.dataDiskAssignments_);
          }
          onChanged();
        }
      } else {
        if (!other.dataDiskAssignments_.isEmpty()) {
          if (dataDiskAssignmentsBuilder_.isEmpty()) {
            dataDiskAssignmentsBuilder_.dispose();
            dataDiskAssignmentsBuilder_ = null;
            dataDiskAssignments_ = other.dataDiskAssignments_;
            bitField0_ = (bitField0_ & ~0x00000002);
            dataDiskAssignmentsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getDataDiskAssignmentsFieldBuilder()
                    : null;
          } else {
            dataDiskAssignmentsBuilder_.addAllMessages(other.dataDiskAssignments_);
          }
        }
      }
      internalGetMutableUserStageToComputationNameMap()
          .mergeFrom(other.internalGetUserStageToComputationNameMap());
      if (other.getForwardingKeyBits() != 0) {
        setForwardingKeyBits(other.getForwardingKeyBits());
      }
      if (other.getPersistentStateVersion() != 0) {
        setPersistentStateVersion(other.getPersistentStateVersion());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                com.google.dataflow.v1beta3.ComputationTopology m =
                    input.readMessage(
                        com.google.dataflow.v1beta3.ComputationTopology.parser(),
                        extensionRegistry);
                if (computationsBuilder_ == null) {
                  ensureComputationsIsMutable();
                  computations_.add(m);
                } else {
                  computationsBuilder_.addMessage(m);
                }
                break;
              } // case 10
            case 18:
              {
                com.google.dataflow.v1beta3.DataDiskAssignment m =
                    input.readMessage(
                        com.google.dataflow.v1beta3.DataDiskAssignment.parser(), extensionRegistry);
                if (dataDiskAssignmentsBuilder_ == null) {
                  ensureDataDiskAssignmentsIsMutable();
                  dataDiskAssignments_.add(m);
                } else {
                  dataDiskAssignmentsBuilder_.addMessage(m);
                }
                break;
              } // case 18
            case 26:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
                    userStageToComputationNameMap__ =
                        input.readMessage(
                            UserStageToComputationNameMapDefaultEntryHolder.defaultEntry
                                .getParserForType(),
                            extensionRegistry);
                internalGetMutableUserStageToComputationNameMap()
                    .getMutableMap()
                    .put(
                        userStageToComputationNameMap__.getKey(),
                        userStageToComputationNameMap__.getValue());
                break;
              } // case 26
            case 32:
              {
                forwardingKeyBits_ = input.readInt32();

                break;
              } // case 32
            case 40:
              {
                persistentStateVersion_ = input.readInt32();

                break;
              } // case 40
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.util.List<com.google.dataflow.v1beta3.ComputationTopology> computations_ =
        java.util.Collections.emptyList();

    private void ensureComputationsIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        computations_ =
            new java.util.ArrayList<com.google.dataflow.v1beta3.ComputationTopology>(computations_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.dataflow.v1beta3.ComputationTopology,
            com.google.dataflow.v1beta3.ComputationTopology.Builder,
            com.google.dataflow.v1beta3.ComputationTopologyOrBuilder>
        computationsBuilder_;

    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public java.util.List<com.google.dataflow.v1beta3.ComputationTopology> getComputationsList() {
      if (computationsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(computations_);
      } else {
        return computationsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public int getComputationsCount() {
      if (computationsBuilder_ == null) {
        return computations_.size();
      } else {
        return computationsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public com.google.dataflow.v1beta3.ComputationTopology getComputations(int index) {
      if (computationsBuilder_ == null) {
        return computations_.get(index);
      } else {
        return computationsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public Builder setComputations(
        int index, com.google.dataflow.v1beta3.ComputationTopology value) {
      if (computationsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureComputationsIsMutable();
        computations_.set(index, value);
        onChanged();
      } else {
        computationsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public Builder setComputations(
        int index, com.google.dataflow.v1beta3.ComputationTopology.Builder builderForValue) {
      if (computationsBuilder_ == null) {
        ensureComputationsIsMutable();
        computations_.set(index, builderForValue.build());
        onChanged();
      } else {
        computationsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public Builder addComputations(com.google.dataflow.v1beta3.ComputationTopology value) {
      if (computationsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureComputationsIsMutable();
        computations_.add(value);
        onChanged();
      } else {
        computationsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public Builder addComputations(
        int index, com.google.dataflow.v1beta3.ComputationTopology value) {
      if (computationsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureComputationsIsMutable();
        computations_.add(index, value);
        onChanged();
      } else {
        computationsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public Builder addComputations(
        com.google.dataflow.v1beta3.ComputationTopology.Builder builderForValue) {
      if (computationsBuilder_ == null) {
        ensureComputationsIsMutable();
        computations_.add(builderForValue.build());
        onChanged();
      } else {
        computationsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public Builder addComputations(
        int index, com.google.dataflow.v1beta3.ComputationTopology.Builder builderForValue) {
      if (computationsBuilder_ == null) {
        ensureComputationsIsMutable();
        computations_.add(index, builderForValue.build());
        onChanged();
      } else {
        computationsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public Builder addAllComputations(
        java.lang.Iterable<? extends com.google.dataflow.v1beta3.ComputationTopology> values) {
      if (computationsBuilder_ == null) {
        ensureComputationsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, computations_);
        onChanged();
      } else {
        computationsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public Builder clearComputations() {
      if (computationsBuilder_ == null) {
        computations_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        computationsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public Builder removeComputations(int index) {
      if (computationsBuilder_ == null) {
        ensureComputationsIsMutable();
        computations_.remove(index);
        onChanged();
      } else {
        computationsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public com.google.dataflow.v1beta3.ComputationTopology.Builder getComputationsBuilder(
        int index) {
      return getComputationsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public com.google.dataflow.v1beta3.ComputationTopologyOrBuilder getComputationsOrBuilder(
        int index) {
      if (computationsBuilder_ == null) {
        return computations_.get(index);
      } else {
        return computationsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public java.util.List<? extends com.google.dataflow.v1beta3.ComputationTopologyOrBuilder>
        getComputationsOrBuilderList() {
      if (computationsBuilder_ != null) {
        return computationsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(computations_);
      }
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public com.google.dataflow.v1beta3.ComputationTopology.Builder addComputationsBuilder() {
      return getComputationsFieldBuilder()
          .addBuilder(com.google.dataflow.v1beta3.ComputationTopology.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public com.google.dataflow.v1beta3.ComputationTopology.Builder addComputationsBuilder(
        int index) {
      return getComputationsFieldBuilder()
          .addBuilder(index, com.google.dataflow.v1beta3.ComputationTopology.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The computations associated with a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.ComputationTopology computations = 1;</code>
     */
    public java.util.List<com.google.dataflow.v1beta3.ComputationTopology.Builder>
        getComputationsBuilderList() {
      return getComputationsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.dataflow.v1beta3.ComputationTopology,
            com.google.dataflow.v1beta3.ComputationTopology.Builder,
            com.google.dataflow.v1beta3.ComputationTopologyOrBuilder>
        getComputationsFieldBuilder() {
      if (computationsBuilder_ == null) {
        computationsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.dataflow.v1beta3.ComputationTopology,
                com.google.dataflow.v1beta3.ComputationTopology.Builder,
                com.google.dataflow.v1beta3.ComputationTopologyOrBuilder>(
                computations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        computations_ = null;
      }
      return computationsBuilder_;
    }

    private java.util.List<com.google.dataflow.v1beta3.DataDiskAssignment> dataDiskAssignments_ =
        java.util.Collections.emptyList();

    private void ensureDataDiskAssignmentsIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        dataDiskAssignments_ =
            new java.util.ArrayList<com.google.dataflow.v1beta3.DataDiskAssignment>(
                dataDiskAssignments_);
        bitField0_ |= 0x00000002;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.dataflow.v1beta3.DataDiskAssignment,
            com.google.dataflow.v1beta3.DataDiskAssignment.Builder,
            com.google.dataflow.v1beta3.DataDiskAssignmentOrBuilder>
        dataDiskAssignmentsBuilder_;

    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public java.util.List<com.google.dataflow.v1beta3.DataDiskAssignment>
        getDataDiskAssignmentsList() {
      if (dataDiskAssignmentsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(dataDiskAssignments_);
      } else {
        return dataDiskAssignmentsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public int getDataDiskAssignmentsCount() {
      if (dataDiskAssignmentsBuilder_ == null) {
        return dataDiskAssignments_.size();
      } else {
        return dataDiskAssignmentsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public com.google.dataflow.v1beta3.DataDiskAssignment getDataDiskAssignments(int index) {
      if (dataDiskAssignmentsBuilder_ == null) {
        return dataDiskAssignments_.get(index);
      } else {
        return dataDiskAssignmentsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public Builder setDataDiskAssignments(
        int index, com.google.dataflow.v1beta3.DataDiskAssignment value) {
      if (dataDiskAssignmentsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDataDiskAssignmentsIsMutable();
        dataDiskAssignments_.set(index, value);
        onChanged();
      } else {
        dataDiskAssignmentsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public Builder setDataDiskAssignments(
        int index, com.google.dataflow.v1beta3.DataDiskAssignment.Builder builderForValue) {
      if (dataDiskAssignmentsBuilder_ == null) {
        ensureDataDiskAssignmentsIsMutable();
        dataDiskAssignments_.set(index, builderForValue.build());
        onChanged();
      } else {
        dataDiskAssignmentsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public Builder addDataDiskAssignments(com.google.dataflow.v1beta3.DataDiskAssignment value) {
      if (dataDiskAssignmentsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDataDiskAssignmentsIsMutable();
        dataDiskAssignments_.add(value);
        onChanged();
      } else {
        dataDiskAssignmentsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public Builder addDataDiskAssignments(
        int index, com.google.dataflow.v1beta3.DataDiskAssignment value) {
      if (dataDiskAssignmentsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDataDiskAssignmentsIsMutable();
        dataDiskAssignments_.add(index, value);
        onChanged();
      } else {
        dataDiskAssignmentsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public Builder addDataDiskAssignments(
        com.google.dataflow.v1beta3.DataDiskAssignment.Builder builderForValue) {
      if (dataDiskAssignmentsBuilder_ == null) {
        ensureDataDiskAssignmentsIsMutable();
        dataDiskAssignments_.add(builderForValue.build());
        onChanged();
      } else {
        dataDiskAssignmentsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public Builder addDataDiskAssignments(
        int index, com.google.dataflow.v1beta3.DataDiskAssignment.Builder builderForValue) {
      if (dataDiskAssignmentsBuilder_ == null) {
        ensureDataDiskAssignmentsIsMutable();
        dataDiskAssignments_.add(index, builderForValue.build());
        onChanged();
      } else {
        dataDiskAssignmentsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public Builder addAllDataDiskAssignments(
        java.lang.Iterable<? extends com.google.dataflow.v1beta3.DataDiskAssignment> values) {
      if (dataDiskAssignmentsBuilder_ == null) {
        ensureDataDiskAssignmentsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dataDiskAssignments_);
        onChanged();
      } else {
        dataDiskAssignmentsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public Builder clearDataDiskAssignments() {
      if (dataDiskAssignmentsBuilder_ == null) {
        dataDiskAssignments_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
      } else {
        dataDiskAssignmentsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public Builder removeDataDiskAssignments(int index) {
      if (dataDiskAssignmentsBuilder_ == null) {
        ensureDataDiskAssignmentsIsMutable();
        dataDiskAssignments_.remove(index);
        onChanged();
      } else {
        dataDiskAssignmentsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public com.google.dataflow.v1beta3.DataDiskAssignment.Builder getDataDiskAssignmentsBuilder(
        int index) {
      return getDataDiskAssignmentsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public com.google.dataflow.v1beta3.DataDiskAssignmentOrBuilder getDataDiskAssignmentsOrBuilder(
        int index) {
      if (dataDiskAssignmentsBuilder_ == null) {
        return dataDiskAssignments_.get(index);
      } else {
        return dataDiskAssignmentsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public java.util.List<? extends com.google.dataflow.v1beta3.DataDiskAssignmentOrBuilder>
        getDataDiskAssignmentsOrBuilderList() {
      if (dataDiskAssignmentsBuilder_ != null) {
        return dataDiskAssignmentsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(dataDiskAssignments_);
      }
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public com.google.dataflow.v1beta3.DataDiskAssignment.Builder addDataDiskAssignmentsBuilder() {
      return getDataDiskAssignmentsFieldBuilder()
          .addBuilder(com.google.dataflow.v1beta3.DataDiskAssignment.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public com.google.dataflow.v1beta3.DataDiskAssignment.Builder addDataDiskAssignmentsBuilder(
        int index) {
      return getDataDiskAssignmentsFieldBuilder()
          .addBuilder(index, com.google.dataflow.v1beta3.DataDiskAssignment.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The disks assigned to a streaming Dataflow job.
     * </pre>
     *
     * <code>repeated .google.dataflow.v1beta3.DataDiskAssignment data_disk_assignments = 2;</code>
     */
    public java.util.List<com.google.dataflow.v1beta3.DataDiskAssignment.Builder>
        getDataDiskAssignmentsBuilderList() {
      return getDataDiskAssignmentsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.dataflow.v1beta3.DataDiskAssignment,
            com.google.dataflow.v1beta3.DataDiskAssignment.Builder,
            com.google.dataflow.v1beta3.DataDiskAssignmentOrBuilder>
        getDataDiskAssignmentsFieldBuilder() {
      if (dataDiskAssignmentsBuilder_ == null) {
        dataDiskAssignmentsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.dataflow.v1beta3.DataDiskAssignment,
                com.google.dataflow.v1beta3.DataDiskAssignment.Builder,
                com.google.dataflow.v1beta3.DataDiskAssignmentOrBuilder>(
                dataDiskAssignments_,
                ((bitField0_ & 0x00000002) != 0),
                getParentForChildren(),
                isClean());
        dataDiskAssignments_ = null;
      }
      return dataDiskAssignmentsBuilder_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        userStageToComputationNameMap_;

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetUserStageToComputationNameMap() {
      if (userStageToComputationNameMap_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            UserStageToComputationNameMapDefaultEntryHolder.defaultEntry);
      }
      return userStageToComputationNameMap_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableUserStageToComputationNameMap() {
      onChanged();
      ;
      if (userStageToComputationNameMap_ == null) {
        userStageToComputationNameMap_ =
            com.google.protobuf.MapField.newMapField(
                UserStageToComputationNameMapDefaultEntryHolder.defaultEntry);
      }
      if (!userStageToComputationNameMap_.isMutable()) {
        userStageToComputationNameMap_ = userStageToComputationNameMap_.copy();
      }
      return userStageToComputationNameMap_;
    }

    public int getUserStageToComputationNameMapCount() {
      return internalGetUserStageToComputationNameMap().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Maps user stage names to stable computation names.
     * </pre>
     *
     * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
     */
    @java.lang.Override
    public boolean containsUserStageToComputationNameMap(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetUserStageToComputationNameMap().getMap().containsKey(key);
    }
    /** Use {@link #getUserStageToComputationNameMapMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getUserStageToComputationNameMap() {
      return getUserStageToComputationNameMapMap();
    }
    /**
     *
     *
     * <pre>
     * Maps user stage names to stable computation names.
     * </pre>
     *
     * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getUserStageToComputationNameMapMap() {
      return internalGetUserStageToComputationNameMap().getMap();
    }
    /**
     *
     *
     * <pre>
     * Maps user stage names to stable computation names.
     * </pre>
     *
     * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
     */
    @java.lang.Override
    public java.lang.String getUserStageToComputationNameMapOrDefault(
        java.lang.String key, java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetUserStageToComputationNameMap().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Maps user stage names to stable computation names.
     * </pre>
     *
     * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
     */
    @java.lang.Override
    public java.lang.String getUserStageToComputationNameMapOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetUserStageToComputationNameMap().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearUserStageToComputationNameMap() {
      internalGetMutableUserStageToComputationNameMap().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Maps user stage names to stable computation names.
     * </pre>
     *
     * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
     */
    public Builder removeUserStageToComputationNameMap(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableUserStageToComputationNameMap().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String>
        getMutableUserStageToComputationNameMap() {
      return internalGetMutableUserStageToComputationNameMap().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Maps user stage names to stable computation names.
     * </pre>
     *
     * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
     */
    public Builder putUserStageToComputationNameMap(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }

      internalGetMutableUserStageToComputationNameMap().getMutableMap().put(key, value);
      return this;
    }
    /**
     *
     *
     * <pre>
     * Maps user stage names to stable computation names.
     * </pre>
     *
     * <code>map&lt;string, string&gt; user_stage_to_computation_name_map = 3;</code>
     */
    public Builder putAllUserStageToComputationNameMap(
        java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableUserStageToComputationNameMap().getMutableMap().putAll(values);
      return this;
    }

    private int forwardingKeyBits_;
    /**
     *
     *
     * <pre>
     * The size (in bits) of keys that will be assigned to source messages.
     * </pre>
     *
     * <code>int32 forwarding_key_bits = 4;</code>
     *
     * @return The forwardingKeyBits.
     */
    @java.lang.Override
    public int getForwardingKeyBits() {
      return forwardingKeyBits_;
    }
    /**
     *
     *
     * <pre>
     * The size (in bits) of keys that will be assigned to source messages.
     * </pre>
     *
     * <code>int32 forwarding_key_bits = 4;</code>
     *
     * @param value The forwardingKeyBits to set.
     * @return This builder for chaining.
     */
    public Builder setForwardingKeyBits(int value) {

      forwardingKeyBits_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The size (in bits) of keys that will be assigned to source messages.
     * </pre>
     *
     * <code>int32 forwarding_key_bits = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearForwardingKeyBits() {

      forwardingKeyBits_ = 0;
      onChanged();
      return this;
    }

    private int persistentStateVersion_;
    /**
     *
     *
     * <pre>
     * Version number for persistent state.
     * </pre>
     *
     * <code>int32 persistent_state_version = 5;</code>
     *
     * @return The persistentStateVersion.
     */
    @java.lang.Override
    public int getPersistentStateVersion() {
      return persistentStateVersion_;
    }
    /**
     *
     *
     * <pre>
     * Version number for persistent state.
     * </pre>
     *
     * <code>int32 persistent_state_version = 5;</code>
     *
     * @param value The persistentStateVersion to set.
     * @return This builder for chaining.
     */
    public Builder setPersistentStateVersion(int value) {

      persistentStateVersion_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Version number for persistent state.
     * </pre>
     *
     * <code>int32 persistent_state_version = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPersistentStateVersion() {

      persistentStateVersion_ = 0;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.dataflow.v1beta3.TopologyConfig)
  }

  // @@protoc_insertion_point(class_scope:google.dataflow.v1beta3.TopologyConfig)
  private static final com.google.dataflow.v1beta3.TopologyConfig DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.dataflow.v1beta3.TopologyConfig();
  }

  public static com.google.dataflow.v1beta3.TopologyConfig getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<TopologyConfig> PARSER =
      new com.google.protobuf.AbstractParser<TopologyConfig>() {
        @java.lang.Override
        public TopologyConfig parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<TopologyConfig> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<TopologyConfig> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.dataflow.v1beta3.TopologyConfig getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
