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

package com.google.cloud.dataproc.v1;

/**
 * <pre>
 * A Cloud Dataproc job for running [Apache Pig](https://pig.apache.org/)
 * queries on YARN.
 * </pre>
 *
 * Protobuf type {@code google.cloud.dataproc.v1.PigJob}
 */
public  final class PigJob extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.dataproc.v1.PigJob)
    PigJobOrBuilder {
private static final long serialVersionUID = 0L;
  // Use PigJob.newBuilder() to construct.
  private PigJob(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private PigJob() {
    continueOnFailure_ = false;
    jarFileUris_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private PigJob(
      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;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();
            queriesCase_ = 1;
            queries_ = s;
            break;
          }
          case 18: {
            com.google.cloud.dataproc.v1.QueryList.Builder subBuilder = null;
            if (queriesCase_ == 2) {
              subBuilder = ((com.google.cloud.dataproc.v1.QueryList) queries_).toBuilder();
            }
            queries_ =
                input.readMessage(com.google.cloud.dataproc.v1.QueryList.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((com.google.cloud.dataproc.v1.QueryList) queries_);
              queries_ = subBuilder.buildPartial();
            }
            queriesCase_ = 2;
            break;
          }
          case 24: {

            continueOnFailure_ = input.readBool();
            break;
          }
          case 34: {
            if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
              scriptVariables_ = com.google.protobuf.MapField.newMapField(
                  ScriptVariablesDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000008;
            }
            com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
            scriptVariables__ = input.readMessage(
                ScriptVariablesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            scriptVariables_.getMutableMap().put(
                scriptVariables__.getKey(), scriptVariables__.getValue());
            break;
          }
          case 42: {
            if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
              properties_ = com.google.protobuf.MapField.newMapField(
                  PropertiesDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000010;
            }
            com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
            properties__ = input.readMessage(
                PropertiesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            properties_.getMutableMap().put(
                properties__.getKey(), properties__.getValue());
            break;
          }
          case 50: {
            java.lang.String s = input.readStringRequireUtf8();
            if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
              jarFileUris_ = new com.google.protobuf.LazyStringArrayList();
              mutable_bitField0_ |= 0x00000020;
            }
            jarFileUris_.add(s);
            break;
          }
          case 58: {
            com.google.cloud.dataproc.v1.LoggingConfig.Builder subBuilder = null;
            if (loggingConfig_ != null) {
              subBuilder = loggingConfig_.toBuilder();
            }
            loggingConfig_ = input.readMessage(com.google.cloud.dataproc.v1.LoggingConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(loggingConfig_);
              loggingConfig_ = subBuilder.buildPartial();
            }

            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_ & 0x00000020) == 0x00000020)) {
        jarFileUris_ = jarFileUris_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.cloud.dataproc.v1.JobsProto.internal_static_google_cloud_dataproc_v1_PigJob_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  protected com.google.protobuf.MapField internalGetMapField(
      int number) {
    switch (number) {
      case 4:
        return internalGetScriptVariables();
      case 5:
        return internalGetProperties();
      default:
        throw new RuntimeException(
            "Invalid map field number: " + number);
    }
  }
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.dataproc.v1.JobsProto.internal_static_google_cloud_dataproc_v1_PigJob_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.dataproc.v1.PigJob.class, com.google.cloud.dataproc.v1.PigJob.Builder.class);
  }

  private int bitField0_;
  private int queriesCase_ = 0;
  private java.lang.Object queries_;
  public enum QueriesCase
      implements com.google.protobuf.Internal.EnumLite {
    QUERY_FILE_URI(1),
    QUERY_LIST(2),
    QUERIES_NOT_SET(0);
    private final int value;
    private QueriesCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static QueriesCase valueOf(int value) {
      return forNumber(value);
    }

    public static QueriesCase forNumber(int value) {
      switch (value) {
        case 1: return QUERY_FILE_URI;
        case 2: return QUERY_LIST;
        case 0: return QUERIES_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public QueriesCase
  getQueriesCase() {
    return QueriesCase.forNumber(
        queriesCase_);
  }

  public static final int QUERY_FILE_URI_FIELD_NUMBER = 1;
  /**
   * <pre>
   * The HCFS URI of the script that contains the Pig queries.
   * </pre>
   *
   * <code>string query_file_uri = 1;</code>
   */
  public java.lang.String getQueryFileUri() {
    java.lang.Object ref = "";
    if (queriesCase_ == 1) {
      ref = queries_;
    }
    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();
      if (queriesCase_ == 1) {
        queries_ = s;
      }
      return s;
    }
  }
  /**
   * <pre>
   * The HCFS URI of the script that contains the Pig queries.
   * </pre>
   *
   * <code>string query_file_uri = 1;</code>
   */
  public com.google.protobuf.ByteString
      getQueryFileUriBytes() {
    java.lang.Object ref = "";
    if (queriesCase_ == 1) {
      ref = queries_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      if (queriesCase_ == 1) {
        queries_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int QUERY_LIST_FIELD_NUMBER = 2;
  /**
   * <pre>
   * A list of queries.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
   */
  public boolean hasQueryList() {
    return queriesCase_ == 2;
  }
  /**
   * <pre>
   * A list of queries.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
   */
  public com.google.cloud.dataproc.v1.QueryList getQueryList() {
    if (queriesCase_ == 2) {
       return (com.google.cloud.dataproc.v1.QueryList) queries_;
    }
    return com.google.cloud.dataproc.v1.QueryList.getDefaultInstance();
  }
  /**
   * <pre>
   * A list of queries.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
   */
  public com.google.cloud.dataproc.v1.QueryListOrBuilder getQueryListOrBuilder() {
    if (queriesCase_ == 2) {
       return (com.google.cloud.dataproc.v1.QueryList) queries_;
    }
    return com.google.cloud.dataproc.v1.QueryList.getDefaultInstance();
  }

  public static final int CONTINUE_ON_FAILURE_FIELD_NUMBER = 3;
  private boolean continueOnFailure_;
  /**
   * <pre>
   * Optional. Whether to continue executing queries if a query fails.
   * The default value is `false`. Setting to `true` can be useful when executing
   * independent parallel queries.
   * </pre>
   *
   * <code>bool continue_on_failure = 3;</code>
   */
  public boolean getContinueOnFailure() {
    return continueOnFailure_;
  }

  public static final int SCRIPT_VARIABLES_FIELD_NUMBER = 4;
  private static final class ScriptVariablesDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.String, java.lang.String> defaultEntry =
            com.google.protobuf.MapEntry
            .<java.lang.String, java.lang.String>newDefaultInstance(
                com.google.cloud.dataproc.v1.JobsProto.internal_static_google_cloud_dataproc_v1_PigJob_ScriptVariablesEntry_descriptor, 
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.STRING,
                "");
  }
  private com.google.protobuf.MapField<
      java.lang.String, java.lang.String> scriptVariables_;
  private com.google.protobuf.MapField<java.lang.String, java.lang.String>
  internalGetScriptVariables() {
    if (scriptVariables_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          ScriptVariablesDefaultEntryHolder.defaultEntry);
    }
    return scriptVariables_;
  }

  public int getScriptVariablesCount() {
    return internalGetScriptVariables().getMap().size();
  }
  /**
   * <pre>
   * Optional. Mapping of query variable names to values (equivalent to the Pig
   * command: `name=[value]`).
   * </pre>
   *
   * <code>map&lt;string, string&gt; script_variables = 4;</code>
   */

  public boolean containsScriptVariables(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetScriptVariables().getMap().containsKey(key);
  }
  /**
   * Use {@link #getScriptVariablesMap()} instead.
   */
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getScriptVariables() {
    return getScriptVariablesMap();
  }
  /**
   * <pre>
   * Optional. Mapping of query variable names to values (equivalent to the Pig
   * command: `name=[value]`).
   * </pre>
   *
   * <code>map&lt;string, string&gt; script_variables = 4;</code>
   */

  public java.util.Map<java.lang.String, java.lang.String> getScriptVariablesMap() {
    return internalGetScriptVariables().getMap();
  }
  /**
   * <pre>
   * Optional. Mapping of query variable names to values (equivalent to the Pig
   * command: `name=[value]`).
   * </pre>
   *
   * <code>map&lt;string, string&gt; script_variables = 4;</code>
   */

  public java.lang.String getScriptVariablesOrDefault(
      java.lang.String key,
      java.lang.String defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetScriptVariables().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * <pre>
   * Optional. Mapping of query variable names to values (equivalent to the Pig
   * command: `name=[value]`).
   * </pre>
   *
   * <code>map&lt;string, string&gt; script_variables = 4;</code>
   */

  public java.lang.String getScriptVariablesOrThrow(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetScriptVariables().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int PROPERTIES_FIELD_NUMBER = 5;
  private static final class PropertiesDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.String, java.lang.String> defaultEntry =
            com.google.protobuf.MapEntry
            .<java.lang.String, java.lang.String>newDefaultInstance(
                com.google.cloud.dataproc.v1.JobsProto.internal_static_google_cloud_dataproc_v1_PigJob_PropertiesEntry_descriptor, 
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.STRING,
                "");
  }
  private com.google.protobuf.MapField<
      java.lang.String, java.lang.String> properties_;
  private com.google.protobuf.MapField<java.lang.String, java.lang.String>
  internalGetProperties() {
    if (properties_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          PropertiesDefaultEntryHolder.defaultEntry);
    }
    return properties_;
  }

  public int getPropertiesCount() {
    return internalGetProperties().getMap().size();
  }
  /**
   * <pre>
   * Optional. A mapping of property names to values, used to configure Pig.
   * Properties that conflict with values set by the Cloud Dataproc API may be
   * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
   * /etc/pig/conf/pig.properties, and classes in user code.
   * </pre>
   *
   * <code>map&lt;string, string&gt; properties = 5;</code>
   */

  public boolean containsProperties(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetProperties().getMap().containsKey(key);
  }
  /**
   * Use {@link #getPropertiesMap()} instead.
   */
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getProperties() {
    return getPropertiesMap();
  }
  /**
   * <pre>
   * Optional. A mapping of property names to values, used to configure Pig.
   * Properties that conflict with values set by the Cloud Dataproc API may be
   * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
   * /etc/pig/conf/pig.properties, and classes in user code.
   * </pre>
   *
   * <code>map&lt;string, string&gt; properties = 5;</code>
   */

  public java.util.Map<java.lang.String, java.lang.String> getPropertiesMap() {
    return internalGetProperties().getMap();
  }
  /**
   * <pre>
   * Optional. A mapping of property names to values, used to configure Pig.
   * Properties that conflict with values set by the Cloud Dataproc API may be
   * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
   * /etc/pig/conf/pig.properties, and classes in user code.
   * </pre>
   *
   * <code>map&lt;string, string&gt; properties = 5;</code>
   */

  public java.lang.String getPropertiesOrDefault(
      java.lang.String key,
      java.lang.String defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetProperties().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * <pre>
   * Optional. A mapping of property names to values, used to configure Pig.
   * Properties that conflict with values set by the Cloud Dataproc API may be
   * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
   * /etc/pig/conf/pig.properties, and classes in user code.
   * </pre>
   *
   * <code>map&lt;string, string&gt; properties = 5;</code>
   */

  public java.lang.String getPropertiesOrThrow(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetProperties().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int JAR_FILE_URIS_FIELD_NUMBER = 6;
  private com.google.protobuf.LazyStringList jarFileUris_;
  /**
   * <pre>
   * Optional. HCFS URIs of jar files to add to the CLASSPATH of
   * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
   * </pre>
   *
   * <code>repeated string jar_file_uris = 6;</code>
   */
  public com.google.protobuf.ProtocolStringList
      getJarFileUrisList() {
    return jarFileUris_;
  }
  /**
   * <pre>
   * Optional. HCFS URIs of jar files to add to the CLASSPATH of
   * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
   * </pre>
   *
   * <code>repeated string jar_file_uris = 6;</code>
   */
  public int getJarFileUrisCount() {
    return jarFileUris_.size();
  }
  /**
   * <pre>
   * Optional. HCFS URIs of jar files to add to the CLASSPATH of
   * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
   * </pre>
   *
   * <code>repeated string jar_file_uris = 6;</code>
   */
  public java.lang.String getJarFileUris(int index) {
    return jarFileUris_.get(index);
  }
  /**
   * <pre>
   * Optional. HCFS URIs of jar files to add to the CLASSPATH of
   * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
   * </pre>
   *
   * <code>repeated string jar_file_uris = 6;</code>
   */
  public com.google.protobuf.ByteString
      getJarFileUrisBytes(int index) {
    return jarFileUris_.getByteString(index);
  }

  public static final int LOGGING_CONFIG_FIELD_NUMBER = 7;
  private com.google.cloud.dataproc.v1.LoggingConfig loggingConfig_;
  /**
   * <pre>
   * Optional. The runtime log config for job execution.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
   */
  public boolean hasLoggingConfig() {
    return loggingConfig_ != null;
  }
  /**
   * <pre>
   * Optional. The runtime log config for job execution.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
   */
  public com.google.cloud.dataproc.v1.LoggingConfig getLoggingConfig() {
    return loggingConfig_ == null ? com.google.cloud.dataproc.v1.LoggingConfig.getDefaultInstance() : loggingConfig_;
  }
  /**
   * <pre>
   * Optional. The runtime log config for job execution.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
   */
  public com.google.cloud.dataproc.v1.LoggingConfigOrBuilder getLoggingConfigOrBuilder() {
    return getLoggingConfig();
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (queriesCase_ == 1) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, queries_);
    }
    if (queriesCase_ == 2) {
      output.writeMessage(2, (com.google.cloud.dataproc.v1.QueryList) queries_);
    }
    if (continueOnFailure_ != false) {
      output.writeBool(3, continueOnFailure_);
    }
    com.google.protobuf.GeneratedMessageV3
      .serializeStringMapTo(
        output,
        internalGetScriptVariables(),
        ScriptVariablesDefaultEntryHolder.defaultEntry,
        4);
    com.google.protobuf.GeneratedMessageV3
      .serializeStringMapTo(
        output,
        internalGetProperties(),
        PropertiesDefaultEntryHolder.defaultEntry,
        5);
    for (int i = 0; i < jarFileUris_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, jarFileUris_.getRaw(i));
    }
    if (loggingConfig_ != null) {
      output.writeMessage(7, getLoggingConfig());
    }
    unknownFields.writeTo(output);
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (queriesCase_ == 1) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, queries_);
    }
    if (queriesCase_ == 2) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, (com.google.cloud.dataproc.v1.QueryList) queries_);
    }
    if (continueOnFailure_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(3, continueOnFailure_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
         : internalGetScriptVariables().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
      scriptVariables__ = ScriptVariablesDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, scriptVariables__);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
         : internalGetProperties().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
      properties__ = PropertiesDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, properties__);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < jarFileUris_.size(); i++) {
        dataSize += computeStringSizeNoTag(jarFileUris_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getJarFileUrisList().size();
    }
    if (loggingConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(7, getLoggingConfig());
    }
    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.PigJob)) {
      return super.equals(obj);
    }
    com.google.cloud.dataproc.v1.PigJob other = (com.google.cloud.dataproc.v1.PigJob) obj;

    boolean result = true;
    result = result && (getContinueOnFailure()
        == other.getContinueOnFailure());
    result = result && internalGetScriptVariables().equals(
        other.internalGetScriptVariables());
    result = result && internalGetProperties().equals(
        other.internalGetProperties());
    result = result && getJarFileUrisList()
        .equals(other.getJarFileUrisList());
    result = result && (hasLoggingConfig() == other.hasLoggingConfig());
    if (hasLoggingConfig()) {
      result = result && getLoggingConfig()
          .equals(other.getLoggingConfig());
    }
    result = result && getQueriesCase().equals(
        other.getQueriesCase());
    if (!result) return false;
    switch (queriesCase_) {
      case 1:
        result = result && getQueryFileUri()
            .equals(other.getQueryFileUri());
        break;
      case 2:
        result = result && getQueryList()
            .equals(other.getQueryList());
        break;
      case 0:
      default:
    }
    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) + CONTINUE_ON_FAILURE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getContinueOnFailure());
    if (!internalGetScriptVariables().getMap().isEmpty()) {
      hash = (37 * hash) + SCRIPT_VARIABLES_FIELD_NUMBER;
      hash = (53 * hash) + internalGetScriptVariables().hashCode();
    }
    if (!internalGetProperties().getMap().isEmpty()) {
      hash = (37 * hash) + PROPERTIES_FIELD_NUMBER;
      hash = (53 * hash) + internalGetProperties().hashCode();
    }
    if (getJarFileUrisCount() > 0) {
      hash = (37 * hash) + JAR_FILE_URIS_FIELD_NUMBER;
      hash = (53 * hash) + getJarFileUrisList().hashCode();
    }
    if (hasLoggingConfig()) {
      hash = (37 * hash) + LOGGING_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getLoggingConfig().hashCode();
    }
    switch (queriesCase_) {
      case 1:
        hash = (37 * hash) + QUERY_FILE_URI_FIELD_NUMBER;
        hash = (53 * hash) + getQueryFileUri().hashCode();
        break;
      case 2:
        hash = (37 * hash) + QUERY_LIST_FIELD_NUMBER;
        hash = (53 * hash) + getQueryList().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.dataproc.v1.PigJob parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dataproc.v1.PigJob 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.PigJob parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dataproc.v1.PigJob 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.PigJob parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dataproc.v1.PigJob 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.PigJob parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.dataproc.v1.PigJob 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.PigJob parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.dataproc.v1.PigJob 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.PigJob 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.PigJob parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.cloud.dataproc.v1.PigJob prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  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>
   * A Cloud Dataproc job for running [Apache Pig](https://pig.apache.org/)
   * queries on YARN.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dataproc.v1.PigJob}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dataproc.v1.PigJob)
      com.google.cloud.dataproc.v1.PigJobOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.dataproc.v1.JobsProto.internal_static_google_cloud_dataproc_v1_PigJob_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 4:
          return internalGetScriptVariables();
        case 5:
          return internalGetProperties();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(
        int number) {
      switch (number) {
        case 4:
          return internalGetMutableScriptVariables();
        case 5:
          return internalGetMutableProperties();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.dataproc.v1.JobsProto.internal_static_google_cloud_dataproc_v1_PigJob_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.dataproc.v1.PigJob.class, com.google.cloud.dataproc.v1.PigJob.Builder.class);
    }

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

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      continueOnFailure_ = false;

      internalGetMutableScriptVariables().clear();
      internalGetMutableProperties().clear();
      jarFileUris_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000020);
      if (loggingConfigBuilder_ == null) {
        loggingConfig_ = null;
      } else {
        loggingConfig_ = null;
        loggingConfigBuilder_ = null;
      }
      queriesCase_ = 0;
      queries_ = null;
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.dataproc.v1.JobsProto.internal_static_google_cloud_dataproc_v1_PigJob_descriptor;
    }

    public com.google.cloud.dataproc.v1.PigJob getDefaultInstanceForType() {
      return com.google.cloud.dataproc.v1.PigJob.getDefaultInstance();
    }

    public com.google.cloud.dataproc.v1.PigJob build() {
      com.google.cloud.dataproc.v1.PigJob result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.cloud.dataproc.v1.PigJob buildPartial() {
      com.google.cloud.dataproc.v1.PigJob result = new com.google.cloud.dataproc.v1.PigJob(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (queriesCase_ == 1) {
        result.queries_ = queries_;
      }
      if (queriesCase_ == 2) {
        if (queryListBuilder_ == null) {
          result.queries_ = queries_;
        } else {
          result.queries_ = queryListBuilder_.build();
        }
      }
      result.continueOnFailure_ = continueOnFailure_;
      result.scriptVariables_ = internalGetScriptVariables();
      result.scriptVariables_.makeImmutable();
      result.properties_ = internalGetProperties();
      result.properties_.makeImmutable();
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        jarFileUris_ = jarFileUris_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000020);
      }
      result.jarFileUris_ = jarFileUris_;
      if (loggingConfigBuilder_ == null) {
        result.loggingConfig_ = loggingConfig_;
      } else {
        result.loggingConfig_ = loggingConfigBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      result.queriesCase_ = queriesCase_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.google.cloud.dataproc.v1.PigJob other) {
      if (other == com.google.cloud.dataproc.v1.PigJob.getDefaultInstance()) return this;
      if (other.getContinueOnFailure() != false) {
        setContinueOnFailure(other.getContinueOnFailure());
      }
      internalGetMutableScriptVariables().mergeFrom(
          other.internalGetScriptVariables());
      internalGetMutableProperties().mergeFrom(
          other.internalGetProperties());
      if (!other.jarFileUris_.isEmpty()) {
        if (jarFileUris_.isEmpty()) {
          jarFileUris_ = other.jarFileUris_;
          bitField0_ = (bitField0_ & ~0x00000020);
        } else {
          ensureJarFileUrisIsMutable();
          jarFileUris_.addAll(other.jarFileUris_);
        }
        onChanged();
      }
      if (other.hasLoggingConfig()) {
        mergeLoggingConfig(other.getLoggingConfig());
      }
      switch (other.getQueriesCase()) {
        case QUERY_FILE_URI: {
          queriesCase_ = 1;
          queries_ = other.queries_;
          onChanged();
          break;
        }
        case QUERY_LIST: {
          mergeQueryList(other.getQueryList());
          break;
        }
        case QUERIES_NOT_SET: {
          break;
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.dataproc.v1.PigJob parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.dataproc.v1.PigJob) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int queriesCase_ = 0;
    private java.lang.Object queries_;
    public QueriesCase
        getQueriesCase() {
      return QueriesCase.forNumber(
          queriesCase_);
    }

    public Builder clearQueries() {
      queriesCase_ = 0;
      queries_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    /**
     * <pre>
     * The HCFS URI of the script that contains the Pig queries.
     * </pre>
     *
     * <code>string query_file_uri = 1;</code>
     */
    public java.lang.String getQueryFileUri() {
      java.lang.Object ref = "";
      if (queriesCase_ == 1) {
        ref = queries_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (queriesCase_ == 1) {
          queries_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The HCFS URI of the script that contains the Pig queries.
     * </pre>
     *
     * <code>string query_file_uri = 1;</code>
     */
    public com.google.protobuf.ByteString
        getQueryFileUriBytes() {
      java.lang.Object ref = "";
      if (queriesCase_ == 1) {
        ref = queries_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        if (queriesCase_ == 1) {
          queries_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The HCFS URI of the script that contains the Pig queries.
     * </pre>
     *
     * <code>string query_file_uri = 1;</code>
     */
    public Builder setQueryFileUri(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  queriesCase_ = 1;
      queries_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The HCFS URI of the script that contains the Pig queries.
     * </pre>
     *
     * <code>string query_file_uri = 1;</code>
     */
    public Builder clearQueryFileUri() {
      if (queriesCase_ == 1) {
        queriesCase_ = 0;
        queries_ = null;
        onChanged();
      }
      return this;
    }
    /**
     * <pre>
     * The HCFS URI of the script that contains the Pig queries.
     * </pre>
     *
     * <code>string query_file_uri = 1;</code>
     */
    public Builder setQueryFileUriBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      queriesCase_ = 1;
      queries_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.QueryList, com.google.cloud.dataproc.v1.QueryList.Builder, com.google.cloud.dataproc.v1.QueryListOrBuilder> queryListBuilder_;
    /**
     * <pre>
     * A list of queries.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
     */
    public boolean hasQueryList() {
      return queriesCase_ == 2;
    }
    /**
     * <pre>
     * A list of queries.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
     */
    public com.google.cloud.dataproc.v1.QueryList getQueryList() {
      if (queryListBuilder_ == null) {
        if (queriesCase_ == 2) {
          return (com.google.cloud.dataproc.v1.QueryList) queries_;
        }
        return com.google.cloud.dataproc.v1.QueryList.getDefaultInstance();
      } else {
        if (queriesCase_ == 2) {
          return queryListBuilder_.getMessage();
        }
        return com.google.cloud.dataproc.v1.QueryList.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * A list of queries.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
     */
    public Builder setQueryList(com.google.cloud.dataproc.v1.QueryList value) {
      if (queryListBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        queries_ = value;
        onChanged();
      } else {
        queryListBuilder_.setMessage(value);
      }
      queriesCase_ = 2;
      return this;
    }
    /**
     * <pre>
     * A list of queries.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
     */
    public Builder setQueryList(
        com.google.cloud.dataproc.v1.QueryList.Builder builderForValue) {
      if (queryListBuilder_ == null) {
        queries_ = builderForValue.build();
        onChanged();
      } else {
        queryListBuilder_.setMessage(builderForValue.build());
      }
      queriesCase_ = 2;
      return this;
    }
    /**
     * <pre>
     * A list of queries.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
     */
    public Builder mergeQueryList(com.google.cloud.dataproc.v1.QueryList value) {
      if (queryListBuilder_ == null) {
        if (queriesCase_ == 2 &&
            queries_ != com.google.cloud.dataproc.v1.QueryList.getDefaultInstance()) {
          queries_ = com.google.cloud.dataproc.v1.QueryList.newBuilder((com.google.cloud.dataproc.v1.QueryList) queries_)
              .mergeFrom(value).buildPartial();
        } else {
          queries_ = value;
        }
        onChanged();
      } else {
        if (queriesCase_ == 2) {
          queryListBuilder_.mergeFrom(value);
        }
        queryListBuilder_.setMessage(value);
      }
      queriesCase_ = 2;
      return this;
    }
    /**
     * <pre>
     * A list of queries.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
     */
    public Builder clearQueryList() {
      if (queryListBuilder_ == null) {
        if (queriesCase_ == 2) {
          queriesCase_ = 0;
          queries_ = null;
          onChanged();
        }
      } else {
        if (queriesCase_ == 2) {
          queriesCase_ = 0;
          queries_ = null;
        }
        queryListBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * A list of queries.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
     */
    public com.google.cloud.dataproc.v1.QueryList.Builder getQueryListBuilder() {
      return getQueryListFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * A list of queries.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
     */
    public com.google.cloud.dataproc.v1.QueryListOrBuilder getQueryListOrBuilder() {
      if ((queriesCase_ == 2) && (queryListBuilder_ != null)) {
        return queryListBuilder_.getMessageOrBuilder();
      } else {
        if (queriesCase_ == 2) {
          return (com.google.cloud.dataproc.v1.QueryList) queries_;
        }
        return com.google.cloud.dataproc.v1.QueryList.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * A list of queries.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.QueryList query_list = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.QueryList, com.google.cloud.dataproc.v1.QueryList.Builder, com.google.cloud.dataproc.v1.QueryListOrBuilder> 
        getQueryListFieldBuilder() {
      if (queryListBuilder_ == null) {
        if (!(queriesCase_ == 2)) {
          queries_ = com.google.cloud.dataproc.v1.QueryList.getDefaultInstance();
        }
        queryListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1.QueryList, com.google.cloud.dataproc.v1.QueryList.Builder, com.google.cloud.dataproc.v1.QueryListOrBuilder>(
                (com.google.cloud.dataproc.v1.QueryList) queries_,
                getParentForChildren(),
                isClean());
        queries_ = null;
      }
      queriesCase_ = 2;
      onChanged();;
      return queryListBuilder_;
    }

    private boolean continueOnFailure_ ;
    /**
     * <pre>
     * Optional. Whether to continue executing queries if a query fails.
     * The default value is `false`. Setting to `true` can be useful when executing
     * independent parallel queries.
     * </pre>
     *
     * <code>bool continue_on_failure = 3;</code>
     */
    public boolean getContinueOnFailure() {
      return continueOnFailure_;
    }
    /**
     * <pre>
     * Optional. Whether to continue executing queries if a query fails.
     * The default value is `false`. Setting to `true` can be useful when executing
     * independent parallel queries.
     * </pre>
     *
     * <code>bool continue_on_failure = 3;</code>
     */
    public Builder setContinueOnFailure(boolean value) {
      
      continueOnFailure_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. Whether to continue executing queries if a query fails.
     * The default value is `false`. Setting to `true` can be useful when executing
     * independent parallel queries.
     * </pre>
     *
     * <code>bool continue_on_failure = 3;</code>
     */
    public Builder clearContinueOnFailure() {
      
      continueOnFailure_ = false;
      onChanged();
      return this;
    }

    private com.google.protobuf.MapField<
        java.lang.String, java.lang.String> scriptVariables_;
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetScriptVariables() {
      if (scriptVariables_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            ScriptVariablesDefaultEntryHolder.defaultEntry);
      }
      return scriptVariables_;
    }
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetMutableScriptVariables() {
      onChanged();;
      if (scriptVariables_ == null) {
        scriptVariables_ = com.google.protobuf.MapField.newMapField(
            ScriptVariablesDefaultEntryHolder.defaultEntry);
      }
      if (!scriptVariables_.isMutable()) {
        scriptVariables_ = scriptVariables_.copy();
      }
      return scriptVariables_;
    }

    public int getScriptVariablesCount() {
      return internalGetScriptVariables().getMap().size();
    }
    /**
     * <pre>
     * Optional. Mapping of query variable names to values (equivalent to the Pig
     * command: `name=[value]`).
     * </pre>
     *
     * <code>map&lt;string, string&gt; script_variables = 4;</code>
     */

    public boolean containsScriptVariables(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      return internalGetScriptVariables().getMap().containsKey(key);
    }
    /**
     * Use {@link #getScriptVariablesMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getScriptVariables() {
      return getScriptVariablesMap();
    }
    /**
     * <pre>
     * Optional. Mapping of query variable names to values (equivalent to the Pig
     * command: `name=[value]`).
     * </pre>
     *
     * <code>map&lt;string, string&gt; script_variables = 4;</code>
     */

    public java.util.Map<java.lang.String, java.lang.String> getScriptVariablesMap() {
      return internalGetScriptVariables().getMap();
    }
    /**
     * <pre>
     * Optional. Mapping of query variable names to values (equivalent to the Pig
     * command: `name=[value]`).
     * </pre>
     *
     * <code>map&lt;string, string&gt; script_variables = 4;</code>
     */

    public java.lang.String getScriptVariablesOrDefault(
        java.lang.String key,
        java.lang.String defaultValue) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetScriptVariables().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * Optional. Mapping of query variable names to values (equivalent to the Pig
     * command: `name=[value]`).
     * </pre>
     *
     * <code>map&lt;string, string&gt; script_variables = 4;</code>
     */

    public java.lang.String getScriptVariablesOrThrow(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetScriptVariables().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearScriptVariables() {
      internalGetMutableScriptVariables().getMutableMap()
          .clear();
      return this;
    }
    /**
     * <pre>
     * Optional. Mapping of query variable names to values (equivalent to the Pig
     * command: `name=[value]`).
     * </pre>
     *
     * <code>map&lt;string, string&gt; script_variables = 4;</code>
     */

    public Builder removeScriptVariables(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableScriptVariables().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String>
    getMutableScriptVariables() {
      return internalGetMutableScriptVariables().getMutableMap();
    }
    /**
     * <pre>
     * Optional. Mapping of query variable names to values (equivalent to the Pig
     * command: `name=[value]`).
     * </pre>
     *
     * <code>map&lt;string, string&gt; script_variables = 4;</code>
     */
    public Builder putScriptVariables(
        java.lang.String key,
        java.lang.String value) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      if (value == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableScriptVariables().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     * <pre>
     * Optional. Mapping of query variable names to values (equivalent to the Pig
     * command: `name=[value]`).
     * </pre>
     *
     * <code>map&lt;string, string&gt; script_variables = 4;</code>
     */

    public Builder putAllScriptVariables(
        java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableScriptVariables().getMutableMap()
          .putAll(values);
      return this;
    }

    private com.google.protobuf.MapField<
        java.lang.String, java.lang.String> properties_;
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetProperties() {
      if (properties_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            PropertiesDefaultEntryHolder.defaultEntry);
      }
      return properties_;
    }
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetMutableProperties() {
      onChanged();;
      if (properties_ == null) {
        properties_ = com.google.protobuf.MapField.newMapField(
            PropertiesDefaultEntryHolder.defaultEntry);
      }
      if (!properties_.isMutable()) {
        properties_ = properties_.copy();
      }
      return properties_;
    }

    public int getPropertiesCount() {
      return internalGetProperties().getMap().size();
    }
    /**
     * <pre>
     * Optional. A mapping of property names to values, used to configure Pig.
     * Properties that conflict with values set by the Cloud Dataproc API may be
     * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
     * /etc/pig/conf/pig.properties, and classes in user code.
     * </pre>
     *
     * <code>map&lt;string, string&gt; properties = 5;</code>
     */

    public boolean containsProperties(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      return internalGetProperties().getMap().containsKey(key);
    }
    /**
     * Use {@link #getPropertiesMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getProperties() {
      return getPropertiesMap();
    }
    /**
     * <pre>
     * Optional. A mapping of property names to values, used to configure Pig.
     * Properties that conflict with values set by the Cloud Dataproc API may be
     * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
     * /etc/pig/conf/pig.properties, and classes in user code.
     * </pre>
     *
     * <code>map&lt;string, string&gt; properties = 5;</code>
     */

    public java.util.Map<java.lang.String, java.lang.String> getPropertiesMap() {
      return internalGetProperties().getMap();
    }
    /**
     * <pre>
     * Optional. A mapping of property names to values, used to configure Pig.
     * Properties that conflict with values set by the Cloud Dataproc API may be
     * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
     * /etc/pig/conf/pig.properties, and classes in user code.
     * </pre>
     *
     * <code>map&lt;string, string&gt; properties = 5;</code>
     */

    public java.lang.String getPropertiesOrDefault(
        java.lang.String key,
        java.lang.String defaultValue) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetProperties().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * Optional. A mapping of property names to values, used to configure Pig.
     * Properties that conflict with values set by the Cloud Dataproc API may be
     * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
     * /etc/pig/conf/pig.properties, and classes in user code.
     * </pre>
     *
     * <code>map&lt;string, string&gt; properties = 5;</code>
     */

    public java.lang.String getPropertiesOrThrow(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetProperties().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearProperties() {
      internalGetMutableProperties().getMutableMap()
          .clear();
      return this;
    }
    /**
     * <pre>
     * Optional. A mapping of property names to values, used to configure Pig.
     * Properties that conflict with values set by the Cloud Dataproc API may be
     * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
     * /etc/pig/conf/pig.properties, and classes in user code.
     * </pre>
     *
     * <code>map&lt;string, string&gt; properties = 5;</code>
     */

    public Builder removeProperties(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableProperties().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String>
    getMutableProperties() {
      return internalGetMutableProperties().getMutableMap();
    }
    /**
     * <pre>
     * Optional. A mapping of property names to values, used to configure Pig.
     * Properties that conflict with values set by the Cloud Dataproc API may be
     * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
     * /etc/pig/conf/pig.properties, and classes in user code.
     * </pre>
     *
     * <code>map&lt;string, string&gt; properties = 5;</code>
     */
    public Builder putProperties(
        java.lang.String key,
        java.lang.String value) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      if (value == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableProperties().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     * <pre>
     * Optional. A mapping of property names to values, used to configure Pig.
     * Properties that conflict with values set by the Cloud Dataproc API may be
     * overwritten. Can include properties set in /etc/hadoop/conf/&#42;-site.xml,
     * /etc/pig/conf/pig.properties, and classes in user code.
     * </pre>
     *
     * <code>map&lt;string, string&gt; properties = 5;</code>
     */

    public Builder putAllProperties(
        java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableProperties().getMutableMap()
          .putAll(values);
      return this;
    }

    private com.google.protobuf.LazyStringList jarFileUris_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    private void ensureJarFileUrisIsMutable() {
      if (!((bitField0_ & 0x00000020) == 0x00000020)) {
        jarFileUris_ = new com.google.protobuf.LazyStringArrayList(jarFileUris_);
        bitField0_ |= 0x00000020;
       }
    }
    /**
     * <pre>
     * Optional. HCFS URIs of jar files to add to the CLASSPATH of
     * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
     * </pre>
     *
     * <code>repeated string jar_file_uris = 6;</code>
     */
    public com.google.protobuf.ProtocolStringList
        getJarFileUrisList() {
      return jarFileUris_.getUnmodifiableView();
    }
    /**
     * <pre>
     * Optional. HCFS URIs of jar files to add to the CLASSPATH of
     * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
     * </pre>
     *
     * <code>repeated string jar_file_uris = 6;</code>
     */
    public int getJarFileUrisCount() {
      return jarFileUris_.size();
    }
    /**
     * <pre>
     * Optional. HCFS URIs of jar files to add to the CLASSPATH of
     * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
     * </pre>
     *
     * <code>repeated string jar_file_uris = 6;</code>
     */
    public java.lang.String getJarFileUris(int index) {
      return jarFileUris_.get(index);
    }
    /**
     * <pre>
     * Optional. HCFS URIs of jar files to add to the CLASSPATH of
     * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
     * </pre>
     *
     * <code>repeated string jar_file_uris = 6;</code>
     */
    public com.google.protobuf.ByteString
        getJarFileUrisBytes(int index) {
      return jarFileUris_.getByteString(index);
    }
    /**
     * <pre>
     * Optional. HCFS URIs of jar files to add to the CLASSPATH of
     * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
     * </pre>
     *
     * <code>repeated string jar_file_uris = 6;</code>
     */
    public Builder setJarFileUris(
        int index, java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureJarFileUrisIsMutable();
      jarFileUris_.set(index, value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. HCFS URIs of jar files to add to the CLASSPATH of
     * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
     * </pre>
     *
     * <code>repeated string jar_file_uris = 6;</code>
     */
    public Builder addJarFileUris(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureJarFileUrisIsMutable();
      jarFileUris_.add(value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. HCFS URIs of jar files to add to the CLASSPATH of
     * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
     * </pre>
     *
     * <code>repeated string jar_file_uris = 6;</code>
     */
    public Builder addAllJarFileUris(
        java.lang.Iterable<java.lang.String> values) {
      ensureJarFileUrisIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, jarFileUris_);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. HCFS URIs of jar files to add to the CLASSPATH of
     * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
     * </pre>
     *
     * <code>repeated string jar_file_uris = 6;</code>
     */
    public Builder clearJarFileUris() {
      jarFileUris_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. HCFS URIs of jar files to add to the CLASSPATH of
     * the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
     * </pre>
     *
     * <code>repeated string jar_file_uris = 6;</code>
     */
    public Builder addJarFileUrisBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      ensureJarFileUrisIsMutable();
      jarFileUris_.add(value);
      onChanged();
      return this;
    }

    private com.google.cloud.dataproc.v1.LoggingConfig loggingConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.LoggingConfig, com.google.cloud.dataproc.v1.LoggingConfig.Builder, com.google.cloud.dataproc.v1.LoggingConfigOrBuilder> loggingConfigBuilder_;
    /**
     * <pre>
     * Optional. The runtime log config for job execution.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
     */
    public boolean hasLoggingConfig() {
      return loggingConfigBuilder_ != null || loggingConfig_ != null;
    }
    /**
     * <pre>
     * Optional. The runtime log config for job execution.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
     */
    public com.google.cloud.dataproc.v1.LoggingConfig getLoggingConfig() {
      if (loggingConfigBuilder_ == null) {
        return loggingConfig_ == null ? com.google.cloud.dataproc.v1.LoggingConfig.getDefaultInstance() : loggingConfig_;
      } else {
        return loggingConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Optional. The runtime log config for job execution.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
     */
    public Builder setLoggingConfig(com.google.cloud.dataproc.v1.LoggingConfig value) {
      if (loggingConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        loggingConfig_ = value;
        onChanged();
      } else {
        loggingConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The runtime log config for job execution.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
     */
    public Builder setLoggingConfig(
        com.google.cloud.dataproc.v1.LoggingConfig.Builder builderForValue) {
      if (loggingConfigBuilder_ == null) {
        loggingConfig_ = builderForValue.build();
        onChanged();
      } else {
        loggingConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The runtime log config for job execution.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
     */
    public Builder mergeLoggingConfig(com.google.cloud.dataproc.v1.LoggingConfig value) {
      if (loggingConfigBuilder_ == null) {
        if (loggingConfig_ != null) {
          loggingConfig_ =
            com.google.cloud.dataproc.v1.LoggingConfig.newBuilder(loggingConfig_).mergeFrom(value).buildPartial();
        } else {
          loggingConfig_ = value;
        }
        onChanged();
      } else {
        loggingConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The runtime log config for job execution.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
     */
    public Builder clearLoggingConfig() {
      if (loggingConfigBuilder_ == null) {
        loggingConfig_ = null;
        onChanged();
      } else {
        loggingConfig_ = null;
        loggingConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Optional. The runtime log config for job execution.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
     */
    public com.google.cloud.dataproc.v1.LoggingConfig.Builder getLoggingConfigBuilder() {
      
      onChanged();
      return getLoggingConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Optional. The runtime log config for job execution.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
     */
    public com.google.cloud.dataproc.v1.LoggingConfigOrBuilder getLoggingConfigOrBuilder() {
      if (loggingConfigBuilder_ != null) {
        return loggingConfigBuilder_.getMessageOrBuilder();
      } else {
        return loggingConfig_ == null ?
            com.google.cloud.dataproc.v1.LoggingConfig.getDefaultInstance() : loggingConfig_;
      }
    }
    /**
     * <pre>
     * Optional. The runtime log config for job execution.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.LoggingConfig logging_config = 7;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.LoggingConfig, com.google.cloud.dataproc.v1.LoggingConfig.Builder, com.google.cloud.dataproc.v1.LoggingConfigOrBuilder> 
        getLoggingConfigFieldBuilder() {
      if (loggingConfigBuilder_ == null) {
        loggingConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1.LoggingConfig, com.google.cloud.dataproc.v1.LoggingConfig.Builder, com.google.cloud.dataproc.v1.LoggingConfigOrBuilder>(
                getLoggingConfig(),
                getParentForChildren(),
                isClean());
        loggingConfig_ = null;
      }
      return loggingConfigBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


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

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

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

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

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

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

  public com.google.cloud.dataproc.v1.PigJob getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

