diff --git a/common/src/main/java/com/usthe/common/entity/message/CollectRep.java b/common/src/main/java/com/usthe/common/entity/message/CollectRep.java index a990c4d..38f9de5 100644 --- a/common/src/main/java/com/usthe/common/entity/message/CollectRep.java +++ b/common/src/main/java/com/usthe/common/entity/message/CollectRep.java @@ -315,18 +315,24 @@ public final class CollectRep { * 采集指标名 * * - * repeated string fields = 7; - * @return A list containing the fields. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ - java.util.List + java.util.List getFieldsList(); /** *
      * 采集指标名
      * 
* - * repeated string fields = 7; - * @return The count of fields. + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + com.usthe.common.entity.message.CollectRep.Field getFields(int index); + /** + *
+     * 采集指标名
+     * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; */ int getFieldsCount(); /** @@ -334,22 +340,19 @@ public final class CollectRep { * 采集指标名 * * - * repeated string fields = 7; - * @param index The index of the element to return. - * @return The fields at the given index. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ - java.lang.String getFields(int index); + java.util.List + getFieldsOrBuilderList(); /** *
      * 采集指标名
      * 
* - * repeated string fields = 7; - * @param index The index of the value to return. - * @return The bytes of the fields at the given index. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ - com.google.protobuf.ByteString - getFieldsBytes(int index); + com.usthe.common.entity.message.CollectRep.FieldOrBuilder getFieldsOrBuilder( + int index); /** *
@@ -412,7 +415,7 @@ public final class CollectRep {
       metrics_ = "";
       code_ = 0;
       msg_ = "";
-      fields_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+      fields_ = java.util.Collections.emptyList();
       values_ = java.util.Collections.emptyList();
     }
 
@@ -482,12 +485,12 @@ public final class CollectRep {
               break;
             }
             case 58: {
-              java.lang.String s = input.readStringRequireUtf8();
               if (!((mutable_bitField0_ & 0x00000001) != 0)) {
-                fields_ = new com.google.protobuf.LazyStringArrayList();
+                fields_ = new java.util.ArrayList();
                 mutable_bitField0_ |= 0x00000001;
               }
-              fields_.add(s);
+              fields_.add(
+                  input.readMessage(com.usthe.common.entity.message.CollectRep.Field.parser(), extensionRegistry));
               break;
             }
             case 66: {
@@ -515,7 +518,7 @@ public final class CollectRep {
             e).setUnfinishedMessage(this);
       } finally {
         if (((mutable_bitField0_ & 0x00000001) != 0)) {
-          fields_ = fields_.getUnmodifiableView();
+          fields_ = java.util.Collections.unmodifiableList(fields_);
         }
         if (((mutable_bitField0_ & 0x00000002) != 0)) {
           values_ = java.util.Collections.unmodifiableList(values_);
@@ -733,17 +736,16 @@ public final class CollectRep {
     }
 
     public static final int FIELDS_FIELD_NUMBER = 7;
-    private com.google.protobuf.LazyStringList fields_;
+    private java.util.List fields_;
     /**
      * 
      * 采集指标名
      * 
* - * repeated string fields = 7; - * @return A list containing the fields. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ - public com.google.protobuf.ProtocolStringList - getFieldsList() { + @java.lang.Override + public java.util.List getFieldsList() { return fields_; } /** @@ -751,9 +753,21 @@ public final class CollectRep { * 采集指标名 *
* - * repeated string fields = 7; - * @return The count of fields. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ + @java.lang.Override + public java.util.List + getFieldsOrBuilderList() { + return fields_; + } + /** + *
+     * 采集指标名
+     * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + @java.lang.Override public int getFieldsCount() { return fields_.size(); } @@ -762,11 +776,10 @@ public final class CollectRep { * 采集指标名 * * - * repeated string fields = 7; - * @param index The index of the element to return. - * @return The fields at the given index. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ - public java.lang.String getFields(int index) { + @java.lang.Override + public com.usthe.common.entity.message.CollectRep.Field getFields(int index) { return fields_.get(index); } /** @@ -774,13 +787,12 @@ public final class CollectRep { * 采集指标名 * * - * repeated string fields = 7; - * @param index The index of the value to return. - * @return The bytes of the fields at the given index. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ - public com.google.protobuf.ByteString - getFieldsBytes(int index) { - return fields_.getByteString(index); + @java.lang.Override + public com.usthe.common.entity.message.CollectRep.FieldOrBuilder getFieldsOrBuilder( + int index) { + return fields_.get(index); } public static final int VALUES_FIELD_NUMBER = 8; @@ -876,7 +888,7 @@ public final class CollectRep { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, msg_); } for (int i = 0; i < fields_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, fields_.getRaw(i)); + output.writeMessage(7, fields_.get(i)); } for (int i = 0; i < values_.size(); i++) { output.writeMessage(8, values_.get(i)); @@ -911,13 +923,9 @@ public final class CollectRep { if (!getMsgBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, msg_); } - { - int dataSize = 0; - for (int i = 0; i < fields_.size(); i++) { - dataSize += computeStringSizeNoTag(fields_.getRaw(i)); - } - size += dataSize; - size += 1 * getFieldsList().size(); + for (int i = 0; i < fields_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, fields_.get(i)); } for (int i = 0; i < values_.size(); i++) { size += com.google.protobuf.CodedOutputStream @@ -1114,6 +1122,7 @@ public final class CollectRep { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getFieldsFieldBuilder(); getValuesFieldBuilder(); } } @@ -1132,8 +1141,12 @@ public final class CollectRep { msg_ = ""; - fields_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + fieldsBuilder_.clear(); + } if (valuesBuilder_ == null) { values_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); @@ -1173,11 +1186,15 @@ public final class CollectRep { result.time_ = time_; result.code_ = code_; result.msg_ = msg_; - if (((bitField0_ & 0x00000001) != 0)) { - fields_ = fields_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (fieldsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fields_ = fields_; + } else { + result.fields_ = fieldsBuilder_.build(); } - result.fields_ = fields_; if (valuesBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { values_ = java.util.Collections.unmodifiableList(values_); @@ -1256,15 +1273,31 @@ public final class CollectRep { msg_ = other.msg_; onChanged(); } - if (!other.fields_.isEmpty()) { - if (fields_.isEmpty()) { - fields_ = other.fields_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFieldsIsMutable(); - fields_.addAll(other.fields_); + if (fieldsBuilder_ == null) { + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + } else { + if (!other.fields_.isEmpty()) { + if (fieldsBuilder_.isEmpty()) { + fieldsBuilder_.dispose(); + fieldsBuilder_ = null; + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + fieldsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFieldsFieldBuilder() : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } } - onChanged(); } if (valuesBuilder_ == null) { if (!other.values_.isEmpty()) { @@ -1770,79 +1803,79 @@ public final class CollectRep { return this; } - private com.google.protobuf.LazyStringList fields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private java.util.List fields_ = + java.util.Collections.emptyList(); private void ensureFieldsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - fields_ = new com.google.protobuf.LazyStringArrayList(fields_); + fields_ = new java.util.ArrayList(fields_); bitField0_ |= 0x00000001; } } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.usthe.common.entity.message.CollectRep.Field, com.usthe.common.entity.message.CollectRep.Field.Builder, com.usthe.common.entity.message.CollectRep.FieldOrBuilder> fieldsBuilder_; + /** *
        * 采集指标名
        * 
* - * repeated string fields = 7; - * @return A list containing the fields. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ - public com.google.protobuf.ProtocolStringList - getFieldsList() { - return fields_.getUnmodifiableView(); + public java.util.List getFieldsList() { + if (fieldsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fields_); + } else { + return fieldsBuilder_.getMessageList(); + } } /** *
        * 采集指标名
        * 
* - * repeated string fields = 7; - * @return The count of fields. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ public int getFieldsCount() { - return fields_.size(); + if (fieldsBuilder_ == null) { + return fields_.size(); + } else { + return fieldsBuilder_.getCount(); + } } /** *
        * 采集指标名
        * 
* - * repeated string fields = 7; - * @param index The index of the element to return. - * @return The fields at the given index. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ - public java.lang.String getFields(int index) { - return fields_.get(index); + public com.usthe.common.entity.message.CollectRep.Field getFields(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessage(index); + } } /** *
        * 采集指标名
        * 
* - * repeated string fields = 7; - * @param index The index of the value to return. - * @return The bytes of the fields at the given index. - */ - public com.google.protobuf.ByteString - getFieldsBytes(int index) { - return fields_.getByteString(index); - } - /** - *
-       * 采集指标名
-       * 
- * - * repeated string fields = 7; - * @param index The index to set the value at. - * @param value The fields to set. - * @return This builder for chaining. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ public Builder setFields( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFieldsIsMutable(); - fields_.set(index, value); - onChanged(); + int index, com.usthe.common.entity.message.CollectRep.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.set(index, value); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, value); + } return this; } /** @@ -1850,18 +1883,58 @@ public final class CollectRep { * 采集指标名 * * - * repeated string fields = 7; - * @param value The fields to add. - * @return This builder for chaining. + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public Builder setFields( + int index, com.usthe.common.entity.message.CollectRep.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public Builder addFields(com.usthe.common.entity.message.CollectRep.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + } else { + fieldsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; */ public Builder addFields( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureFieldsIsMutable(); - fields_.add(value); - onChanged(); + int index, com.usthe.common.entity.message.CollectRep.Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(index, value); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, value); + } return this; } /** @@ -1869,16 +1942,54 @@ public final class CollectRep { * 采集指标名 * * - * repeated string fields = 7; - * @param values The fields to add. - * @return This builder for chaining. + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public Builder addFields( + com.usthe.common.entity.message.CollectRep.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public Builder addFields( + int index, com.usthe.common.entity.message.CollectRep.Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; */ public Builder addAllFields( - java.lang.Iterable values) { - ensureFieldsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, fields_); - onChanged(); + java.lang.Iterable values) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fields_); + onChanged(); + } else { + fieldsBuilder_.addAllMessages(values); + } return this; } /** @@ -1886,13 +1997,16 @@ public final class CollectRep { * 采集指标名 * * - * repeated string fields = 7; - * @return This builder for chaining. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ public Builder clearFields() { - fields_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fieldsBuilder_.clear(); + } return this; } /** @@ -1900,21 +2014,106 @@ public final class CollectRep { * 采集指标名 * * - * repeated string fields = 7; - * @param value The bytes of the fields to add. - * @return This builder for chaining. + * repeated .com.usthe.common.entity.message.Field fields = 7; */ - public Builder addFieldsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureFieldsIsMutable(); - fields_.add(value); - onChanged(); + public Builder removeFields(int index) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.remove(index); + onChanged(); + } else { + fieldsBuilder_.remove(index); + } return this; } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public com.usthe.common.entity.message.CollectRep.Field.Builder getFieldsBuilder( + int index) { + return getFieldsFieldBuilder().getBuilder(index); + } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public com.usthe.common.entity.message.CollectRep.FieldOrBuilder getFieldsOrBuilder( + int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); } else { + return fieldsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public java.util.List + getFieldsOrBuilderList() { + if (fieldsBuilder_ != null) { + return fieldsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fields_); + } + } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public com.usthe.common.entity.message.CollectRep.Field.Builder addFieldsBuilder() { + return getFieldsFieldBuilder().addBuilder( + com.usthe.common.entity.message.CollectRep.Field.getDefaultInstance()); + } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public com.usthe.common.entity.message.CollectRep.Field.Builder addFieldsBuilder( + int index) { + return getFieldsFieldBuilder().addBuilder( + index, com.usthe.common.entity.message.CollectRep.Field.getDefaultInstance()); + } + /** + *
+       * 采集指标名
+       * 
+ * + * repeated .com.usthe.common.entity.message.Field fields = 7; + */ + public java.util.List + getFieldsBuilderList() { + return getFieldsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.usthe.common.entity.message.CollectRep.Field, com.usthe.common.entity.message.CollectRep.Field.Builder, com.usthe.common.entity.message.CollectRep.FieldOrBuilder> + getFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.usthe.common.entity.message.CollectRep.Field, com.usthe.common.entity.message.CollectRep.Field.Builder, com.usthe.common.entity.message.CollectRep.FieldOrBuilder>( + fields_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + fields_ = null; + } + return fieldsBuilder_; + } private java.util.List values_ = java.util.Collections.emptyList(); @@ -2280,6 +2479,700 @@ public final class CollectRep { } + public interface FieldOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.usthe.common.entity.message.Field) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 指标采集字符名称
+     * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+     * 指标采集字符名称
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+     * 字段类型:0-number数字 1-string字符串
+     * 
+ * + * uint32 type = 2; + * @return The type. + */ + int getType(); + } + /** + * Protobuf type {@code com.usthe.common.entity.message.Field} + */ + public static final class Field extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.usthe.common.entity.message.Field) + FieldOrBuilder { + private static final long serialVersionUID = 0L; + // Use Field.newBuilder() to construct. + private Field(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Field() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Field(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Field( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: { + + type_ = input.readUInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.usthe.common.entity.message.CollectRep.internal_static_com_usthe_common_entity_message_Field_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.usthe.common.entity.message.CollectRep.internal_static_com_usthe_common_entity_message_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.usthe.common.entity.message.CollectRep.Field.class, com.usthe.common.entity.message.CollectRep.Field.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+     * 指标采集字符名称
+     * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+     * 指标采集字符名称
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_; + /** + *
+     * 字段类型:0-number数字 1-string字符串
+     * 
+ * + * uint32 type = 2; + * @return The type. + */ + @java.lang.Override + public int getType() { + return type_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (type_ != 0) { + output.writeUInt32(2, type_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, type_); + } + 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.usthe.common.entity.message.CollectRep.Field)) { + return super.equals(obj); + } + com.usthe.common.entity.message.CollectRep.Field other = (com.usthe.common.entity.message.CollectRep.Field) obj; + + if (!getName() + .equals(other.getName())) return false; + if (getType() + != other.getType()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.usthe.common.entity.message.CollectRep.Field parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.usthe.common.entity.message.CollectRep.Field parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.usthe.common.entity.message.CollectRep.Field parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.usthe.common.entity.message.CollectRep.Field parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.usthe.common.entity.message.CollectRep.Field parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.usthe.common.entity.message.CollectRep.Field parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.usthe.common.entity.message.CollectRep.Field parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.usthe.common.entity.message.CollectRep.Field 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.usthe.common.entity.message.CollectRep.Field parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.usthe.common.entity.message.CollectRep.Field 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.usthe.common.entity.message.CollectRep.Field parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.usthe.common.entity.message.CollectRep.Field parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.usthe.common.entity.message.CollectRep.Field prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.usthe.common.entity.message.Field} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.usthe.common.entity.message.Field) + com.usthe.common.entity.message.CollectRep.FieldOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.usthe.common.entity.message.CollectRep.internal_static_com_usthe_common_entity_message_Field_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.usthe.common.entity.message.CollectRep.internal_static_com_usthe_common_entity_message_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.usthe.common.entity.message.CollectRep.Field.class, com.usthe.common.entity.message.CollectRep.Field.Builder.class); + } + + // Construct using com.usthe.common.entity.message.CollectRep.Field.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + type_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.usthe.common.entity.message.CollectRep.internal_static_com_usthe_common_entity_message_Field_descriptor; + } + + @java.lang.Override + public com.usthe.common.entity.message.CollectRep.Field getDefaultInstanceForType() { + return com.usthe.common.entity.message.CollectRep.Field.getDefaultInstance(); + } + + @java.lang.Override + public com.usthe.common.entity.message.CollectRep.Field build() { + com.usthe.common.entity.message.CollectRep.Field result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.usthe.common.entity.message.CollectRep.Field buildPartial() { + com.usthe.common.entity.message.CollectRep.Field result = new com.usthe.common.entity.message.CollectRep.Field(this); + result.name_ = name_; + result.type_ = type_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.usthe.common.entity.message.CollectRep.Field) { + return mergeFrom((com.usthe.common.entity.message.CollectRep.Field)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.usthe.common.entity.message.CollectRep.Field other) { + if (other == com.usthe.common.entity.message.CollectRep.Field.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getType() != 0) { + setType(other.getType()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.usthe.common.entity.message.CollectRep.Field parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.usthe.common.entity.message.CollectRep.Field) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+       * 指标采集字符名称
+       * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * 指标采集字符名称
+       * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * 指标采集字符名称
+       * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+       * 指标采集字符名称
+       * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+       * 指标采集字符名称
+       * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int type_ ; + /** + *
+       * 字段类型:0-number数字 1-string字符串
+       * 
+ * + * uint32 type = 2; + * @return The type. + */ + @java.lang.Override + public int getType() { + return type_; + } + /** + *
+       * 字段类型:0-number数字 1-string字符串
+       * 
+ * + * uint32 type = 2; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + *
+       * 字段类型:0-number数字 1-string字符串
+       * 
+ * + * uint32 type = 2; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.usthe.common.entity.message.Field) + } + + // @@protoc_insertion_point(class_scope:com.usthe.common.entity.message.Field) + private static final com.usthe.common.entity.message.CollectRep.Field DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.usthe.common.entity.message.CollectRep.Field(); + } + + public static com.usthe.common.entity.message.CollectRep.Field getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Field parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Field(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.usthe.common.entity.message.CollectRep.Field getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + public interface ValueRowOrBuilder extends // @@protoc_insertion_point(interface_extends:com.usthe.common.entity.message.ValueRow) com.google.protobuf.MessageOrBuilder { @@ -3177,6 +4070,11 @@ public final class CollectRep { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_com_usthe_common_entity_message_MetricsData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_usthe_common_entity_message_Field_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_usthe_common_entity_message_Field_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_com_usthe_common_entity_message_ValueRow_descriptor; private static final @@ -3192,16 +4090,18 @@ public final class CollectRep { static { java.lang.String[] descriptorData = { "\n\021collect_rep.proto\022\037com.usthe.common.en" + - "tity.message\"\322\001\n\013MetricsData\022\n\n\002id\030\001 \001(\004" + + "tity.message\"\372\001\n\013MetricsData\022\n\n\002id\030\001 \001(\004" + "\022\013\n\003app\030\002 \001(\t\022\017\n\007metrics\030\003 \001(\t\022\014\n\004time\030\004" + " \001(\004\0223\n\004code\030\005 \001(\0162%.com.usthe.common.en" + - "tity.message.Code\022\013\n\003msg\030\006 \001(\t\022\016\n\006fields" + - "\030\007 \003(\t\0229\n\006values\030\010 \003(\0132).com.usthe.commo" + - "n.entity.message.ValueRow\"-\n\010ValueRow\022\020\n" + - "\010instance\030\001 \001(\t\022\017\n\007columns\030\002 \003(\t*b\n\004Code" + - "\022\013\n\007SUCCESS\020\000\022\020\n\014UN_AVAILABLE\020\001\022\020\n\014UN_RE" + - "ACHABLE\020\002\022\022\n\016UN_CONNECTABLE\020\003\022\010\n\004FAIL\020\004\022" + - "\013\n\007TIMEOUT\020\005b\006proto3" + "tity.message.Code\022\013\n\003msg\030\006 \001(\t\0226\n\006fields" + + "\030\007 \003(\0132&.com.usthe.common.entity.message" + + ".Field\0229\n\006values\030\010 \003(\0132).com.usthe.commo" + + "n.entity.message.ValueRow\"#\n\005Field\022\014\n\004na" + + "me\030\001 \001(\t\022\014\n\004type\030\002 \001(\r\"-\n\010ValueRow\022\020\n\010in" + + "stance\030\001 \001(\t\022\017\n\007columns\030\002 \003(\t*b\n\004Code\022\013\n" + + "\007SUCCESS\020\000\022\020\n\014UN_AVAILABLE\020\001\022\020\n\014UN_REACH" + + "ABLE\020\002\022\022\n\016UN_CONNECTABLE\020\003\022\010\n\004FAIL\020\004\022\013\n\007" + + "TIMEOUT\020\005b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -3213,8 +4113,14 @@ public final class CollectRep { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_usthe_common_entity_message_MetricsData_descriptor, new java.lang.String[] { "Id", "App", "Metrics", "Time", "Code", "Msg", "Fields", "Values", }); - internal_static_com_usthe_common_entity_message_ValueRow_descriptor = + internal_static_com_usthe_common_entity_message_Field_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_com_usthe_common_entity_message_Field_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_usthe_common_entity_message_Field_descriptor, + new java.lang.String[] { "Name", "Type", }); + internal_static_com_usthe_common_entity_message_ValueRow_descriptor = + getDescriptor().getMessageTypes().get(2); internal_static_com_usthe_common_entity_message_ValueRow_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_com_usthe_common_entity_message_ValueRow_descriptor, diff --git a/common/src/main/message/collect_rep.proto b/common/src/main/message/collect_rep.proto index 0b9c5fb..a899054 100644 --- a/common/src/main/message/collect_rep.proto +++ b/common/src/main/message/collect_rep.proto @@ -16,11 +16,19 @@ message MetricsData // 采集响应信息 string msg = 6; // 采集指标名 - repeated string fields = 7; + repeated Field fields = 7; // 采集指标值集合(fields作为字段名称与ValueRow映射) repeated ValueRow values = 8; } +message Field +{ + // 指标采集字符名称 + string name = 1; + // 字段类型:0-number数字 1-string字符串 + uint32 type = 2; +} + message ValueRow { // 主键实例,唯一标识这行数据