// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/dataproc/v1/clusters.proto

package com.google.cloud.dataproc.v1;

/**
 * <pre>
 * The cluster config.
 * </pre>
 *
 * Protobuf type {@code google.cloud.dataproc.v1.ClusterConfig}
 */
public  final class ClusterConfig extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.dataproc.v1.ClusterConfig)
    ClusterConfigOrBuilder {
private static final long serialVersionUID = 0L;
  // Use ClusterConfig.newBuilder() to construct.
  private ClusterConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private ClusterConfig() {
    configBucket_ = "";
    initializationActions_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private ClusterConfig(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            configBucket_ = s;
            break;
          }
          case 66: {
            com.google.cloud.dataproc.v1.GceClusterConfig.Builder subBuilder = null;
            if (gceClusterConfig_ != null) {
              subBuilder = gceClusterConfig_.toBuilder();
            }
            gceClusterConfig_ = input.readMessage(com.google.cloud.dataproc.v1.GceClusterConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(gceClusterConfig_);
              gceClusterConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          case 74: {
            com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder subBuilder = null;
            if (masterConfig_ != null) {
              subBuilder = masterConfig_.toBuilder();
            }
            masterConfig_ = input.readMessage(com.google.cloud.dataproc.v1.InstanceGroupConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(masterConfig_);
              masterConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          case 82: {
            com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder subBuilder = null;
            if (workerConfig_ != null) {
              subBuilder = workerConfig_.toBuilder();
            }
            workerConfig_ = input.readMessage(com.google.cloud.dataproc.v1.InstanceGroupConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(workerConfig_);
              workerConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          case 90: {
            if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
              initializationActions_ = new java.util.ArrayList<com.google.cloud.dataproc.v1.NodeInitializationAction>();
              mutable_bitField0_ |= 0x00000040;
            }
            initializationActions_.add(
                input.readMessage(com.google.cloud.dataproc.v1.NodeInitializationAction.parser(), extensionRegistry));
            break;
          }
          case 98: {
            com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder subBuilder = null;
            if (secondaryWorkerConfig_ != null) {
              subBuilder = secondaryWorkerConfig_.toBuilder();
            }
            secondaryWorkerConfig_ = input.readMessage(com.google.cloud.dataproc.v1.InstanceGroupConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(secondaryWorkerConfig_);
              secondaryWorkerConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          case 106: {
            com.google.cloud.dataproc.v1.SoftwareConfig.Builder subBuilder = null;
            if (softwareConfig_ != null) {
              subBuilder = softwareConfig_.toBuilder();
            }
            softwareConfig_ = input.readMessage(com.google.cloud.dataproc.v1.SoftwareConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(softwareConfig_);
              softwareConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
        initializationActions_ = java.util.Collections.unmodifiableList(initializationActions_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_ClusterConfig_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_ClusterConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.dataproc.v1.ClusterConfig.class, com.google.cloud.dataproc.v1.ClusterConfig.Builder.class);
  }

  private int bitField0_;
  public static final int CONFIG_BUCKET_FIELD_NUMBER = 1;
  private volatile java.lang.Object configBucket_;
  /**
   * <pre>
   * Optional. A Google Cloud Storage staging bucket used for sharing generated
   * SSH keys and config. If you do not specify a staging bucket, Cloud
   * Dataproc will determine an appropriate Cloud Storage location (US,
   * ASIA, or EU) for your cluster's staging bucket according to the Google
   * Compute Engine zone where your cluster is deployed, and then it will create
   * and manage this project-level, per-location bucket for you.
   * </pre>
   *
   * <code>string config_bucket = 1;</code>
   */
  public java.lang.String getConfigBucket() {
    java.lang.Object ref = configBucket_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      configBucket_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Optional. A Google Cloud Storage staging bucket used for sharing generated
   * SSH keys and config. If you do not specify a staging bucket, Cloud
   * Dataproc will determine an appropriate Cloud Storage location (US,
   * ASIA, or EU) for your cluster's staging bucket according to the Google
   * Compute Engine zone where your cluster is deployed, and then it will create
   * and manage this project-level, per-location bucket for you.
   * </pre>
   *
   * <code>string config_bucket = 1;</code>
   */
  public com.google.protobuf.ByteString
      getConfigBucketBytes() {
    java.lang.Object ref = configBucket_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      configBucket_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int GCE_CLUSTER_CONFIG_FIELD_NUMBER = 8;
  private com.google.cloud.dataproc.v1.GceClusterConfig gceClusterConfig_;
  /**
   * <pre>
   * Required. The shared Google Compute Engine config settings for
   * all instances in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
   */
  public boolean hasGceClusterConfig() {
    return gceClusterConfig_ != null;
  }
  /**
   * <pre>
   * Required. The shared Google Compute Engine config settings for
   * all instances in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
   */
  public com.google.cloud.dataproc.v1.GceClusterConfig getGceClusterConfig() {
    return gceClusterConfig_ == null ? com.google.cloud.dataproc.v1.GceClusterConfig.getDefaultInstance() : gceClusterConfig_;
  }
  /**
   * <pre>
   * Required. The shared Google Compute Engine config settings for
   * all instances in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
   */
  public com.google.cloud.dataproc.v1.GceClusterConfigOrBuilder getGceClusterConfigOrBuilder() {
    return getGceClusterConfig();
  }

  public static final int MASTER_CONFIG_FIELD_NUMBER = 9;
  private com.google.cloud.dataproc.v1.InstanceGroupConfig masterConfig_;
  /**
   * <pre>
   * Optional. The Google Compute Engine config settings for
   * the master instance in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
   */
  public boolean hasMasterConfig() {
    return masterConfig_ != null;
  }
  /**
   * <pre>
   * Optional. The Google Compute Engine config settings for
   * the master instance in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
   */
  public com.google.cloud.dataproc.v1.InstanceGroupConfig getMasterConfig() {
    return masterConfig_ == null ? com.google.cloud.dataproc.v1.InstanceGroupConfig.getDefaultInstance() : masterConfig_;
  }
  /**
   * <pre>
   * Optional. The Google Compute Engine config settings for
   * the master instance in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
   */
  public com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder getMasterConfigOrBuilder() {
    return getMasterConfig();
  }

  public static final int WORKER_CONFIG_FIELD_NUMBER = 10;
  private com.google.cloud.dataproc.v1.InstanceGroupConfig workerConfig_;
  /**
   * <pre>
   * Optional. The Google Compute Engine config settings for
   * worker instances in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
   */
  public boolean hasWorkerConfig() {
    return workerConfig_ != null;
  }
  /**
   * <pre>
   * Optional. The Google Compute Engine config settings for
   * worker instances in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
   */
  public com.google.cloud.dataproc.v1.InstanceGroupConfig getWorkerConfig() {
    return workerConfig_ == null ? com.google.cloud.dataproc.v1.InstanceGroupConfig.getDefaultInstance() : workerConfig_;
  }
  /**
   * <pre>
   * Optional. The Google Compute Engine config settings for
   * worker instances in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
   */
  public com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder getWorkerConfigOrBuilder() {
    return getWorkerConfig();
  }

  public static final int SECONDARY_WORKER_CONFIG_FIELD_NUMBER = 12;
  private com.google.cloud.dataproc.v1.InstanceGroupConfig secondaryWorkerConfig_;
  /**
   * <pre>
   * Optional. The Google Compute Engine config settings for
   * additional worker instances in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
   */
  public boolean hasSecondaryWorkerConfig() {
    return secondaryWorkerConfig_ != null;
  }
  /**
   * <pre>
   * Optional. The Google Compute Engine config settings for
   * additional worker instances in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
   */
  public com.google.cloud.dataproc.v1.InstanceGroupConfig getSecondaryWorkerConfig() {
    return secondaryWorkerConfig_ == null ? com.google.cloud.dataproc.v1.InstanceGroupConfig.getDefaultInstance() : secondaryWorkerConfig_;
  }
  /**
   * <pre>
   * Optional. The Google Compute Engine config settings for
   * additional worker instances in a cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
   */
  public com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder getSecondaryWorkerConfigOrBuilder() {
    return getSecondaryWorkerConfig();
  }

  public static final int SOFTWARE_CONFIG_FIELD_NUMBER = 13;
  private com.google.cloud.dataproc.v1.SoftwareConfig softwareConfig_;
  /**
   * <pre>
   * Optional. The config settings for software inside the cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
   */
  public boolean hasSoftwareConfig() {
    return softwareConfig_ != null;
  }
  /**
   * <pre>
   * Optional. The config settings for software inside the cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
   */
  public com.google.cloud.dataproc.v1.SoftwareConfig getSoftwareConfig() {
    return softwareConfig_ == null ? com.google.cloud.dataproc.v1.SoftwareConfig.getDefaultInstance() : softwareConfig_;
  }
  /**
   * <pre>
   * Optional. The config settings for software inside the cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
   */
  public com.google.cloud.dataproc.v1.SoftwareConfigOrBuilder getSoftwareConfigOrBuilder() {
    return getSoftwareConfig();
  }

  public static final int INITIALIZATION_ACTIONS_FIELD_NUMBER = 11;
  private java.util.List<com.google.cloud.dataproc.v1.NodeInitializationAction> initializationActions_;
  /**
   * <pre>
   * Optional. Commands to execute on each node after config is
   * completed. By default, executables are run on master and all worker nodes.
   * You can test a node's `role` metadata to run an executable on
   * a master or worker node, as shown below using `curl` (you can also use `wget`):
   *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
   *     if [[ "${ROLE}" == 'Master' ]]; then
   *       ... master specific actions ...
   *     else
   *       ... worker specific actions ...
   *     fi
   * </pre>
   *
   * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
   */
  public java.util.List<com.google.cloud.dataproc.v1.NodeInitializationAction> getInitializationActionsList() {
    return initializationActions_;
  }
  /**
   * <pre>
   * Optional. Commands to execute on each node after config is
   * completed. By default, executables are run on master and all worker nodes.
   * You can test a node's `role` metadata to run an executable on
   * a master or worker node, as shown below using `curl` (you can also use `wget`):
   *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
   *     if [[ "${ROLE}" == 'Master' ]]; then
   *       ... master specific actions ...
   *     else
   *       ... worker specific actions ...
   *     fi
   * </pre>
   *
   * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
   */
  public java.util.List<? extends com.google.cloud.dataproc.v1.NodeInitializationActionOrBuilder> 
      getInitializationActionsOrBuilderList() {
    return initializationActions_;
  }
  /**
   * <pre>
   * Optional. Commands to execute on each node after config is
   * completed. By default, executables are run on master and all worker nodes.
   * You can test a node's `role` metadata to run an executable on
   * a master or worker node, as shown below using `curl` (you can also use `wget`):
   *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
   *     if [[ "${ROLE}" == 'Master' ]]; then
   *       ... master specific actions ...
   *     else
   *       ... worker specific actions ...
   *     fi
   * </pre>
   *
   * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
   */
  public int getInitializationActionsCount() {
    return initializationActions_.size();
  }
  /**
   * <pre>
   * Optional. Commands to execute on each node after config is
   * completed. By default, executables are run on master and all worker nodes.
   * You can test a node's `role` metadata to run an executable on
   * a master or worker node, as shown below using `curl` (you can also use `wget`):
   *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
   *     if [[ "${ROLE}" == 'Master' ]]; then
   *       ... master specific actions ...
   *     else
   *       ... worker specific actions ...
   *     fi
   * </pre>
   *
   * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
   */
  public com.google.cloud.dataproc.v1.NodeInitializationAction getInitializationActions(int index) {
    return initializationActions_.get(index);
  }
  /**
   * <pre>
   * Optional. Commands to execute on each node after config is
   * completed. By default, executables are run on master and all worker nodes.
   * You can test a node's `role` metadata to run an executable on
   * a master or worker node, as shown below using `curl` (you can also use `wget`):
   *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
   *     if [[ "${ROLE}" == 'Master' ]]; then
   *       ... master specific actions ...
   *     else
   *       ... worker specific actions ...
   *     fi
   * </pre>
   *
   * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
   */
  public com.google.cloud.dataproc.v1.NodeInitializationActionOrBuilder getInitializationActionsOrBuilder(
      int index) {
    return initializationActions_.get(index);
  }

  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 {
    if (!getConfigBucketBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, configBucket_);
    }
    if (gceClusterConfig_ != null) {
      output.writeMessage(8, getGceClusterConfig());
    }
    if (masterConfig_ != null) {
      output.writeMessage(9, getMasterConfig());
    }
    if (workerConfig_ != null) {
      output.writeMessage(10, getWorkerConfig());
    }
    for (int i = 0; i < initializationActions_.size(); i++) {
      output.writeMessage(11, initializationActions_.get(i));
    }
    if (secondaryWorkerConfig_ != null) {
      output.writeMessage(12, getSecondaryWorkerConfig());
    }
    if (softwareConfig_ != null) {
      output.writeMessage(13, getSoftwareConfig());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getConfigBucketBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, configBucket_);
    }
    if (gceClusterConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(8, getGceClusterConfig());
    }
    if (masterConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(9, getMasterConfig());
    }
    if (workerConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(10, getWorkerConfig());
    }
    for (int i = 0; i < initializationActions_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(11, initializationActions_.get(i));
    }
    if (secondaryWorkerConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(12, getSecondaryWorkerConfig());
    }
    if (softwareConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(13, getSoftwareConfig());
    }
    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 com.google.cloud.dataproc.v1.ClusterConfig)) {
      return super.equals(obj);
    }
    com.google.cloud.dataproc.v1.ClusterConfig other = (com.google.cloud.dataproc.v1.ClusterConfig) obj;

    boolean result = true;
    result = result && getConfigBucket()
        .equals(other.getConfigBucket());
    result = result && (hasGceClusterConfig() == other.hasGceClusterConfig());
    if (hasGceClusterConfig()) {
      result = result && getGceClusterConfig()
          .equals(other.getGceClusterConfig());
    }
    result = result && (hasMasterConfig() == other.hasMasterConfig());
    if (hasMasterConfig()) {
      result = result && getMasterConfig()
          .equals(other.getMasterConfig());
    }
    result = result && (hasWorkerConfig() == other.hasWorkerConfig());
    if (hasWorkerConfig()) {
      result = result && getWorkerConfig()
          .equals(other.getWorkerConfig());
    }
    result = result && (hasSecondaryWorkerConfig() == other.hasSecondaryWorkerConfig());
    if (hasSecondaryWorkerConfig()) {
      result = result && getSecondaryWorkerConfig()
          .equals(other.getSecondaryWorkerConfig());
    }
    result = result && (hasSoftwareConfig() == other.hasSoftwareConfig());
    if (hasSoftwareConfig()) {
      result = result && getSoftwareConfig()
          .equals(other.getSoftwareConfig());
    }
    result = result && getInitializationActionsList()
        .equals(other.getInitializationActionsList());
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + CONFIG_BUCKET_FIELD_NUMBER;
    hash = (53 * hash) + getConfigBucket().hashCode();
    if (hasGceClusterConfig()) {
      hash = (37 * hash) + GCE_CLUSTER_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getGceClusterConfig().hashCode();
    }
    if (hasMasterConfig()) {
      hash = (37 * hash) + MASTER_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getMasterConfig().hashCode();
    }
    if (hasWorkerConfig()) {
      hash = (37 * hash) + WORKER_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getWorkerConfig().hashCode();
    }
    if (hasSecondaryWorkerConfig()) {
      hash = (37 * hash) + SECONDARY_WORKER_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getSecondaryWorkerConfig().hashCode();
    }
    if (hasSoftwareConfig()) {
      hash = (37 * hash) + SOFTWARE_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getSoftwareConfig().hashCode();
    }
    if (getInitializationActionsCount() > 0) {
      hash = (37 * hash) + INITIALIZATION_ACTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getInitializationActionsList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.dataproc.v1.ClusterConfig parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dataproc.v1.ClusterConfig parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.dataproc.v1.ClusterConfig parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dataproc.v1.ClusterConfig 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.cloud.dataproc.v1.ClusterConfig parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dataproc.v1.ClusterConfig parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.dataproc.v1.ClusterConfig parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.dataproc.v1.ClusterConfig 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.cloud.dataproc.v1.ClusterConfig parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.dataproc.v1.ClusterConfig 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.cloud.dataproc.v1.ClusterConfig parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.dataproc.v1.ClusterConfig 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.cloud.dataproc.v1.ClusterConfig 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>
   * The cluster config.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dataproc.v1.ClusterConfig}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dataproc.v1.ClusterConfig)
      com.google.cloud.dataproc.v1.ClusterConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_ClusterConfig_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_ClusterConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.dataproc.v1.ClusterConfig.class, com.google.cloud.dataproc.v1.ClusterConfig.Builder.class);
    }

    // Construct using com.google.cloud.dataproc.v1.ClusterConfig.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getInitializationActionsFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      configBucket_ = "";

      if (gceClusterConfigBuilder_ == null) {
        gceClusterConfig_ = null;
      } else {
        gceClusterConfig_ = null;
        gceClusterConfigBuilder_ = null;
      }
      if (masterConfigBuilder_ == null) {
        masterConfig_ = null;
      } else {
        masterConfig_ = null;
        masterConfigBuilder_ = null;
      }
      if (workerConfigBuilder_ == null) {
        workerConfig_ = null;
      } else {
        workerConfig_ = null;
        workerConfigBuilder_ = null;
      }
      if (secondaryWorkerConfigBuilder_ == null) {
        secondaryWorkerConfig_ = null;
      } else {
        secondaryWorkerConfig_ = null;
        secondaryWorkerConfigBuilder_ = null;
      }
      if (softwareConfigBuilder_ == null) {
        softwareConfig_ = null;
      } else {
        softwareConfig_ = null;
        softwareConfigBuilder_ = null;
      }
      if (initializationActionsBuilder_ == null) {
        initializationActions_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000040);
      } else {
        initializationActionsBuilder_.clear();
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_ClusterConfig_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.dataproc.v1.ClusterConfig getDefaultInstanceForType() {
      return com.google.cloud.dataproc.v1.ClusterConfig.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.dataproc.v1.ClusterConfig build() {
      com.google.cloud.dataproc.v1.ClusterConfig result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.dataproc.v1.ClusterConfig buildPartial() {
      com.google.cloud.dataproc.v1.ClusterConfig result = new com.google.cloud.dataproc.v1.ClusterConfig(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.configBucket_ = configBucket_;
      if (gceClusterConfigBuilder_ == null) {
        result.gceClusterConfig_ = gceClusterConfig_;
      } else {
        result.gceClusterConfig_ = gceClusterConfigBuilder_.build();
      }
      if (masterConfigBuilder_ == null) {
        result.masterConfig_ = masterConfig_;
      } else {
        result.masterConfig_ = masterConfigBuilder_.build();
      }
      if (workerConfigBuilder_ == null) {
        result.workerConfig_ = workerConfig_;
      } else {
        result.workerConfig_ = workerConfigBuilder_.build();
      }
      if (secondaryWorkerConfigBuilder_ == null) {
        result.secondaryWorkerConfig_ = secondaryWorkerConfig_;
      } else {
        result.secondaryWorkerConfig_ = secondaryWorkerConfigBuilder_.build();
      }
      if (softwareConfigBuilder_ == null) {
        result.softwareConfig_ = softwareConfig_;
      } else {
        result.softwareConfig_ = softwareConfigBuilder_.build();
      }
      if (initializationActionsBuilder_ == null) {
        if (((bitField0_ & 0x00000040) == 0x00000040)) {
          initializationActions_ = java.util.Collections.unmodifiableList(initializationActions_);
          bitField0_ = (bitField0_ & ~0x00000040);
        }
        result.initializationActions_ = initializationActions_;
      } else {
        result.initializationActions_ = initializationActionsBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return (Builder) super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.dataproc.v1.ClusterConfig) {
        return mergeFrom((com.google.cloud.dataproc.v1.ClusterConfig)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.dataproc.v1.ClusterConfig other) {
      if (other == com.google.cloud.dataproc.v1.ClusterConfig.getDefaultInstance()) return this;
      if (!other.getConfigBucket().isEmpty()) {
        configBucket_ = other.configBucket_;
        onChanged();
      }
      if (other.hasGceClusterConfig()) {
        mergeGceClusterConfig(other.getGceClusterConfig());
      }
      if (other.hasMasterConfig()) {
        mergeMasterConfig(other.getMasterConfig());
      }
      if (other.hasWorkerConfig()) {
        mergeWorkerConfig(other.getWorkerConfig());
      }
      if (other.hasSecondaryWorkerConfig()) {
        mergeSecondaryWorkerConfig(other.getSecondaryWorkerConfig());
      }
      if (other.hasSoftwareConfig()) {
        mergeSoftwareConfig(other.getSoftwareConfig());
      }
      if (initializationActionsBuilder_ == null) {
        if (!other.initializationActions_.isEmpty()) {
          if (initializationActions_.isEmpty()) {
            initializationActions_ = other.initializationActions_;
            bitField0_ = (bitField0_ & ~0x00000040);
          } else {
            ensureInitializationActionsIsMutable();
            initializationActions_.addAll(other.initializationActions_);
          }
          onChanged();
        }
      } else {
        if (!other.initializationActions_.isEmpty()) {
          if (initializationActionsBuilder_.isEmpty()) {
            initializationActionsBuilder_.dispose();
            initializationActionsBuilder_ = null;
            initializationActions_ = other.initializationActions_;
            bitField0_ = (bitField0_ & ~0x00000040);
            initializationActionsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getInitializationActionsFieldBuilder() : null;
          } else {
            initializationActionsBuilder_.addAllMessages(other.initializationActions_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.cloud.dataproc.v1.ClusterConfig parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.dataproc.v1.ClusterConfig) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object configBucket_ = "";
    /**
     * <pre>
     * Optional. A Google Cloud Storage staging bucket used for sharing generated
     * SSH keys and config. If you do not specify a staging bucket, Cloud
     * Dataproc will determine an appropriate Cloud Storage location (US,
     * ASIA, or EU) for your cluster's staging bucket according to the Google
     * Compute Engine zone where your cluster is deployed, and then it will create
     * and manage this project-level, per-location bucket for you.
     * </pre>
     *
     * <code>string config_bucket = 1;</code>
     */
    public java.lang.String getConfigBucket() {
      java.lang.Object ref = configBucket_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        configBucket_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Optional. A Google Cloud Storage staging bucket used for sharing generated
     * SSH keys and config. If you do not specify a staging bucket, Cloud
     * Dataproc will determine an appropriate Cloud Storage location (US,
     * ASIA, or EU) for your cluster's staging bucket according to the Google
     * Compute Engine zone where your cluster is deployed, and then it will create
     * and manage this project-level, per-location bucket for you.
     * </pre>
     *
     * <code>string config_bucket = 1;</code>
     */
    public com.google.protobuf.ByteString
        getConfigBucketBytes() {
      java.lang.Object ref = configBucket_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        configBucket_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Optional. A Google Cloud Storage staging bucket used for sharing generated
     * SSH keys and config. If you do not specify a staging bucket, Cloud
     * Dataproc will determine an appropriate Cloud Storage location (US,
     * ASIA, or EU) for your cluster's staging bucket according to the Google
     * Compute Engine zone where your cluster is deployed, and then it will create
     * and manage this project-level, per-location bucket for you.
     * </pre>
     *
     * <code>string config_bucket = 1;</code>
     */
    public Builder setConfigBucket(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      configBucket_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. A Google Cloud Storage staging bucket used for sharing generated
     * SSH keys and config. If you do not specify a staging bucket, Cloud
     * Dataproc will determine an appropriate Cloud Storage location (US,
     * ASIA, or EU) for your cluster's staging bucket according to the Google
     * Compute Engine zone where your cluster is deployed, and then it will create
     * and manage this project-level, per-location bucket for you.
     * </pre>
     *
     * <code>string config_bucket = 1;</code>
     */
    public Builder clearConfigBucket() {
      
      configBucket_ = getDefaultInstance().getConfigBucket();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. A Google Cloud Storage staging bucket used for sharing generated
     * SSH keys and config. If you do not specify a staging bucket, Cloud
     * Dataproc will determine an appropriate Cloud Storage location (US,
     * ASIA, or EU) for your cluster's staging bucket according to the Google
     * Compute Engine zone where your cluster is deployed, and then it will create
     * and manage this project-level, per-location bucket for you.
     * </pre>
     *
     * <code>string config_bucket = 1;</code>
     */
    public Builder setConfigBucketBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      configBucket_ = value;
      onChanged();
      return this;
    }

    private com.google.cloud.dataproc.v1.GceClusterConfig gceClusterConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.GceClusterConfig, com.google.cloud.dataproc.v1.GceClusterConfig.Builder, com.google.cloud.dataproc.v1.GceClusterConfigOrBuilder> gceClusterConfigBuilder_;
    /**
     * <pre>
     * Required. The shared Google Compute Engine config settings for
     * all instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
     */
    public boolean hasGceClusterConfig() {
      return gceClusterConfigBuilder_ != null || gceClusterConfig_ != null;
    }
    /**
     * <pre>
     * Required. The shared Google Compute Engine config settings for
     * all instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
     */
    public com.google.cloud.dataproc.v1.GceClusterConfig getGceClusterConfig() {
      if (gceClusterConfigBuilder_ == null) {
        return gceClusterConfig_ == null ? com.google.cloud.dataproc.v1.GceClusterConfig.getDefaultInstance() : gceClusterConfig_;
      } else {
        return gceClusterConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Required. The shared Google Compute Engine config settings for
     * all instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
     */
    public Builder setGceClusterConfig(com.google.cloud.dataproc.v1.GceClusterConfig value) {
      if (gceClusterConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        gceClusterConfig_ = value;
        onChanged();
      } else {
        gceClusterConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Required. The shared Google Compute Engine config settings for
     * all instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
     */
    public Builder setGceClusterConfig(
        com.google.cloud.dataproc.v1.GceClusterConfig.Builder builderForValue) {
      if (gceClusterConfigBuilder_ == null) {
        gceClusterConfig_ = builderForValue.build();
        onChanged();
      } else {
        gceClusterConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Required. The shared Google Compute Engine config settings for
     * all instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
     */
    public Builder mergeGceClusterConfig(com.google.cloud.dataproc.v1.GceClusterConfig value) {
      if (gceClusterConfigBuilder_ == null) {
        if (gceClusterConfig_ != null) {
          gceClusterConfig_ =
            com.google.cloud.dataproc.v1.GceClusterConfig.newBuilder(gceClusterConfig_).mergeFrom(value).buildPartial();
        } else {
          gceClusterConfig_ = value;
        }
        onChanged();
      } else {
        gceClusterConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Required. The shared Google Compute Engine config settings for
     * all instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
     */
    public Builder clearGceClusterConfig() {
      if (gceClusterConfigBuilder_ == null) {
        gceClusterConfig_ = null;
        onChanged();
      } else {
        gceClusterConfig_ = null;
        gceClusterConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Required. The shared Google Compute Engine config settings for
     * all instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
     */
    public com.google.cloud.dataproc.v1.GceClusterConfig.Builder getGceClusterConfigBuilder() {
      
      onChanged();
      return getGceClusterConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Required. The shared Google Compute Engine config settings for
     * all instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
     */
    public com.google.cloud.dataproc.v1.GceClusterConfigOrBuilder getGceClusterConfigOrBuilder() {
      if (gceClusterConfigBuilder_ != null) {
        return gceClusterConfigBuilder_.getMessageOrBuilder();
      } else {
        return gceClusterConfig_ == null ?
            com.google.cloud.dataproc.v1.GceClusterConfig.getDefaultInstance() : gceClusterConfig_;
      }
    }
    /**
     * <pre>
     * Required. The shared Google Compute Engine config settings for
     * all instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.GceClusterConfig gce_cluster_config = 8;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.GceClusterConfig, com.google.cloud.dataproc.v1.GceClusterConfig.Builder, com.google.cloud.dataproc.v1.GceClusterConfigOrBuilder> 
        getGceClusterConfigFieldBuilder() {
      if (gceClusterConfigBuilder_ == null) {
        gceClusterConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1.GceClusterConfig, com.google.cloud.dataproc.v1.GceClusterConfig.Builder, com.google.cloud.dataproc.v1.GceClusterConfigOrBuilder>(
                getGceClusterConfig(),
                getParentForChildren(),
                isClean());
        gceClusterConfig_ = null;
      }
      return gceClusterConfigBuilder_;
    }

    private com.google.cloud.dataproc.v1.InstanceGroupConfig masterConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.InstanceGroupConfig, com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder, com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder> masterConfigBuilder_;
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * the master instance in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
     */
    public boolean hasMasterConfig() {
      return masterConfigBuilder_ != null || masterConfig_ != null;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * the master instance in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
     */
    public com.google.cloud.dataproc.v1.InstanceGroupConfig getMasterConfig() {
      if (masterConfigBuilder_ == null) {
        return masterConfig_ == null ? com.google.cloud.dataproc.v1.InstanceGroupConfig.getDefaultInstance() : masterConfig_;
      } else {
        return masterConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * the master instance in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
     */
    public Builder setMasterConfig(com.google.cloud.dataproc.v1.InstanceGroupConfig value) {
      if (masterConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        masterConfig_ = value;
        onChanged();
      } else {
        masterConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * the master instance in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
     */
    public Builder setMasterConfig(
        com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder builderForValue) {
      if (masterConfigBuilder_ == null) {
        masterConfig_ = builderForValue.build();
        onChanged();
      } else {
        masterConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * the master instance in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
     */
    public Builder mergeMasterConfig(com.google.cloud.dataproc.v1.InstanceGroupConfig value) {
      if (masterConfigBuilder_ == null) {
        if (masterConfig_ != null) {
          masterConfig_ =
            com.google.cloud.dataproc.v1.InstanceGroupConfig.newBuilder(masterConfig_).mergeFrom(value).buildPartial();
        } else {
          masterConfig_ = value;
        }
        onChanged();
      } else {
        masterConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * the master instance in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
     */
    public Builder clearMasterConfig() {
      if (masterConfigBuilder_ == null) {
        masterConfig_ = null;
        onChanged();
      } else {
        masterConfig_ = null;
        masterConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * the master instance in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
     */
    public com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder getMasterConfigBuilder() {
      
      onChanged();
      return getMasterConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * the master instance in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
     */
    public com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder getMasterConfigOrBuilder() {
      if (masterConfigBuilder_ != null) {
        return masterConfigBuilder_.getMessageOrBuilder();
      } else {
        return masterConfig_ == null ?
            com.google.cloud.dataproc.v1.InstanceGroupConfig.getDefaultInstance() : masterConfig_;
      }
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * the master instance in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig master_config = 9;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.InstanceGroupConfig, com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder, com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder> 
        getMasterConfigFieldBuilder() {
      if (masterConfigBuilder_ == null) {
        masterConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1.InstanceGroupConfig, com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder, com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder>(
                getMasterConfig(),
                getParentForChildren(),
                isClean());
        masterConfig_ = null;
      }
      return masterConfigBuilder_;
    }

    private com.google.cloud.dataproc.v1.InstanceGroupConfig workerConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.InstanceGroupConfig, com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder, com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder> workerConfigBuilder_;
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
     */
    public boolean hasWorkerConfig() {
      return workerConfigBuilder_ != null || workerConfig_ != null;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
     */
    public com.google.cloud.dataproc.v1.InstanceGroupConfig getWorkerConfig() {
      if (workerConfigBuilder_ == null) {
        return workerConfig_ == null ? com.google.cloud.dataproc.v1.InstanceGroupConfig.getDefaultInstance() : workerConfig_;
      } else {
        return workerConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
     */
    public Builder setWorkerConfig(com.google.cloud.dataproc.v1.InstanceGroupConfig value) {
      if (workerConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        workerConfig_ = value;
        onChanged();
      } else {
        workerConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
     */
    public Builder setWorkerConfig(
        com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder builderForValue) {
      if (workerConfigBuilder_ == null) {
        workerConfig_ = builderForValue.build();
        onChanged();
      } else {
        workerConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
     */
    public Builder mergeWorkerConfig(com.google.cloud.dataproc.v1.InstanceGroupConfig value) {
      if (workerConfigBuilder_ == null) {
        if (workerConfig_ != null) {
          workerConfig_ =
            com.google.cloud.dataproc.v1.InstanceGroupConfig.newBuilder(workerConfig_).mergeFrom(value).buildPartial();
        } else {
          workerConfig_ = value;
        }
        onChanged();
      } else {
        workerConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
     */
    public Builder clearWorkerConfig() {
      if (workerConfigBuilder_ == null) {
        workerConfig_ = null;
        onChanged();
      } else {
        workerConfig_ = null;
        workerConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
     */
    public com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder getWorkerConfigBuilder() {
      
      onChanged();
      return getWorkerConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
     */
    public com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder getWorkerConfigOrBuilder() {
      if (workerConfigBuilder_ != null) {
        return workerConfigBuilder_.getMessageOrBuilder();
      } else {
        return workerConfig_ == null ?
            com.google.cloud.dataproc.v1.InstanceGroupConfig.getDefaultInstance() : workerConfig_;
      }
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig worker_config = 10;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.InstanceGroupConfig, com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder, com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder> 
        getWorkerConfigFieldBuilder() {
      if (workerConfigBuilder_ == null) {
        workerConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1.InstanceGroupConfig, com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder, com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder>(
                getWorkerConfig(),
                getParentForChildren(),
                isClean());
        workerConfig_ = null;
      }
      return workerConfigBuilder_;
    }

    private com.google.cloud.dataproc.v1.InstanceGroupConfig secondaryWorkerConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.InstanceGroupConfig, com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder, com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder> secondaryWorkerConfigBuilder_;
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * additional worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
     */
    public boolean hasSecondaryWorkerConfig() {
      return secondaryWorkerConfigBuilder_ != null || secondaryWorkerConfig_ != null;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * additional worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
     */
    public com.google.cloud.dataproc.v1.InstanceGroupConfig getSecondaryWorkerConfig() {
      if (secondaryWorkerConfigBuilder_ == null) {
        return secondaryWorkerConfig_ == null ? com.google.cloud.dataproc.v1.InstanceGroupConfig.getDefaultInstance() : secondaryWorkerConfig_;
      } else {
        return secondaryWorkerConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * additional worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
     */
    public Builder setSecondaryWorkerConfig(com.google.cloud.dataproc.v1.InstanceGroupConfig value) {
      if (secondaryWorkerConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        secondaryWorkerConfig_ = value;
        onChanged();
      } else {
        secondaryWorkerConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * additional worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
     */
    public Builder setSecondaryWorkerConfig(
        com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder builderForValue) {
      if (secondaryWorkerConfigBuilder_ == null) {
        secondaryWorkerConfig_ = builderForValue.build();
        onChanged();
      } else {
        secondaryWorkerConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * additional worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
     */
    public Builder mergeSecondaryWorkerConfig(com.google.cloud.dataproc.v1.InstanceGroupConfig value) {
      if (secondaryWorkerConfigBuilder_ == null) {
        if (secondaryWorkerConfig_ != null) {
          secondaryWorkerConfig_ =
            com.google.cloud.dataproc.v1.InstanceGroupConfig.newBuilder(secondaryWorkerConfig_).mergeFrom(value).buildPartial();
        } else {
          secondaryWorkerConfig_ = value;
        }
        onChanged();
      } else {
        secondaryWorkerConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * additional worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
     */
    public Builder clearSecondaryWorkerConfig() {
      if (secondaryWorkerConfigBuilder_ == null) {
        secondaryWorkerConfig_ = null;
        onChanged();
      } else {
        secondaryWorkerConfig_ = null;
        secondaryWorkerConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * additional worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
     */
    public com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder getSecondaryWorkerConfigBuilder() {
      
      onChanged();
      return getSecondaryWorkerConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * additional worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
     */
    public com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder getSecondaryWorkerConfigOrBuilder() {
      if (secondaryWorkerConfigBuilder_ != null) {
        return secondaryWorkerConfigBuilder_.getMessageOrBuilder();
      } else {
        return secondaryWorkerConfig_ == null ?
            com.google.cloud.dataproc.v1.InstanceGroupConfig.getDefaultInstance() : secondaryWorkerConfig_;
      }
    }
    /**
     * <pre>
     * Optional. The Google Compute Engine config settings for
     * additional worker instances in a cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.InstanceGroupConfig secondary_worker_config = 12;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.InstanceGroupConfig, com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder, com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder> 
        getSecondaryWorkerConfigFieldBuilder() {
      if (secondaryWorkerConfigBuilder_ == null) {
        secondaryWorkerConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1.InstanceGroupConfig, com.google.cloud.dataproc.v1.InstanceGroupConfig.Builder, com.google.cloud.dataproc.v1.InstanceGroupConfigOrBuilder>(
                getSecondaryWorkerConfig(),
                getParentForChildren(),
                isClean());
        secondaryWorkerConfig_ = null;
      }
      return secondaryWorkerConfigBuilder_;
    }

    private com.google.cloud.dataproc.v1.SoftwareConfig softwareConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.SoftwareConfig, com.google.cloud.dataproc.v1.SoftwareConfig.Builder, com.google.cloud.dataproc.v1.SoftwareConfigOrBuilder> softwareConfigBuilder_;
    /**
     * <pre>
     * Optional. The config settings for software inside the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
     */
    public boolean hasSoftwareConfig() {
      return softwareConfigBuilder_ != null || softwareConfig_ != null;
    }
    /**
     * <pre>
     * Optional. The config settings for software inside the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
     */
    public com.google.cloud.dataproc.v1.SoftwareConfig getSoftwareConfig() {
      if (softwareConfigBuilder_ == null) {
        return softwareConfig_ == null ? com.google.cloud.dataproc.v1.SoftwareConfig.getDefaultInstance() : softwareConfig_;
      } else {
        return softwareConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Optional. The config settings for software inside the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
     */
    public Builder setSoftwareConfig(com.google.cloud.dataproc.v1.SoftwareConfig value) {
      if (softwareConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        softwareConfig_ = value;
        onChanged();
      } else {
        softwareConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The config settings for software inside the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
     */
    public Builder setSoftwareConfig(
        com.google.cloud.dataproc.v1.SoftwareConfig.Builder builderForValue) {
      if (softwareConfigBuilder_ == null) {
        softwareConfig_ = builderForValue.build();
        onChanged();
      } else {
        softwareConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The config settings for software inside the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
     */
    public Builder mergeSoftwareConfig(com.google.cloud.dataproc.v1.SoftwareConfig value) {
      if (softwareConfigBuilder_ == null) {
        if (softwareConfig_ != null) {
          softwareConfig_ =
            com.google.cloud.dataproc.v1.SoftwareConfig.newBuilder(softwareConfig_).mergeFrom(value).buildPartial();
        } else {
          softwareConfig_ = value;
        }
        onChanged();
      } else {
        softwareConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The config settings for software inside the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
     */
    public Builder clearSoftwareConfig() {
      if (softwareConfigBuilder_ == null) {
        softwareConfig_ = null;
        onChanged();
      } else {
        softwareConfig_ = null;
        softwareConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The config settings for software inside the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
     */
    public com.google.cloud.dataproc.v1.SoftwareConfig.Builder getSoftwareConfigBuilder() {
      
      onChanged();
      return getSoftwareConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Optional. The config settings for software inside the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
     */
    public com.google.cloud.dataproc.v1.SoftwareConfigOrBuilder getSoftwareConfigOrBuilder() {
      if (softwareConfigBuilder_ != null) {
        return softwareConfigBuilder_.getMessageOrBuilder();
      } else {
        return softwareConfig_ == null ?
            com.google.cloud.dataproc.v1.SoftwareConfig.getDefaultInstance() : softwareConfig_;
      }
    }
    /**
     * <pre>
     * Optional. The config settings for software inside the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.SoftwareConfig software_config = 13;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.SoftwareConfig, com.google.cloud.dataproc.v1.SoftwareConfig.Builder, com.google.cloud.dataproc.v1.SoftwareConfigOrBuilder> 
        getSoftwareConfigFieldBuilder() {
      if (softwareConfigBuilder_ == null) {
        softwareConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1.SoftwareConfig, com.google.cloud.dataproc.v1.SoftwareConfig.Builder, com.google.cloud.dataproc.v1.SoftwareConfigOrBuilder>(
                getSoftwareConfig(),
                getParentForChildren(),
                isClean());
        softwareConfig_ = null;
      }
      return softwareConfigBuilder_;
    }

    private java.util.List<com.google.cloud.dataproc.v1.NodeInitializationAction> initializationActions_ =
      java.util.Collections.emptyList();
    private void ensureInitializationActionsIsMutable() {
      if (!((bitField0_ & 0x00000040) == 0x00000040)) {
        initializationActions_ = new java.util.ArrayList<com.google.cloud.dataproc.v1.NodeInitializationAction>(initializationActions_);
        bitField0_ |= 0x00000040;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.cloud.dataproc.v1.NodeInitializationAction, com.google.cloud.dataproc.v1.NodeInitializationAction.Builder, com.google.cloud.dataproc.v1.NodeInitializationActionOrBuilder> initializationActionsBuilder_;

    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public java.util.List<com.google.cloud.dataproc.v1.NodeInitializationAction> getInitializationActionsList() {
      if (initializationActionsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(initializationActions_);
      } else {
        return initializationActionsBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public int getInitializationActionsCount() {
      if (initializationActionsBuilder_ == null) {
        return initializationActions_.size();
      } else {
        return initializationActionsBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public com.google.cloud.dataproc.v1.NodeInitializationAction getInitializationActions(int index) {
      if (initializationActionsBuilder_ == null) {
        return initializationActions_.get(index);
      } else {
        return initializationActionsBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public Builder setInitializationActions(
        int index, com.google.cloud.dataproc.v1.NodeInitializationAction value) {
      if (initializationActionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureInitializationActionsIsMutable();
        initializationActions_.set(index, value);
        onChanged();
      } else {
        initializationActionsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public Builder setInitializationActions(
        int index, com.google.cloud.dataproc.v1.NodeInitializationAction.Builder builderForValue) {
      if (initializationActionsBuilder_ == null) {
        ensureInitializationActionsIsMutable();
        initializationActions_.set(index, builderForValue.build());
        onChanged();
      } else {
        initializationActionsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public Builder addInitializationActions(com.google.cloud.dataproc.v1.NodeInitializationAction value) {
      if (initializationActionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureInitializationActionsIsMutable();
        initializationActions_.add(value);
        onChanged();
      } else {
        initializationActionsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public Builder addInitializationActions(
        int index, com.google.cloud.dataproc.v1.NodeInitializationAction value) {
      if (initializationActionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureInitializationActionsIsMutable();
        initializationActions_.add(index, value);
        onChanged();
      } else {
        initializationActionsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public Builder addInitializationActions(
        com.google.cloud.dataproc.v1.NodeInitializationAction.Builder builderForValue) {
      if (initializationActionsBuilder_ == null) {
        ensureInitializationActionsIsMutable();
        initializationActions_.add(builderForValue.build());
        onChanged();
      } else {
        initializationActionsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public Builder addInitializationActions(
        int index, com.google.cloud.dataproc.v1.NodeInitializationAction.Builder builderForValue) {
      if (initializationActionsBuilder_ == null) {
        ensureInitializationActionsIsMutable();
        initializationActions_.add(index, builderForValue.build());
        onChanged();
      } else {
        initializationActionsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public Builder addAllInitializationActions(
        java.lang.Iterable<? extends com.google.cloud.dataproc.v1.NodeInitializationAction> values) {
      if (initializationActionsBuilder_ == null) {
        ensureInitializationActionsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, initializationActions_);
        onChanged();
      } else {
        initializationActionsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public Builder clearInitializationActions() {
      if (initializationActionsBuilder_ == null) {
        initializationActions_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000040);
        onChanged();
      } else {
        initializationActionsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public Builder removeInitializationActions(int index) {
      if (initializationActionsBuilder_ == null) {
        ensureInitializationActionsIsMutable();
        initializationActions_.remove(index);
        onChanged();
      } else {
        initializationActionsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public com.google.cloud.dataproc.v1.NodeInitializationAction.Builder getInitializationActionsBuilder(
        int index) {
      return getInitializationActionsFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public com.google.cloud.dataproc.v1.NodeInitializationActionOrBuilder getInitializationActionsOrBuilder(
        int index) {
      if (initializationActionsBuilder_ == null) {
        return initializationActions_.get(index);  } else {
        return initializationActionsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public java.util.List<? extends com.google.cloud.dataproc.v1.NodeInitializationActionOrBuilder> 
         getInitializationActionsOrBuilderList() {
      if (initializationActionsBuilder_ != null) {
        return initializationActionsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(initializationActions_);
      }
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public com.google.cloud.dataproc.v1.NodeInitializationAction.Builder addInitializationActionsBuilder() {
      return getInitializationActionsFieldBuilder().addBuilder(
          com.google.cloud.dataproc.v1.NodeInitializationAction.getDefaultInstance());
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public com.google.cloud.dataproc.v1.NodeInitializationAction.Builder addInitializationActionsBuilder(
        int index) {
      return getInitializationActionsFieldBuilder().addBuilder(
          index, com.google.cloud.dataproc.v1.NodeInitializationAction.getDefaultInstance());
    }
    /**
     * <pre>
     * Optional. Commands to execute on each node after config is
     * completed. By default, executables are run on master and all worker nodes.
     * You can test a node's `role` metadata to run an executable on
     * a master or worker node, as shown below using `curl` (you can also use `wget`):
     *     ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
     *     if [[ "${ROLE}" == 'Master' ]]; then
     *       ... master specific actions ...
     *     else
     *       ... worker specific actions ...
     *     fi
     * </pre>
     *
     * <code>repeated .google.cloud.dataproc.v1.NodeInitializationAction initialization_actions = 11;</code>
     */
    public java.util.List<com.google.cloud.dataproc.v1.NodeInitializationAction.Builder> 
         getInitializationActionsBuilderList() {
      return getInitializationActionsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.cloud.dataproc.v1.NodeInitializationAction, com.google.cloud.dataproc.v1.NodeInitializationAction.Builder, com.google.cloud.dataproc.v1.NodeInitializationActionOrBuilder> 
        getInitializationActionsFieldBuilder() {
      if (initializationActionsBuilder_ == null) {
        initializationActionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.dataproc.v1.NodeInitializationAction, com.google.cloud.dataproc.v1.NodeInitializationAction.Builder, com.google.cloud.dataproc.v1.NodeInitializationActionOrBuilder>(
                initializationActions_,
                ((bitField0_ & 0x00000040) == 0x00000040),
                getParentForChildren(),
                isClean());
        initializationActions_ = null;
      }
      return initializationActionsBuilder_;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:google.cloud.dataproc.v1.ClusterConfig)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.dataproc.v1.ClusterConfig)
  private static final com.google.cloud.dataproc.v1.ClusterConfig DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.cloud.dataproc.v1.ClusterConfig();
  }

  public static com.google.cloud.dataproc.v1.ClusterConfig getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ClusterConfig>
      PARSER = new com.google.protobuf.AbstractParser<ClusterConfig>() {
    @java.lang.Override
    public ClusterConfig parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new ClusterConfig(input, extensionRegistry);
    }
  };

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

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

  @java.lang.Override
  public com.google.cloud.dataproc.v1.ClusterConfig getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

