content: /*
   * Tencent is pleased to support the open source community by making Angel available.
   *
   * Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
   * compliance with the License. You may obtain a copy of the License at
   *
   * https://opensource.org/licenses/Apache-2.0
   *
   * Unless required by applicable law or agreed to in writing, software distributed under the License
   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
   * or implied. See the License for the specific language governing permissions and limitations under
   * the License.
   *
   */
  // Generated by the protocol buffer compiler.  DO NOT EDIT!
  // source: config/resources.proto
  
  package com.tencent.angel.config;
  
  public final class ResourceProtos {
    private ResourceProtos() {}
    public static void registerAllExtensions(
        com.google.protobuf.ExtensionRegistryLite registry) {
    }
  
    public static void registerAllExtensions(
        com.google.protobuf.ExtensionRegistry registry) {
      registerAllExtensions(
          (com.google.protobuf.ExtensionRegistryLite) registry);
    }
    public interface ResourceOrBuilder extends
        // @@protoc_insertion_point(interface_extends:angel.Resource)
        com.google.protobuf.MessageOrBuilder {
  
      /**
       * <pre>
       * The type of device on which the resource resides, e.g. CPU or GPU.
       * </pre>
       *
       * <code>string device = 1;</code>
       */
      java.lang.String getDevice();
      /**
       * <pre>
       * The type of device on which the resource resides, e.g. CPU or GPU.
       * </pre>
       *
       * <code>string device = 1;</code>
       */
      com.google.protobuf.ByteString
          getDeviceBytes();
  
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      boolean hasDeviceInstance();
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      com.google.protobuf.UInt32Value getDeviceInstance();
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      com.google.protobuf.UInt32ValueOrBuilder getDeviceInstanceOrBuilder();
  
      /**
       * <pre>
       * The kind of resource on the device (instance), e.g. RAM or compute share.
       * A given type of resource should have a standard unit that represents the
       * smallest useful quantization. We strongly recommend including the unit
       * (e.g. bytes or millicores) in this string, as in "ram_bytes".
       * </pre>
       *
       * <code>string kind = 3;</code>
       */
      java.lang.String getKind();
      /**
       * <pre>
       * The kind of resource on the device (instance), e.g. RAM or compute share.
       * A given type of resource should have a standard unit that represents the
       * smallest useful quantization. We strongly recommend including the unit
       * (e.g. bytes or millicores) in this string, as in "ram_bytes".
       * </pre>
       *
       * <code>string kind = 3;</code>
       */
      com.google.protobuf.ByteString
          getKindBytes();
    }
    /**
     * <pre>
     * One kind of resource on one device (or type of device).
     * </pre>
     *
     * Protobuf type {@code angel.Resource}
     */
    public  static final class Resource extends
        com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:angel.Resource)
        ResourceOrBuilder {
    private static final long serialVersionUID = 0L;
      // Use Resource.newBuilder() to construct.
      private Resource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }
      private Resource() {
        device_ = "";
        kind_ = "";
      }
  
      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
        return this.unknownFields;
      }
      private Resource(
          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();
  
                device_ = s;
                break;
              }
              case 18: {
                com.google.protobuf.UInt32Value.Builder subBuilder = null;
                if (deviceInstance_ != null) {
                  subBuilder = deviceInstance_.toBuilder();
                }
                deviceInstance_ = input.readMessage(com.google.protobuf.UInt32Value.parser(), extensionRegistry);
                if (subBuilder != null) {
                  subBuilder.mergeFrom(deviceInstance_);
                  deviceInstance_ = subBuilder.buildPartial();
                }
  
                break;
              }
              case 26: {
                java.lang.String s = input.readStringRequireUtf8();
  
                kind_ = s;
                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 {
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.tencent.angel.config.ResourceProtos.internal_static_angel_Resource_descriptor;
      }
  
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.tencent.angel.config.ResourceProtos.internal_static_angel_Resource_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.tencent.angel.config.ResourceProtos.Resource.class, com.tencent.angel.config.ResourceProtos.Resource.Builder.class);
      }
  
      public static final int DEVICE_FIELD_NUMBER = 1;
      private volatile java.lang.Object device_;
      /**
       * <pre>
       * The type of device on which the resource resides, e.g. CPU or GPU.
       * </pre>
       *
       * <code>string device = 1;</code>
       */
      public java.lang.String getDevice() {
        java.lang.Object ref = device_;
        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();
          device_ = s;
          return s;
        }
      }
      /**
       * <pre>
       * The type of device on which the resource resides, e.g. CPU or GPU.
       * </pre>
       *
       * <code>string device = 1;</code>
       */
      public com.google.protobuf.ByteString
          getDeviceBytes() {
        java.lang.Object ref = device_;
        if (ref instanceof java.lang.String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          device_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
  
      public static final int DEVICE_INSTANCE_FIELD_NUMBER = 2;
      private com.google.protobuf.UInt32Value deviceInstance_;
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public boolean hasDeviceInstance() {
        return deviceInstance_ != null;
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public com.google.protobuf.UInt32Value getDeviceInstance() {
        return deviceInstance_ == null ? com.google.protobuf.UInt32Value.getDefaultInstance() : deviceInstance_;
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public com.google.protobuf.UInt32ValueOrBuilder getDeviceInstanceOrBuilder() {
        return getDeviceInstance();
      }
  
      public static final int KIND_FIELD_NUMBER = 3;
      private volatile java.lang.Object kind_;
      /**
       * <pre>
       * The kind of resource on the device (instance), e.g. RAM or compute share.
       * A given type of resource should have a standard unit that represents the
       * smallest useful quantization. We strongly recommend including the unit
       * (e.g. bytes or millicores) in this string, as in "ram_bytes".
       * </pre>
       *
       * <code>string kind = 3;</code>
       */
      public java.lang.String getKind() {
        java.lang.Object ref = kind_;
        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();
          kind_ = s;
          return s;
        }
      }
      /**
       * <pre>
       * The kind of resource on the device (instance), e.g. RAM or compute share.
       * A given type of resource should have a standard unit that represents the
       * smallest useful quantization. We strongly recommend including the unit
       * (e.g. bytes or millicores) in this string, as in "ram_bytes".
       * </pre>
       *
       * <code>string kind = 3;</code>
       */
      public com.google.protobuf.ByteString
          getKindBytes() {
        java.lang.Object ref = kind_;
        if (ref instanceof java.lang.String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          kind_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
  
      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 (!getDeviceBytes().isEmpty()) {
          com.google.protobuf.GeneratedMessageV3.writeString(output, 1, device_);
        }
        if (deviceInstance_ != null) {
          output.writeMessage(2, getDeviceInstance());
        }
        if (!getKindBytes().isEmpty()) {
          com.google.protobuf.GeneratedMessageV3.writeString(output, 3, kind_);
        }
        unknownFields.writeTo(output);
      }
  
      public int getSerializedSize() {
        int size = memoizedSize;
        if (size != -1) return size;
  
        size = 0;
        if (!getDeviceBytes().isEmpty()) {
          size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, device_);
        }
        if (deviceInstance_ != null) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(2, getDeviceInstance());
        }
        if (!getKindBytes().isEmpty()) {
          size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, kind_);
        }
        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.tencent.angel.config.ResourceProtos.Resource)) {
          return super.equals(obj);
        }
        com.tencent.angel.config.ResourceProtos.Resource other = (com.tencent.angel.config.ResourceProtos.Resource) obj;
  
        boolean result = true;
        result = result && getDevice()
            .equals(other.getDevice());
        result = result && (hasDeviceInstance() == other.hasDeviceInstance());
        if (hasDeviceInstance()) {
          result = result && getDeviceInstance()
              .equals(other.getDeviceInstance());
        }
        result = result && getKind()
            .equals(other.getKind());
        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) + DEVICE_FIELD_NUMBER;
        hash = (53 * hash) + getDevice().hashCode();
        if (hasDeviceInstance()) {
          hash = (37 * hash) + DEVICE_INSTANCE_FIELD_NUMBER;
          hash = (53 * hash) + getDeviceInstance().hashCode();
        }
        hash = (37 * hash) + KIND_FIELD_NUMBER;
        hash = (53 * hash) + getKind().hashCode();
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
      }
  
      public static com.tencent.angel.config.ResourceProtos.Resource parseFrom(
          java.nio.ByteBuffer data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.config.ResourceProtos.Resource parseFrom(
          java.nio.ByteBuffer data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.tencent.angel.config.ResourceProtos.Resource parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.config.ResourceProtos.Resource parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.tencent.angel.config.ResourceProtos.Resource parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.config.ResourceProtos.Resource parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.tencent.angel.config.ResourceProtos.Resource parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static com.tencent.angel.config.ResourceProtos.Resource 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.tencent.angel.config.ResourceProtos.Resource parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseDelimitedWithIOException(PARSER, input);
      }
      public static com.tencent.angel.config.ResourceProtos.Resource 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.tencent.angel.config.ResourceProtos.Resource parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static com.tencent.angel.config.ResourceProtos.Resource 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.tencent.angel.config.ResourceProtos.Resource 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>
       * One kind of resource on one device (or type of device).
       * </pre>
       *
       * Protobuf type {@code angel.Resource}
       */
      public static final class Builder extends
          com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
          // @@protoc_insertion_point(builder_implements:angel.Resource)
          com.tencent.angel.config.ResourceProtos.ResourceOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return com.tencent.angel.config.ResourceProtos.internal_static_angel_Resource_descriptor;
        }
  
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.tencent.angel.config.ResourceProtos.internal_static_angel_Resource_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.tencent.angel.config.ResourceProtos.Resource.class, com.tencent.angel.config.ResourceProtos.Resource.Builder.class);
        }
  
        // Construct using com.tencent.angel.config.ResourceProtos.Resource.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();
          device_ = "";
  
          if (deviceInstanceBuilder_ == null) {
            deviceInstance_ = null;
          } else {
            deviceInstance_ = null;
            deviceInstanceBuilder_ = null;
          }
          kind_ = "";
  
          return this;
        }
  
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return com.tencent.angel.config.ResourceProtos.internal_static_angel_Resource_descriptor;
        }
  
        public com.tencent.angel.config.ResourceProtos.Resource getDefaultInstanceForType() {
          return com.tencent.angel.config.ResourceProtos.Resource.getDefaultInstance();
        }
  
        public com.tencent.angel.config.ResourceProtos.Resource build() {
          com.tencent.angel.config.ResourceProtos.Resource result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }
  
        public com.tencent.angel.config.ResourceProtos.Resource buildPartial() {
          com.tencent.angel.config.ResourceProtos.Resource result = new com.tencent.angel.config.ResourceProtos.Resource(this);
          result.device_ = device_;
          if (deviceInstanceBuilder_ == null) {
            result.deviceInstance_ = deviceInstance_;
          } else {
            result.deviceInstance_ = deviceInstanceBuilder_.build();
          }
          result.kind_ = kind_;
          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.tencent.angel.config.ResourceProtos.Resource) {
            return mergeFrom((com.tencent.angel.config.ResourceProtos.Resource)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
  
        public Builder mergeFrom(com.tencent.angel.config.ResourceProtos.Resource other) {
          if (other == com.tencent.angel.config.ResourceProtos.Resource.getDefaultInstance()) return this;
          if (!other.getDevice().isEmpty()) {
            device_ = other.device_;
            onChanged();
          }
          if (other.hasDeviceInstance()) {
            mergeDeviceInstance(other.getDeviceInstance());
          }
          if (!other.getKind().isEmpty()) {
            kind_ = other.kind_;
            onChanged();
          }
          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.tencent.angel.config.ResourceProtos.Resource parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage = (com.tencent.angel.config.ResourceProtos.Resource) e.getUnfinishedMessage();
            throw e.unwrapIOException();
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }
  
        private java.lang.Object device_ = "";
        /**
         * <pre>
         * The type of device on which the resource resides, e.g. CPU or GPU.
         * </pre>
         *
         * <code>string device = 1;</code>
         */
        public java.lang.String getDevice() {
          java.lang.Object ref = device_;
          if (!(ref instanceof java.lang.String)) {
            com.google.protobuf.ByteString bs =
                (com.google.protobuf.ByteString) ref;
            java.lang.String s = bs.toStringUtf8();
            device_ = s;
            return s;
          } else {
            return (java.lang.String) ref;
          }
        }
        /**
         * <pre>
         * The type of device on which the resource resides, e.g. CPU or GPU.
         * </pre>
         *
         * <code>string device = 1;</code>
         */
        public com.google.protobuf.ByteString
            getDeviceBytes() {
          java.lang.Object ref = device_;
          if (ref instanceof String) {
            com.google.protobuf.ByteString b = 
                com.google.protobuf.ByteString.copyFromUtf8(
                    (java.lang.String) ref);
            device_ = b;
            return b;
          } else {
            return (com.google.protobuf.ByteString) ref;
          }
        }
        /**
         * <pre>
         * The type of device on which the resource resides, e.g. CPU or GPU.
         * </pre>
         *
         * <code>string device = 1;</code>
         */
        public Builder setDevice(
            java.lang.String value) {
          if (value == null) {
      throw new NullPointerException();
    }
    
          device_ = value;
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The type of device on which the resource resides, e.g. CPU or GPU.
         * </pre>
         *
         * <code>string device = 1;</code>
         */
        public Builder clearDevice() {
          
          device_ = getDefaultInstance().getDevice();
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The type of device on which the resource resides, e.g. CPU or GPU.
         * </pre>
         *
         * <code>string device = 1;</code>
         */
        public Builder setDeviceBytes(
            com.google.protobuf.ByteString value) {
          if (value == null) {
      throw new NullPointerException();
    }
    checkByteStringIsUtf8(value);
          
          device_ = value;
          onChanged();
          return this;
        }
  
        private com.google.protobuf.UInt32Value deviceInstance_ = null;
        private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder> deviceInstanceBuilder_;
        /**
         * <pre>
         * A specific instance of the device of type 'device' to which the resources
         * are bound (instances are assumed to be numbered 0, 1, ...).
         * When representing the resources required by a servable that has yet to be
         * loaded, this field is optional. If not set, it denotes that the servable's
         * resources are not (yet) bound to a specific instance.
         * </pre>
         *
         * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
         */
        public boolean hasDeviceInstance() {
          return deviceInstanceBuilder_ != null || deviceInstance_ != null;
        }
        /**
         * <pre>
         * A specific instance of the device of type 'device' to which the resources
         * are bound (instances are assumed to be numbered 0, 1, ...).
         * When representing the resources required by a servable that has yet to be
         * loaded, this field is optional. If not set, it denotes that the servable's
         * resources are not (yet) bound to a specific instance.
         * </pre>
         *
         * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
         */
        public com.google.protobuf.UInt32Value getDeviceInstance() {
          if (deviceInstanceBuilder_ == null) {
            return deviceInstance_ == null ? com.google.protobuf.UInt32Value.getDefaultInstance() : deviceInstance_;
          } else {
            return deviceInstanceBuilder_.getMessage();
          }
        }
        /**
         * <pre>
         * A specific instance of the device of type 'device' to which the resources
         * are bound (instances are assumed to be numbered 0, 1, ...).
         * When representing the resources required by a servable that has yet to be
         * loaded, this field is optional. If not set, it denotes that the servable's
         * resources are not (yet) bound to a specific instance.
         * </pre>
         *
         * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
         */
        public Builder setDeviceInstance(com.google.protobuf.UInt32Value value) {
          if (deviceInstanceBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            deviceInstance_ = value;
            onChanged();
          } else {
            deviceInstanceBuilder_.setMessage(value);
          }
  
          return this;
        }
        /**
         * <pre>
         * A specific instance of the device of type 'device' to which the resources
         * are bound (instances are assumed to be numbered 0, 1, ...).
         * When representing the resources required by a servable that has yet to be
         * loaded, this field is optional. If not set, it denotes that the servable's
         * resources are not (yet) bound to a specific instance.
         * </pre>
         *
         * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
         */
        public Builder setDeviceInstance(
            com.google.protobuf.UInt32Value.Builder builderForValue) {
          if (deviceInstanceBuilder_ == null) {
            deviceInstance_ = builderForValue.build();
            onChanged();
          } else {
            deviceInstanceBuilder_.setMessage(builderForValue.build());
          }
  
          return this;
        }
        /**
         * <pre>
         * A specific instance of the device of type 'device' to which the resources
         * are bound (instances are assumed to be numbered 0, 1, ...).
         * When representing the resources required by a servable that has yet to be
         * loaded, this field is optional. If not set, it denotes that the servable's
         * resources are not (yet) bound to a specific instance.
         * </pre>
         *
         * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
         */
        public Builder mergeDeviceInstance(com.google.protobuf.UInt32Value value) {
          if (deviceInstanceBuilder_ == null) {
            if (deviceInstance_ != null) {
              deviceInstance_ =
                com.google.protobuf.UInt32Value.newBuilder(deviceInstance_).mergeFrom(value).buildPartial();
            } else {
              deviceInstance_ = value;
            }
            onChanged();
          } else {
            deviceInstanceBuilder_.mergeFrom(value);
          }
  
          return this;
        }
        /**
         * <pre>
         * A specific instance of the device of type 'device' to which the resources
         * are bound (instances are assumed to be numbered 0, 1, ...).
         * When representing the resources required by a servable that has yet to be
         * loaded, this field is optional. If not set, it denotes that the servable's
         * resources are not (yet) bound to a specific instance.
         * </pre>
         *
         * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
         */
        public Builder clearDeviceInstance() {
          if (deviceInstanceBuilder_ == null) {
            deviceInstance_ = null;
            onChanged();
          } else {
            deviceInstance_ = null;
            deviceInstanceBuilder_ = null;
          }
  
          return this;
        }
        /**
         * <pre>
         * A specific instance of the device of type 'device' to which the resources
         * are bound (instances are assumed to be numbered 0, 1, ...).
         * When representing the resources required by a servable that has yet to be
         * loaded, this field is optional. If not set, it denotes that the servable's
         * resources are not (yet) bound to a specific instance.
         * </pre>
         *
         * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
         */
        public com.google.protobuf.UInt32Value.Builder getDeviceInstanceBuilder() {
          
          onChanged();
          return getDeviceInstanceFieldBuilder().getBuilder();
        }
        /**
         * <pre>
         * A specific instance of the device of type 'device' to which the resources
         * are bound (instances are assumed to be numbered 0, 1, ...).
         * When representing the resources required by a servable that has yet to be
         * loaded, this field is optional. If not set, it denotes that the servable's
         * resources are not (yet) bound to a specific instance.
         * </pre>
         *
         * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
         */
        public com.google.protobuf.UInt32ValueOrBuilder getDeviceInstanceOrBuilder() {
          if (deviceInstanceBuilder_ != null) {
            return deviceInstanceBuilder_.getMessageOrBuilder();
          } else {
            return deviceInstance_ == null ?
                com.google.protobuf.UInt32Value.getDefaultInstance() : deviceInstance_;
          }
        }
        /**
         * <pre>
         * A specific instance of the device of type 'device' to which the resources
         * are bound (instances are assumed to be numbered 0, 1, ...).
         * When representing the resources required by a servable that has yet to be
         * loaded, this field is optional. If not set, it denotes that the servable's
         * resources are not (yet) bound to a specific instance.
         * </pre>
         *
         * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
         */
        private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder> 
            getDeviceInstanceFieldBuilder() {
          if (deviceInstanceBuilder_ == null) {
            deviceInstanceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder>(
                    getDeviceInstance(),
                    getParentForChildren(),
                    isClean());
            deviceInstance_ = null;
          }
          return deviceInstanceBuilder_;
        }
  
        private java.lang.Object kind_ = "";
        /**
         * <pre>
         * The kind of resource on the device (instance), e.g. RAM or compute share.
         * A given type of resource should have a standard unit that represents the
         * smallest useful quantization. We strongly recommend including the unit
         * (e.g. bytes or millicores) in this string, as in "ram_bytes".
         * </pre>
         *
         * <code>string kind = 3;</code>
         */
        public java.lang.String getKind() {
          java.lang.Object ref = kind_;
          if (!(ref instanceof java.lang.String)) {
            com.google.protobuf.ByteString bs =
                (com.google.protobuf.ByteString) ref;
            java.lang.String s = bs.toStringUtf8();
            kind_ = s;
            return s;
          } else {
            return (java.lang.String) ref;
          }
        }
        /**
         * <pre>
         * The kind of resource on the device (instance), e.g. RAM or compute share.
         * A given type of resource should have a standard unit that represents the
         * smallest useful quantization. We strongly recommend including the unit
         * (e.g. bytes or millicores) in this string, as in "ram_bytes".
         * </pre>
         *
         * <code>string kind = 3;</code>
         */
        public com.google.protobuf.ByteString
            getKindBytes() {
          java.lang.Object ref = kind_;
          if (ref instanceof String) {
            com.google.protobuf.ByteString b = 
                com.google.protobuf.ByteString.copyFromUtf8(
                    (java.lang.String) ref);
            kind_ = b;
            return b;
          } else {
            return (com.google.protobuf.ByteString) ref;
          }
        }
        /**
         * <pre>
         * The kind of resource on the device (instance), e.g. RAM or compute share.
         * A given type of resource should have a standard unit that represents the
         * smallest useful quantization. We strongly recommend including the unit
         * (e.g. bytes or millicores) in this string, as in "ram_bytes".
         * </pre>
         *
         * <code>string kind = 3;</code>
         */
        public Builder setKind(
            java.lang.String value) {
          if (value == null) {
      throw new NullPointerException();
    }
    
          kind_ = value;
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The kind of resource on the device (instance), e.g. RAM or compute share.
         * A given type of resource should have a standard unit that represents the
         * smallest useful quantization. We strongly recommend including the unit
         * (e.g. bytes or millicores) in this string, as in "ram_bytes".
         * </pre>
         *
         * <code>string kind = 3;</code>
         */
        public Builder clearKind() {
          
          kind_ = getDefaultInstance().getKind();
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The kind of resource on the device (instance), e.g. RAM or compute share.
         * A given type of resource should have a standard unit that represents the
         * smallest useful quantization. We strongly recommend including the unit
         * (e.g. bytes or millicores) in this string, as in "ram_bytes".
         * </pre>
         *
         * <code>string kind = 3;</code>
         */
        public Builder setKindBytes(
            com.google.protobuf.ByteString value) {
          if (value == null) {
      throw new NullPointerException();
    }
    checkByteStringIsUtf8(value);
          
          kind_ = value;
          onChanged();
          return this;
        }
        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:angel.Resource)
      }
  
      // @@protoc_insertion_point(class_scope:angel.Resource)
      private static final com.tencent.angel.config.ResourceProtos.Resource DEFAULT_INSTANCE;
      static {
        DEFAULT_INSTANCE = new com.tencent.angel.config.ResourceProtos.Resource();
      }
  
      public static com.tencent.angel.config.ResourceProtos.Resource getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }
  
      private static final com.google.protobuf.Parser<Resource>
          PARSER = new com.google.protobuf.AbstractParser<Resource>() {
        public Resource parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new Resource(input, extensionRegistry);
        }
      };
  
      public static com.google.protobuf.Parser<Resource> parser() {
        return PARSER;
      }
  
      @java.lang.Override
      public com.google.protobuf.Parser<Resource> getParserForType() {
        return PARSER;
      }
  
      public com.tencent.angel.config.ResourceProtos.Resource getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
  
    }
  
    public interface ResourceAllocationOrBuilder extends
        // @@protoc_insertion_point(interface_extends:angel.ResourceAllocation)
        com.google.protobuf.MessageOrBuilder {
  
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      java.util.List<com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry> 
          getResourceQuantitiesList();
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry getResourceQuantities(int index);
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      int getResourceQuantitiesCount();
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      java.util.List<? extends com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder> 
          getResourceQuantitiesOrBuilderList();
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder getResourceQuantitiesOrBuilder(
          int index);
    }
    /**
     * <pre>
     * An allocation of one or more kinds of resources, along with the quantity of
     * each. Used to denote the resources that a servable (or collection of
     * servables) will use or is currently using. Also used to denote resources
     * available to the serving system for loading more servables.
     * </pre>
     *
     * Protobuf type {@code angel.ResourceAllocation}
     */
    public  static final class ResourceAllocation extends
        com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:angel.ResourceAllocation)
        ResourceAllocationOrBuilder {
    private static final long serialVersionUID = 0L;
      // Use ResourceAllocation.newBuilder() to construct.
      private ResourceAllocation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }
      private ResourceAllocation() {
        resourceQuantities_ = java.util.Collections.emptyList();
      }
  
      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
        return this.unknownFields;
      }
      private ResourceAllocation(
          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: {
                if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                  resourceQuantities_ = new java.util.ArrayList<com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry>();
                  mutable_bitField0_ |= 0x00000001;
                }
                resourceQuantities_.add(
                    input.readMessage(com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.parser(), extensionRegistry));
                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) == 0x00000001)) {
            resourceQuantities_ = java.util.Collections.unmodifiableList(resourceQuantities_);
          }
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_descriptor;
      }
  
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.tencent.angel.config.ResourceProtos.ResourceAllocation.class, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Builder.class);
      }
  
      public interface EntryOrBuilder extends
          // @@protoc_insertion_point(interface_extends:angel.ResourceAllocation.Entry)
          com.google.protobuf.MessageOrBuilder {
  
        /**
         * <code>.angel.Resource resource = 1;</code>
         */
        boolean hasResource();
        /**
         * <code>.angel.Resource resource = 1;</code>
         */
        com.tencent.angel.config.ResourceProtos.Resource getResource();
        /**
         * <code>.angel.Resource resource = 1;</code>
         */
        com.tencent.angel.config.ResourceProtos.ResourceOrBuilder getResourceOrBuilder();
  
        /**
         * <code>uint64 quantity = 2;</code>
         */
        long getQuantity();
      }
      /**
       * <pre>
       * A collection of resources, each with a quantity. Treated as a resource-&gt;
       * quantity map, i.e. no resource can repeat and the order is immaterial.
       * </pre>
       *
       * Protobuf type {@code angel.ResourceAllocation.Entry}
       */
      public  static final class Entry extends
          com.google.protobuf.GeneratedMessageV3 implements
          // @@protoc_insertion_point(message_implements:angel.ResourceAllocation.Entry)
          EntryOrBuilder {
      private static final long serialVersionUID = 0L;
        // Use Entry.newBuilder() to construct.
        private Entry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
          super(builder);
        }
        private Entry() {
          quantity_ = 0L;
        }
  
        @java.lang.Override
        public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
          return this.unknownFields;
        }
        private Entry(
            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: {
                  com.tencent.angel.config.ResourceProtos.Resource.Builder subBuilder = null;
                  if (resource_ != null) {
                    subBuilder = resource_.toBuilder();
                  }
                  resource_ = input.readMessage(com.tencent.angel.config.ResourceProtos.Resource.parser(), extensionRegistry);
                  if (subBuilder != null) {
                    subBuilder.mergeFrom(resource_);
                    resource_ = subBuilder.buildPartial();
                  }
  
                  break;
                }
                case 16: {
  
                  quantity_ = input.readUInt64();
                  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 {
            this.unknownFields = unknownFields.build();
            makeExtensionsImmutable();
          }
        }
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_Entry_descriptor;
        }
  
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_Entry_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.class, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder.class);
        }
  
        public static final int RESOURCE_FIELD_NUMBER = 1;
        private com.tencent.angel.config.ResourceProtos.Resource resource_;
        /**
         * <code>.angel.Resource resource = 1;</code>
         */
        public boolean hasResource() {
          return resource_ != null;
        }
        /**
         * <code>.angel.Resource resource = 1;</code>
         */
        public com.tencent.angel.config.ResourceProtos.Resource getResource() {
          return resource_ == null ? com.tencent.angel.config.ResourceProtos.Resource.getDefaultInstance() : resource_;
        }
        /**
         * <code>.angel.Resource resource = 1;</code>
         */
        public com.tencent.angel.config.ResourceProtos.ResourceOrBuilder getResourceOrBuilder() {
          return getResource();
        }
  
        public static final int QUANTITY_FIELD_NUMBER = 2;
        private long quantity_;
        /**
         * <code>uint64 quantity = 2;</code>
         */
        public long getQuantity() {
          return quantity_;
        }
  
        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 (resource_ != null) {
            output.writeMessage(1, getResource());
          }
          if (quantity_ != 0L) {
            output.writeUInt64(2, quantity_);
          }
          unknownFields.writeTo(output);
        }
  
        public int getSerializedSize() {
          int size = memoizedSize;
          if (size != -1) return size;
  
          size = 0;
          if (resource_ != null) {
            size += com.google.protobuf.CodedOutputStream
              .computeMessageSize(1, getResource());
          }
          if (quantity_ != 0L) {
            size += com.google.protobuf.CodedOutputStream
              .computeUInt64Size(2, quantity_);
          }
          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.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry)) {
            return super.equals(obj);
          }
          com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry other = (com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry) obj;
  
          boolean result = true;
          result = result && (hasResource() == other.hasResource());
          if (hasResource()) {
            result = result && getResource()
                .equals(other.getResource());
          }
          result = result && (getQuantity()
              == other.getQuantity());
          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();
          if (hasResource()) {
            hash = (37 * hash) + RESOURCE_FIELD_NUMBER;
            hash = (53 * hash) + getResource().hashCode();
          }
          hash = (37 * hash) + QUANTITY_FIELD_NUMBER;
          hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
              getQuantity());
          hash = (29 * hash) + unknownFields.hashCode();
          memoizedHashCode = hash;
          return hash;
        }
  
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parseFrom(
            java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return PARSER.parseFrom(data);
        }
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parseFrom(
            java.nio.ByteBuffer data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return PARSER.parseFrom(data, extensionRegistry);
        }
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parseFrom(
            com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return PARSER.parseFrom(data);
        }
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parseFrom(
            com.google.protobuf.ByteString data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return PARSER.parseFrom(data, extensionRegistry);
        }
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parseFrom(byte[] data)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return PARSER.parseFrom(data);
        }
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parseFrom(
            byte[] data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return PARSER.parseFrom(data, extensionRegistry);
        }
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parseFrom(java.io.InputStream input)
            throws java.io.IOException {
          return com.google.protobuf.GeneratedMessageV3
              .parseWithIOException(PARSER, input);
        }
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry 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.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parseDelimitedFrom(java.io.InputStream input)
            throws java.io.IOException {
          return com.google.protobuf.GeneratedMessageV3
              .parseDelimitedWithIOException(PARSER, input);
        }
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry 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.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parseFrom(
            com.google.protobuf.CodedInputStream input)
            throws java.io.IOException {
          return com.google.protobuf.GeneratedMessageV3
              .parseWithIOException(PARSER, input);
        }
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry 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.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry 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 collection of resources, each with a quantity. Treated as a resource-&gt;
         * quantity map, i.e. no resource can repeat and the order is immaterial.
         * </pre>
         *
         * Protobuf type {@code angel.ResourceAllocation.Entry}
         */
        public static final class Builder extends
            com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
            // @@protoc_insertion_point(builder_implements:angel.ResourceAllocation.Entry)
            com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder {
          public static final com.google.protobuf.Descriptors.Descriptor
              getDescriptor() {
            return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_Entry_descriptor;
          }
  
          protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
              internalGetFieldAccessorTable() {
            return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_Entry_fieldAccessorTable
                .ensureFieldAccessorsInitialized(
                    com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.class, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder.class);
          }
  
          // Construct using com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.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();
            if (resourceBuilder_ == null) {
              resource_ = null;
            } else {
              resource_ = null;
              resourceBuilder_ = null;
            }
            quantity_ = 0L;
  
            return this;
          }
  
          public com.google.protobuf.Descriptors.Descriptor
              getDescriptorForType() {
            return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_Entry_descriptor;
          }
  
          public com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry getDefaultInstanceForType() {
            return com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.getDefaultInstance();
          }
  
          public com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry build() {
            com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry result = buildPartial();
            if (!result.isInitialized()) {
              throw newUninitializedMessageException(result);
            }
            return result;
          }
  
          public com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry buildPartial() {
            com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry result = new com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry(this);
            if (resourceBuilder_ == null) {
              result.resource_ = resource_;
            } else {
              result.resource_ = resourceBuilder_.build();
            }
            result.quantity_ = quantity_;
            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.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry) {
              return mergeFrom((com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry)other);
            } else {
              super.mergeFrom(other);
              return this;
            }
          }
  
          public Builder mergeFrom(com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry other) {
            if (other == com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.getDefaultInstance()) return this;
            if (other.hasResource()) {
              mergeResource(other.getResource());
            }
            if (other.getQuantity() != 0L) {
              setQuantity(other.getQuantity());
            }
            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.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry parsedMessage = null;
            try {
              parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
              parsedMessage = (com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry) e.getUnfinishedMessage();
              throw e.unwrapIOException();
            } finally {
              if (parsedMessage != null) {
                mergeFrom(parsedMessage);
              }
            }
            return this;
          }
  
          private com.tencent.angel.config.ResourceProtos.Resource resource_ = null;
          private com.google.protobuf.SingleFieldBuilderV3<
              com.tencent.angel.config.ResourceProtos.Resource, com.tencent.angel.config.ResourceProtos.Resource.Builder, com.tencent.angel.config.ResourceProtos.ResourceOrBuilder> resourceBuilder_;
          /**
           * <code>.angel.Resource resource = 1;</code>
           */
          public boolean hasResource() {
            return resourceBuilder_ != null || resource_ != null;
          }
          /**
           * <code>.angel.Resource resource = 1;</code>
           */
          public com.tencent.angel.config.ResourceProtos.Resource getResource() {
            if (resourceBuilder_ == null) {
              return resource_ == null ? com.tencent.angel.config.ResourceProtos.Resource.getDefaultInstance() : resource_;
            } else {
              return resourceBuilder_.getMessage();
            }
          }
          /**
           * <code>.angel.Resource resource = 1;</code>
           */
          public Builder setResource(com.tencent.angel.config.ResourceProtos.Resource value) {
            if (resourceBuilder_ == null) {
              if (value == null) {
                throw new NullPointerException();
              }
              resource_ = value;
              onChanged();
            } else {
              resourceBuilder_.setMessage(value);
            }
  
            return this;
          }
          /**
           * <code>.angel.Resource resource = 1;</code>
           */
          public Builder setResource(
              com.tencent.angel.config.ResourceProtos.Resource.Builder builderForValue) {
            if (resourceBuilder_ == null) {
              resource_ = builderForValue.build();
              onChanged();
            } else {
              resourceBuilder_.setMessage(builderForValue.build());
            }
  
            return this;
          }
          /**
           * <code>.angel.Resource resource = 1;</code>
           */
          public Builder mergeResource(com.tencent.angel.config.ResourceProtos.Resource value) {
            if (resourceBuilder_ == null) {
              if (resource_ != null) {
                resource_ =
                  com.tencent.angel.config.ResourceProtos.Resource.newBuilder(resource_).mergeFrom(value).buildPartial();
              } else {
                resource_ = value;
              }
              onChanged();
            } else {
              resourceBuilder_.mergeFrom(value);
            }
  
            return this;
          }
          /**
           * <code>.angel.Resource resource = 1;</code>
           */
          public Builder clearResource() {
            if (resourceBuilder_ == null) {
              resource_ = null;
              onChanged();
            } else {
              resource_ = null;
              resourceBuilder_ = null;
            }
  
            return this;
          }
          /**
           * <code>.angel.Resource resource = 1;</code>
           */
          public com.tencent.angel.config.ResourceProtos.Resource.Builder getResourceBuilder() {
            
            onChanged();
            return getResourceFieldBuilder().getBuilder();
          }
          /**
           * <code>.angel.Resource resource = 1;</code>
           */
          public com.tencent.angel.config.ResourceProtos.ResourceOrBuilder getResourceOrBuilder() {
            if (resourceBuilder_ != null) {
              return resourceBuilder_.getMessageOrBuilder();
            } else {
              return resource_ == null ?
                  com.tencent.angel.config.ResourceProtos.Resource.getDefaultInstance() : resource_;
            }
          }
          /**
           * <code>.angel.Resource resource = 1;</code>
           */
          private com.google.protobuf.SingleFieldBuilderV3<
              com.tencent.angel.config.ResourceProtos.Resource, com.tencent.angel.config.ResourceProtos.Resource.Builder, com.tencent.angel.config.ResourceProtos.ResourceOrBuilder> 
              getResourceFieldBuilder() {
            if (resourceBuilder_ == null) {
              resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
                  com.tencent.angel.config.ResourceProtos.Resource, com.tencent.angel.config.ResourceProtos.Resource.Builder, com.tencent.angel.config.ResourceProtos.ResourceOrBuilder>(
                      getResource(),
                      getParentForChildren(),
                      isClean());
              resource_ = null;
            }
            return resourceBuilder_;
          }
  
          private long quantity_ ;
          /**
           * <code>uint64 quantity = 2;</code>
           */
          public long getQuantity() {
            return quantity_;
          }
          /**
           * <code>uint64 quantity = 2;</code>
           */
          public Builder setQuantity(long value) {
            
            quantity_ = value;
            onChanged();
            return this;
          }
          /**
           * <code>uint64 quantity = 2;</code>
           */
          public Builder clearQuantity() {
            
            quantity_ = 0L;
            onChanged();
            return this;
          }
          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:angel.ResourceAllocation.Entry)
        }
  
        // @@protoc_insertion_point(class_scope:angel.ResourceAllocation.Entry)
        private static final com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry DEFAULT_INSTANCE;
        static {
          DEFAULT_INSTANCE = new com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry();
        }
  
        public static com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry getDefaultInstance() {
          return DEFAULT_INSTANCE;
        }
  
        private static final com.google.protobuf.Parser<Entry>
            PARSER = new com.google.protobuf.AbstractParser<Entry>() {
          public Entry parsePartialFrom(
              com.google.protobuf.CodedInputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
            return new Entry(input, extensionRegistry);
          }
        };
  
        public static com.google.protobuf.Parser<Entry> parser() {
          return PARSER;
        }
  
        @java.lang.Override
        public com.google.protobuf.Parser<Entry> getParserForType() {
          return PARSER;
        }
  
        public com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry getDefaultInstanceForType() {
          return DEFAULT_INSTANCE;
        }
  
      }
  
      public static final int RESOURCE_QUANTITIES_FIELD_NUMBER = 1;
      private java.util.List<com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry> resourceQuantities_;
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public java.util.List<com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry> getResourceQuantitiesList() {
        return resourceQuantities_;
      }
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public java.util.List<? extends com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder> 
          getResourceQuantitiesOrBuilderList() {
        return resourceQuantities_;
      }
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public int getResourceQuantitiesCount() {
        return resourceQuantities_.size();
      }
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry getResourceQuantities(int index) {
        return resourceQuantities_.get(index);
      }
      /**
       * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder getResourceQuantitiesOrBuilder(
          int index) {
        return resourceQuantities_.get(index);
      }
  
      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 {
        for (int i = 0; i < resourceQuantities_.size(); i++) {
          output.writeMessage(1, resourceQuantities_.get(i));
        }
        unknownFields.writeTo(output);
      }
  
      public int getSerializedSize() {
        int size = memoizedSize;
        if (size != -1) return size;
  
        size = 0;
        for (int i = 0; i < resourceQuantities_.size(); i++) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(1, resourceQuantities_.get(i));
        }
        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.tencent.angel.config.ResourceProtos.ResourceAllocation)) {
          return super.equals(obj);
        }
        com.tencent.angel.config.ResourceProtos.ResourceAllocation other = (com.tencent.angel.config.ResourceProtos.ResourceAllocation) obj;
  
        boolean result = true;
        result = result && getResourceQuantitiesList()
            .equals(other.getResourceQuantitiesList());
        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();
        if (getResourceQuantitiesCount() > 0) {
          hash = (37 * hash) + RESOURCE_QUANTITIES_FIELD_NUMBER;
          hash = (53 * hash) + getResourceQuantitiesList().hashCode();
        }
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
      }
  
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation parseFrom(
          java.nio.ByteBuffer data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation parseFrom(
          java.nio.ByteBuffer data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation 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.tencent.angel.config.ResourceProtos.ResourceAllocation parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseDelimitedWithIOException(PARSER, input);
      }
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation 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.tencent.angel.config.ResourceProtos.ResourceAllocation parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation 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.tencent.angel.config.ResourceProtos.ResourceAllocation 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>
       * An allocation of one or more kinds of resources, along with the quantity of
       * each. Used to denote the resources that a servable (or collection of
       * servables) will use or is currently using. Also used to denote resources
       * available to the serving system for loading more servables.
       * </pre>
       *
       * Protobuf type {@code angel.ResourceAllocation}
       */
      public static final class Builder extends
          com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
          // @@protoc_insertion_point(builder_implements:angel.ResourceAllocation)
          com.tencent.angel.config.ResourceProtos.ResourceAllocationOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_descriptor;
        }
  
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.tencent.angel.config.ResourceProtos.ResourceAllocation.class, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Builder.class);
        }
  
        // Construct using com.tencent.angel.config.ResourceProtos.ResourceAllocation.newBuilder()
        private Builder() {
          maybeForceBuilderInitialization();
        }
  
        private Builder(
            com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
          super(parent);
          maybeForceBuilderInitialization();
        }
        private void maybeForceBuilderInitialization() {
          if (com.google.protobuf.GeneratedMessageV3
                  .alwaysUseFieldBuilders) {
            getResourceQuantitiesFieldBuilder();
          }
        }
        public Builder clear() {
          super.clear();
          if (resourceQuantitiesBuilder_ == null) {
            resourceQuantities_ = java.util.Collections.emptyList();
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            resourceQuantitiesBuilder_.clear();
          }
          return this;
        }
  
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return com.tencent.angel.config.ResourceProtos.internal_static_angel_ResourceAllocation_descriptor;
        }
  
        public com.tencent.angel.config.ResourceProtos.ResourceAllocation getDefaultInstanceForType() {
          return com.tencent.angel.config.ResourceProtos.ResourceAllocation.getDefaultInstance();
        }
  
        public com.tencent.angel.config.ResourceProtos.ResourceAllocation build() {
          com.tencent.angel.config.ResourceProtos.ResourceAllocation result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }
  
        public com.tencent.angel.config.ResourceProtos.ResourceAllocation buildPartial() {
          com.tencent.angel.config.ResourceProtos.ResourceAllocation result = new com.tencent.angel.config.ResourceProtos.ResourceAllocation(this);
          int from_bitField0_ = bitField0_;
          if (resourceQuantitiesBuilder_ == null) {
            if (((bitField0_ & 0x00000001) == 0x00000001)) {
              resourceQuantities_ = java.util.Collections.unmodifiableList(resourceQuantities_);
              bitField0_ = (bitField0_ & ~0x00000001);
            }
            result.resourceQuantities_ = resourceQuantities_;
          } else {
            result.resourceQuantities_ = resourceQuantitiesBuilder_.build();
          }
          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.tencent.angel.config.ResourceProtos.ResourceAllocation) {
            return mergeFrom((com.tencent.angel.config.ResourceProtos.ResourceAllocation)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
  
        public Builder mergeFrom(com.tencent.angel.config.ResourceProtos.ResourceAllocation other) {
          if (other == com.tencent.angel.config.ResourceProtos.ResourceAllocation.getDefaultInstance()) return this;
          if (resourceQuantitiesBuilder_ == null) {
            if (!other.resourceQuantities_.isEmpty()) {
              if (resourceQuantities_.isEmpty()) {
                resourceQuantities_ = other.resourceQuantities_;
                bitField0_ = (bitField0_ & ~0x00000001);
              } else {
                ensureResourceQuantitiesIsMutable();
                resourceQuantities_.addAll(other.resourceQuantities_);
              }
              onChanged();
            }
          } else {
            if (!other.resourceQuantities_.isEmpty()) {
              if (resourceQuantitiesBuilder_.isEmpty()) {
                resourceQuantitiesBuilder_.dispose();
                resourceQuantitiesBuilder_ = null;
                resourceQuantities_ = other.resourceQuantities_;
                bitField0_ = (bitField0_ & ~0x00000001);
                resourceQuantitiesBuilder_ = 
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                     getResourceQuantitiesFieldBuilder() : null;
              } else {
                resourceQuantitiesBuilder_.addAllMessages(other.resourceQuantities_);
              }
            }
          }
          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.tencent.angel.config.ResourceProtos.ResourceAllocation parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage = (com.tencent.angel.config.ResourceProtos.ResourceAllocation) e.getUnfinishedMessage();
            throw e.unwrapIOException();
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }
        private int bitField0_;
  
        private java.util.List<com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry> resourceQuantities_ =
          java.util.Collections.emptyList();
        private void ensureResourceQuantitiesIsMutable() {
          if (!((bitField0_ & 0x00000001) == 0x00000001)) {
            resourceQuantities_ = new java.util.ArrayList<com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry>(resourceQuantities_);
            bitField0_ |= 0x00000001;
           }
        }
  
        private com.google.protobuf.RepeatedFieldBuilderV3<
            com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder, com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder> resourceQuantitiesBuilder_;
  
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public java.util.List<com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry> getResourceQuantitiesList() {
          if (resourceQuantitiesBuilder_ == null) {
            return java.util.Collections.unmodifiableList(resourceQuantities_);
          } else {
            return resourceQuantitiesBuilder_.getMessageList();
          }
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public int getResourceQuantitiesCount() {
          if (resourceQuantitiesBuilder_ == null) {
            return resourceQuantities_.size();
          } else {
            return resourceQuantitiesBuilder_.getCount();
          }
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry getResourceQuantities(int index) {
          if (resourceQuantitiesBuilder_ == null) {
            return resourceQuantities_.get(index);
          } else {
            return resourceQuantitiesBuilder_.getMessage(index);
          }
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public Builder setResourceQuantities(
            int index, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry value) {
          if (resourceQuantitiesBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureResourceQuantitiesIsMutable();
            resourceQuantities_.set(index, value);
            onChanged();
          } else {
            resourceQuantitiesBuilder_.setMessage(index, value);
          }
          return this;
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public Builder setResourceQuantities(
            int index, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder builderForValue) {
          if (resourceQuantitiesBuilder_ == null) {
            ensureResourceQuantitiesIsMutable();
            resourceQuantities_.set(index, builderForValue.build());
            onChanged();
          } else {
            resourceQuantitiesBuilder_.setMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public Builder addResourceQuantities(com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry value) {
          if (resourceQuantitiesBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureResourceQuantitiesIsMutable();
            resourceQuantities_.add(value);
            onChanged();
          } else {
            resourceQuantitiesBuilder_.addMessage(value);
          }
          return this;
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public Builder addResourceQuantities(
            int index, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry value) {
          if (resourceQuantitiesBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureResourceQuantitiesIsMutable();
            resourceQuantities_.add(index, value);
            onChanged();
          } else {
            resourceQuantitiesBuilder_.addMessage(index, value);
          }
          return this;
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public Builder addResourceQuantities(
            com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder builderForValue) {
          if (resourceQuantitiesBuilder_ == null) {
            ensureResourceQuantitiesIsMutable();
            resourceQuantities_.add(builderForValue.build());
            onChanged();
          } else {
            resourceQuantitiesBuilder_.addMessage(builderForValue.build());
          }
          return this;
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public Builder addResourceQuantities(
            int index, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder builderForValue) {
          if (resourceQuantitiesBuilder_ == null) {
            ensureResourceQuantitiesIsMutable();
            resourceQuantities_.add(index, builderForValue.build());
            onChanged();
          } else {
            resourceQuantitiesBuilder_.addMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public Builder addAllResourceQuantities(
            java.lang.Iterable<? extends com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry> values) {
          if (resourceQuantitiesBuilder_ == null) {
            ensureResourceQuantitiesIsMutable();
            com.google.protobuf.AbstractMessageLite.Builder.addAll(
                values, resourceQuantities_);
            onChanged();
          } else {
            resourceQuantitiesBuilder_.addAllMessages(values);
          }
          return this;
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public Builder clearResourceQuantities() {
          if (resourceQuantitiesBuilder_ == null) {
            resourceQuantities_ = java.util.Collections.emptyList();
            bitField0_ = (bitField0_ & ~0x00000001);
            onChanged();
          } else {
            resourceQuantitiesBuilder_.clear();
          }
          return this;
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public Builder removeResourceQuantities(int index) {
          if (resourceQuantitiesBuilder_ == null) {
            ensureResourceQuantitiesIsMutable();
            resourceQuantities_.remove(index);
            onChanged();
          } else {
            resourceQuantitiesBuilder_.remove(index);
          }
          return this;
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder getResourceQuantitiesBuilder(
            int index) {
          return getResourceQuantitiesFieldBuilder().getBuilder(index);
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder getResourceQuantitiesOrBuilder(
            int index) {
          if (resourceQuantitiesBuilder_ == null) {
            return resourceQuantities_.get(index);  } else {
            return resourceQuantitiesBuilder_.getMessageOrBuilder(index);
          }
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public java.util.List<? extends com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder> 
             getResourceQuantitiesOrBuilderList() {
          if (resourceQuantitiesBuilder_ != null) {
            return resourceQuantitiesBuilder_.getMessageOrBuilderList();
          } else {
            return java.util.Collections.unmodifiableList(resourceQuantities_);
          }
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder addResourceQuantitiesBuilder() {
          return getResourceQuantitiesFieldBuilder().addBuilder(
              com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.getDefaultInstance());
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder addResourceQuantitiesBuilder(
            int index) {
          return getResourceQuantitiesFieldBuilder().addBuilder(
              index, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.getDefaultInstance());
        }
        /**
         * <code>repeated .angel.ResourceAllocation.Entry resource_quantities = 1;</code>
         */
        public java.util.List<com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder> 
             getResourceQuantitiesBuilderList() {
          return getResourceQuantitiesFieldBuilder().getBuilderList();
        }
        private com.google.protobuf.RepeatedFieldBuilderV3<
            com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder, com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder> 
            getResourceQuantitiesFieldBuilder() {
          if (resourceQuantitiesBuilder_ == null) {
            resourceQuantitiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
                com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry, com.tencent.angel.config.ResourceProtos.ResourceAllocation.Entry.Builder, com.tencent.angel.config.ResourceProtos.ResourceAllocation.EntryOrBuilder>(
                    resourceQuantities_,
                    ((bitField0_ & 0x00000001) == 0x00000001),
                    getParentForChildren(),
                    isClean());
            resourceQuantities_ = null;
          }
          return resourceQuantitiesBuilder_;
        }
        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:angel.ResourceAllocation)
      }
  
      // @@protoc_insertion_point(class_scope:angel.ResourceAllocation)
      private static final com.tencent.angel.config.ResourceProtos.ResourceAllocation DEFAULT_INSTANCE;
      static {
        DEFAULT_INSTANCE = new com.tencent.angel.config.ResourceProtos.ResourceAllocation();
      }
  
      public static com.tencent.angel.config.ResourceProtos.ResourceAllocation getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }
  
      private static final com.google.protobuf.Parser<ResourceAllocation>
          PARSER = new com.google.protobuf.AbstractParser<ResourceAllocation>() {
        public ResourceAllocation parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ResourceAllocation(input, extensionRegistry);
        }
      };
  
      public static com.google.protobuf.Parser<ResourceAllocation> parser() {
        return PARSER;
      }
  
      @java.lang.Override
      public com.google.protobuf.Parser<ResourceAllocation> getParserForType() {
        return PARSER;
      }
  
      public com.tencent.angel.config.ResourceProtos.ResourceAllocation getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
  
    }
  
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_Resource_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_Resource_fieldAccessorTable;
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_ResourceAllocation_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_ResourceAllocation_fieldAccessorTable;
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_ResourceAllocation_Entry_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_ResourceAllocation_Entry_fieldAccessorTable;
  
    public static com.google.protobuf.Descriptors.FileDescriptor
        getDescriptor() {
      return descriptor;
    }
    private static  com.google.protobuf.Descriptors.FileDescriptor
        descriptor;
    static {
      java.lang.String[] descriptorData = {
        "\n\026config/resources.proto\022\005angel\032\036google/" +
        "protobuf/wrappers.proto\"_\n\010Resource\022\016\n\006d" +
        "evice\030\001 \001(\t\0225\n\017device_instance\030\002 \001(\0132\034.g" +
        "oogle.protobuf.UInt32Value\022\014\n\004kind\030\003 \001(\t" +
        "\"\220\001\n\022ResourceAllocation\022<\n\023resource_quan" +
        "tities\030\001 \003(\0132\037.angel.ResourceAllocation." +
        "Entry\032<\n\005Entry\022!\n\010resource\030\001 \001(\0132\017.angel" +
        ".Resource\022\020\n\010quantity\030\002 \001(\004B,\n\030com.tence" +
        "nt.angel.configB\016ResourceProtosP\000b\006proto" +
        "3"
      };
      com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
          new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
            public com.google.protobuf.ExtensionRegistry assignDescriptors(
                com.google.protobuf.Descriptors.FileDescriptor root) {
              descriptor = root;
              return null;
            }
          };
      com.google.protobuf.Descriptors.FileDescriptor
        .internalBuildGeneratedFileFrom(descriptorData,
          new com.google.protobuf.Descriptors.FileDescriptor[] {
            com.google.protobuf.WrappersProto.getDescriptor(),
          }, assigner);
      internal_static_angel_Resource_descriptor =
        getDescriptor().getMessageTypes().get(0);
      internal_static_angel_Resource_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_Resource_descriptor,
          new java.lang.String[] { "Device", "DeviceInstance", "Kind", });
      internal_static_angel_ResourceAllocation_descriptor =
        getDescriptor().getMessageTypes().get(1);
      internal_static_angel_ResourceAllocation_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_ResourceAllocation_descriptor,
          new java.lang.String[] { "ResourceQuantities", });
      internal_static_angel_ResourceAllocation_Entry_descriptor =
        internal_static_angel_ResourceAllocation_descriptor.getNestedTypes().get(0);
      internal_static_angel_ResourceAllocation_Entry_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_ResourceAllocation_Entry_descriptor,
          new java.lang.String[] { "Resource", "Quantity", });
      com.google.protobuf.WrappersProto.getDescriptor();
    }
  
    // @@protoc_insertion_point(outer_class_scope)
  }
  