Changeset a423b8a0d70a420968798dd0e5ff4dc20c963419
- Timestamp:
- 07/08/11 12:40:13 (2 years ago)
- git-parent:
- Files:
-
- src/bundle.pb-c.c (modified) (9 diffs)
- src/bundle.pb-c.h (modified) (6 diffs)
- src/bundle.proto (modified) (2 diffs)
- src/java/com/omniti/reconnoiter/CheckStatus.java (modified) (35 diffs)
- src/java/com/omniti/reconnoiter/event/NoitBundlev2.java (modified) (1 diff)
- src/noit_check_log.c (modified) (1 diff)
- src/noit_check_log_helpers.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/bundle.pb-c.c
r3081176 ra423b8a 48 48 { 49 49 PROTOBUF_C_ASSERT (message->base.descriptor == &metric__descriptor); 50 protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); 51 } 52 void status__init 53 (Status *message) 54 { 55 static Status init_value = STATUS__INIT; 56 *message = init_value; 57 } 58 size_t status__get_packed_size 59 (const Status *message) 60 { 61 PROTOBUF_C_ASSERT (message->base.descriptor == &status__descriptor); 62 return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); 63 } 64 size_t status__pack 65 (const Status *message, 66 uint8_t *out) 67 { 68 PROTOBUF_C_ASSERT (message->base.descriptor == &status__descriptor); 69 return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); 70 } 71 size_t status__pack_to_buffer 72 (const Status *message, 73 ProtobufCBuffer *buffer) 74 { 75 PROTOBUF_C_ASSERT (message->base.descriptor == &status__descriptor); 76 return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); 77 } 78 Status * 79 status__unpack 80 (ProtobufCAllocator *allocator, 81 size_t len, 82 const uint8_t *data) 83 { 84 return (Status *) 85 protobuf_c_message_unpack (&status__descriptor, 86 allocator, len, data); 87 } 88 void status__free_unpacked 89 (Status *message, 90 ProtobufCAllocator *allocator) 91 { 92 PROTOBUF_C_ASSERT (message->base.descriptor == &status__descriptor); 93 protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); 94 } 95 void metadata__init 96 (Metadata *message) 97 { 98 static Metadata init_value = METADATA__INIT; 99 *message = init_value; 100 } 101 size_t metadata__get_packed_size 102 (const Metadata *message) 103 { 104 PROTOBUF_C_ASSERT (message->base.descriptor == &metadata__descriptor); 105 return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); 106 } 107 size_t metadata__pack 108 (const Metadata *message, 109 uint8_t *out) 110 { 111 PROTOBUF_C_ASSERT (message->base.descriptor == &metadata__descriptor); 112 return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); 113 } 114 size_t metadata__pack_to_buffer 115 (const Metadata *message, 116 ProtobufCBuffer *buffer) 117 { 118 PROTOBUF_C_ASSERT (message->base.descriptor == &metadata__descriptor); 119 return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); 120 } 121 Metadata * 122 metadata__unpack 123 (ProtobufCAllocator *allocator, 124 size_t len, 125 const uint8_t *data) 126 { 127 return (Metadata *) 128 protobuf_c_message_unpack (&metadata__descriptor, 129 allocator, len, data); 130 } 131 void metadata__free_unpacked 132 (Metadata *message, 133 ProtobufCAllocator *allocator) 134 { 135 PROTOBUF_C_ASSERT (message->base.descriptor == &metadata__descriptor); 50 136 protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); 51 137 } … … 222 308 NULL,NULL,NULL /* reserved[123] */ 223 309 }; 224 static const ProtobufCFieldDescriptor bundle__field_descriptors[5] =310 static const ProtobufCFieldDescriptor status__field_descriptors[4] = 225 311 { 226 312 { … … 230 316 PROTOBUF_C_TYPE_INT32, 231 317 0, /* quantifier_offset */ 232 PROTOBUF_C_OFFSETOF( Bundle, available),318 PROTOBUF_C_OFFSETOF(Status, available), 233 319 NULL, 234 320 NULL, … … 242 328 PROTOBUF_C_TYPE_INT32, 243 329 0, /* quantifier_offset */ 244 PROTOBUF_C_OFFSETOF( Bundle, state),330 PROTOBUF_C_OFFSETOF(Status, state), 245 331 NULL, 246 332 NULL, … … 254 340 PROTOBUF_C_TYPE_INT32, 255 341 0, /* quantifier_offset */ 256 PROTOBUF_C_OFFSETOF( Bundle, duration),342 PROTOBUF_C_OFFSETOF(Status, duration), 257 343 NULL, 258 344 NULL, … … 266 352 PROTOBUF_C_TYPE_STRING, 267 353 0, /* quantifier_offset */ 354 PROTOBUF_C_OFFSETOF(Status, status), 355 NULL, 356 NULL, 357 0, /* packed */ 358 0,NULL,NULL /* reserved1,reserved2, etc */ 359 }, 360 }; 361 static const unsigned status__field_indices_by_name[] = { 362 0, /* field[0] = available */ 363 2, /* field[2] = duration */ 364 1, /* field[1] = state */ 365 3, /* field[3] = status */ 366 }; 367 static const ProtobufCIntRange status__number_ranges[1 + 1] = 368 { 369 { 1, 0 }, 370 { 0, 4 } 371 }; 372 const ProtobufCMessageDescriptor status__descriptor = 373 { 374 PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, 375 "Status", 376 "Status", 377 "Status", 378 "", 379 sizeof(Status), 380 4, 381 status__field_descriptors, 382 status__field_indices_by_name, 383 1, status__number_ranges, 384 (ProtobufCMessageInit) status__init, 385 NULL,NULL,NULL /* reserved[123] */ 386 }; 387 static const ProtobufCFieldDescriptor metadata__field_descriptors[2] = 388 { 389 { 390 "key", 391 1, 392 PROTOBUF_C_LABEL_REQUIRED, 393 PROTOBUF_C_TYPE_STRING, 394 0, /* quantifier_offset */ 395 PROTOBUF_C_OFFSETOF(Metadata, key), 396 NULL, 397 NULL, 398 0, /* packed */ 399 0,NULL,NULL /* reserved1,reserved2, etc */ 400 }, 401 { 402 "value", 403 2, 404 PROTOBUF_C_LABEL_REQUIRED, 405 PROTOBUF_C_TYPE_STRING, 406 0, /* quantifier_offset */ 407 PROTOBUF_C_OFFSETOF(Metadata, value), 408 NULL, 409 NULL, 410 0, /* packed */ 411 0,NULL,NULL /* reserved1,reserved2, etc */ 412 }, 413 }; 414 static const unsigned metadata__field_indices_by_name[] = { 415 0, /* field[0] = key */ 416 1, /* field[1] = value */ 417 }; 418 static const ProtobufCIntRange metadata__number_ranges[1 + 1] = 419 { 420 { 1, 0 }, 421 { 0, 2 } 422 }; 423 const ProtobufCMessageDescriptor metadata__descriptor = 424 { 425 PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, 426 "Metadata", 427 "Metadata", 428 "Metadata", 429 "", 430 sizeof(Metadata), 431 2, 432 metadata__field_descriptors, 433 metadata__field_indices_by_name, 434 1, metadata__number_ranges, 435 (ProtobufCMessageInit) metadata__init, 436 NULL,NULL,NULL /* reserved[123] */ 437 }; 438 static const ProtobufCFieldDescriptor bundle__field_descriptors[3] = 439 { 440 { 441 "status", 442 1, 443 PROTOBUF_C_LABEL_OPTIONAL, 444 PROTOBUF_C_TYPE_MESSAGE, 445 0, /* quantifier_offset */ 268 446 PROTOBUF_C_OFFSETOF(Bundle, status), 269 NULL,447 &status__descriptor, 270 448 NULL, 271 449 0, /* packed */ … … 274 452 { 275 453 "metrics", 276 5,454 2, 277 455 PROTOBUF_C_LABEL_REPEATED, 278 456 PROTOBUF_C_TYPE_MESSAGE, … … 284 462 0,NULL,NULL /* reserved1,reserved2, etc */ 285 463 }, 464 { 465 "metadata", 466 3, 467 PROTOBUF_C_LABEL_REPEATED, 468 PROTOBUF_C_TYPE_MESSAGE, 469 PROTOBUF_C_OFFSETOF(Bundle, n_metadata), 470 PROTOBUF_C_OFFSETOF(Bundle, metadata), 471 &metadata__descriptor, 472 NULL, 473 0, /* packed */ 474 0,NULL,NULL /* reserved1,reserved2, etc */ 475 }, 286 476 }; 287 477 static const unsigned bundle__field_indices_by_name[] = { 288 0, /* field[0] = available */ 289 2, /* field[2] = duration */ 290 4, /* field[4] = metrics */ 291 1, /* field[1] = state */ 292 3, /* field[3] = status */ 478 2, /* field[2] = metadata */ 479 1, /* field[1] = metrics */ 480 0, /* field[0] = status */ 293 481 }; 294 482 static const ProtobufCIntRange bundle__number_ranges[1 + 1] = 295 483 { 296 484 { 1, 0 }, 297 { 0, 5}485 { 0, 3 } 298 486 }; 299 487 const ProtobufCMessageDescriptor bundle__descriptor = … … 305 493 "", 306 494 sizeof(Bundle), 307 5,495 3, 308 496 bundle__field_descriptors, 309 497 bundle__field_indices_by_name, src/bundle.pb-c.h
r3081176 ra423b8a 10 10 11 11 typedef struct _Metric Metric; 12 typedef struct _Status Status; 13 typedef struct _Metadata Metadata; 12 14 typedef struct _Bundle Bundle; 13 15 … … 40 42 41 43 42 struct _ Bundle44 struct _Status 43 45 { 44 46 ProtobufCMessage base; … … 47 49 int32_t duration; 48 50 char *status; 51 }; 52 #define STATUS__INIT \ 53 { PROTOBUF_C_MESSAGE_INIT (&status__descriptor) \ 54 , 0, 0, 0, NULL } 55 56 57 struct _Metadata 58 { 59 ProtobufCMessage base; 60 char *key; 61 char *value; 62 }; 63 #define METADATA__INIT \ 64 { PROTOBUF_C_MESSAGE_INIT (&metadata__descriptor) \ 65 , NULL, NULL } 66 67 68 struct _Bundle 69 { 70 ProtobufCMessage base; 71 Status *status; 49 72 size_t n_metrics; 50 73 Metric **metrics; 74 size_t n_metadata; 75 Metadata **metadata; 51 76 }; 52 77 #define BUNDLE__INIT \ 53 78 { PROTOBUF_C_MESSAGE_INIT (&bundle__descriptor) \ 54 , 0, 0, 0,NULL, 0,NULL }79 , NULL, 0,NULL, 0,NULL } 55 80 56 81 … … 73 98 void metric__free_unpacked 74 99 (Metric *message, 100 ProtobufCAllocator *allocator); 101 /* Status methods */ 102 void status__init 103 (Status *message); 104 size_t status__get_packed_size 105 (const Status *message); 106 size_t status__pack 107 (const Status *message, 108 uint8_t *out); 109 size_t status__pack_to_buffer 110 (const Status *message, 111 ProtobufCBuffer *buffer); 112 Status * 113 status__unpack 114 (ProtobufCAllocator *allocator, 115 size_t len, 116 const uint8_t *data); 117 void status__free_unpacked 118 (Status *message, 119 ProtobufCAllocator *allocator); 120 /* Metadata methods */ 121 void metadata__init 122 (Metadata *message); 123 size_t metadata__get_packed_size 124 (const Metadata *message); 125 size_t metadata__pack 126 (const Metadata *message, 127 uint8_t *out); 128 size_t metadata__pack_to_buffer 129 (const Metadata *message, 130 ProtobufCBuffer *buffer); 131 Metadata * 132 metadata__unpack 133 (ProtobufCAllocator *allocator, 134 size_t len, 135 const uint8_t *data); 136 void metadata__free_unpacked 137 (Metadata *message, 75 138 ProtobufCAllocator *allocator); 76 139 /* Bundle methods */ … … 98 161 (const Metric *message, 99 162 void *closure_data); 163 typedef void (*Status_Closure) 164 (const Status *message, 165 void *closure_data); 166 typedef void (*Metadata_Closure) 167 (const Metadata *message, 168 void *closure_data); 100 169 typedef void (*Bundle_Closure) 101 170 (const Bundle *message, … … 108 177 109 178 extern const ProtobufCMessageDescriptor metric__descriptor; 179 extern const ProtobufCMessageDescriptor status__descriptor; 180 extern const ProtobufCMessageDescriptor metadata__descriptor; 110 181 extern const ProtobufCMessageDescriptor bundle__descriptor; 111 182 src/bundle.proto
r3081176 ra423b8a 11 11 } 12 12 13 message Bundle13 message Status 14 14 { 15 15 required int32 available = 1; … … 17 17 required int32 duration = 3; 18 18 required string status = 4; 19 repeated Metric metrics = 5;20 19 } 21 20 21 message Metadata 22 { 23 required string key = 1; 24 required string value = 2; 25 } 26 27 message Bundle 28 { 29 optional Status status = 1; 30 repeated Metric metrics = 2; 31 repeated Metadata metadata = 3; 32 } 33 src/java/com/omniti/reconnoiter/CheckStatus.java
r24c830d ra423b8a 1 1 package com.omniti.reconnoiter; 2 2 // Generated by the protocol buffer compiler. DO NOT EDIT! 3 // source: checkstatus.proto3 // source: CheckStatus.proto 4 4 5 5 public final class CheckStatus { … … 835 835 } 836 836 837 public interface BundleOrBuilder837 public interface StatusOrBuilder 838 838 extends com.google.protobuf.MessageOrBuilder { 839 839 … … 853 853 boolean hasStatus(); 854 854 String getStatus(); 855 856 // repeated .Metric metrics = 5;857 java.util.List<CheckStatus.Metric>858 getMetricsList();859 CheckStatus.Metric getMetrics(int index);860 int getMetricsCount();861 java.util.List<? extends CheckStatus.MetricOrBuilder>862 getMetricsOrBuilderList();863 CheckStatus.MetricOrBuilder getMetricsOrBuilder(864 int index);865 855 } 866 public static final class Bundleextends856 public static final class Status extends 867 857 com.google.protobuf.GeneratedMessage 868 implements BundleOrBuilder {869 // Use Bundle.newBuilder() to construct.870 private Bundle(Builder builder) {858 implements StatusOrBuilder { 859 // Use Status.newBuilder() to construct. 860 private Status(Builder builder) { 871 861 super(builder); 872 862 } 873 private Bundle(boolean noInit) {}874 875 private static final BundledefaultInstance;876 public static BundlegetDefaultInstance() {863 private Status(boolean noInit) {} 864 865 private static final Status defaultInstance; 866 public static Status getDefaultInstance() { 877 867 return defaultInstance; 878 868 } 879 869 880 public BundlegetDefaultInstanceForType() {870 public Status getDefaultInstanceForType() { 881 871 return defaultInstance; 882 872 } … … 884 874 public static final com.google.protobuf.Descriptors.Descriptor 885 875 getDescriptor() { 886 return CheckStatus.internal_static_ Bundle_descriptor;876 return CheckStatus.internal_static_Status_descriptor; 887 877 } 888 878 889 879 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable 890 880 internalGetFieldAccessorTable() { 891 return CheckStatus.internal_static_ Bundle_fieldAccessorTable;881 return CheckStatus.internal_static_Status_fieldAccessorTable; 892 882 } 893 883 … … 955 945 } 956 946 957 // repeated .Metric metrics = 5;958 public static final int METRICS_FIELD_NUMBER = 5;959 private java.util.List<CheckStatus.Metric> metrics_;960 public java.util.List<CheckStatus.Metric> getMetricsList() {961 return metrics_;962 }963 public java.util.List<? extends CheckStatus.MetricOrBuilder>964 getMetricsOrBuilderList() {965 return metrics_;966 }967 public int getMetricsCount() {968 return metrics_.size();969 }970 public CheckStatus.Metric getMetrics(int index) {971 return metrics_.get(index);972 }973 public CheckStatus.MetricOrBuilder getMetricsOrBuilder(974 int index) {975 return metrics_.get(index);976 }977 978 947 private void initFields() { 979 948 available_ = 0; … … 981 950 duration_ = 0; 982 951 status_ = ""; 983 metrics_ = java.util.Collections.emptyList();984 952 } 985 953 private byte memoizedIsInitialized = -1; … … 1003 971 memoizedIsInitialized = 0; 1004 972 return false; 1005 }1006 for (int i = 0; i < getMetricsCount(); i++) {1007 if (!getMetrics(i).isInitialized()) {1008 memoizedIsInitialized = 0;1009 return false;1010 }1011 973 } 1012 974 memoizedIsInitialized = 1; … … 1029 991 output.writeBytes(4, getStatusBytes()); 1030 992 } 1031 for (int i = 0; i < metrics_.size(); i++) {1032 output.writeMessage(5, metrics_.get(i));1033 }1034 993 getUnknownFields().writeTo(output); 1035 994 } … … 1056 1015 size += com.google.protobuf.CodedOutputStream 1057 1016 .computeBytesSize(4, getStatusBytes()); 1058 }1059 for (int i = 0; i < metrics_.size(); i++) {1060 size += com.google.protobuf.CodedOutputStream1061 .computeMessageSize(5, metrics_.get(i));1062 1017 } 1063 1018 size += getUnknownFields().getSerializedSize(); … … 1073 1028 } 1074 1029 1075 public static CheckStatus. BundleparseFrom(1030 public static CheckStatus.Status parseFrom( 1076 1031 com.google.protobuf.ByteString data) 1077 1032 throws com.google.protobuf.InvalidProtocolBufferException { 1078 1033 return newBuilder().mergeFrom(data).buildParsed(); 1079 1034 } 1080 public static CheckStatus. BundleparseFrom(1035 public static CheckStatus.Status parseFrom( 1081 1036 com.google.protobuf.ByteString data, 1082 1037 com.google.protobuf.ExtensionRegistryLite extensionRegistry) … … 1085 1040 .buildParsed(); 1086 1041 } 1087 public static CheckStatus. BundleparseFrom(byte[] data)1042 public static CheckStatus.Status parseFrom(byte[] data) 1088 1043 throws com.google.protobuf.InvalidProtocolBufferException { 1089 1044 return newBuilder().mergeFrom(data).buildParsed(); 1090 1045 } 1091 public static CheckStatus. BundleparseFrom(1046 public static CheckStatus.Status parseFrom( 1092 1047 byte[] data, 1093 1048 com.google.protobuf.ExtensionRegistryLite extensionRegistry) … … 1096 1051 .buildParsed(); 1097 1052 } 1098 public static CheckStatus. BundleparseFrom(java.io.InputStream input)1053 public static CheckStatus.Status parseFrom(java.io.InputStream input) 1099 1054 throws java.io.IOException { 1100 1055 return newBuilder().mergeFrom(input).buildParsed(); 1101 1056 } 1102 public static CheckStatus. BundleparseFrom(1057 public static CheckStatus.Status parseFrom( 1103 1058 java.io.InputStream input, 1104 1059 com.google.protobuf.ExtensionRegistryLite extensionRegistry) … … 1107 1062 .buildParsed(); 1108 1063 } 1109 public static CheckStatus. BundleparseDelimitedFrom(java.io.InputStream input)1064 public static CheckStatus.Status parseDelimitedFrom(java.io.InputStream input) 1110 1065 throws java.io.IOException { 1111 1066 Builder builder = newBuilder(); … … 1116 1071 } 1117 1072 } 1118 public static CheckStatus. BundleparseDelimitedFrom(1073 public static CheckStatus.Status parseDelimitedFrom( 1119 1074 java.io.InputStream input, 1120 1075 com.google.protobuf.ExtensionRegistryLite extensionRegistry) … … 1127 1082 } 1128 1083 } 1129 public static CheckStatus. BundleparseFrom(1084 public static CheckStatus.Status parseFrom( 1130 1085 com.google.protobuf.CodedInputStream input) 1131 1086 throws java.io.IOException { 1132 1087 return newBuilder().mergeFrom(input).buildParsed(); 1133 1088 } 1134 public static CheckStatus. BundleparseFrom(1089 public static CheckStatus.Status parseFrom( 1135 1090 com.google.protobuf.CodedInputStream input, 1136 1091 com.google.protobuf.ExtensionRegistryLite extensionRegistry) … … 1142 1097 public static Builder newBuilder() { return Builder.create(); } 1143 1098 public Builder newBuilderForType() { return newBuilder(); } 1144 public static Builder newBuilder(CheckStatus. Bundleprototype) {1099 public static Builder newBuilder(CheckStatus.Status prototype) { 1145 1100 return newBuilder().mergeFrom(prototype); 1146 1101 } … … 1155 1110 public static final class Builder extends 1156 1111 com.google.protobuf.GeneratedMessage.Builder<Builder> 1157 implements CheckStatus. BundleOrBuilder {1112 implements CheckStatus.StatusOrBuilder { 1158 1113 public static final com.google.protobuf.Descriptors.Descriptor 1159 1114 getDescriptor() { 1160 return CheckStatus.internal_static_ Bundle_descriptor;1115 return CheckStatus.internal_static_Status_descriptor; 1161 1116 } 1162 1117 1163 1118 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable 1164 1119 internalGetFieldAccessorTable() { 1165 return CheckStatus.internal_static_ Bundle_fieldAccessorTable;1166 } 1167 1168 // Construct using CheckStatus. Bundle.newBuilder()1120 return CheckStatus.internal_static_Status_fieldAccessorTable; 1121 } 1122 1123 // Construct using CheckStatus.Status.newBuilder() 1169 1124 private Builder() { 1170 1125 maybeForceBuilderInitialization(); … … 1177 1132 private void maybeForceBuilderInitialization() { 1178 1133 if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { 1179 getMetricsFieldBuilder();1180 1134 } 1181 1135 } … … 1194 1148 status_ = ""; 1195 1149 bitField0_ = (bitField0_ & ~0x00000008); 1196 if (metricsBuilder_ == null) {1197 metrics_ = java.util.Collections.emptyList();1198 bitField0_ = (bitField0_ & ~0x00000010);1199 } else {1200 metricsBuilder_.clear();1201 }1202 1150 return this; 1203 1151 } … … 1209 1157 public com.google.protobuf.Descriptors.Descriptor 1210 1158 getDescriptorForType() { 1211 return CheckStatus. Bundle.getDescriptor();1212 } 1213 1214 public CheckStatus. BundlegetDefaultInstanceForType() {1215 return CheckStatus. Bundle.getDefaultInstance();1216 } 1217 1218 public CheckStatus. Bundlebuild() {1219 CheckStatus. Bundleresult = buildPartial();1159 return CheckStatus.Status.getDescriptor(); 1160 } 1161 1162 public CheckStatus.Status getDefaultInstanceForType() { 1163 return CheckStatus.Status.getDefaultInstance(); 1164 } 1165 1166 public CheckStatus.Status build() { 1167 CheckStatus.Status result = buildPartial(); 1220 1168 if (!result.isInitialized()) { 1221 1169 throw newUninitializedMessageException(result); … … 1224 1172 } 1225 1173 1226 private CheckStatus. BundlebuildParsed()1174 private CheckStatus.Status buildParsed() 1227 1175 throws com.google.protobuf.InvalidProtocolBufferException { 1228 CheckStatus. Bundleresult = buildPartial();1176 CheckStatus.Status result = buildPartial(); 1229 1177 if (!result.isInitialized()) { 1230 1178 throw newUninitializedMessageException( … … 1234 1182 } 1235 1183 1236 public CheckStatus. BundlebuildPartial() {1237 CheckStatus. Bundle result = new CheckStatus.Bundle(this);1184 public CheckStatus.Status buildPartial() { 1185 CheckStatus.Status result = new CheckStatus.Status(this); 1238 1186 int from_bitField0_ = bitField0_; 1239 1187 int to_bitField0_ = 0; … … 1254 1202 } 1255 1203 result.status_ = status_; 1256 if (metricsBuilder_ == null) {1257 if (((bitField0_ & 0x00000010) == 0x00000010)) {1258 metrics_ = java.util.Collections.unmodifiableList(metrics_);1259 bitField0_ = (bitField0_ & ~0x00000010);1260 }1261 result.metrics_ = metrics_;1262 } else {1263 result.metrics_ = metricsBuilder_.build();1264 }1265 1204 result.bitField0_ = to_bitField0_; 1266 1205 onBuilt(); … … 1269 1208 1270 1209 public Builder mergeFrom(com.google.protobuf.Message other) { 1271 if (other instanceof CheckStatus. Bundle) {1272 return mergeFrom((CheckStatus. Bundle)other);1210 if (other instanceof CheckStatus.Status) { 1211 return mergeFrom((CheckStatus.Status)other); 1273 1212 } else { 1274 1213 super.mergeFrom(other); … … 1277 1216 } 1278 1217 1279 public Builder mergeFrom(CheckStatus. Bundleother) {1280 if (other == CheckStatus. Bundle.getDefaultInstance()) return this;1218 public Builder mergeFrom(CheckStatus.Status other) { 1219 if (other == CheckStatus.Status.getDefaultInstance()) return this; 1281 1220 if (other.hasAvailable()) { 1282 1221 setAvailable(other.getAvailable()); … … 1290 1229 if (other.hasStatus()) { 1291 1230 setStatus(other.getStatus()); 1292 }1293 if (metricsBuilder_ == null) {1294 if (!other.metrics_.isEmpty()) {1295 if (metrics_.isEmpty()) {1296 metrics_ = other.metrics_;1297 bitField0_ = (bitField0_ & ~0x00000010);1298 } else {1299 ensureMetricsIsMutable();1300 metrics_.addAll(other.metrics_);1301 }1302 onChanged();1303 }1304 } else {1305 if (!other.metrics_.isEmpty()) {1306 if (metricsBuilder_.isEmpty()) {1307 metricsBuilder_.dispose();1308 metricsBuilder_ = null;1309 metrics_ = other.metrics_;1310 bitField0_ = (bitField0_ & ~0x00000010);1311 metricsBuilder_ =1312 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?1313 getMetricsFieldBuilder() : null;1314 } else {1315 metricsBuilder_.addAllMessages(other.metrics_);1316 }1317 }1318 1231 } 1319 1232 this.mergeUnknownFields(other.getUnknownFields()); … … 1337 1250 1338 1251 return false; 1339 }1340 for (int i = 0; i < getMetricsCount(); i++) {1341 if (!getMetrics(i).isInitialized()) {1342 1343 return false;1344 }1345 1252 } 1346 1253 return true; … … 1390 1297 break; 1391 1298 } 1392 case 42: {1393 CheckStatus.Metric.Builder subBuilder = CheckStatus.Metric.newBuilder();1394 input.readMessage(subBuilder, extensionRegistry);1395 addMetrics(subBuilder.buildPartial());1396 break;1397 }1398 1299 } 1399 1300 } … … 1501 1402 } 1502 1403 1503 // repeated .Metric metrics = 5; 1404 // @@protoc_insertion_point(builder_scope:Status) 1405 } 1406 1407 static { 1408 defaultInstance = new Status(true); 1409 defaultInstance.initFields(); 1410 } 1411 1412 // @@protoc_insertion_point(class_scope:Status) 1413 } 1414 1415 public interface MetadataOrBuilder 1416 extends com.google.protobuf.MessageOrBuilder { 1417 1418 // required string key = 1; 1419 boolean hasKey(); 1420 String getKey(); 1421 1422 // required string value = 2; 1423 boolean hasValue(); 1424 String getValue(); 1425 } 1426 public static final class Metadata extends 1427 com.google.protobuf.GeneratedMessage 1428 implements MetadataOrBuilder { 1429 // Use Metadata.newBuilder() to construct. 1430 private Metadata(Builder builder) { 1431 super(builder); 1432 } 1433 private Metadata(boolean noInit) {} 1434 1435 private static final Metadata defaultInstance; 1436 public static Metadata getDefaultInstance() { 1437 return defaultInstance; 1438 } 1439 1440 public Metadata getDefaultInstanceForType() { 1441 return defaultInstance; 1442 } 1443 1444 public static final com.google.protobuf.Descriptors.Descriptor 1445 getDescriptor() { 1446 return CheckStatus.internal_static_Metadata_descriptor; 1447 } 1448 1449 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable 1450 internalGetFieldAccessorTable() { 1451 return CheckStatus.internal_static_Metadata_fieldAccessorTable; 1452 } 1453 1454 private int bitField0_; 1455 // required string key = 1; 1456 public static final int KEY_FIELD_NUMBER = 1; 1457 private java.lang.Object key_; 1458 public boolean hasKey() { 1459 return ((bitField0_ & 0x00000001) == 0x00000001); 1460 } 1461 public String getKey() { 1462 java.lang.Object ref = key_; 1463 if (ref instanceof String) { 1464 return (String) ref; 1465 } else { 1466 com.google.protobuf.ByteString bs = 1467 (com.google.protobuf.ByteString) ref; 1468 String s = bs.toStringUtf8(); 1469 if (com.google.protobuf.Internal.isValidUtf8(bs)) { 1470 key_ = s; 1471 } 1472 return s; 1473 } 1474 } 1475 private com.google.protobuf.ByteString getKeyBytes() { 1476 java.lang.Object ref = key_; 1477 if (ref instanceof String) { 1478 com.google.protobuf.ByteString b = 1479 com.google.protobuf.ByteString.copyFromUtf8((String) ref); 1480 key_ = b; 1481 return b; 1482 } else { 1483 return (com.google.protobuf.ByteString) ref; 1484 } 1485 } 1486 1487 // required string value = 2; 1488 public static final int VALUE_FIELD_NUMBER = 2; 1489 private java.lang.Object value_; 1490 public boolean hasValue() { 1491 return ((bitField0_ & 0x00000002) == 0x00000002); 1492 } 1493 public String getValue() { 1494 java.lang.Object ref = value_; 1495 if (ref instanceof String) { 1496 return (String) ref; 1497 } else { 1498 com.google.protobuf.ByteString bs = 1499 (com.google.protobuf.ByteString) ref; 1500 String s = bs.toStringUtf8(); 1501 if (com.google.protobuf.Internal.isValidUtf8(bs)) { 1502 value_ = s; 1503 } 1504 return s; 1505 } 1506 } 1507 private com.google.protobuf.ByteString getValueBytes() { 1508 java.lang.Object ref = value_; 1509 if (ref instanceof String) { 1510 com.google.protobuf.ByteString b = 1511 com.google.protobuf.ByteString.copyFromUtf8((String) ref); 1512 value_ = b; 1513 return b; 1514 } else { 1515 return (com.google.protobuf.ByteString) ref; 1516 } 1517 } 1518 1519 private void initFields() { 1520 key_ = ""; 1521 value_ = ""; 1522 } 1523 private byte memoizedIsInitialized = -1; 1524 public final boolean isInitialized() { 1525 byte isInitialized = memoizedIsInitialized; 1526 if (isInitialized != -1) return isInitialized == 1; 1527 1528 if (!hasKey()) { 1529 memoizedIsInitialized = 0; 1530 return false; 1531 } 1532 if (!hasValue()) { 1533 memoizedIsInitialized = 0; 1534 return false; 1535 } 1536 memoizedIsInitialized = 1; 1537 return true; 1538 } 1539 1540 public void writeTo(com.google.protobuf.CodedOutputStream output) 1541 throws java.io.IOException { 1542 getSerializedSize(); 1543 if (((bitField0_ & 0x00000001) == 0x00000001)) { 1544 output.writeBytes(1, getKeyBytes()); 1545 } 1546 if (((bitField0_ & 0x00000002) == 0x00000002)) { 1547 output.writeBytes(2, getValueBytes()); 1548 } 1549 getUnknownFields().writeTo(output); 1550 } 1551 1552 private int memoizedSerializedSize = -1; 1553 public int getSerializedSize() { 1554 int size = memoizedSerializedSize; 1555 if (size != -1) return size; 1556 1557 size = 0; 1558 if (((bitField0_ & 0x00000001) == 0x00000001)) { 1559 size += com.google.protobuf.CodedOutputStream 1560 .computeBytesSize(1, getKeyBytes()); 1561 } 1562 if (((bitField0_ & 0x00000002) == 0x00000002)) { 1563 size += com.google.protobuf.CodedOutputStream 1564 .computeBytesSize(2, getValueBytes()); 1565 } 1566 size += getUnknownFields().getSerializedSize(); 1567 memoizedSerializedSize = size; 1568 return size; 1569 } 1570 1571 private static final long serialVersionUID = 0L; 1572 @java.lang.Override 1573 protected java.lang.Object writeReplace() 1574 throws java.io.ObjectStreamException { 1575 return super.writeReplace(); 1576 } 1577 1578 public static CheckStatus.Metadata parseFrom( 1579 com.google.protobuf.ByteString data) 1580 throws com.google.protobuf.InvalidProtocolBufferException { 1581 return newBuilder().mergeFrom(data).buildParsed(); 1582 } 1583 public static CheckStatus.Metadata parseFrom( 1584 com.google.protobuf.ByteString data, 1585 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1586 throws com.google.protobuf.InvalidProtocolBufferException { 1587 return newBuilder().mergeFrom(data, extensionRegistry) 1588 .buildParsed(); 1589 } 1590 public static CheckStatus.Metadata parseFrom(byte[] data) 1591 throws com.google.protobuf.InvalidProtocolBufferException { 1592 return newBuilder().mergeFrom(data).buildParsed(); 1593 } 1594 public static CheckStatus.Metadata parseFrom( 1595 byte[] data, 1596 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1597 throws com.google.protobuf.InvalidProtocolBufferException { 1598 return newBuilder().mergeFrom(data, extensionRegistry) 1599 .buildParsed(); 1600 } 1601 public static CheckStatus.Metadata parseFrom(java.io.InputStream input) 1602 throws java.io.IOException { 1603 return newBuilder().mergeFrom(input).buildParsed(); 1604 } 1605 public static CheckStatus.Metadata parseFrom( 1606 java.io.InputStream input, 1607 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1608 throws java.io.IOException { 1609 return newBuilder().mergeFrom(input, extensionRegistry) 1610 .buildParsed(); 1611 } 1612 public static CheckStatus.Metadata parseDelimitedFrom(java.io.InputStream input) 1613 throws java.io.IOException { 1614 Builder builder = newBuilder(); 1615 if (builder.mergeDelimitedFrom(input)) { 1616 return builder.buildParsed(); 1617 } else { 1618 return null; 1619 } 1620 } 1621 public static CheckStatus.Metadata parseDelimitedFrom( 1622 java.io.InputStream input, 1623 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1624 throws java.io.IOException { 1625 Builder builder = newBuilder(); 1626 if (builder.mergeDelimitedFrom(input, extensionRegistry)) { 1627 return builder.buildParsed(); 1628 } else { 1629 return null; 1630 } 1631 } 1632 public static CheckStatus.Metadata parseFrom( 1633 com.google.protobuf.CodedInputStream input) 1634 throws java.io.IOException { 1635 return newBuilder().mergeFrom(input).buildParsed(); 1636 } 1637 public static CheckStatus.Metadata parseFrom( 1638 com.google.protobuf.CodedInputStream input, 1639 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1640 throws java.io.IOException { 1641 return newBuilder().mergeFrom(input, extensionRegistry) 1642 .buildParsed(); 1643 } 1644 1645 public static Builder newBuilder() { return Builder.create(); } 1646 public Builder newBuilderForType() { return newBuilder(); } 1647 public static Builder newBuilder(CheckStatus.Metadata prototype) { 1648 return newBuilder().mergeFrom(prototype); 1649 } 1650 public Builder toBuilder() { return newBuilder(this); } 1651 1652 @java.lang.Override 1653 protected Builder newBuilderForType( 1654 com.google.protobuf.GeneratedMessage.BuilderParent parent) { 1655 Builder builder = new Builder(parent); 1656 return builder; 1657 } 1658 public static final class Builder extends 1659 com.google.protobuf.GeneratedMessage.Builder<Builder> 1660 implements CheckStatus.MetadataOrBuilder { 1661 public static final com.google.protobuf.Descriptors.Descriptor 1662 getDescriptor() { 1663 return CheckStatus.internal_static_Metadata_descriptor; 1664 } 1665 1666 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable 1667 internalGetFieldAccessorTable() { 1668 return CheckStatus.internal_static_Metadata_fieldAccessorTable; 1669 } 1670 1671 // Construct using CheckStatus.Metadata.newBuilder() 1672 private Builder() { 1673 maybeForceBuilderInitialization(); 1674 } 1675 1676 private Builder(BuilderParent parent) { 1677 super(parent); 1678 maybeForceBuilderInitialization(); 1679 } 1680 private void maybeForceBuilderInitialization() { 1681 if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { 1682 } 1683 } 1684 private static Builder create() { 1685 return new Builder(); 1686 } 1687 1688 public Builder clear() { 1689 super.clear(); 1690 key_ = ""; 1691 bitField0_ = (bitField0_ & ~0x00000001); 1692 value_ = ""; 1693 bitField0_ = (bitField0_ & ~0x00000002); 1694 return this; 1695 } 1696 1697 public Builder clone() { 1698 return create().mergeFrom(buildPartial()); 1699 } 1700 1701 public com.google.protobuf.Descriptors.Descriptor 1702 getDescriptorForType() { 1703 return CheckStatus.Metadata.getDescriptor(); 1704 } 1705 1706 public CheckStatus.Metadata getDefaultInstanceForType() { 1707 return CheckStatus.Metadata.getDefaultInstance(); 1708 } 1709 1710 public CheckStatus.Metadata build() { 1711 CheckStatus.Metadata result = buildPartial(); 1712 if (!result.isInitialized()) { 1713 throw newUninitializedMessageException(result); 1714 } 1715 return result; 1716 } 1717 1718 private CheckStatus.Metadata buildParsed() 1719 throws com.google.protobuf.InvalidProtocolBufferException { 1720 CheckStatus.Metadata result = buildPartial(); 1721 if (!result.isInitialized()) { 1722 throw newUninitializedMessageException( 1723 result).asInvalidProtocolBufferException(); 1724 } 1725 return result; 1726 } 1727 1728 public CheckStatus.Metadata buildPartial() { 1729 CheckStatus.Metadata result = new CheckStatus.Metadata(this); 1730 int from_bitField0_ = bitField0_; 1731 int to_bitField0_ = 0; 1732 if (((from_bitField0_ & 0x00000001) == 0x00000001)) { 1733 to_bitField0_ |= 0x00000001; 1734 } 1735 result.key_ = key_; 1736 if (((from_bitField0_ & 0x00000002) == 0x00000002)) { 1737 to_bitField0_ |= 0x00000002; 1738 } 1739 result.value_ = value_; 1740 result.bitField0_ = to_bitField0_; 1741 onBuilt(); 1742 return result; 1743 } 1744 1745 public Builder mergeFrom(com.google.protobuf.Message other) { 1746 if (other instanceof CheckStatus.Metadata) { 1747 return mergeFrom((CheckStatus.Metadata)other); 1748 } else { 1749 super.mergeFrom(other); 1750 return this; 1751 } 1752 } 1753 1754 public Builder mergeFrom(CheckStatus.Metadata other) { 1755 if (other == CheckStatus.Metadata.getDefaultInstance()) return this; 1756 if (other.hasKey()) { 1757 setKey(other.getKey()); 1758 } 1759 if (other.hasValue()) { 1760 setValue(other.getValue()); 1761 } 1762 this.mergeUnknownFields(other.getUnknownFields()); 1763 return this; 1764 } 1765 1766 public final boolean isInitialized() { 1767 if (!hasKey()) { 1768 1769 return false; 1770 } 1771 if (!hasValue()) { 1772 1773 return false; 1774 } 1775 return true; 1776 } 1777 1778 public Builder mergeFrom( 1779 com.google.protobuf.CodedInputStream input, 1780 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1781 throws java.io.IOException { 1782 com.google.protobuf.UnknownFieldSet.Builder unknownFields = 1783 com.google.protobuf.UnknownFieldSet.newBuilder( 1784 this.getUnknownFields()); 1785 while (true) { 1786 int tag = input.readTag(); 1787 switch (tag) { 1788 case 0: 1789 this.setUnknownFields(unknownFields.build()); 1790 onChanged(); 1791 return this; 1792 default: { 1793 if (!parseUnknownField(input, unknownFields, 1794 extensionRegistry, tag)) { 1795 this.setUnknownFields(unknownFields.build()); 1796 onChanged(); 1797 return this; 1798 } 1799 break; 1800 } 1801 case 10: { 1802 bitField0_ |= 0x00000001; 1803 key_ = input.readBytes(); 1804 break; 1805 } 1806 case 18: { 1807 bitField0_ |= 0x00000002; 1808 value_ = input.readBytes(); 1809 break; 1810 } 1811 } 1812 } 1813 } 1814 1815 private int bitField0_; 1816 1817 // required string key = 1; 1818 private java.lang.Object key_ = ""; 1819 public boolean hasKey() { 1820 return ((bitField0_ & 0x00000001) == 0x00000001); 1821 } 1822 public String getKey() { 1823 java.lang.Object ref = key_; 1824 if (!(ref instanceof String)) { 1825 String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); 1826 key_ = s; 1827 return s; 1828 } else { 1829 return (String) ref; 1830 } 1831 } 1832 public Builder setKey(String value) { 1833 if (value == null) { 1834 throw new NullPointerException(); 1835 } 1836 bitField0_ |= 0x00000001; 1837 key_ = value; 1838 onChanged(); 1839 return this; 1840 } 1841 public Builder clearKey() { 1842 bitField0_ = (bitField0_ & ~0x00000001); 1843 key_ = getDefaultInstance().getKey(); 1844 onChanged(); 1845 return this; 1846 } 1847 void setKey(com.google.protobuf.ByteString value) { 1848 bitField0_ |= 0x00000001; 1849 key_ = value; 1850 onChanged(); 1851 } 1852 1853 // required string value = 2; 1854 private java.lang.Object value_ = ""; 1855 public boolean hasValue() { 1856 return ((bitField0_ & 0x00000002) == 0x00000002); 1857 } 1858 public String getValue() { 1859 java.lang.Object ref = value_; 1860 if (!(ref instanceof String)) { 1861 String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); 1862 value_ = s; 1863 return s; 1864 } else { 1865 return (String) ref; 1866 } 1867 } 1868 public Builder setValue(String value) { 1869 if (value == null) { 1870 throw new NullPointerException(); 1871 } 1872 bitField0_ |= 0x00000002; 1873 value_ = value; 1874 onChanged(); 1875 return this; 1876 } 1877 public Builder clearValue() { 1878 bitField0_ = (bitField0_ & ~0x00000002); 1879 value_ = getDefaultInstance().getValue(); 1880 onChanged(); 1881 return this; 1882 } 1883 void setValue(com.google.protobuf.ByteString value) { 1884 bitField0_ |= 0x00000002; 1885 value_ = value; 1886 onChanged(); 1887 } 1888 1889 // @@protoc_insertion_point(builder_scope:Metadata) 1890 } 1891 1892 static { 1893 defaultInstance = new Metadata(true); 1894 defaultInstance.initFields(); 1895 } 1896 1897 // @@protoc_insertion_point(class_scope:Metadata) 1898 } 1899 1900 public interface BundleOrBuilder 1901 extends com.google.protobuf.MessageOrBuilder { 1902 1903 // optional .Status status = 1; 1904 boolean hasStatus(); 1905 CheckStatus.Status getStatus(); 1906 CheckStatus.StatusOrBuilder getStatusOrBuilder(); 1907 1908 // repeated .Metric metrics = 2; 1909 java.util.List<CheckStatus.Metric> 1910 getMetricsList(); 1911 CheckStatus.Metric getMetrics(int index); 1912 int getMetricsCount(); 1913 java.util.List<? extends CheckStatus.MetricOrBuilder> 1914 getMetricsOrBuilderList(); 1915 CheckStatus.MetricOrBuilder getMetricsOrBuilder( 1916 int index); 1917 1918 // repeated .Metadata metadata = 3; 1919 java.util.List<CheckStatus.Metadata> 1920 getMetadataList(); 1921 CheckStatus.Metadata getMetadata(int index); 1922 int getMetadataCount(); 1923 java.util.List<? extends CheckStatus.MetadataOrBuilder> 1924 getMetadataOrBuilderList(); 1925 CheckStatus.MetadataOrBuilder getMetadataOrBuilder( 1926 int index); 1927 } 1928 public static final class Bundle extends 1929 com.google.protobuf.GeneratedMessage 1930 implements BundleOrBuilder { 1931 // Use Bundle.newBuilder() to construct. 1932 private Bundle(Builder builder) { 1933 super(builder); 1934 } 1935 private Bundle(boolean noInit) {} 1936 1937 private static final Bundle defaultInstance; 1938 public static Bundle getDefaultInstance() { 1939 return defaultInstance; 1940 } 1941 1942 public Bundle getDefaultInstanceForType() { 1943 return defaultInstance; 1944 } 1945 1946 public static final com.google.protobuf.Descriptors.Descriptor 1947 getDescriptor() { 1948 return CheckStatus.internal_static_Bundle_descriptor; 1949 } 1950 1951 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable 1952 internalGetFieldAccessorTable() { 1953 return CheckStatus.internal_static_Bundle_fieldAccessorTable; 1954 } 1955 1956 private int bitField0_; 1957 // optional .Status status = 1; 1958 public static final int STATUS_FIELD_NUMBER = 1; 1959 private CheckStatus.Status status_; 1960 public boolean hasStatus() { 1961 return ((bitField0_ & 0x00000001) == 0x00000001); 1962 } 1963 public CheckStatus.Status getStatus() { 1964 return status_; 1965 } 1966 public CheckStatus.StatusOrBuilder getStatusOrBuilder() { 1967 return status_; 1968 } 1969 1970 // repeated .Metric metrics = 2; 1971 public static final int METRICS_FIELD_NUMBER = 2; 1972 private java.util.List<CheckStatus.Metric> metrics_; 1973 public java.util.List<CheckStatus.Metric> getMetricsList() { 1974 return metrics_; 1975 } 1976 public java.util.List<? extends CheckStatus.MetricOrBuilder> 1977 getMetricsOrBuilderList() { 1978 return metrics_; 1979 } 1980 public int getMetricsCount() { 1981 return metrics_.size(); 1982 } 1983 public CheckStatus.Metric getMetrics(int index) { 1984 return metrics_.get(index); 1985 } 1986 public CheckStatus.MetricOrBuilder getMetricsOrBuilder( 1987 int index) { 1988 return metrics_.get(index); 1989 } 1990 1991 // repeated .Metadata metadata = 3; 1992 public static final int METADATA_FIELD_NUMBER = 3; 1993 private java.util.List<CheckStatus.Metadata> metadata_; 1994 public java.util.List<CheckStatus.Metadata> getMetadataList() { 1995 return metadata_; 1996 } 1997 public java.util.List<? extends CheckStatus.MetadataOrBuilder> 1998 getMetadataOrBuilderList() { 1999 return metadata_; 2000 } 2001 public int getMetadataCount() { 2002 return metadata_.size(); 2003 } 2004 public CheckStatus.Metadata getMetadata(int index) { 2005 return metadata_.get(index); 2006 } 2007 public CheckStatus.MetadataOrBuilder getMetadataOrBuilder( 2008 int index) { 2009 return metadata_.get(index); 2010 } 2011 2012 private void initFields() { 2013 status_ = CheckStatus.Status.getDefaultInstance(); 2014 metrics_ = java.util.Collections.emptyList(); 2015 metadata_ = java.util.Collections.emptyList(); 2016 } 2017 private byte memoizedIsInitialized = -1; 2018 public final boolean isInitialized() { 2019 byte isInitialized = memoizedIsInitialized; 2020 if (isInitialized != -1) return isInitialized == 1; 2021 2022 if (hasStatus()) { 2023 if (!getStatus().isInitialized()) { 2024 memoizedIsInitialized = 0; 2025 return false; 2026 } 2027 } 2028 for (int i = 0; i < getMetricsCount(); i++) { 2029 if (!getMetrics(i).isInitialized()) { 2030 memoizedIsInitialized = 0; 2031 return false; 2032 } 2033 } 2034 for (int i = 0; i < getMetadataCount(); i++) { 2035 if (!getMetadata(i).isInitialized()) { 2036 memoizedIsInitialized = 0; 2037 return false; 2038 } 2039 } 2040 memoizedIsInitialized = 1; 2041 return true; 2042 } 2043 2044 public void writeTo(com.google.protobuf.CodedOutputStream output) 2045 throws java.io.IOException { 2046 getSerializedSize(); 2047 if (((bitField0_ & 0x00000001) == 0x00000001)) { 2048 output.writeMessage(1, status_); 2049 } 2050 for (int i = 0; i < metrics_.size(); i++) { 2051 output.writeMessage(2, metrics_.get(i)); 2052 } 2053 for (int i = 0; i < metadata_.size(); i++) { 2054 output.writeMessage(3, metadata_.get(i)); 2055 } 2056 getUnknownFields().writeTo(output); 2057 } 2058 2059 private int memoizedSerializedSize = -1; 2060 public int getSerializedSize() { 2061 int size = memoizedSerializedSize; 2062 if (size != -1) return size; 2063 2064 size = 0; 2065 if (((bitField0_ & 0x00000001) == 0x00000001)) { 2066 size += com.google.protobuf.CodedOutputStream 2067 .computeMessageSize(1, status_); 2068 } 2069 for (int i = 0; i < metrics_.size(); i++) { 2070 size += com.google.protobuf.CodedOutputStream 2071 .computeMessageSize(2, metrics_.get(i)); 2072 } 2073 for (int i = 0; i < metadata_.size(); i++) { 2074 size += com.google.protobuf.CodedOutputStream 2075 .computeMessageSize(3, metadata_.get(i)); 2076 } 2077 size += getUnknownFields().getSerializedSize(); 2078 memoizedSerializedSize = size; 2079 return size; 2080 } 2081 2082 private static final long serialVersionUID = 0L; 2083 @java.lang.Override 2084 protected java.lang.Object writeReplace() 2085 throws java.io.ObjectStreamException { 2086 return super.writeReplace(); 2087 } 2088 2089 public static CheckStatus.Bundle parseFrom( 2090 com.google.protobuf.ByteString data) 2091 throws com.google.protobuf.InvalidProtocolBufferException { 2092 return newBuilder().mergeFrom(data).buildParsed(); 2093 } 2094 public static CheckStatus.Bundle parseFrom( 2095 com.google.protobuf.ByteString data, 2096 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2097 throws com.google.protobuf.InvalidProtocolBufferException { 2098 return newBuilder().mergeFrom(data, extensionRegistry) 2099 .buildParsed(); 2100 } 2101 public static CheckStatus.Bundle parseFrom(byte[] data) 2102 throws com.google.protobuf.InvalidProtocolBufferException { 2103 return newBuilder().mergeFrom(data).buildParsed(); 2104 } 2105 public static CheckStatus.Bundle parseFrom( 2106 byte[] data, 2107 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2108 throws com.google.protobuf.InvalidProtocolBufferException { 2109 return newBuilder().mergeFrom(data, extensionRegistry) 2110 .buildParsed(); 2111 } 2112 public static CheckStatus.Bundle parseFrom(java.io.InputStream input) 2113 throws java.io.IOException { 2114 return newBuilder().mergeFrom(input).buildParsed(); 2115 } 2116 public static CheckStatus.Bundle parseFrom( 2117 java.io.InputStream input, 2118 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2119 throws java.io.IOException { 2120 return newBuilder().mergeFrom(input, extensionRegistry) 2121 .buildParsed(); 2122 } 2123 public static CheckStatus.Bundle parseDelimitedFrom(java.io.InputStream input) 2124 throws java.io.IOException { 2125 Builder builder = newBuilder(); 2126 if (builder.mergeDelimitedFrom(input)) { 2127 return builder.buildParsed(); 2128 } else { 2129 return null; 2130 } 2131 } 2132 public static CheckStatus.Bundle parseDelimitedFrom( 2133 java.io.InputStream input, 2134 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2135 throws java.io.IOException { 2136 Builder builder = newBuilder(); 2137 if (builder.mergeDelimitedFrom(input, extensionRegistry)) { 2138 return builder.buildParsed(); 2139 } else { 2140 return null; 2141 } 2142 } 2143 public static CheckStatus.Bundle parseFrom( 2144 com.google.protobuf.CodedInputStream input) 2145 throws java.io.IOException { 2146 return newBuilder().mergeFrom(input).buildParsed(); 2147 } 2148 public static CheckStatus.Bundle parseFrom( 2149 com.google.protobuf.CodedInputStream input, 2150 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2151 throws java.io.IOException { 2152 return newBuilder().mergeFrom(input, extensionRegistry) 2153 .buildParsed(); 2154 } 2155 2156 public static Builder newBuilder() { return Builder.create(); } 2157 public Builder newBuilderForType() { return newBuilder(); } 2158 public static Builder newBuilder(CheckStatus.Bundle prototype) { 2159 return newBuilder().mergeFrom(prototype); 2160 } 2161 public Builder toBuilder() { return newBuilder(this); } 2162 2163 @java.lang.Override 2164 protected Builder newBuilderForType( 2165 com.google.protobuf.GeneratedMessage.BuilderParent parent) { 2166 Builder builder = new Builder(parent); 2167 return builder; 2168 } 2169 public static final class Builder extends 2170 com.google.protobuf.GeneratedMessage.Builder<Builder> 2171 implements CheckStatus.BundleOrBuilder { 2172 public static final com.google.protobuf.Descriptors.Descriptor 2173 getDescriptor() { 2174 return CheckStatus.internal_static_Bundle_descriptor; 2175 } 2176 2177 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable 2178 internalGetFieldAccessorTable() { 2179 return CheckStatus.internal_static_Bundle_fieldAccessorTable; 2180 } 2181 2182 // Construct using CheckStatus.Bundle.newBuilder() 2183 private Builder() { 2184 maybeForceBuilderInitialization(); 2185 } 2186 2187 private Builder(BuilderParent parent) { 2188 super(parent); 2189 maybeForceBuilderInitialization(); 2190 } 2191 private void maybeForceBuilderInitialization() { 2192 if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { 2193 getStatusFieldBuilder(); 2194 getMetricsFieldBuilder(); 2195 getMetadataFieldBuilder(); 2196 } 2197 } 2198 private static Builder create() { 2199 return new Builder(); 2200 } 2201 2202 public Builder clear() { 2203 super.clear(); 2204 if (statusBuilder_ == null) { 2205 status_ = CheckStatus.Status.getDefaultInstance(); 2206 } else { 2207 statusBuilder_.clear(); 2208 } 2209 bitField0_ = (bitField0_ & ~0x00000001); 2210 if (metricsBuilder_ == null) { 2211 metrics_ = java.util.Collections.emptyList(); 2212 bitField0_ = (bitField0_ & ~0x00000002); 2213 } else { 2214 metricsBuilder_.clear(); 2215 } 2216 if (metadataBuilder_ == null) { 2217 metadata_ = java.util.Collections.emptyList(); 2218 bitField0_ = (bitField0_ & ~0x00000004); 2219 } else { 2220 metadataBuilder_.clear(); 2221 } 2222 return this; 2223 } 2224 2225 public Builder clone() { 2226 return create().mergeFrom(buildPartial()); 2227 } 2228 2229 public com.google.protobuf.Descriptors.Descriptor 2230 getDescriptorForType() { 2231 return CheckStatus.Bundle.getDescriptor(); 2232 } 2233 2234 public CheckStatus.Bundle getDefaultInstanceForType() { 2235 return CheckStatus.Bundle.getDefaultInstance(); 2236 } 2237 2238 public CheckStatus.Bundle build() { 2239 CheckStatus.Bundle result = buildPartial(); 2240 if (!result.isInitialized()) { 2241 throw newUninitializedMessageException(result); 2242 } 2243 return result; 2244 } 2245 2246 private CheckStatus.Bundle buildParsed() 2247 throws com.google.protobuf.InvalidProtocolBufferException { 2248 CheckStatus.Bundle result = buildPartial(); 2249 if (!result.isInitialized()) { 2250 throw newUninitializedMessageException( 2251 result).asInvalidProtocolBufferException(); 2252 } 2253 return result; 2254 } 2255 2256 public CheckStatus.Bundle buildPartial() { 2257 CheckStatus.Bundle result = new CheckStatus.Bundle(this); 2258 int from_bitField0_ = bitField0_; 2259 int to_bitField0_ = 0; 2260 if (((from_bitField0_ & 0x00000001) == 0x00000001)) { 2261 to_bitField0_ |= 0x00000001; 2262 } 2263 if (statusBuilder_ == null) { 2264 result.status_ = status_; 2265 } else { 2266 result.status_ = statusBuilder_.build(); 2267 } 2268 if (metricsBuilder_ == null) { 2269 if (((bitField0_ & 0x00000002) == 0x00000002)) { 2270 metrics_ = java.util.Collections.unmodifiableList(metrics_); 2271 bitField0_ = (bitField0_ & ~0x00000002); 2272 } 2273 result.metrics_ = metrics_; 2274 } else { 2275 result.metrics_ = metricsBuilder_.build(); 2276 } 2277 if (metadataBuilder_ == null) { 2278 if (((bitField0_ & 0x00000004) == 0x00000004)) { 2279 metadata_ = java.util.Collections.unmodifiableList(metadata_); 2280 bitField0_ = (bitField0_ & ~0x00000004); 2281 } 2282 result.metadata_ = metadata_; 2283 } else { 2284 result.metadata_ = metadataBuilder_.build(); 2285 } 2286 result.bitField0_ = to_bitField0_; 2287 onBuilt(); 2288 return result; 2289 } 2290 2291 public Builder mergeFrom(com.google.protobuf.Message other) { 2292 if (other instanceof CheckStatus.Bundle) { 2293 return mergeFrom((CheckStatus.Bundle)other); 2294 } else { 2295 super.mergeFrom(other); 2296 return this; 2297 } 2298 } 2299 2300 public Builder mergeFrom(CheckStatus.Bundle other) { 2301 if (other == CheckStatus.Bundle.getDefaultInstance()) return this; 2302 if (other.hasStatus()) { 2303 mergeStatus(other.getStatus()); 2304 } 2305 if (metricsBuilder_ == null) { 2306 if (!other.metrics_.isEmpty()) { 2307 if (metrics_.isEmpty()) { 2308 metrics_ = other.metrics_; 2309 bitField0_ = (bitField0_ & ~0x00000002); 2310 } else { 2311 ensureMetricsIsMutable(); 2312 metrics_.addAll(other.metrics_); 2313 } 2314 onChanged(); 2315 } 2316 } else { 2317 if (!other.metrics_.isEmpty()) { 2318 if (metricsBuilder_.isEmpty()) { 2319 metricsBuilder_.dispose(); 2320 metricsBuilder_ = null; 2321 metrics_ = other.metrics_; 2322 bitField0_ = (bitField0_ & ~0x00000002); 2323 metricsBuilder_ = 2324 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? 2325 getMetricsFieldBuilder() : null; 2326 } else { 2327 metricsBuilder_.addAllMessages(other.metrics_); 2328 } 2329 } 2330 } 2331 if (metadataBuilder_ == null) { 2332 if (!other.metadata_.isEmpty()) { 2333 if (metadata_.isEmpty()) { 2334 metadata_ = other.metadata_; 2335 bitField0_ = (bitField0_ & ~0x00000004); 2336 } else { 2337 ensureMetadataIsMutable(); 2338 metadata_.addAll(other.metadata_); 2339 } 2340 onChanged(); 2341 } 2342 } else { 2343 if (!other.metadata_.isEmpty()) { 2344 if (metadataBuilder_.isEmpty()) { 2345 metadataBuilder_.dispose(); 2346 metadataBuilder_ = null; 2347 metadata_ = other.metadata_; 2348 bitField0_ = (bitField0_ & ~0x00000004); 2349 metadataBuilder_ = 2350 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? 2351 getMetadataFieldBuilder() : null; 2352 } else { 2353 metadataBuilder_.addAllMessages(other.metadata_); 2354 } 2355 } 2356 } 2357 this.mergeUnknownFields(other.getUnknownFields()); 2358 return this; 2359 } 2360 2361 public final boolean isInitialized() { 2362 if (hasStatus()) { 2363 if (!getStatus().isInitialized()) { 2364 2365 return false; 2366 } 2367 } 2368 for (int i = 0; i < getMetricsCount(); i++) { 2369 if (!getMetrics(i).isInitialized()) { 2370 2371 return false; 2372 } 2373 } 2374 for (int i = 0; i < getMetadataCount(); i++) { 2375 if (!getMetadata(i).isInitialized()) { 2376 2377 return false; 2378 } 2379 } 2380 return true; 2381 } 2382 2383 public Builder mergeFrom( 2384 com.google.protobuf.CodedInputStream input, 2385 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2386 throws java.io.IOException { 2387 com.google.protobuf.UnknownFieldSet.Builder unknownFields = 2388 com.google.protobuf.UnknownFieldSet.newBuilder( 2389 this.getUnknownFields()); 2390 while (true) { 2391 int tag = input.readTag(); 2392 switch (tag) { 2393 case 0: 2394 this.setUnknownFields(unknownFields.build()); 2395 onChanged(); 2396 return this; 2397 default: { 2398 if (!parseUnknownField(input, unknownFields, 2399 extensionRegistry, tag)) { 2400 this.setUnknownFields(unknownFields.build()); 2401 onChanged(); 2402 return this; 2403 } 2404 break; 2405 } 2406 case 10: { 2407 CheckStatus.Status.Builder subBuilder = CheckStatus.Status.newBuilder(); 2408 if (hasStatus()) { 2409 subBuilder.mergeFrom(getStatus()); 2410 } 2411 input.readMessage(subBuilder, extensionRegistry); 2412 setStatus(subBuilder.buildPartial()); 2413 break; 2414 } 2415 case 18: { 2416 CheckStatus.Metric.Builder subBuilder = CheckStatus.Metric.newBuilder(); 2417 input.readMessage(subBuilder, extensionRegistry); 2418 addMetrics(subBuilder.buildPartial()); 2419 break; 2420 } 2421 case 26: { 2422 CheckStatus.Metadata.Builder subBuilder = CheckStatus.Metadata.newBuilder(); 2423 input.readMessage(subBuilder, extensionRegistry); 2424 addMetadata(subBuilder.buildPartial()); 2425 break; 2426 } 2427 } 2428 } 2429 } 2430 2431 private int bitField0_; 2432 2433 // optional .Status status = 1; 2434 private CheckStatus.Status status_ = CheckStatus.Status.getDefaultInstance(); 2435 private com.google.protobuf.SingleFieldBuilder< 2436 CheckStatus.Status, CheckStatus.Status.Builder, CheckStatus.StatusOrBuilder> statusBuilder_; 2437 public boolean hasStatus() { 2438 return ((bitField0_ & 0x00000001) == 0x00000001); 2439 } 2440 public CheckStatus.Status getStatus() { 2441 if (statusBuilder_ == null) { 2442 return status_; 2443 } else { 2444 return statusBuilder_.getMessage(); 2445 } 2446 } 2447 public Builder setStatus(CheckStatus.Status value) { 2448 if (statusBuilder_ == null) { 2449 if (value == null) { 2450 throw new NullPointerException(); 2451 } 2452 status_ = value; 2453 onChanged(); 2454 } else { 2455 statusBuilder_.setMessage(value); 2456 } 2457 bitField0_ |= 0x00000001; 2458 return this; 2459 } 2460 public Builder setStatus( 2461 CheckStatus.Status.Builder builderForValue) { 2462 if (statusBuilder_ == null) { 2463 status_ = builderForValue.build(); 2464 onChanged(); 2465 } else { 2466 statusBuilder_.setMessage(builderForValue.build()); 2467 } 2468 bitField0_ |= 0x00000001; 2469 return this; 2470 } 2471 public Builder mergeStatus(CheckStatus.Status value) { 2472 if (statusBuilder_ == null) { 2473 if (((bitField0_ & 0x00000001) == 0x00000001) && 2474 status_ != CheckStatus.Status.getDefaultInstance()) { 2475 status_ = 2476 CheckStatus.Status.newBuilder(status_).mergeFrom(value).buildPartial(); 2477 } else { 2478 status_ = value; 2479 } 2480 onChanged(); 2481 } else { 2482 statusBuilder_.mergeFrom(value); 2483 } 2484 bitField0_ |= 0x00000001; 2485 return this; 2486 } 2487 public Builder clearStatus() { 2488 if (statusBuilder_ == null) { 2489 status_ = CheckStatus.Status.getDefaultInstance(); 2490 onChanged(); 2491 } else { 2492 statusBuilder_.clear(); 2493 } 2494 bitField0_ = (bitField0_ & ~0x00000001); 2495 return this; 2496 } 2497 public CheckStatus.Status.Builder getStatusBuilder() { 2498 bitField0_ |= 0x00000001; 2499 onChanged(); 2500 return getStatusFieldBuilder().getBuilder(); 2501 } 2502 public CheckStatus.StatusOrBuilder getStatusOrBuilder() { 2503 if (statusBuilder_ != null) { 2504 return statusBuilder_.getMessageOrBuilder(); 2505 } else { 2506 return status_; 2507 } 2508 } 2509 private com.google.protobuf.SingleFieldBuilder< 2510 CheckStatus.Status, CheckStatus.Status.Builder, CheckStatus.StatusOrBuilder> 2511 getStatusFieldBuilder() { 2512 if (statusBuilder_ == null) { 2513 statusBuilder_ = new com.google.protobuf.SingleFieldBuilder< 2514 CheckStatus.Status, CheckStatus.Status.Builder, CheckStatus.StatusOrBuilder>( 2515 status_, 2516 getParentForChildren(), 2517 isClean()); 2518 status_ = null; 2519 } 2520 return statusBuilder_; 2521 } 2522 2523 // repeated .Metric metrics = 2; 1504 2524 private java.util.List<CheckStatus.Metric> metrics_ = 1505 2525 java.util.Collections.emptyList(); 1506 2526 private void ensureMetricsIsMutable() { 1507 if (!((bitField0_ & 0x000000 10) == 0x00000010)) {2527 if (!((bitField0_ & 0x00000002) == 0x00000002)) { 1508 2528 metrics_ = new java.util.ArrayList<CheckStatus.Metric>(metrics_); 1509 bitField0_ |= 0x000000 10;2529 bitField0_ |= 0x00000002; 1510 2530 } 1511 2531 } … … 1623 2643 if (metricsBuilder_ == null) { 1624 2644 metrics_ = java.util.Collections.emptyList(); 1625 bitField0_ = (bitField0_ & ~0x000000 10);2645 bitField0_ = (bitField0_ & ~0x00000002); 1626 2646 onChanged(); 1627 2647 } else { … … 1679 2699 CheckStatus.Metric, CheckStatus.Metric.Builder, CheckStatus.MetricOrBuilder>( 1680 2700 metrics_, 1681 ((bitField0_ & 0x000000 10) == 0x00000010),2701 ((bitField0_ & 0x00000002) == 0x00000002), 1682 2702 getParentForChildren(), 1683 2703 isClean()); … … 1685 2705 } 1686 2706 return metricsBuilder_; 2707 } 2708 2709 // repeated .Metadata metadata = 3; 2710 private java.util.List<CheckStatus.Metadata> metadata_ = 2711 java.util.Collections.emptyList(); 2712 private void ensureMetadataIsMutable() { 2713 if (!((bitField0_ & 0x00000004) == 0x00000004)) { 2714 metadata_ = new java.util.ArrayList<CheckStatus.Metadata>(metadata_); 2715 bitField0_ |= 0x00000004; 2716 } 2717 } 2718 2719 private com.google.protobuf.RepeatedFieldBuilder< 2720 CheckStatus.Metadata, CheckStatus.Metadata.Builder, CheckStatus.MetadataOrBuilder> metadataBuilder_; 2721 2722 public java.util.List<CheckStatus.Metadata> getMetadataList() { 2723 if (metadataBuilder_ == null) { 2724 return java.util.Collections.unmodifiableList(metadata_); 2725 } else { 2726 return metadataBuilder_.getMessageList(); 2727 } 2728 } 2729 public int getMetadataCount() { 2730 if (metadataBuilder_ == null) { 2731 return metadata_.size(); 2732 } else { 2733 return metadataBuilder_.getCount(); 2734 } 2735 } 2736 public CheckStatus.Metadata getMetadata(int index) { 2737 if (metadataBuilder_ == null) { 2738 return metadata_.get(index); 2739 } else { 2740 return metadataBuilder_.getMessage(index); 2741 } 2742 } 2743 public Builder setMetadata( 2744 int index, CheckStatus.Metadata value) { 2745 if (metadataBuilder_ == null) { 2746 if (value == null) { 2747 throw new NullPointerException(); 2748 } 2749 ensureMetadataIsMutable(); 2750 metadata_.set(index, value); 2751 onChanged(); 2752 } else { 2753 metadataBuilder_.setMessage(index, value); 2754 } 2755 return this; 2756 } 2757 public Builder setMetadata( 2758 int index, CheckStatus.Metadata.Builder builderForValue) { 2759 if (metadataBuilder_ == null) { 2760 ensureMetadataIsMutable(); 2761 metadata_.set(index, builderForValue.build()); 2762 onChanged(); 2763 } else { 2764 metadataBuilder_.setMessage(index, builderForValue.build()); 2765 } 2766 return this; 2767 } 2768 public Builder addMetadata(CheckStatus.Metadata value) { 2769 if (metadataBuilder_ == null) { 2770 if (value == null) { 2771 throw new NullPointerException(); 2772 } 2773 ensureMetadataIsMutable(); 2774 metadata_.add(value); 2775 onChanged(); 2776 } else { 2777 metadataBuilder_.addMessage(value); 2778 } 2779 return this; 2780 } 2781 public Builder addMetadata( 2782 int index, CheckStatus.Metadata value) { 2783 if (metadataBuilder_ == null) { 2784 if (value == null) { 2785 throw new NullPointerException(); 2786 } 2787 ensureMetadataIsMutable(); 2788 metadata_.add(index, value); 2789 onChanged(); 2790 } else { 2791 metadataBuilder_.addMessage(index, value); 2792 } 2793 return this; 2794 } 2795 public Builder addMetadata( 2796 CheckStatus.Metadata.Builder builderForValue) { 2797 if (metadataBuilder_ == null) { 2798 ensureMetadataIsMutable(); 2799 metadata_.add(builderForValue.build()); 2800 onChanged(); 2801 } else { 2802 metadataBuilder_.addMessage(builderForValue.build()); 2803 } 2804 return this; 2805 } 2806 public Builder addMetadata( 2807 int index, CheckStatus.Metadata.Builder builderForValue) { 2808 if (metadataBuilder_ == null) { 2809 ensureMetadataIsMutable(); 2810 metadata_.add(index, builderForValue.build()); 2811 onChanged(); 2812 } else { 2813 metadataBuilder_.addMessage(index, builderForValue.build()); 2814 } 2815 return this; 2816 } 2817 public Builder addAllMetadata( 2818 java.lang.Iterable<? extends CheckStatus.Metadata> values) { 2819 if (metadataBuilder_ == null) { 2820 ensureMetadataIsMutable(); 2821 super.addAll(values, metadata_); 2822 onChanged(); 2823 } else { 2824 metadataBuilder_.addAllMessages(values); 2825 } 2826 return this; 2827 } 2828 public Builder clearMetadata() { 2829 if (metadataBuilder_ == null) { 2830 metadata_ = java.util.Collections.emptyList(); 2831 bitField0_ = (bitField0_ & ~0x00000004); 2832 onChanged(); 2833 } else { 2834 metadataBuilder_.clear(); 2835 } 2836 return this; 2837 } 2838 public Builder removeMetadata(int index) { 2839 if (metadataBuilder_ == null) { 2840 ensureMetadataIsMutable(); 2841 metadata_.remove(index); 2842 onChanged(); 2843 } else { 2844 metadataBuilder_.remove(index); 2845 } 2846 return this; 2847 } 2848 public CheckStatus.Metadata.Builder getMetadataBuilder( 2849 int index) { 2850 return getMetadataFieldBuilder().getBuilder(index); 2851 } 2852 public CheckStatus.MetadataOrBuilder getMetadataOrBuilder( 2853 int index) { 2854 if (metadataBuilder_ == null) { 2855 return metadata_.get(index); } else { 2856 return metadataBuilder_.getMessageOrBuilder(index); 2857 } 2858 } 2859 public java.util.List<? extends CheckStatus.MetadataOrBuilder> 2860 getMetadataOrBuilderList() { 2861 if (metadataBuilder_ != null) { 2862 return metadataBuilder_.getMessageOrBuilderList(); 2863 } else { 2864 return java.util.Collections.unmodifiableList(metadata_); 2865 } 2866 } 2867 public CheckStatus.Metadata.Builder addMetadataBuilder() { 2868 return getMetadataFieldBuilder().addBuilder( 2869 CheckStatus.Metadata.getDefaultInstance()); 2870 } 2871 public CheckStatus.Metadata.Builder addMetadataBuilder( 2872 int index) { 2873 return getMetadataFieldBuilder().addBuilder( 2874 index, CheckStatus.Metadata.getDefaultInstance()); 2875 } 2876 public java.util.List<CheckStatus.Metadata.Builder> 2877 getMetadataBuilderList() { 2878 return getMetadataFieldBuilder().getBuilderList(); 2879 } 2880 private com.google.protobuf.RepeatedFieldBuilder< 2881 CheckStatus.Metadata, CheckStatus.Metadata.Builder, CheckStatus.MetadataOrBuilder> 2882 getMetadataFieldBuilder() { 2883 if (metadataBuilder_ == null) { 2884 metadataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< 2885 CheckStatus.Metadata, CheckStatus.Metadata.Builder, CheckStatus.MetadataOrBuilder>( 2886 metadata_, 2887 ((bitField0_ & 0x00000004) == 0x00000004), 2888 getParentForChildren(), 2889 isClean()); 2890 metadata_ = null; 2891 } 2892 return metadataBuilder_; 1687 2893 } 1688 2894 … … 1703 2909 com.google.protobuf.GeneratedMessage.FieldAccessorTable 1704 2910 internal_static_Metric_fieldAccessorTable; 2911 private static com.google.protobuf.Descriptors.Descriptor 2912 internal_static_Status_descriptor; 2913 private static 2914 com.google.protobuf.GeneratedMessage.FieldAccessorTable 2915 internal_static_Status_fieldAccessorTable; 2916 private static com.google.protobuf.Descriptors.Descriptor 2917 internal_static_Metadata_descriptor; 2918 private static 2919 com.google.protobuf.GeneratedMessage.FieldAccessorTable 2920 internal_static_Metadata_fieldAccessorTable; 1705 2921 private static com.google.protobuf.Descriptors.Descriptor 1706 2922 internal_static_Bundle_descriptor; … … 1717 2933 static { 1718 2934 java.lang.String[] descriptorData = { 1719 "\n\021 checkstatus.proto\"\230\001\n\006Metric\022\014\n\004name\030\001" +2935 "\n\021CheckStatus.proto\"\230\001\n\006Metric\022\014\n\004name\030\001" + 1720 2936 " \002(\t\022\022\n\nmetricType\030\002 \002(\005\022\020\n\010valueDbl\030\003 \001" + 1721 2937 "(\001\022\020\n\010valueI64\030\004 \001(\003\022\021\n\tvalueUI64\030\005 \001(\004\022" + 1722 2938 "\020\n\010valueI32\030\006 \001(\005\022\021\n\tvalueUI32\030\007 \001(\r\022\020\n\010" + 1723 "valueStr\030\010 \001(\t\" f\n\006Bundle\022\021\n\tavailable\030\001 " +2939 "valueStr\030\010 \001(\t\"L\n\006Status\022\021\n\tavailable\030\001 " + 1724 2940 "\002(\005\022\r\n\005state\030\002 \002(\005\022\020\n\010duration\030\003 \002(\005\022\016\n\006" + 1725 "status\030\004 \002(\t\022\030\n\007metrics\030\005 \003(\0132\007.Metric" 2941 "status\030\004 \002(\t\"&\n\010Metadata\022\013\n\003key\030\001 \002(\t\022\r\n" + 2942 "\005value\030\002 \002(\t\"X\n\006Bundle\022\027\n\006status\030\001 \001(\0132\007" + 2943 ".Status\022\030\n\007metrics\030\002 \003(\0132\007.Metric\022\033\n\010met" + 2944 "adata\030\003 \003(\0132\t.Metadata" 1726 2945 }; 1727 2946 com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = … … 1738 2957 CheckStatus.Metric.class, 1739 2958 CheckStatus.Metric.Builder.class); 2959 internal_static_Status_descriptor = 2960 getDescriptor().getMessageTypes().get(1); 2961 internal_static_Status_fieldAccessorTable = new 2962 com.google.protobuf.GeneratedMessage.FieldAccessorTable( 2963 internal_static_Status_descriptor, 2964 new java.lang.String[] { "Available", "State", "Duration", "Status", }, 2965 CheckStatus.Status.class, 2966 CheckStatus.Status.Builder.class); 2967 internal_static_Metadata_descriptor = 2968 getDescriptor().getMessageTypes().get(2); 2969 internal_static_Metadata_fieldAccessorTable = new 2970 com.google.protobuf.GeneratedMessage.FieldAccessorTable( 2971 internal_static_Metadata_descriptor, 2972 new java.lang.String[] { "Key", "Value", }, 2973 CheckStatus.Metadata.class, 2974 CheckStatus.Metadata.Builder.class); 1740 2975 internal_static_Bundle_descriptor = 1741 getDescriptor().getMessageTypes().get( 1);2976 getDescriptor().getMessageTypes().get(3); 1742 2977 internal_static_Bundle_fieldAccessorTable = new 1743 2978 com.google.protobuf.GeneratedMessage.FieldAccessorTable( 1744 2979 internal_static_Bundle_descriptor, 1745 new java.lang.String[] { " Available", "State", "Duration", "Status", "Metrics", },2980 new java.lang.String[] { "Status", "Metrics", "Metadata", }, 1746 2981 CheckStatus.Bundle.class, 1747 2982 CheckStatus.Bundle.Builder.class); src/java/com/omniti/reconnoiter/event/NoitBundlev2.java
r2258f49 ra423b8a 54 54 CheckStatus.Bundle bundle = decode(parts[8], rawlen); 55 55 if(bundle != null) { 56 char state[] = new char [] { (char)bundle.getState() }; 57 char available[] = new char [] { (char) bundle.getAvailable() }; 58 items.addLast(new NoitStatus(new java.lang.String[] 59 { "S", noit, timestamp, parts[3], new String(state), 60 new String(available), 61 new Integer(bundle.getDuration()).toString(), 62 bundle.getStatus() })); 56 CheckStatus.Status status = bundle.getStatus(); 57 if(status != null) { 58 char state[] = new char [] { (char)status.getState() }; 59 char available[] = new char [] { (char) status.getAvailable() }; 60 61 items.addLast(new NoitStatus(new java.lang.String[] 62 { "S", noit, timestamp, parts[3], new String(state), 63 new String(available), 64 new Integer(status.getDuration()).toString(), 65 status.getStatus() })); 66 } 63 67 for(CheckStatus.Metric metric : bundle.getMetricsList()) { 64 68 char metrictype[] = new char [] { (char)metric.getMetricType() }; src/noit_check_log.c
r6b7bec9 ra423b8a 335 335 336 336 // Set attributes 337 bundle.available = c->available; 338 bundle.state = c->state; 339 bundle.duration = c->duration; 340 bundle.status = c->status; 337 bundle.status = malloc(sizeof(Status)); 338 status__init(bundle.status); 339 bundle.status->available = c->available; 340 bundle.status->state = c->state; 341 bundle.status->duration = c->duration; 342 bundle.status->status = c->status; 341 343 342 344 src/noit_check_log_helpers.c
re1f9f43 ra423b8a 171 171 noit_compression_type_t ctype; 172 172 unsigned int ulen; 173 int i, size, cnt = 0 ;173 int i, size, cnt = 0, has_status = 0; 174 174 const char *cp1, *cp2, *rest, *error_str = NULL; 175 175 char *timestamp, *uuid_str, *target, *module, *name, *ulen_str; … … 227 227 noitL(noit_error, "ZOMG -> data (%lld metrics)\n", 228 228 (long long int)bundle->n_metrics); 229 cnt = bundle->n_metrics + 1; 230 *out = calloc(sizeof(**out), cnt); 229 has_status = bundle->status ? 1 : 0; 230 cnt = bundle->n_metrics; 231 *out = calloc(sizeof(**out), cnt + has_status); 231 232 if(!*out) { error_str = "memory exhaustion"; goto bad_line; } 232 /* build out status line */ 233 size = 2 /* S\t */ + strlen(timestamp) + 1 /* \t */ + strlen(uuid_str) + 234 5 /* \tG\tA\t */ + 11 /* max(strlen(duration)) */ + 235 1 /* \t */ + 236 (bundle->status ? strlen(bundle->status) : 8 /* [[null]] */) + 237 1 /* \0 */; 238 **out = malloc(size); 239 snprintf(**out, size, "S\t%s\t%s\t%c\t%c\t%d\t%s", 240 timestamp, uuid_str, bundle->state, bundle->available, 241 bundle->duration, bundle->status ? bundle->status : "[[null]]"); 233 if(has_status) { 234 Status *status = bundle->status; 235 /* build out status line */ 236 size = 2 /* S\t */ + strlen(timestamp) + 1 /* \t */ + strlen(uuid_str) + 237 5 /* \tG\tA\t */ + 11 /* max(strlen(duration)) */ + 238 1 /* \t */ + 239 (status->status ? strlen(status->status) : 8 /* [[null]] */) + 240 1 /* \0 */; 241 **out = malloc(size); 242 snprintf(**out, size, "S\t%s\t%s\t%c\t%c\t%d\t%s", 243 timestamp, uuid_str, status->state, status->available, 244 status->duration, status->status ? status->status : "[[null]]"); 245 } 242 246 /* build our metric lines */ 243 for(i= 1; i<cnt; i++) {244 Metric *metric = bundle->metrics[i -1];247 for(i=0; i<cnt; i++) { 248 Metric *metric = bundle->metrics[i]; 245 249 metric_t m; 246 250 char scratch[64], *value_str;; … … 291 295 strlen(uuid_str) + 1 /* \t */ + strlen(metric->name) + 292 296 3 /* \t<type>\t */ + value_size + 1 /* \0 */; 293 (*out)[i ] = malloc(size);294 snprintf((*out)[i ], size, "M\t%s\t%s\t%s\t%c\t%s",297 (*out)[i+has_status] = malloc(size); 298 snprintf((*out)[i+has_status], size, "M\t%s\t%s\t%s\t%c\t%s", 295 299 timestamp, uuid_str, metric->name, m.metric_type, value_str); 296 300 } … … 300 304 if(*out) { 301 305 int i; 302 for(i=0; i<cnt ; i++) if((*out)[i]) free((*out)[i]);306 for(i=0; i<cnt + has_status; i++) if((*out)[i]) free((*out)[i]); 303 307 free(*out); 304 308 *out = NULL;
