// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/profiler/profiler_options.proto

package org.tensorflow.proto.profiler;

/**
 * <pre>
 * Options for remote profiler session manager.
 * Next ID: 6
 * </pre>
 *
 * Protobuf type {@code tensorflow.RemoteProfilerSessionManagerOptions}
 */
public  final class RemoteProfilerSessionManagerOptions extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.RemoteProfilerSessionManagerOptions)
    RemoteProfilerSessionManagerOptionsOrBuilder {
private static final long serialVersionUID = 0L;
  // Use RemoteProfilerSessionManagerOptions.newBuilder() to construct.
  private RemoteProfilerSessionManagerOptions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private RemoteProfilerSessionManagerOptions() {
    serviceAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private RemoteProfilerSessionManagerOptions(
      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: {
            org.tensorflow.proto.profiler.ProfileOptions.Builder subBuilder = null;
            if (profilerOptions_ != null) {
              subBuilder = profilerOptions_.toBuilder();
            }
            profilerOptions_ = input.readMessage(org.tensorflow.proto.profiler.ProfileOptions.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(profilerOptions_);
              profilerOptions_ = subBuilder.buildPartial();
            }

            break;
          }
          case 18: {
            java.lang.String s = input.readStringRequireUtf8();
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              serviceAddresses_ = new com.google.protobuf.LazyStringArrayList();
              mutable_bitField0_ |= 0x00000001;
            }
            serviceAddresses_.add(s);
            break;
          }
          case 24: {

            sessionCreationTimestampNs_ = input.readUInt64();
            break;
          }
          case 32: {

            maxSessionDurationMs_ = input.readUInt64();
            break;
          }
          case 40: {

            delayMs_ = input.readUInt64();
            break;
          }
          default: {
            if (!parseUnknownField(
                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_ & 0x00000001) != 0)) {
        serviceAddresses_ = serviceAddresses_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.class, org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.Builder.class);
  }

  public static final int PROFILER_OPTIONS_FIELD_NUMBER = 1;
  private org.tensorflow.proto.profiler.ProfileOptions profilerOptions_;
  /**
   * <pre>
   * Options for each local profiler.
   * </pre>
   *
   * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
   */
  public boolean hasProfilerOptions() {
    return profilerOptions_ != null;
  }
  /**
   * <pre>
   * Options for each local profiler.
   * </pre>
   *
   * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
   */
  public org.tensorflow.proto.profiler.ProfileOptions getProfilerOptions() {
    return profilerOptions_ == null ? org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance() : profilerOptions_;
  }
  /**
   * <pre>
   * Options for each local profiler.
   * </pre>
   *
   * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
   */
  public org.tensorflow.proto.profiler.ProfileOptionsOrBuilder getProfilerOptionsOrBuilder() {
    return getProfilerOptions();
  }

  public static final int SERVICE_ADDRESSES_FIELD_NUMBER = 2;
  private com.google.protobuf.LazyStringList serviceAddresses_;
  /**
   * <pre>
   * List of servers to profile. Supported formats: host:port.
   * </pre>
   *
   * <code>repeated string service_addresses = 2;</code>
   */
  public com.google.protobuf.ProtocolStringList
      getServiceAddressesList() {
    return serviceAddresses_;
  }
  /**
   * <pre>
   * List of servers to profile. Supported formats: host:port.
   * </pre>
   *
   * <code>repeated string service_addresses = 2;</code>
   */
  public int getServiceAddressesCount() {
    return serviceAddresses_.size();
  }
  /**
   * <pre>
   * List of servers to profile. Supported formats: host:port.
   * </pre>
   *
   * <code>repeated string service_addresses = 2;</code>
   */
  public java.lang.String getServiceAddresses(int index) {
    return serviceAddresses_.get(index);
  }
  /**
   * <pre>
   * List of servers to profile. Supported formats: host:port.
   * </pre>
   *
   * <code>repeated string service_addresses = 2;</code>
   */
  public com.google.protobuf.ByteString
      getServiceAddressesBytes(int index) {
    return serviceAddresses_.getByteString(index);
  }

  public static final int SESSION_CREATION_TIMESTAMP_NS_FIELD_NUMBER = 3;
  private long sessionCreationTimestampNs_;
  /**
   * <pre>
   * Unix timestamp of when the session was started.
   * </pre>
   *
   * <code>uint64 session_creation_timestamp_ns = 3;</code>
   */
  public long getSessionCreationTimestampNs() {
    return sessionCreationTimestampNs_;
  }

  public static final int MAX_SESSION_DURATION_MS_FIELD_NUMBER = 4;
  private long maxSessionDurationMs_;
  /**
   * <pre>
   * Maximum time (in milliseconds) a profiling session manager waits for all
   * profilers to finish after issuing gRPC request. If value is 0, session
   * continues until interrupted. Otherwise, value must be greater than
   * profiler_options.duration_ms.
   * </pre>
   *
   * <code>uint64 max_session_duration_ms = 4;</code>
   */
  public long getMaxSessionDurationMs() {
    return maxSessionDurationMs_;
  }

  public static final int DELAY_MS_FIELD_NUMBER = 5;
  private long delayMs_;
  /**
   * <pre>
   * Start of profiling is delayed by this much (in milliseconds).
   * </pre>
   *
   * <code>uint64 delay_ms = 5;</code>
   */
  public long getDelayMs() {
    return delayMs_;
  }

  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 (profilerOptions_ != null) {
      output.writeMessage(1, getProfilerOptions());
    }
    for (int i = 0; i < serviceAddresses_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceAddresses_.getRaw(i));
    }
    if (sessionCreationTimestampNs_ != 0L) {
      output.writeUInt64(3, sessionCreationTimestampNs_);
    }
    if (maxSessionDurationMs_ != 0L) {
      output.writeUInt64(4, maxSessionDurationMs_);
    }
    if (delayMs_ != 0L) {
      output.writeUInt64(5, delayMs_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (profilerOptions_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, getProfilerOptions());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < serviceAddresses_.size(); i++) {
        dataSize += computeStringSizeNoTag(serviceAddresses_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getServiceAddressesList().size();
    }
    if (sessionCreationTimestampNs_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt64Size(3, sessionCreationTimestampNs_);
    }
    if (maxSessionDurationMs_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt64Size(4, maxSessionDurationMs_);
    }
    if (delayMs_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt64Size(5, delayMs_);
    }
    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 org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions other = (org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions) obj;

    if (hasProfilerOptions() != other.hasProfilerOptions()) return false;
    if (hasProfilerOptions()) {
      if (!getProfilerOptions()
          .equals(other.getProfilerOptions())) return false;
    }
    if (!getServiceAddressesList()
        .equals(other.getServiceAddressesList())) return false;
    if (getSessionCreationTimestampNs()
        != other.getSessionCreationTimestampNs()) return false;
    if (getMaxSessionDurationMs()
        != other.getMaxSessionDurationMs()) return false;
    if (getDelayMs()
        != other.getDelayMs()) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasProfilerOptions()) {
      hash = (37 * hash) + PROFILER_OPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getProfilerOptions().hashCode();
    }
    if (getServiceAddressesCount() > 0) {
      hash = (37 * hash) + SERVICE_ADDRESSES_FIELD_NUMBER;
      hash = (53 * hash) + getServiceAddressesList().hashCode();
    }
    hash = (37 * hash) + SESSION_CREATION_TIMESTAMP_NS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getSessionCreationTimestampNs());
    hash = (37 * hash) + MAX_SESSION_DURATION_MS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getMaxSessionDurationMs());
    hash = (37 * hash) + DELAY_MS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getDelayMs());
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions 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 org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions 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 org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions 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(org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions 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>
   * Options for remote profiler session manager.
   * Next ID: 6
   * </pre>
   *
   * Protobuf type {@code tensorflow.RemoteProfilerSessionManagerOptions}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.RemoteProfilerSessionManagerOptions)
      org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptionsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.class, org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.Builder.class);
    }

    // Construct using org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (profilerOptionsBuilder_ == null) {
        profilerOptions_ = null;
      } else {
        profilerOptions_ = null;
        profilerOptionsBuilder_ = null;
      }
      serviceAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      sessionCreationTimestampNs_ = 0L;

      maxSessionDurationMs_ = 0L;

      delayMs_ = 0L;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_RemoteProfilerSessionManagerOptions_descriptor;
    }

    @java.lang.Override
    public org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions getDefaultInstanceForType() {
      return org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.getDefaultInstance();
    }

    @java.lang.Override
    public org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions build() {
      org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions buildPartial() {
      org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions result = new org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions(this);
      int from_bitField0_ = bitField0_;
      if (profilerOptionsBuilder_ == null) {
        result.profilerOptions_ = profilerOptions_;
      } else {
        result.profilerOptions_ = profilerOptionsBuilder_.build();
      }
      if (((bitField0_ & 0x00000001) != 0)) {
        serviceAddresses_ = serviceAddresses_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.serviceAddresses_ = serviceAddresses_;
      result.sessionCreationTimestampNs_ = sessionCreationTimestampNs_;
      result.maxSessionDurationMs_ = maxSessionDurationMs_;
      result.delayMs_ = delayMs_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions other) {
      if (other == org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions.getDefaultInstance()) return this;
      if (other.hasProfilerOptions()) {
        mergeProfilerOptions(other.getProfilerOptions());
      }
      if (!other.serviceAddresses_.isEmpty()) {
        if (serviceAddresses_.isEmpty()) {
          serviceAddresses_ = other.serviceAddresses_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureServiceAddressesIsMutable();
          serviceAddresses_.addAll(other.serviceAddresses_);
        }
        onChanged();
      }
      if (other.getSessionCreationTimestampNs() != 0L) {
        setSessionCreationTimestampNs(other.getSessionCreationTimestampNs());
      }
      if (other.getMaxSessionDurationMs() != 0L) {
        setMaxSessionDurationMs(other.getMaxSessionDurationMs());
      }
      if (other.getDelayMs() != 0L) {
        setDelayMs(other.getDelayMs());
      }
      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 {
      org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private org.tensorflow.proto.profiler.ProfileOptions profilerOptions_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.profiler.ProfileOptions, org.tensorflow.proto.profiler.ProfileOptions.Builder, org.tensorflow.proto.profiler.ProfileOptionsOrBuilder> profilerOptionsBuilder_;
    /**
     * <pre>
     * Options for each local profiler.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
     */
    public boolean hasProfilerOptions() {
      return profilerOptionsBuilder_ != null || profilerOptions_ != null;
    }
    /**
     * <pre>
     * Options for each local profiler.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
     */
    public org.tensorflow.proto.profiler.ProfileOptions getProfilerOptions() {
      if (profilerOptionsBuilder_ == null) {
        return profilerOptions_ == null ? org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance() : profilerOptions_;
      } else {
        return profilerOptionsBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Options for each local profiler.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
     */
    public Builder setProfilerOptions(org.tensorflow.proto.profiler.ProfileOptions value) {
      if (profilerOptionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        profilerOptions_ = value;
        onChanged();
      } else {
        profilerOptionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Options for each local profiler.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
     */
    public Builder setProfilerOptions(
        org.tensorflow.proto.profiler.ProfileOptions.Builder builderForValue) {
      if (profilerOptionsBuilder_ == null) {
        profilerOptions_ = builderForValue.build();
        onChanged();
      } else {
        profilerOptionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Options for each local profiler.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
     */
    public Builder mergeProfilerOptions(org.tensorflow.proto.profiler.ProfileOptions value) {
      if (profilerOptionsBuilder_ == null) {
        if (profilerOptions_ != null) {
          profilerOptions_ =
            org.tensorflow.proto.profiler.ProfileOptions.newBuilder(profilerOptions_).mergeFrom(value).buildPartial();
        } else {
          profilerOptions_ = value;
        }
        onChanged();
      } else {
        profilerOptionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Options for each local profiler.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
     */
    public Builder clearProfilerOptions() {
      if (profilerOptionsBuilder_ == null) {
        profilerOptions_ = null;
        onChanged();
      } else {
        profilerOptions_ = null;
        profilerOptionsBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Options for each local profiler.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
     */
    public org.tensorflow.proto.profiler.ProfileOptions.Builder getProfilerOptionsBuilder() {
      
      onChanged();
      return getProfilerOptionsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Options for each local profiler.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
     */
    public org.tensorflow.proto.profiler.ProfileOptionsOrBuilder getProfilerOptionsOrBuilder() {
      if (profilerOptionsBuilder_ != null) {
        return profilerOptionsBuilder_.getMessageOrBuilder();
      } else {
        return profilerOptions_ == null ?
            org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance() : profilerOptions_;
      }
    }
    /**
     * <pre>
     * Options for each local profiler.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions profiler_options = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.profiler.ProfileOptions, org.tensorflow.proto.profiler.ProfileOptions.Builder, org.tensorflow.proto.profiler.ProfileOptionsOrBuilder> 
        getProfilerOptionsFieldBuilder() {
      if (profilerOptionsBuilder_ == null) {
        profilerOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.proto.profiler.ProfileOptions, org.tensorflow.proto.profiler.ProfileOptions.Builder, org.tensorflow.proto.profiler.ProfileOptionsOrBuilder>(
                getProfilerOptions(),
                getParentForChildren(),
                isClean());
        profilerOptions_ = null;
      }
      return profilerOptionsBuilder_;
    }

    private com.google.protobuf.LazyStringList serviceAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    private void ensureServiceAddressesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        serviceAddresses_ = new com.google.protobuf.LazyStringArrayList(serviceAddresses_);
        bitField0_ |= 0x00000001;
       }
    }
    /**
     * <pre>
     * List of servers to profile. Supported formats: host:port.
     * </pre>
     *
     * <code>repeated string service_addresses = 2;</code>
     */
    public com.google.protobuf.ProtocolStringList
        getServiceAddressesList() {
      return serviceAddresses_.getUnmodifiableView();
    }
    /**
     * <pre>
     * List of servers to profile. Supported formats: host:port.
     * </pre>
     *
     * <code>repeated string service_addresses = 2;</code>
     */
    public int getServiceAddressesCount() {
      return serviceAddresses_.size();
    }
    /**
     * <pre>
     * List of servers to profile. Supported formats: host:port.
     * </pre>
     *
     * <code>repeated string service_addresses = 2;</code>
     */
    public java.lang.String getServiceAddresses(int index) {
      return serviceAddresses_.get(index);
    }
    /**
     * <pre>
     * List of servers to profile. Supported formats: host:port.
     * </pre>
     *
     * <code>repeated string service_addresses = 2;</code>
     */
    public com.google.protobuf.ByteString
        getServiceAddressesBytes(int index) {
      return serviceAddresses_.getByteString(index);
    }
    /**
     * <pre>
     * List of servers to profile. Supported formats: host:port.
     * </pre>
     *
     * <code>repeated string service_addresses = 2;</code>
     */
    public Builder setServiceAddresses(
        int index, java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureServiceAddressesIsMutable();
      serviceAddresses_.set(index, value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * List of servers to profile. Supported formats: host:port.
     * </pre>
     *
     * <code>repeated string service_addresses = 2;</code>
     */
    public Builder addServiceAddresses(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureServiceAddressesIsMutable();
      serviceAddresses_.add(value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * List of servers to profile. Supported formats: host:port.
     * </pre>
     *
     * <code>repeated string service_addresses = 2;</code>
     */
    public Builder addAllServiceAddresses(
        java.lang.Iterable<java.lang.String> values) {
      ensureServiceAddressesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, serviceAddresses_);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * List of servers to profile. Supported formats: host:port.
     * </pre>
     *
     * <code>repeated string service_addresses = 2;</code>
     */
    public Builder clearServiceAddresses() {
      serviceAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * List of servers to profile. Supported formats: host:port.
     * </pre>
     *
     * <code>repeated string service_addresses = 2;</code>
     */
    public Builder addServiceAddressesBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      ensureServiceAddressesIsMutable();
      serviceAddresses_.add(value);
      onChanged();
      return this;
    }

    private long sessionCreationTimestampNs_ ;
    /**
     * <pre>
     * Unix timestamp of when the session was started.
     * </pre>
     *
     * <code>uint64 session_creation_timestamp_ns = 3;</code>
     */
    public long getSessionCreationTimestampNs() {
      return sessionCreationTimestampNs_;
    }
    /**
     * <pre>
     * Unix timestamp of when the session was started.
     * </pre>
     *
     * <code>uint64 session_creation_timestamp_ns = 3;</code>
     */
    public Builder setSessionCreationTimestampNs(long value) {
      
      sessionCreationTimestampNs_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Unix timestamp of when the session was started.
     * </pre>
     *
     * <code>uint64 session_creation_timestamp_ns = 3;</code>
     */
    public Builder clearSessionCreationTimestampNs() {
      
      sessionCreationTimestampNs_ = 0L;
      onChanged();
      return this;
    }

    private long maxSessionDurationMs_ ;
    /**
     * <pre>
     * Maximum time (in milliseconds) a profiling session manager waits for all
     * profilers to finish after issuing gRPC request. If value is 0, session
     * continues until interrupted. Otherwise, value must be greater than
     * profiler_options.duration_ms.
     * </pre>
     *
     * <code>uint64 max_session_duration_ms = 4;</code>
     */
    public long getMaxSessionDurationMs() {
      return maxSessionDurationMs_;
    }
    /**
     * <pre>
     * Maximum time (in milliseconds) a profiling session manager waits for all
     * profilers to finish after issuing gRPC request. If value is 0, session
     * continues until interrupted. Otherwise, value must be greater than
     * profiler_options.duration_ms.
     * </pre>
     *
     * <code>uint64 max_session_duration_ms = 4;</code>
     */
    public Builder setMaxSessionDurationMs(long value) {
      
      maxSessionDurationMs_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Maximum time (in milliseconds) a profiling session manager waits for all
     * profilers to finish after issuing gRPC request. If value is 0, session
     * continues until interrupted. Otherwise, value must be greater than
     * profiler_options.duration_ms.
     * </pre>
     *
     * <code>uint64 max_session_duration_ms = 4;</code>
     */
    public Builder clearMaxSessionDurationMs() {
      
      maxSessionDurationMs_ = 0L;
      onChanged();
      return this;
    }

    private long delayMs_ ;
    /**
     * <pre>
     * Start of profiling is delayed by this much (in milliseconds).
     * </pre>
     *
     * <code>uint64 delay_ms = 5;</code>
     */
    public long getDelayMs() {
      return delayMs_;
    }
    /**
     * <pre>
     * Start of profiling is delayed by this much (in milliseconds).
     * </pre>
     *
     * <code>uint64 delay_ms = 5;</code>
     */
    public Builder setDelayMs(long value) {
      
      delayMs_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Start of profiling is delayed by this much (in milliseconds).
     * </pre>
     *
     * <code>uint64 delay_ms = 5;</code>
     */
    public Builder clearDelayMs() {
      
      delayMs_ = 0L;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:tensorflow.RemoteProfilerSessionManagerOptions)
  }

  // @@protoc_insertion_point(class_scope:tensorflow.RemoteProfilerSessionManagerOptions)
  private static final org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions();
  }

  public static org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public org.tensorflow.proto.profiler.RemoteProfilerSessionManagerOptions getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

