diff --git a/.github/workflows/labeler/label-scope-conf.yml b/.github/workflows/labeler/label-scope-conf.yml index b417d53e72a..b825fb9e58b 100644 --- a/.github/workflows/labeler/label-scope-conf.yml +++ b/.github/workflows/labeler/label-scope-conf.yml @@ -132,6 +132,11 @@ http: - changed-files: - any-glob-to-any-file: seatunnel-connectors-v2/connector-http/** - all-globs-to-all-files: '!seatunnel-connectors-v2/connector-!(http)/**' +prometheus: + - all: + - changed-files: + - any-glob-to-any-file: seatunnel-connectors-v2/connector-prometheus/** + - all-globs-to-all-files: '!seatunnel-connectors-v2/connector-!(prometheus)/**' hudi: - all: - changed-files: diff --git a/config/plugin_config b/config/plugin_config index 317b41480e1..317256863f4 100644 --- a/config/plugin_config +++ b/config/plugin_config @@ -88,6 +88,7 @@ connector-tdengine connector-web3j connector-milvus connector-activemq +connector-prometheus connector-sls connector-qdrant connector-typesense diff --git a/docs/en/connector-v2/sink/Prometheus.md b/docs/en/connector-v2/sink/Prometheus.md new file mode 100644 index 00000000000..8ba31ca2e2d --- /dev/null +++ b/docs/en/connector-v2/sink/Prometheus.md @@ -0,0 +1,103 @@ +# Prometheus + +> Prometheus sink connector + +## Support Those Engines + +> Spark
+> Flink
+> SeaTunnel Zeta
+ +## Key Features + +- [ ] [exactly-once](../../concept/connector-v2-features.md) +- [ ] [cdc](../../concept/connector-v2-features.md) +- [x] [support multiple table write](../../concept/connector-v2-features.md) + +## Description + +Used to launch web hooks using data. + +> For example, if the data from upstream is [`label: {"__name__": "test1"}, value: 1.2.3,time:2024-08-15T17:00:00`], the body content is the following: `{"label":{"__name__": "test1"}, "value":"1.23","time":"2024-08-15T17:00:00"}` + +**Tips: Prometheus sink only support `post json` webhook and the data from source will be treated as body content in web hook.And does not support passing past data** + +## Supported DataSource Info + +In order to use the Http connector, the following dependencies are required. +They can be downloaded via install-plugin.sh or from the Maven central repository. + +| Datasource | Supported Versions | Dependency | +|------------|--------------------|------------------------------------------------------------------------------------------------------------------| +| Http | universal | [Download](https://mvnrepository.com/artifact/org.apache.seatunnel/seatunnel-connectors-v2/connector-prometheus) | + +## Sink Options + +| Name | Type | Required | Default | Description | +|-----------------------------|--------|----------|---------|-------------------------------------------------------------------------------------------------------------| +| url | String | Yes | - | Http request url | +| headers | Map | No | - | Http headers | +| retry | Int | No | - | The max retry times if request http return to `IOException` | +| retry_backoff_multiplier_ms | Int | No | 100 | The retry-backoff times(millis) multiplier if request http failed | +| retry_backoff_max_ms | Int | No | 10000 | The maximum retry-backoff times(millis) if request http failed | +| connect_timeout_ms | Int | No | 12000 | Connection timeout setting, default 12s. | +| socket_timeout_ms | Int | No | 60000 | Socket timeout setting, default 60s. | +| key_timestamp | Int | NO | - | prometheus timestamp key . | +| key_label | String | yes | - | prometheus label key | +| key_value | Double | yes | - | prometheus value | +| batch_size | Int | false | 1024 | prometheus batch size write | +| flush_interval | Long | false | 300000L | prometheus flush commit interval | +| common-options | | No | - | Sink plugin common parameters, please refer to [Sink Common Options](../sink-common-options.md) for details | + +## Example + +simple: + +```hocon +env { + parallelism = 1 + job.mode = "BATCH" +} + +source { + FakeSource { + schema = { + fields { + c_map = "map" + c_double = double + c_timestamp = timestamp + } + } + result_table_name = "fake" + rows = [ + { + kind = INSERT + fields = [{"__name__": "test1"}, 1.23, "2024-08-15T17:00:00"] + }, + { + kind = INSERT + fields = [{"__name__": "test2"}, 1.23, "2024-08-15T17:00:00"] + } + ] + } +} + + +sink { + Prometheus { + url = "http://prometheus:9090/api/v1/write" + key_label = "c_map" + key_value = "c_double" + key_timestamp = "c_timestamp" + batch_size = 1 + } +} + +``` + +## Changelog + +### 2.3.8-beta 2024-08-22 + +- Add Http Sink Connector + diff --git a/docs/en/connector-v2/source/Prometheus.md b/docs/en/connector-v2/source/Prometheus.md new file mode 100644 index 00000000000..fc9ecc4988b --- /dev/null +++ b/docs/en/connector-v2/source/Prometheus.md @@ -0,0 +1,152 @@ +# Prometheus + +> Prometheus source connector + +## Description + +Used to read data from Prometheus. + +## Key features + +- [x] [batch](../../concept/connector-v2-features.md) +- [ ] [stream](../../concept/connector-v2-features.md) +- [ ] [parallelism](../../concept/connector-v2-features.md) + +## Options + +| name | type | required | default value | +|-----------------------------|---------|----------|-----------------| +| url | String | Yes | - | +| query | String | Yes | - | +| query_type | String | Yes | Instant | +| content_field | String | Yes | $.data.result.* | +| schema.fields | Config | Yes | - | +| format | String | No | json | +| params | Map | Yes | - | +| poll_interval_millis | int | No | - | +| retry | int | No | - | +| retry_backoff_multiplier_ms | int | No | 100 | +| retry_backoff_max_ms | int | No | 10000 | +| enable_multi_lines | boolean | No | false | +| common-options | config | No | - | + +### url [String] + +http request url + +### query [String] + +Prometheus expression query string + +### query_type [String] + +Instant/Range + +1. Instant : The following endpoint evaluates an instant query at a single point in time +2. Range : The following endpoint evaluates an expression query over a range of time + +https://prometheus.io/docs/prometheus/latest/querying/api/ + +### params [Map] + +http request params + +### poll_interval_millis [int] + +request http api interval(millis) in stream mode + +### retry [int] + +The max retry times if request http return to `IOException` + +### retry_backoff_multiplier_ms [int] + +The retry-backoff times(millis) multiplier if request http failed + +### retry_backoff_max_ms [int] + +The maximum retry-backoff times(millis) if request http failed + +### format [String] + +the format of upstream data, default `json`. + +### schema [Config] + +Fill in a fixed value + +```hocon + schema = { + fields { + metric = "map" + value = double + time = long + } + } + +``` + +#### fields [Config] + +the schema fields of upstream data + +### common options + +Source plugin common parameters, please refer to [Source Common Options](../source-common-options.md) for details + +## Example + +### Instant: + +```hocon +source { + Prometheus { + result_table_name = "http" + url = "http://mockserver:1080" + query = "up" + query_type = "Instant" + content_field = "$.data.result.*" + format = "json" + schema = { + fields { + metric = "map" + value = double + time = long + } + } + } +} +``` + +### Range + +```hocon +source { + Prometheus { + result_table_name = "http" + url = "http://mockserver:1080" + query = "up" + query_type = "Range" + content_field = "$.data.result.*" + format = "json" + start = "2024-07-22T20:10:30.781Z" + end = "2024-07-22T20:11:00.781Z" + step = "15s" + schema = { + fields { + metric = "map" + value = double + time = long + } + } + } + } +``` + +## Changelog + +### next version + +- Add Prometheus Source Connector +- Reduce configuration items + diff --git a/docs/zh/connector-v2/sink/Prometheus.md b/docs/zh/connector-v2/sink/Prometheus.md new file mode 100644 index 00000000000..8e7c9989020 --- /dev/null +++ b/docs/zh/connector-v2/sink/Prometheus.md @@ -0,0 +1,101 @@ +# Prometheus + +> Prometheus 数据接收器 + +## 引擎支持 + +> Spark
+> Flink
+> SeaTunnel Zeta
+ +## 主要特性 + +- [ ] [exactly-once](../../concept/connector-v2-features.md) +- [ ] [cdc](../../concept/connector-v2-features.md) +- [x] [support multiple table write](../../concept/connector-v2-features.md) + +## 描述 + +接收Source端传入的数据,利用数据触发 web hooks。 + +> 例如,来自上游的数据为 [`label: {"__name__": "test1"}, value: 1.2.3,time:2024-08-15T17:00:00`], 则body内容如下: `{"label":{"__name__": "test1"}, "value":"1.23","time":"2024-08-15T17:00:00"}` + +**Tips: Prometheus 数据接收器 仅支持 `post json` 类型的 web hook,source 数据将被视为 webhook 中的 body 内容。并且不支持传递过去太久的数据** + +## 支持的数据源信息 + +想使用 Prometheus 连接器,需要安装以下必要的依赖。可以通过运行 install-plugin.sh 脚本或者从 Maven 中央仓库下载这些依赖 + +| 数据源 | 支持版本 | 依赖 | +|------|-----------|------------------------------------------------------------------------------------------------------------------| +| Http | universal | [Download](https://mvnrepository.com/artifact/org.apache.seatunnel/seatunnel-connectors-v2/connector-prometheus) | + +## 接收器选项 + +| Name | Type | Required | Default | Description | +|-----------------------------|--------|----------|---------|-------------------------------------------------------------------| +| url | String | Yes | - | Http 请求链接 | +| headers | Map | No | - | Http 标头 | +| retry | Int | No | - | 如果请求http返回`IOException`的最大重试次数 | +| retry_backoff_multiplier_ms | Int | No | 100 | http请求失败,重试回退次数(毫秒)乘数 | +| retry_backoff_max_ms | Int | No | 10000 | http请求失败,最大重试回退时间(毫秒) | +| connect_timeout_ms | Int | No | 12000 | 连接超时设置,默认12s | +| socket_timeout_ms | Int | No | 60000 | 套接字超时设置,默认为60s | +| key_timestamp | Int | NO | - | prometheus时间戳的key. | +| key_label | String | yes | - | prometheus标签的key | +| key_value | Double | yes | - | prometheus值的key | +| batch_size | Int | false | 1024 | prometheus批量写入大小 | +| flush_interval | Long | false | 300000L | prometheus定时写入 | +| common-options | | No | - | Sink插件常用参数,请参考 [Sink常用选项 ](../sink-common-options.md) 了解详情 | + +## 示例 + +简单示例: + +```hocon +env { + parallelism = 1 + job.mode = "BATCH" +} + +source { + FakeSource { + schema = { + fields { + c_map = "map" + c_double = double + c_timestamp = timestamp + } + } + result_table_name = "fake" + rows = [ + { + kind = INSERT + fields = [{"__name__": "test1"}, 1.23, "2024-08-15T17:00:00"] + }, + { + kind = INSERT + fields = [{"__name__": "test2"}, 1.23, "2024-08-15T17:00:00"] + } + ] + } +} + + +sink { + Prometheus { + url = "http://prometheus:9090/api/v1/write" + key_label = "c_map" + key_value = "c_double" + key_timestamp = "c_timestamp" + batch_size = 1 + } +} +``` + +## Changelog + +### 2.3.8-beta 2024-08-22 + +- 添加prometheus接收连接器 + diff --git a/docs/zh/connector-v2/source/Prometheus.md b/docs/zh/connector-v2/source/Prometheus.md new file mode 100644 index 00000000000..7618a6c1c6b --- /dev/null +++ b/docs/zh/connector-v2/source/Prometheus.md @@ -0,0 +1,152 @@ +# Prometheus + +> Prometheus 数据源连接器 + +## 描述 + +用于读取prometheus数据。 + +## 主要特性 + +- [x] [批处理](../../concept/connector-v2-features.md) +- [ ] [流处理](../../concept/connector-v2-features.md) +- [ ] [并行](../../concept/connector-v2-features.md) + +## 源选项 + +| 名称 | 类型 | 是否必填 | 默认值 | +|-----------------------------|---------|------|-----------------| +| url | String | Yes | - | +| query | String | Yes | - | +| query_type | String | Yes | Instant | +| content_field | String | Yes | $.data.result.* | +| schema.fields | Config | Yes | - | +| format | String | No | json | +| params | Map | Yes | - | +| poll_interval_millis | int | No | - | +| retry | int | No | - | +| retry_backoff_multiplier_ms | int | No | 100 | +| retry_backoff_max_ms | int | No | 10000 | +| enable_multi_lines | boolean | No | false | +| common-options | config | No | | + +### url [String] + +http 请求路径。 + +### query [String] + +Prometheus 表达式查询字符串 + +### query_type [String] + +Instant/Range + +1. Instant : 简单指标的即时查询。 +2. Range : 一段时间内指标数据。 + +https://prometheus.io/docs/prometheus/latest/querying/api/ + +### params [Map] + +http 请求参数 + +### poll_interval_millis [int] + +流模式下请求HTTP API间隔(毫秒) + +### retry [int] + +The max retry times if request http return to `IOException` + +### retry_backoff_multiplier_ms [int] + +请求http返回到' IOException '的最大重试次数 + +### retry_backoff_max_ms [int] + +http请求失败,最大重试回退时间(毫秒) + +### format [String] + +上游数据的格式,默认为json。 + +### schema [Config] + +按照如下填写一个固定值 + +```hocon + schema = { + fields { + metric = "map" + value = double + time = long + } + } + +``` + +#### fields [Config] + +上游数据的模式字段 + +### common options + +源插件常用参数,请参考[Source Common Options](../source-common-options.md) 了解详细信息 + +## 示例 + +### Instant: + +```hocon +source { + Prometheus { + result_table_name = "http" + url = "http://mockserver:1080" + query = "up" + query_type = "Instant" + content_field = "$.data.result.*" + format = "json" + schema = { + fields { + metric = "map" + value = double + time = long + } + } + } +} +``` + +### Range + +```hocon +source { + Prometheus { + result_table_name = "http" + url = "http://mockserver:1080" + query = "up" + query_type = "Range" + content_field = "$.data.result.*" + format = "json" + start = "2024-07-22T20:10:30.781Z" + end = "2024-07-22T20:11:00.781Z" + step = "15s" + schema = { + fields { + metric = "map" + value = double + time = long + } + } + } + } +``` + +## Changelog + +### next version + +- 添加Prometheus源连接器 +- 减少配置项 + diff --git a/plugin-mapping.properties b/plugin-mapping.properties index 3673ade48f6..5883a4eb20c 100644 --- a/plugin-mapping.properties +++ b/plugin-mapping.properties @@ -132,6 +132,8 @@ seatunnel.sink.ObsFile = connector-file-obs seatunnel.source.Milvus = connector-milvus seatunnel.sink.Milvus = connector-milvus seatunnel.sink.ActiveMQ = connector-activemq +seatunnel.source.Prometheus = connector-prometheus +seatunnel.sink.Prometheus = connector-prometheus seatunnel.source.Qdrant = connector-qdrant seatunnel.sink.Qdrant = connector-qdrant seatunnel.source.Sls = connector-sls diff --git a/seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/client/HttpClientProvider.java b/seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/client/HttpClientProvider.java index b666058ce13..cbea79a15a4 100644 --- a/seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/client/HttpClientProvider.java +++ b/seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/client/HttpClientProvider.java @@ -33,6 +33,7 @@ import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; @@ -263,6 +264,31 @@ public HttpResponse doPost(String url, Map headers, String body) return getResponse(httpPost); } + /** + * Send a post request with request headers and request body + * + * @param url request address + * @param headers request header map + * @param byteArrayEntity request snappy body content + * @return http response result + * @throws Exception information + */ + public HttpResponse doPost( + String url, Map headers, ByteArrayEntity byteArrayEntity) + throws Exception { + // create a new http post + HttpPost httpPost = new HttpPost(url); + // set default request config + httpPost.setConfig(requestConfig); + // set request header + addHeaders(httpPost, headers); + // add body in request + httpPost.getRequestLine(); + httpPost.setEntity(byteArrayEntity); + // return http response + return getResponse(httpPost); + } + /** * Send a post request with request headers , request parameters and request body * diff --git a/seatunnel-connectors-v2/connector-prometheus/pom.xml b/seatunnel-connectors-v2/connector-prometheus/pom.xml new file mode 100644 index 00000000000..f9591dedf1b --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/pom.xml @@ -0,0 +1,118 @@ + + + + 4.0.0 + + org.apache.seatunnel + seatunnel-connectors-v2 + ${revision} + + + connector-prometheus + SeaTunnel : Connectors V2 : Prometheus + + + 0.16.0 + 3.23.2 + 1.1.7.3 + 3.25.4 + + + + org.apache.seatunnel + connector-common + ${project.version} + + + org.apache.seatunnel + connector-http-base + ${project.version} + + + io.prometheus + simpleclient + ${prometheus-client.version} + + + io.prometheus + simpleclient_httpserver + ${prometheus-client.version} + + + + com.google.protobuf + protobuf-java + ${protobuf-java.version} + + + com.google.protobuf + protobuf-java-util + ${protobuf-java.version} + + + + + org.xerial.snappy + snappy-java + ${snappy-java.version} + + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + + shade + + package + + false + true + false + false + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + com.google.protobuf + ${seatunnel.shade.package}.com.google.protobuf + + + + + + + + + diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/Exception/PrometheusConnectorException.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/Exception/PrometheusConnectorException.java new file mode 100644 index 00000000000..d351f2ba15e --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/Exception/PrometheusConnectorException.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.prometheus.Exception; + +import org.apache.seatunnel.common.exception.SeaTunnelErrorCode; +import org.apache.seatunnel.common.exception.SeaTunnelRuntimeException; + +public class PrometheusConnectorException extends SeaTunnelRuntimeException { + + public PrometheusConnectorException( + SeaTunnelErrorCode seaTunnelErrorCode, String errorMessage) { + super(seaTunnelErrorCode, errorMessage); + } + + public PrometheusConnectorException( + SeaTunnelErrorCode seaTunnelErrorCode, String errorMessage, Throwable cause) { + super(seaTunnelErrorCode, errorMessage, cause); + } + + public PrometheusConnectorException(SeaTunnelErrorCode seaTunnelErrorCode, Throwable cause) { + super(seaTunnelErrorCode, cause); + } +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/config/PrometheusSinkConfig.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/config/PrometheusSinkConfig.java new file mode 100644 index 00000000000..959cff607ce --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/config/PrometheusSinkConfig.java @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.config; + +import org.apache.seatunnel.api.configuration.Option; +import org.apache.seatunnel.api.configuration.Options; +import org.apache.seatunnel.api.configuration.ReadonlyConfig; +import org.apache.seatunnel.connectors.seatunnel.http.config.HttpConfig; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import static org.apache.seatunnel.shade.com.google.common.base.Preconditions.checkArgument; + +@Setter +@Getter +@ToString +public class PrometheusSinkConfig extends HttpConfig { + + private static final int DEFAULT_BATCH_SIZE = 1024; + + private static final Long DEFAULT_FLUSH_INTERVAL = 300000L; + + public static final Option KEY_TIMESTAMP = + Options.key("key_timestamp") + .stringType() + .noDefaultValue() + .withDescription("key timestamp"); + + public static final Option KEY_LABEL = + Options.key("key_label").stringType().noDefaultValue().withDescription("key label"); + + public static final Option KEY_VALUE = + Options.key("key_value").stringType().noDefaultValue().withDescription("key value"); + + public static final Option BATCH_SIZE = + Options.key("batch_size") + .intType() + .defaultValue(DEFAULT_BATCH_SIZE) + .withDescription("the batch size writer to prometheus"); + + public static final Option FLUSH_INTERVAL = + Options.key("flush_interval") + .longType() + .defaultValue(DEFAULT_FLUSH_INTERVAL) + .withDescription("the flush interval writer to prometheus"); + + private String keyTimestamp; + + private String keyValue; + + private String keyLabel; + + private int batchSize = BATCH_SIZE.defaultValue(); + + private long flushInterval = FLUSH_INTERVAL.defaultValue(); + + public static PrometheusSinkConfig loadConfig(ReadonlyConfig pluginConfig) { + PrometheusSinkConfig sinkConfig = new PrometheusSinkConfig(); + if (pluginConfig.getOptional(KEY_VALUE).isPresent()) { + sinkConfig.setKeyValue(pluginConfig.get(KEY_VALUE)); + } + if (pluginConfig.getOptional(KEY_LABEL).isPresent()) { + sinkConfig.setKeyLabel(pluginConfig.get(KEY_LABEL)); + } + if (pluginConfig.getOptional(KEY_TIMESTAMP).isPresent()) { + sinkConfig.setKeyTimestamp(pluginConfig.get(KEY_TIMESTAMP)); + } + if (pluginConfig.getOptional(BATCH_SIZE).isPresent()) { + int batchSize = checkIntArgument(pluginConfig.get(BATCH_SIZE)); + sinkConfig.setBatchSize(batchSize); + } + if (pluginConfig.getOptional(FLUSH_INTERVAL).isPresent()) { + long flushInterval = pluginConfig.get(FLUSH_INTERVAL); + sinkConfig.setFlushInterval(flushInterval); + } + return sinkConfig; + } + + private static int checkIntArgument(int args) { + checkArgument(args > 0); + return args; + } +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/config/PrometheusSourceConfig.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/config/PrometheusSourceConfig.java new file mode 100644 index 00000000000..1c51f6b8f68 --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/config/PrometheusSourceConfig.java @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.prometheus.config; + +import org.apache.seatunnel.api.configuration.Option; +import org.apache.seatunnel.api.configuration.Options; +import org.apache.seatunnel.connectors.seatunnel.http.config.HttpConfig; + +/** + * SourceConfig is the configuration for the PrometheusSource. + * + *

please see the following link for more details: + * https://prometheus.io/docs/prometheus/latest/querying/api/ + */ +public class PrometheusSourceConfig extends HttpConfig { + + public static final String INSTANT_QUERY_URL = "/api/v1/query"; + + public static final String RANGE_QUERY = "Range"; + + public static final String INSTANT_QUERY = "Instant"; + + public static final String RANGE_QUERY_URL = "/api/v1/query_range"; + + public static final Option QUERY = + Options.key("query") + .stringType() + .noDefaultValue() + .withDescription("Prometheus expression query string"); + + public static final Option QUERY_TYPE = + Options.key("query_type") + .stringType() + .defaultValue("Instant") + .withDescription("Prometheus expression query string"); + + public static final Option TIMEOUT = + Options.key("timeout") + .longType() + .noDefaultValue() + .withDescription("Evaluation timeout"); + + public static class RangeConfig { + + public static final Option START = + Options.key("start") + .stringType() + .noDefaultValue() + .withDescription("Start timestamp, inclusive."); + + public static final Option END = + Options.key("end") + .stringType() + .noDefaultValue() + .withDescription("End timestamp, inclusive."); + + public static final Option STEP = + Options.key("step") + .stringType() + .noDefaultValue() + .withDescription( + " Query resolution step width in duration format or float number of seconds."); + } + + public static class InstantQueryConfig { + public static final Option TIME = + Options.key("time") + .longType() + .noDefaultValue() + .withDescription("Evaluation timestamp,unix_timestamp"); + } +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/config/PrometheusSourceParameter.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/config/PrometheusSourceParameter.java new file mode 100644 index 00000000000..bec3eb2ea1d --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/config/PrometheusSourceParameter.java @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.prometheus.config; + +import org.apache.seatunnel.shade.com.typesafe.config.Config; + +import org.apache.seatunnel.common.exception.CommonErrorCode; +import org.apache.seatunnel.connectors.seatunnel.http.config.HttpParameter; +import org.apache.seatunnel.connectors.seatunnel.http.config.HttpRequestMethod; +import org.apache.seatunnel.connectors.seatunnel.prometheus.Exception.PrometheusConnectorException; + +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.HashMap; + +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.INSTANT_QUERY_URL; +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.InstantQueryConfig.TIME; +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.QUERY; +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.QUERY_TYPE; +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.RANGE_QUERY; +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.RANGE_QUERY_URL; +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.RangeConfig.END; +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.RangeConfig.START; +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.RangeConfig.STEP; +import static org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSourceConfig.TIMEOUT; + +public class PrometheusSourceParameter extends HttpParameter { + public static final String CURRENT_TIMESTAMP = "CURRENT_TIMESTAMP"; + + public void buildWithConfig(Config pluginConfig) { + super.buildWithConfig(pluginConfig); + + String query = pluginConfig.getString(QUERY.key()); + + String queryType = + pluginConfig.hasPath(QUERY_TYPE.key()) + ? pluginConfig.getString(QUERY_TYPE.key()) + : QUERY_TYPE.defaultValue(); + + this.params = this.getParams() == null ? new HashMap<>() : this.getParams(); + + params.put(PrometheusSourceConfig.QUERY.key(), query); + + this.setMethod(HttpRequestMethod.GET); + + if (pluginConfig.hasPath(TIMEOUT.key())) { + params.put(TIMEOUT.key(), pluginConfig.getString(TIMEOUT.key())); + } + + if (RANGE_QUERY.equals(queryType)) { + this.setUrl(this.getUrl() + RANGE_QUERY_URL); + params.put(START.key(), checkTimeParam(pluginConfig.getString(START.key()))); + params.put(END.key(), checkTimeParam(pluginConfig.getString(END.key()))); + params.put(STEP.key(), pluginConfig.getString(STEP.key())); + + } else { + this.setUrl(this.getUrl() + INSTANT_QUERY_URL); + if (pluginConfig.hasPath(TIME.key())) { + String time = pluginConfig.getString(TIME.key()); + params.put(TIME.key(), time); + } + } + this.setParams(params); + } + + private String checkTimeParam(String time) { + if (CURRENT_TIMESTAMP.equals(time)) { + ZonedDateTime now = ZonedDateTime.now(); + return now.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + if (isValidISO8601(time)) { + return time; + } + throw new PrometheusConnectorException( + CommonErrorCode.UNSUPPORTED_DATA_TYPE, "unsupported time type"); + } + + private boolean isValidISO8601(String dateTimeString) { + try { + DateTimeFormatter formatter = DateTimeFormatter.ISO_INSTANT; + ZonedDateTime.parse(dateTimeString, formatter); + return true; + } catch (DateTimeParseException e) { + return false; + } + } +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/pojo/InstantPoint.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/pojo/InstantPoint.java new file mode 100644 index 00000000000..7e12562b355 --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/pojo/InstantPoint.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.pojo; + +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +public class InstantPoint { + private Map metric; + + private List value; +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/pojo/RangePoint.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/pojo/RangePoint.java new file mode 100644 index 00000000000..a597fd0c98e --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/pojo/RangePoint.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.pojo; + +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +public class RangePoint { + + private Map metric; + + private List values; +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/serialize/PrometheusSerializer.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/serialize/PrometheusSerializer.java new file mode 100644 index 00000000000..7ce0dfc8dd1 --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/serialize/PrometheusSerializer.java @@ -0,0 +1,148 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.serialize; + +import org.apache.seatunnel.api.table.type.SeaTunnelDataType; +import org.apache.seatunnel.api.table.type.SeaTunnelRow; +import org.apache.seatunnel.api.table.type.SeaTunnelRowType; +import org.apache.seatunnel.common.exception.CommonErrorCodeDeprecated; +import org.apache.seatunnel.connectors.seatunnel.prometheus.Exception.PrometheusConnectorException; +import org.apache.seatunnel.connectors.seatunnel.prometheus.sink.Point; + +import com.google.common.base.Strings; +import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +@Slf4j +public class PrometheusSerializer implements Serializer { + + private final Function timestampExtractor; + private final Function valueExtractor; + private final Function labelExtractor; + + public PrometheusSerializer( + @NonNull SeaTunnelRowType seaTunnelRowType, + String timestampKey, + String labelKey, + String valueKey) { + this.valueExtractor = createValueExtractor(seaTunnelRowType, valueKey); + this.timestampExtractor = createTimestampExtractor(seaTunnelRowType, timestampKey); + this.labelExtractor = createLabelExtractor(seaTunnelRowType, labelKey); + } + + @Override + public Point serialize(SeaTunnelRow seaTunnelRow) { + Long timestamp = timestampExtractor.apply(seaTunnelRow); + Double value = valueExtractor.apply(seaTunnelRow); + Map label = labelExtractor.apply(seaTunnelRow); + Point point = Point.builder().metric(label).value(value).timestamp(timestamp).build(); + + return point; + } + + private Function createLabelExtractor( + SeaTunnelRowType seaTunnelRowType, String labelKey) { + if (Strings.isNullOrEmpty(labelKey)) { + return row -> new HashMap(); + } + int labelFieldIndex = seaTunnelRowType.indexOf(labelKey); + return row -> { + Object value = row.getField(labelFieldIndex); + if (value == null) { + return new HashMap(); + } + SeaTunnelDataType valueFieldType = seaTunnelRowType.getFieldType(labelFieldIndex); + switch (valueFieldType.getSqlType()) { + case MAP: + return (Map) value; + default: + throw new PrometheusConnectorException( + CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE, + "Unsupported data type: " + valueFieldType); + } + }; + } + + private Function createValueExtractor( + SeaTunnelRowType seaTunnelRowType, String valueKey) { + if (Strings.isNullOrEmpty(valueKey)) { + return row -> Double.NaN; + } + + int valueFieldIndex = seaTunnelRowType.indexOf(valueKey); + return row -> { + Object value = row.getField(valueFieldIndex); + if (value == null) { + return Double.NaN; + } + SeaTunnelDataType valueFieldType = seaTunnelRowType.getFieldType(valueFieldIndex); + switch (valueFieldType.getSqlType()) { + case STRING: + case INT: + case FLOAT: + return Double.parseDouble((String) value); + case DOUBLE: + return (Double) value; + default: + throw new PrometheusConnectorException( + CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE, + "Unsupported data type: " + valueFieldType); + } + }; + } + + private Function createTimestampExtractor( + SeaTunnelRowType seaTunnelRowType, String timestampKey) { + if (Strings.isNullOrEmpty(timestampKey)) { + return row -> System.currentTimeMillis(); + } + + int timestampFieldIndex = seaTunnelRowType.indexOf(timestampKey); + return row -> { + Object timestamp = row.getField(timestampFieldIndex); + if (timestamp == null) { + return System.currentTimeMillis(); + } + SeaTunnelDataType timestampFieldType = + seaTunnelRowType.getFieldType(timestampFieldIndex); + switch (timestampFieldType.getSqlType()) { + case STRING: + return Long.parseLong((String) timestamp); + case TIMESTAMP: + return ((LocalDateTime) timestamp) + .atZone(ZoneId.systemDefault()) + .toInstant() + .toEpochMilli(); + case BIGINT: + return (Long) timestamp; + case DOUBLE: + double timestampDouble = (double) timestamp; + return (long) (timestampDouble * 1000); + default: + throw new PrometheusConnectorException( + CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE, + "Unsupported data type: " + timestampFieldType); + } + }; + } +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/serialize/Serializer.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/serialize/Serializer.java new file mode 100644 index 00000000000..ad830f5baa0 --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/serialize/Serializer.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.seatunnel.prometheus.serialize; + +import org.apache.seatunnel.api.table.type.SeaTunnelRow; +import org.apache.seatunnel.connectors.seatunnel.prometheus.sink.Point; + +public interface Serializer { + Point serialize(SeaTunnelRow seaTunnelRow); +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/Point.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/Point.java new file mode 100644 index 00000000000..fb78bff56fa --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/Point.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.sink; + +import lombok.Builder; +import lombok.Data; + +import java.util.Map; + +@Data +@Builder +public class Point { + + private Map metric; + + private Double value; + + private Long timestamp; +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusSink.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusSink.java new file mode 100644 index 00000000000..93d4e931e17 --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusSink.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.sink; + +import org.apache.seatunnel.api.configuration.ReadonlyConfig; +import org.apache.seatunnel.api.sink.SinkWriter; +import org.apache.seatunnel.api.sink.SupportMultiTableSink; +import org.apache.seatunnel.api.table.type.SeaTunnelRow; +import org.apache.seatunnel.api.table.type.SeaTunnelRowType; +import org.apache.seatunnel.connectors.seatunnel.common.sink.AbstractSimpleSink; +import org.apache.seatunnel.connectors.seatunnel.http.config.HttpConfig; +import org.apache.seatunnel.connectors.seatunnel.http.config.HttpParameter; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +public class PrometheusSink extends AbstractSimpleSink + implements SupportMultiTableSink { + + protected final HttpParameter httpParameter = new HttpParameter(); + protected SeaTunnelRowType seaTunnelRowType; + protected ReadonlyConfig pluginConfig; + + public PrometheusSink(ReadonlyConfig pluginConfig, SeaTunnelRowType rowType) { + this.pluginConfig = pluginConfig; + httpParameter.setUrl(pluginConfig.get(HttpConfig.URL)); + if (pluginConfig.getOptional(HttpConfig.HEADERS).isPresent()) { + httpParameter.setHeaders(pluginConfig.get(HttpConfig.HEADERS)); + } + if (pluginConfig.getOptional(HttpConfig.PARAMS).isPresent()) { + httpParameter.setHeaders(pluginConfig.get(HttpConfig.PARAMS)); + } + this.seaTunnelRowType = rowType; + + if (Objects.isNull(httpParameter.getHeaders())) { + Map headers = new HashMap<>(); + headers.put("Content-type", "application/x-protobuf"); + headers.put("Content-Encoding", "snappy"); + headers.put("X-Prometheus-Remote-Write-Version", "0.1.0"); + httpParameter.setHeaders(headers); + } else { + httpParameter.getHeaders().put("Content-type", "application/x-protobuf"); + httpParameter.getHeaders().put("Content-Encoding", "snappy"); + httpParameter.getHeaders().put("X-Prometheus-Remote-Write-Version", "0.1.0"); + } + } + + @Override + public String getPluginName() { + return "Prometheus"; + } + + @Override + public PrometheusWriter createWriter(SinkWriter.Context context) { + return new PrometheusWriter(seaTunnelRowType, httpParameter, pluginConfig); + } +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusSinkFactory.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusSinkFactory.java new file mode 100644 index 00000000000..dcd8e72c1a5 --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusSinkFactory.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.sink; + +import org.apache.seatunnel.api.configuration.ReadonlyConfig; +import org.apache.seatunnel.api.configuration.util.OptionRule; +import org.apache.seatunnel.api.sink.SinkCommonOptions; +import org.apache.seatunnel.api.table.catalog.CatalogTable; +import org.apache.seatunnel.api.table.connector.TableSink; +import org.apache.seatunnel.api.table.factory.Factory; +import org.apache.seatunnel.api.table.factory.TableSinkFactoryContext; +import org.apache.seatunnel.connectors.seatunnel.http.sink.HttpSinkFactory; +import org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSinkConfig; + +import com.google.auto.service.AutoService; + +@AutoService(Factory.class) +public class PrometheusSinkFactory extends HttpSinkFactory { + @Override + public String factoryIdentifier() { + return "Prometheus"; + } + + public TableSink createSink(TableSinkFactoryContext context) { + + ReadonlyConfig readonlyConfig = context.getOptions(); + CatalogTable catalogTable = context.getCatalogTable(); + return () -> new PrometheusSink(readonlyConfig, catalogTable.getSeaTunnelRowType()); + } + + @Override + public OptionRule optionRule() { + return OptionRule.builder() + .required(PrometheusSinkConfig.URL) + .required(PrometheusSinkConfig.KEY_LABEL) + .required(PrometheusSinkConfig.KEY_VALUE) + .optional(PrometheusSinkConfig.KEY_TIMESTAMP) + .optional(PrometheusSinkConfig.HEADERS) + .optional(PrometheusSinkConfig.RETRY) + .optional(PrometheusSinkConfig.RETRY_BACKOFF_MULTIPLIER_MS) + .optional(PrometheusSinkConfig.RETRY_BACKOFF_MAX_MS) + .optional(PrometheusSinkConfig.BATCH_SIZE) + .optional(PrometheusSinkConfig.FLUSH_INTERVAL) + .optional(SinkCommonOptions.MULTI_TABLE_SINK_REPLICA) + .build(); + } +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusWriter.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusWriter.java new file mode 100644 index 00000000000..307abb8eed6 --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/PrometheusWriter.java @@ -0,0 +1,214 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.sink; + +import org.apache.seatunnel.api.configuration.ReadonlyConfig; +import org.apache.seatunnel.api.table.type.SeaTunnelRow; +import org.apache.seatunnel.api.table.type.SeaTunnelRowType; +import org.apache.seatunnel.common.exception.CommonErrorCodeDeprecated; +import org.apache.seatunnel.connectors.seatunnel.http.client.HttpClientProvider; +import org.apache.seatunnel.connectors.seatunnel.http.client.HttpResponse; +import org.apache.seatunnel.connectors.seatunnel.http.config.HttpParameter; +import org.apache.seatunnel.connectors.seatunnel.http.sink.HttpSinkWriter; +import org.apache.seatunnel.connectors.seatunnel.prometheus.Exception.PrometheusConnectorException; +import org.apache.seatunnel.connectors.seatunnel.prometheus.config.PrometheusSinkConfig; +import org.apache.seatunnel.connectors.seatunnel.prometheus.serialize.PrometheusSerializer; +import org.apache.seatunnel.connectors.seatunnel.prometheus.serialize.Serializer; +import org.apache.seatunnel.connectors.seatunnel.prometheus.sink.proto.Remote; +import org.apache.seatunnel.connectors.seatunnel.prometheus.sink.proto.Types; + +import org.apache.http.HttpStatus; +import org.apache.http.entity.ByteArrayEntity; + +import org.xerial.snappy.Snappy; + +import lombok.extern.slf4j.Slf4j; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +@Slf4j +public class PrometheusWriter extends HttpSinkWriter { + private final List batchList; + private volatile Exception flushException; + private final Integer batchSize; + private final long flushInterval; + private PrometheusSinkConfig sinkConfig; + private final Serializer serializer; + protected final HttpClientProvider httpClient; + private ScheduledExecutorService executor; + private ScheduledFuture scheduledFuture; + + public PrometheusWriter( + SeaTunnelRowType seaTunnelRowType, + HttpParameter httpParameter, + ReadonlyConfig pluginConfig) { + + super(seaTunnelRowType, httpParameter); + this.batchList = new ArrayList<>(); + this.sinkConfig = PrometheusSinkConfig.loadConfig(pluginConfig); + this.batchSize = sinkConfig.getBatchSize(); + this.flushInterval = sinkConfig.getFlushInterval(); + this.serializer = + new PrometheusSerializer( + seaTunnelRowType, + sinkConfig.getKeyTimestamp(), + sinkConfig.getKeyLabel(), + sinkConfig.getKeyValue()); + this.httpClient = new HttpClientProvider(httpParameter); + if (flushInterval > 0) { + log.info("start schedule submit message,interval:{}", flushInterval); + this.executor = + Executors.newScheduledThreadPool( + 1, + runnable -> { + Thread thread = new Thread(runnable); + thread.setDaemon(true); + thread.setName("Prometheus-Metric-Sender"); + return thread; + }); + this.scheduledFuture = + executor.scheduleAtFixedRate( + this::flushSchedule, + flushInterval, + flushInterval, + TimeUnit.MILLISECONDS); + } + } + + @Override + public void write(SeaTunnelRow element) { + Point record = serializer.serialize(element); + this.write(record); + } + + public void write(Point record) { + checkFlushException(); + + synchronized (batchList) { + batchList.add(record); + if (batchSize > 0 && batchList.size() >= batchSize) { + flush(); + } + } + } + + private void flushSchedule() { + synchronized (batchList) { + if (!batchList.isEmpty()) { + flush(); + } + } + } + + private void checkFlushException() { + if (flushException != null) { + throw new PrometheusConnectorException( + CommonErrorCodeDeprecated.FLUSH_DATA_FAILED, + "Writing records to prometheus failed.", + flushException); + } + } + + private void flush() { + checkFlushException(); + if (batchList.isEmpty()) { + return; + } + try { + byte[] body = snappy(batchList); + ByteArrayEntity byteArrayEntity = new ByteArrayEntity(body); + HttpResponse response = + httpClient.doPost( + httpParameter.getUrl(), httpParameter.getHeaders(), byteArrayEntity); + if (HttpStatus.SC_NO_CONTENT == response.getCode()) { + return; + } + log.error( + "http client execute exception, http response status code:[{}], content:[{}]", + response.getCode(), + response.getContent()); + } catch (Exception e) { + log.error(e.getMessage(), e); + } finally { + batchList.clear(); + } + } + + /** + * snappy data + * + * @param points list of series data + * @return byte data + * @throws IOException IOException + */ + private byte[] snappy(List points) throws IOException { + Remote.WriteRequest writeRequest = createRemoteWriteRequest(points); + byte[] serializedData = writeRequest.toByteArray(); + byte[] compressedData = Snappy.compress(serializedData); + return compressedData; + } + + /** + * create Remote Write Request + * + * @param points list of series data + * @return Remote.WriteRequest + */ + private Remote.WriteRequest createRemoteWriteRequest(List points) { + Remote.WriteRequest.Builder writeRequestBuilder = Remote.WriteRequest.newBuilder(); + for (Point point : points) { + List labels = new ArrayList<>(); + Types.TimeSeries.Builder timeSeriesBuilder = Types.TimeSeries.newBuilder(); + for (Map.Entry entry : point.getMetric().entrySet()) { + Types.Label label = + Types.Label.newBuilder() + .setName(entry.getKey()) + .setValue(entry.getValue()) + .build(); + labels.add(label); + } + Types.Sample sample = + Types.Sample.newBuilder() + .setTimestamp(point.getTimestamp()) + .setValue(point.getValue()) + .build(); + timeSeriesBuilder.addAllLabels(labels); + timeSeriesBuilder.addSamples(sample); + writeRequestBuilder.addTimeseries(timeSeriesBuilder); + } + return writeRequestBuilder.build(); + } + + @Override + public void close() throws IOException { + super.close(); + if (scheduledFuture != null) { + scheduledFuture.cancel(false); + if (executor != null) { + executor.shutdownNow(); + } + } + this.flush(); + } +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/proto/GoGoProtos.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/proto/GoGoProtos.java new file mode 100644 index 00000000000..2ebbc9d97f1 --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/proto/GoGoProtos.java @@ -0,0 +1,919 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.sink.proto; + +public final class GoGoProtos { + private GoGoProtos() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(GoGoProtos.goprotoEnumPrefix); + registry.add(GoGoProtos.goprotoEnumStringer); + registry.add(GoGoProtos.enumStringer); + registry.add(GoGoProtos.enumCustomname); + registry.add(GoGoProtos.enumdecl); + registry.add(GoGoProtos.enumvalueCustomname); + registry.add(GoGoProtos.goprotoGettersAll); + registry.add(GoGoProtos.goprotoEnumPrefixAll); + registry.add(GoGoProtos.goprotoStringerAll); + registry.add(GoGoProtos.verboseEqualAll); + registry.add(GoGoProtos.faceAll); + registry.add(GoGoProtos.gostringAll); + registry.add(GoGoProtos.populateAll); + registry.add(GoGoProtos.stringerAll); + registry.add(GoGoProtos.onlyoneAll); + registry.add(GoGoProtos.equalAll); + registry.add(GoGoProtos.descriptionAll); + registry.add(GoGoProtos.testgenAll); + registry.add(GoGoProtos.benchgenAll); + registry.add(GoGoProtos.marshalerAll); + registry.add(GoGoProtos.unmarshalerAll); + registry.add(GoGoProtos.stableMarshalerAll); + registry.add(GoGoProtos.sizerAll); + registry.add(GoGoProtos.goprotoEnumStringerAll); + registry.add(GoGoProtos.enumStringerAll); + registry.add(GoGoProtos.unsafeMarshalerAll); + registry.add(GoGoProtos.unsafeUnmarshalerAll); + registry.add(GoGoProtos.goprotoExtensionsMapAll); + registry.add(GoGoProtos.goprotoUnrecognizedAll); + registry.add(GoGoProtos.gogoprotoImport); + registry.add(GoGoProtos.protosizerAll); + registry.add(GoGoProtos.compareAll); + registry.add(GoGoProtos.typedeclAll); + registry.add(GoGoProtos.enumdeclAll); + registry.add(GoGoProtos.goprotoRegistration); + registry.add(GoGoProtos.messagenameAll); + registry.add(GoGoProtos.goprotoSizecacheAll); + registry.add(GoGoProtos.goprotoUnkeyedAll); + registry.add(GoGoProtos.goprotoGetters); + registry.add(GoGoProtos.goprotoStringer); + registry.add(GoGoProtos.verboseEqual); + registry.add(GoGoProtos.face); + registry.add(GoGoProtos.gostring); + registry.add(GoGoProtos.populate); + registry.add(GoGoProtos.stringer); + registry.add(GoGoProtos.onlyone); + registry.add(GoGoProtos.equal); + registry.add(GoGoProtos.description); + registry.add(GoGoProtos.testgen); + registry.add(GoGoProtos.benchgen); + registry.add(GoGoProtos.marshaler); + registry.add(GoGoProtos.unmarshaler); + registry.add(GoGoProtos.stableMarshaler); + registry.add(GoGoProtos.sizer); + registry.add(GoGoProtos.unsafeMarshaler); + registry.add(GoGoProtos.unsafeUnmarshaler); + registry.add(GoGoProtos.goprotoExtensionsMap); + registry.add(GoGoProtos.goprotoUnrecognized); + registry.add(GoGoProtos.protosizer); + registry.add(GoGoProtos.compare); + registry.add(GoGoProtos.typedecl); + registry.add(GoGoProtos.messagename); + registry.add(GoGoProtos.goprotoSizecache); + registry.add(GoGoProtos.goprotoUnkeyed); + registry.add(GoGoProtos.nullable); + registry.add(GoGoProtos.embed); + registry.add(GoGoProtos.customtype); + registry.add(GoGoProtos.customname); + registry.add(GoGoProtos.jsontag); + registry.add(GoGoProtos.moretags); + registry.add(GoGoProtos.casttype); + registry.add(GoGoProtos.castkey); + registry.add(GoGoProtos.castvalue); + registry.add(GoGoProtos.stdtime); + registry.add(GoGoProtos.stdduration); + registry.add(GoGoProtos.wktpointer); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int GOPROTO_ENUM_PREFIX_FIELD_NUMBER = 62001; + /** extend .google.protobuf.EnumOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, Boolean> + goprotoEnumPrefix = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_ENUM_STRINGER_FIELD_NUMBER = 62021; + /** extend .google.protobuf.EnumOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, Boolean> + goprotoEnumStringer = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int ENUM_STRINGER_FIELD_NUMBER = 62022; + /** extend .google.protobuf.EnumOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, Boolean> + enumStringer = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int ENUM_CUSTOMNAME_FIELD_NUMBER = 62023; + /** extend .google.protobuf.EnumOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, String> + enumCustomname = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + String.class, null); + + public static final int ENUMDECL_FIELD_NUMBER = 62024; + /** extend .google.protobuf.EnumOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumOptions, Boolean> + enumdecl = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int ENUMVALUE_CUSTOMNAME_FIELD_NUMBER = 66001; + /** extend .google.protobuf.EnumValueOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.EnumValueOptions, String> + enumvalueCustomname = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + String.class, null); + + public static final int GOPROTO_GETTERS_ALL_FIELD_NUMBER = 63001; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + goprotoGettersAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_ENUM_PREFIX_ALL_FIELD_NUMBER = 63002; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + goprotoEnumPrefixAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_STRINGER_ALL_FIELD_NUMBER = 63003; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + goprotoStringerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int VERBOSE_EQUAL_ALL_FIELD_NUMBER = 63004; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + verboseEqualAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int FACE_ALL_FIELD_NUMBER = 63005; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + faceAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOSTRING_ALL_FIELD_NUMBER = 63006; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + gostringAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int POPULATE_ALL_FIELD_NUMBER = 63007; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + populateAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int STRINGER_ALL_FIELD_NUMBER = 63008; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + stringerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int ONLYONE_ALL_FIELD_NUMBER = 63009; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + onlyoneAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int EQUAL_ALL_FIELD_NUMBER = 63013; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + equalAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int DESCRIPTION_ALL_FIELD_NUMBER = 63014; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + descriptionAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int TESTGEN_ALL_FIELD_NUMBER = 63015; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + testgenAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int BENCHGEN_ALL_FIELD_NUMBER = 63016; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + benchgenAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int MARSHALER_ALL_FIELD_NUMBER = 63017; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + marshalerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int UNMARSHALER_ALL_FIELD_NUMBER = 63018; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + unmarshalerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int STABLE_MARSHALER_ALL_FIELD_NUMBER = 63019; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + stableMarshalerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int SIZER_ALL_FIELD_NUMBER = 63020; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + sizerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_ENUM_STRINGER_ALL_FIELD_NUMBER = 63021; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + goprotoEnumStringerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int ENUM_STRINGER_ALL_FIELD_NUMBER = 63022; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + enumStringerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int UNSAFE_MARSHALER_ALL_FIELD_NUMBER = 63023; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + unsafeMarshalerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int UNSAFE_UNMARSHALER_ALL_FIELD_NUMBER = 63024; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + unsafeUnmarshalerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_EXTENSIONS_MAP_ALL_FIELD_NUMBER = 63025; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + goprotoExtensionsMapAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_UNRECOGNIZED_ALL_FIELD_NUMBER = 63026; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + goprotoUnrecognizedAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOGOPROTO_IMPORT_FIELD_NUMBER = 63027; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + gogoprotoImport = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int PROTOSIZER_ALL_FIELD_NUMBER = 63028; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + protosizerAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int COMPARE_ALL_FIELD_NUMBER = 63029; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + compareAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int TYPEDECL_ALL_FIELD_NUMBER = 63030; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + typedeclAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int ENUMDECL_ALL_FIELD_NUMBER = 63031; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + enumdeclAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_REGISTRATION_FIELD_NUMBER = 63032; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + goprotoRegistration = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int MESSAGENAME_ALL_FIELD_NUMBER = 63033; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + messagenameAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_SIZECACHE_ALL_FIELD_NUMBER = 63034; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + goprotoSizecacheAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_UNKEYED_ALL_FIELD_NUMBER = 63035; + /** extend .google.protobuf.FileOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FileOptions, Boolean> + goprotoUnkeyedAll = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_GETTERS_FIELD_NUMBER = 64001; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + goprotoGetters = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_STRINGER_FIELD_NUMBER = 64003; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + goprotoStringer = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int VERBOSE_EQUAL_FIELD_NUMBER = 64004; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + verboseEqual = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int FACE_FIELD_NUMBER = 64005; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + face = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOSTRING_FIELD_NUMBER = 64006; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + gostring = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int POPULATE_FIELD_NUMBER = 64007; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + populate = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int STRINGER_FIELD_NUMBER = 67008; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + stringer = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int ONLYONE_FIELD_NUMBER = 64009; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + onlyone = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int EQUAL_FIELD_NUMBER = 64013; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + equal = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int DESCRIPTION_FIELD_NUMBER = 64014; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + description = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int TESTGEN_FIELD_NUMBER = 64015; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + testgen = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int BENCHGEN_FIELD_NUMBER = 64016; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + benchgen = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int MARSHALER_FIELD_NUMBER = 64017; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + marshaler = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int UNMARSHALER_FIELD_NUMBER = 64018; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + unmarshaler = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int STABLE_MARSHALER_FIELD_NUMBER = 64019; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + stableMarshaler = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int SIZER_FIELD_NUMBER = 64020; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + sizer = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int UNSAFE_MARSHALER_FIELD_NUMBER = 64023; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + unsafeMarshaler = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int UNSAFE_UNMARSHALER_FIELD_NUMBER = 64024; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + unsafeUnmarshaler = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_EXTENSIONS_MAP_FIELD_NUMBER = 64025; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + goprotoExtensionsMap = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_UNRECOGNIZED_FIELD_NUMBER = 64026; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + goprotoUnrecognized = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int PROTOSIZER_FIELD_NUMBER = 64028; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + protosizer = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int COMPARE_FIELD_NUMBER = 64029; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + compare = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int TYPEDECL_FIELD_NUMBER = 64030; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + typedecl = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int MESSAGENAME_FIELD_NUMBER = 64033; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + messagename = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_SIZECACHE_FIELD_NUMBER = 64034; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + goprotoSizecache = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int GOPROTO_UNKEYED_FIELD_NUMBER = 64035; + /** extend .google.protobuf.MessageOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MessageOptions, Boolean> + goprotoUnkeyed = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int NULLABLE_FIELD_NUMBER = 65001; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, Boolean> + nullable = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int EMBED_FIELD_NUMBER = 65002; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, Boolean> + embed = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int CUSTOMTYPE_FIELD_NUMBER = 65003; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, String> + customtype = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + String.class, null); + + public static final int CUSTOMNAME_FIELD_NUMBER = 65004; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, String> + customname = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + String.class, null); + + public static final int JSONTAG_FIELD_NUMBER = 65005; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, String> + jsontag = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + String.class, null); + + public static final int MORETAGS_FIELD_NUMBER = 65006; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, String> + moretags = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + String.class, null); + + public static final int CASTTYPE_FIELD_NUMBER = 65007; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, String> + casttype = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + String.class, null); + + public static final int CASTKEY_FIELD_NUMBER = 65008; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, String> + castkey = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + String.class, null); + + public static final int CASTVALUE_FIELD_NUMBER = 65009; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, String> + castvalue = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + String.class, null); + + public static final int STDTIME_FIELD_NUMBER = 65010; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, Boolean> + stdtime = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int STDDURATION_FIELD_NUMBER = 65011; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, Boolean> + stdduration = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static final int WKTPOINTER_FIELD_NUMBER = 65012; + /** extend .google.protobuf.FieldOptions { ... } */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, Boolean> + wktpointer = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + Boolean.class, null); + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + String[] descriptorData = { + "\n\ngogo.proto\022\tgogoproto\032 google/protobuf" + + "/descriptor.proto:;\n\023goproto_enum_prefix" + + "\022\034.google.protobuf.EnumOptions\030\261\344\003 \001(\010:=" + + "\n\025goproto_enum_stringer\022\034.google.protobu" + + "f.EnumOptions\030\305\344\003 \001(\010:5\n\renum_stringer\022\034" + + ".google.protobuf.EnumOptions\030\306\344\003 \001(\010:7\n\017" + + "enum_customname\022\034.google.protobuf.EnumOp" + + "tions\030\307\344\003 \001(\t:0\n\010enumdecl\022\034.google.proto" + + "buf.EnumOptions\030\310\344\003 \001(\010:A\n\024enumvalue_cus" + + "tomname\022!.google.protobuf.EnumValueOptio" + + "ns\030\321\203\004 \001(\t:;\n\023goproto_getters_all\022\034.goog" + + "le.protobuf.FileOptions\030\231\354\003 \001(\010:?\n\027gopro" + + "to_enum_prefix_all\022\034.google.protobuf.Fil" + + "eOptions\030\232\354\003 \001(\010:<\n\024goproto_stringer_all" + + "\022\034.google.protobuf.FileOptions\030\233\354\003 \001(\010:9" + + "\n\021verbose_equal_all\022\034.google.protobuf.Fi" + + "leOptions\030\234\354\003 \001(\010:0\n\010face_all\022\034.google.p" + + "rotobuf.FileOptions\030\235\354\003 \001(\010:4\n\014gostring_" + + "all\022\034.google.protobuf.FileOptions\030\236\354\003 \001(" + + "\010:4\n\014populate_all\022\034.google.protobuf.File" + + "Options\030\237\354\003 \001(\010:4\n\014stringer_all\022\034.google" + + ".protobuf.FileOptions\030\240\354\003 \001(\010:3\n\013onlyone" + + "_all\022\034.google.protobuf.FileOptions\030\241\354\003 \001" + + "(\010:1\n\tequal_all\022\034.google.protobuf.FileOp" + + "tions\030\245\354\003 \001(\010:7\n\017description_all\022\034.googl" + + "e.protobuf.FileOptions\030\246\354\003 \001(\010:3\n\013testge" + + "n_all\022\034.google.protobuf.FileOptions\030\247\354\003 " + + "\001(\010:4\n\014benchgen_all\022\034.google.protobuf.Fi" + + "leOptions\030\250\354\003 \001(\010:5\n\rmarshaler_all\022\034.goo" + + "gle.protobuf.FileOptions\030\251\354\003 \001(\010:7\n\017unma" + + "rshaler_all\022\034.google.protobuf.FileOption" + + "s\030\252\354\003 \001(\010:<\n\024stable_marshaler_all\022\034.goog" + + "le.protobuf.FileOptions\030\253\354\003 \001(\010:1\n\tsizer" + + "_all\022\034.google.protobuf.FileOptions\030\254\354\003 \001" + + "(\010:A\n\031goproto_enum_stringer_all\022\034.google" + + ".protobuf.FileOptions\030\255\354\003 \001(\010:9\n\021enum_st" + + "ringer_all\022\034.google.protobuf.FileOptions" + + "\030\256\354\003 \001(\010:<\n\024unsafe_marshaler_all\022\034.googl" + + "e.protobuf.FileOptions\030\257\354\003 \001(\010:>\n\026unsafe" + + "_unmarshaler_all\022\034.google.protobuf.FileO" + + "ptions\030\260\354\003 \001(\010:B\n\032goproto_extensions_map" + + "_all\022\034.google.protobuf.FileOptions\030\261\354\003 \001" + + "(\010:@\n\030goproto_unrecognized_all\022\034.google." + + "protobuf.FileOptions\030\262\354\003 \001(\010:8\n\020gogoprot" + + "o_import\022\034.google.protobuf.FileOptions\030\263" + + "\354\003 \001(\010:6\n\016protosizer_all\022\034.google.protob" + + "uf.FileOptions\030\264\354\003 \001(\010:3\n\013compare_all\022\034." + + "google.protobuf.FileOptions\030\265\354\003 \001(\010:4\n\014t" + + "ypedecl_all\022\034.google.protobuf.FileOption" + + "s\030\266\354\003 \001(\010:4\n\014enumdecl_all\022\034.google.proto" + + "buf.FileOptions\030\267\354\003 \001(\010:<\n\024goproto_regis" + + "tration\022\034.google.protobuf.FileOptions\030\270\354" + + "\003 \001(\010:7\n\017messagename_all\022\034.google.protob" + + "uf.FileOptions\030\271\354\003 \001(\010:=\n\025goproto_sizeca" + + "che_all\022\034.google.protobuf.FileOptions\030\272\354" + + "\003 \001(\010:;\n\023goproto_unkeyed_all\022\034.google.pr" + + "otobuf.FileOptions\030\273\354\003 \001(\010::\n\017goproto_ge" + + "tters\022\037.google.protobuf.MessageOptions\030\201" + + "\364\003 \001(\010:;\n\020goproto_stringer\022\037.google.prot" + + "obuf.MessageOptions\030\203\364\003 \001(\010:8\n\rverbose_e" + + "qual\022\037.google.protobuf.MessageOptions\030\204\364" + + "\003 \001(\010:/\n\004face\022\037.google.protobuf.MessageO" + + "ptions\030\205\364\003 \001(\010:3\n\010gostring\022\037.google.prot" + + "obuf.MessageOptions\030\206\364\003 \001(\010:3\n\010populate\022" + + "\037.google.protobuf.MessageOptions\030\207\364\003 \001(\010" + + ":3\n\010stringer\022\037.google.protobuf.MessageOp" + + "tions\030\300\213\004 \001(\010:2\n\007onlyone\022\037.google.protob" + + "uf.MessageOptions\030\211\364\003 \001(\010:0\n\005equal\022\037.goo" + + "gle.protobuf.MessageOptions\030\215\364\003 \001(\010:6\n\013d" + + "escription\022\037.google.protobuf.MessageOpti" + + "ons\030\216\364\003 \001(\010:2\n\007testgen\022\037.google.protobuf" + + ".MessageOptions\030\217\364\003 \001(\010:3\n\010benchgen\022\037.go" + + "ogle.protobuf.MessageOptions\030\220\364\003 \001(\010:4\n\t" + + "marshaler\022\037.google.protobuf.MessageOptio" + + "ns\030\221\364\003 \001(\010:6\n\013unmarshaler\022\037.google.proto" + + "buf.MessageOptions\030\222\364\003 \001(\010:;\n\020stable_mar" + + "shaler\022\037.google.protobuf.MessageOptions\030" + + "\223\364\003 \001(\010:0\n\005sizer\022\037.google.protobuf.Messa" + + "geOptions\030\224\364\003 \001(\010:;\n\020unsafe_marshaler\022\037." + + "google.protobuf.MessageOptions\030\227\364\003 \001(\010:=" + + "\n\022unsafe_unmarshaler\022\037.google.protobuf.M" + + "essageOptions\030\230\364\003 \001(\010:A\n\026goproto_extensi" + + "ons_map\022\037.google.protobuf.MessageOptions" + + "\030\231\364\003 \001(\010:?\n\024goproto_unrecognized\022\037.googl" + + "e.protobuf.MessageOptions\030\232\364\003 \001(\010:5\n\npro" + + "tosizer\022\037.google.protobuf.MessageOptions" + + "\030\234\364\003 \001(\010:2\n\007compare\022\037.google.protobuf.Me" + + "ssageOptions\030\235\364\003 \001(\010:3\n\010typedecl\022\037.googl" + + "e.protobuf.MessageOptions\030\236\364\003 \001(\010:6\n\013mes" + + "sagename\022\037.google.protobuf.MessageOption" + + "s\030\241\364\003 \001(\010:<\n\021goproto_sizecache\022\037.google." + + "protobuf.MessageOptions\030\242\364\003 \001(\010::\n\017gopro" + + "to_unkeyed\022\037.google.protobuf.MessageOpti" + + "ons\030\243\364\003 \001(\010:1\n\010nullable\022\035.google.protobu" + + "f.FieldOptions\030\351\373\003 \001(\010:.\n\005embed\022\035.google" + + ".protobuf.FieldOptions\030\352\373\003 \001(\010:3\n\ncustom" + + "type\022\035.google.protobuf.FieldOptions\030\353\373\003 " + + "\001(\t:3\n\ncustomname\022\035.google.protobuf.Fiel" + + "dOptions\030\354\373\003 \001(\t:0\n\007jsontag\022\035.google.pro" + + "tobuf.FieldOptions\030\355\373\003 \001(\t:1\n\010moretags\022\035" + + ".google.protobuf.FieldOptions\030\356\373\003 \001(\t:1\n" + + "\010casttype\022\035.google.protobuf.FieldOptions" + + "\030\357\373\003 \001(\t:0\n\007castkey\022\035.google.protobuf.Fi" + + "eldOptions\030\360\373\003 \001(\t:2\n\tcastvalue\022\035.google" + + ".protobuf.FieldOptions\030\361\373\003 \001(\t:0\n\007stdtim" + + "e\022\035.google.protobuf.FieldOptions\030\362\373\003 \001(\010" + + ":4\n\013stdduration\022\035.google.protobuf.FieldO" + + "ptions\030\363\373\003 \001(\010:3\n\nwktpointer\022\035.google.pr" + + "otobuf.FieldOptions\030\364\373\003 \001(\010BE\n\023com.googl" + + "e.protobufB\nGoGoProtosZ\"github.com/gogo/" + + "protobuf/gogoproto" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DescriptorProtos.getDescriptor(), + }); + goprotoEnumPrefix.internalInit(descriptor.getExtensions().get(0)); + goprotoEnumStringer.internalInit(descriptor.getExtensions().get(1)); + enumStringer.internalInit(descriptor.getExtensions().get(2)); + enumCustomname.internalInit(descriptor.getExtensions().get(3)); + enumdecl.internalInit(descriptor.getExtensions().get(4)); + enumvalueCustomname.internalInit(descriptor.getExtensions().get(5)); + goprotoGettersAll.internalInit(descriptor.getExtensions().get(6)); + goprotoEnumPrefixAll.internalInit(descriptor.getExtensions().get(7)); + goprotoStringerAll.internalInit(descriptor.getExtensions().get(8)); + verboseEqualAll.internalInit(descriptor.getExtensions().get(9)); + faceAll.internalInit(descriptor.getExtensions().get(10)); + gostringAll.internalInit(descriptor.getExtensions().get(11)); + populateAll.internalInit(descriptor.getExtensions().get(12)); + stringerAll.internalInit(descriptor.getExtensions().get(13)); + onlyoneAll.internalInit(descriptor.getExtensions().get(14)); + equalAll.internalInit(descriptor.getExtensions().get(15)); + descriptionAll.internalInit(descriptor.getExtensions().get(16)); + testgenAll.internalInit(descriptor.getExtensions().get(17)); + benchgenAll.internalInit(descriptor.getExtensions().get(18)); + marshalerAll.internalInit(descriptor.getExtensions().get(19)); + unmarshalerAll.internalInit(descriptor.getExtensions().get(20)); + stableMarshalerAll.internalInit(descriptor.getExtensions().get(21)); + sizerAll.internalInit(descriptor.getExtensions().get(22)); + goprotoEnumStringerAll.internalInit(descriptor.getExtensions().get(23)); + enumStringerAll.internalInit(descriptor.getExtensions().get(24)); + unsafeMarshalerAll.internalInit(descriptor.getExtensions().get(25)); + unsafeUnmarshalerAll.internalInit(descriptor.getExtensions().get(26)); + goprotoExtensionsMapAll.internalInit(descriptor.getExtensions().get(27)); + goprotoUnrecognizedAll.internalInit(descriptor.getExtensions().get(28)); + gogoprotoImport.internalInit(descriptor.getExtensions().get(29)); + protosizerAll.internalInit(descriptor.getExtensions().get(30)); + compareAll.internalInit(descriptor.getExtensions().get(31)); + typedeclAll.internalInit(descriptor.getExtensions().get(32)); + enumdeclAll.internalInit(descriptor.getExtensions().get(33)); + goprotoRegistration.internalInit(descriptor.getExtensions().get(34)); + messagenameAll.internalInit(descriptor.getExtensions().get(35)); + goprotoSizecacheAll.internalInit(descriptor.getExtensions().get(36)); + goprotoUnkeyedAll.internalInit(descriptor.getExtensions().get(37)); + goprotoGetters.internalInit(descriptor.getExtensions().get(38)); + goprotoStringer.internalInit(descriptor.getExtensions().get(39)); + verboseEqual.internalInit(descriptor.getExtensions().get(40)); + face.internalInit(descriptor.getExtensions().get(41)); + gostring.internalInit(descriptor.getExtensions().get(42)); + populate.internalInit(descriptor.getExtensions().get(43)); + stringer.internalInit(descriptor.getExtensions().get(44)); + onlyone.internalInit(descriptor.getExtensions().get(45)); + equal.internalInit(descriptor.getExtensions().get(46)); + description.internalInit(descriptor.getExtensions().get(47)); + testgen.internalInit(descriptor.getExtensions().get(48)); + benchgen.internalInit(descriptor.getExtensions().get(49)); + marshaler.internalInit(descriptor.getExtensions().get(50)); + unmarshaler.internalInit(descriptor.getExtensions().get(51)); + stableMarshaler.internalInit(descriptor.getExtensions().get(52)); + sizer.internalInit(descriptor.getExtensions().get(53)); + unsafeMarshaler.internalInit(descriptor.getExtensions().get(54)); + unsafeUnmarshaler.internalInit(descriptor.getExtensions().get(55)); + goprotoExtensionsMap.internalInit(descriptor.getExtensions().get(56)); + goprotoUnrecognized.internalInit(descriptor.getExtensions().get(57)); + protosizer.internalInit(descriptor.getExtensions().get(58)); + compare.internalInit(descriptor.getExtensions().get(59)); + typedecl.internalInit(descriptor.getExtensions().get(60)); + messagename.internalInit(descriptor.getExtensions().get(61)); + goprotoSizecache.internalInit(descriptor.getExtensions().get(62)); + goprotoUnkeyed.internalInit(descriptor.getExtensions().get(63)); + nullable.internalInit(descriptor.getExtensions().get(64)); + embed.internalInit(descriptor.getExtensions().get(65)); + customtype.internalInit(descriptor.getExtensions().get(66)); + customname.internalInit(descriptor.getExtensions().get(67)); + jsontag.internalInit(descriptor.getExtensions().get(68)); + moretags.internalInit(descriptor.getExtensions().get(69)); + casttype.internalInit(descriptor.getExtensions().get(70)); + castkey.internalInit(descriptor.getExtensions().get(71)); + castvalue.internalInit(descriptor.getExtensions().get(72)); + stdtime.internalInit(descriptor.getExtensions().get(73)); + stdduration.internalInit(descriptor.getExtensions().get(74)); + wktpointer.internalInit(descriptor.getExtensions().get(75)); + com.google.protobuf.DescriptorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/proto/Remote.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/proto/Remote.java new file mode 100644 index 00000000000..17a67d4446b --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/proto/Remote.java @@ -0,0 +1,6998 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.sink.proto; + +public final class Remote { + private Remote() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public interface WriteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.WriteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getTimeseriesList(); + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + Types.TimeSeries getTimeseries(int index); + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + int getTimeseriesCount(); + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getTimeseriesOrBuilderList(); + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + Types.TimeSeriesOrBuilder getTimeseriesOrBuilder(int index); + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getMetadataList(); + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + Types.MetricMetadata getMetadata(int index); + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + int getMetadataCount(); + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getMetadataOrBuilderList(); + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + Types.MetricMetadataOrBuilder getMetadataOrBuilder(int index); + } + + /** Protobuf type {@code prometheus.WriteRequest} */ + public static final class WriteRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.WriteRequest) + WriteRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WriteRequest.newBuilder() to construct. + private WriteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteRequest() { + timeseries_ = java.util.Collections.emptyList(); + metadata_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new WriteRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_WriteRequest_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_WriteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.WriteRequest.class, Remote.WriteRequest.Builder.class); + } + + public static final int TIMESERIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List timeseries_; + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getTimeseriesList() { + return timeseries_; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getTimeseriesOrBuilderList() { + return timeseries_; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + @Override + public int getTimeseriesCount() { + return timeseries_.size(); + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.TimeSeries getTimeseries(int index) { + return timeseries_.get(index); + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.TimeSeriesOrBuilder getTimeseriesOrBuilder(int index) { + return timeseries_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List metadata_; + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getMetadataList() { + return metadata_; + } + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getMetadataOrBuilderList() { + return metadata_; + } + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + @Override + public int getMetadataCount() { + return metadata_.size(); + } + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.MetricMetadata getMetadata(int index) { + return metadata_.get(index); + } + + /** + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.MetricMetadataOrBuilder getMetadataOrBuilder(int index) { + return metadata_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < timeseries_.size(); i++) { + output.writeMessage(1, timeseries_.get(i)); + } + for (int i = 0; i < metadata_.size(); i++) { + output.writeMessage(3, metadata_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + for (int i = 0; i < timeseries_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, timeseries_.get(i)); + } + for (int i = 0; i < metadata_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, metadata_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Remote.WriteRequest)) { + return super.equals(obj); + } + Remote.WriteRequest other = (Remote.WriteRequest) obj; + + if (!getTimeseriesList().equals(other.getTimeseriesList())) { + return false; + } + if (!getMetadataList().equals(other.getMetadataList())) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTimeseriesCount() > 0) { + hash = (37 * hash) + TIMESERIES_FIELD_NUMBER; + hash = (53 * hash) + getTimeseriesList().hashCode(); + } + if (getMetadataCount() > 0) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadataList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Remote.WriteRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.WriteRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.WriteRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.WriteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.WriteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.WriteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.WriteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.WriteRequest 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 Remote.WriteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Remote.WriteRequest 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 Remote.WriteRequest parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.WriteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Remote.WriteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code prometheus.WriteRequest} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.WriteRequest) + Remote.WriteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_WriteRequest_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_WriteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.WriteRequest.class, Remote.WriteRequest.Builder.class); + } + + // Construct using Remote.WriteRequest.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (timeseriesBuilder_ == null) { + timeseries_ = java.util.Collections.emptyList(); + } else { + timeseries_ = null; + timeseriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (metadataBuilder_ == null) { + metadata_ = java.util.Collections.emptyList(); + } else { + metadata_ = null; + metadataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Remote.internal_static_prometheus_WriteRequest_descriptor; + } + + @Override + public Remote.WriteRequest getDefaultInstanceForType() { + return Remote.WriteRequest.getDefaultInstance(); + } + + @Override + public Remote.WriteRequest build() { + Remote.WriteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Remote.WriteRequest buildPartial() { + Remote.WriteRequest result = new Remote.WriteRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Remote.WriteRequest result) { + if (timeseriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + timeseries_ = java.util.Collections.unmodifiableList(timeseries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.timeseries_ = timeseries_; + } else { + result.timeseries_ = timeseriesBuilder_.build(); + } + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + metadata_ = java.util.Collections.unmodifiableList(metadata_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + } + + private void buildPartial0(Remote.WriteRequest result) { + int from_bitField0_ = bitField0_; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Remote.WriteRequest) { + return mergeFrom((Remote.WriteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Remote.WriteRequest other) { + if (other == Remote.WriteRequest.getDefaultInstance()) { + return this; + } + if (timeseriesBuilder_ == null) { + if (!other.timeseries_.isEmpty()) { + if (timeseries_.isEmpty()) { + timeseries_ = other.timeseries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTimeseriesIsMutable(); + timeseries_.addAll(other.timeseries_); + } + onChanged(); + } + } else { + if (!other.timeseries_.isEmpty()) { + if (timeseriesBuilder_.isEmpty()) { + timeseriesBuilder_.dispose(); + timeseriesBuilder_ = null; + timeseries_ = other.timeseries_; + bitField0_ = (bitField0_ & ~0x00000001); + timeseriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTimeseriesFieldBuilder() + : null; + } else { + timeseriesBuilder_.addAllMessages(other.timeseries_); + } + } + } + if (metadataBuilder_ == null) { + if (!other.metadata_.isEmpty()) { + if (metadata_.isEmpty()) { + metadata_ = other.metadata_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMetadataIsMutable(); + metadata_.addAll(other.metadata_); + } + onChanged(); + } + } else { + if (!other.metadata_.isEmpty()) { + if (metadataBuilder_.isEmpty()) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + metadata_ = other.metadata_; + bitField0_ = (bitField0_ & ~0x00000002); + metadataBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMetadataFieldBuilder() + : null; + } else { + metadataBuilder_.addAllMessages(other.metadata_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + Types.TimeSeries m = + input.readMessage( + Types.TimeSeries.parser(), extensionRegistry); + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.add(m); + } else { + timeseriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 26: + { + Types.MetricMetadata m = + input.readMessage( + Types.MetricMetadata.parser(), + extensionRegistry); + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.add(m); + } else { + metadataBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List timeseries_ = + java.util.Collections.emptyList(); + + private void ensureTimeseriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + timeseries_ = new java.util.ArrayList(timeseries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.TimeSeries, Types.TimeSeries.Builder, Types.TimeSeriesOrBuilder> + timeseriesBuilder_; + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getTimeseriesList() { + if (timeseriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(timeseries_); + } else { + return timeseriesBuilder_.getMessageList(); + } + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public int getTimeseriesCount() { + if (timeseriesBuilder_ == null) { + return timeseries_.size(); + } else { + return timeseriesBuilder_.getCount(); + } + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Types.TimeSeries getTimeseries(int index) { + if (timeseriesBuilder_ == null) { + return timeseries_.get(index); + } else { + return timeseriesBuilder_.getMessage(index); + } + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Builder setTimeseries(int index, Types.TimeSeries value) { + if (timeseriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeseriesIsMutable(); + timeseries_.set(index, value); + onChanged(); + } else { + timeseriesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Builder setTimeseries(int index, Types.TimeSeries.Builder builderForValue) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.set(index, builderForValue.build()); + onChanged(); + } else { + timeseriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Builder addTimeseries(Types.TimeSeries value) { + if (timeseriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeseriesIsMutable(); + timeseries_.add(value); + onChanged(); + } else { + timeseriesBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Builder addTimeseries(int index, Types.TimeSeries value) { + if (timeseriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeseriesIsMutable(); + timeseries_.add(index, value); + onChanged(); + } else { + timeseriesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Builder addTimeseries(Types.TimeSeries.Builder builderForValue) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.add(builderForValue.build()); + onChanged(); + } else { + timeseriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Builder addTimeseries(int index, Types.TimeSeries.Builder builderForValue) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.add(index, builderForValue.build()); + onChanged(); + } else { + timeseriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Builder addAllTimeseries(Iterable values) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, timeseries_); + onChanged(); + } else { + timeseriesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Builder clearTimeseries() { + if (timeseriesBuilder_ == null) { + timeseries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + timeseriesBuilder_.clear(); + } + return this; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Builder removeTimeseries(int index) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.remove(index); + onChanged(); + } else { + timeseriesBuilder_.remove(index); + } + return this; + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Types.TimeSeries.Builder getTimeseriesBuilder(int index) { + return getTimeseriesFieldBuilder().getBuilder(index); + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Types.TimeSeriesOrBuilder getTimeseriesOrBuilder(int index) { + if (timeseriesBuilder_ == null) { + return timeseries_.get(index); + } else { + return timeseriesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List + getTimeseriesOrBuilderList() { + if (timeseriesBuilder_ != null) { + return timeseriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(timeseries_); + } + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Types.TimeSeries.Builder addTimeseriesBuilder() { + return getTimeseriesFieldBuilder() + .addBuilder(Types.TimeSeries.getDefaultInstance()); + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public Types.TimeSeries.Builder addTimeseriesBuilder(int index) { + return getTimeseriesFieldBuilder() + .addBuilder(index, Types.TimeSeries.getDefaultInstance()); + } + + /** + * repeated .prometheus.TimeSeries timeseries = 1 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getTimeseriesBuilderList() { + return getTimeseriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.TimeSeries, Types.TimeSeries.Builder, Types.TimeSeriesOrBuilder> + getTimeseriesFieldBuilder() { + if (timeseriesBuilder_ == null) { + timeseriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.TimeSeries, + Types.TimeSeries.Builder, + Types.TimeSeriesOrBuilder>( + timeseries_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + timeseries_ = null; + } + return timeseriesBuilder_; + } + + private java.util.List metadata_ = + java.util.Collections.emptyList(); + + private void ensureMetadataIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + metadata_ = new java.util.ArrayList(metadata_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.MetricMetadata, + Types.MetricMetadata.Builder, + Types.MetricMetadataOrBuilder> + metadataBuilder_; + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getMetadataList() { + if (metadataBuilder_ == null) { + return java.util.Collections.unmodifiableList(metadata_); + } else { + return metadataBuilder_.getMessageList(); + } + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public int getMetadataCount() { + if (metadataBuilder_ == null) { + return metadata_.size(); + } else { + return metadataBuilder_.getCount(); + } + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.MetricMetadata getMetadata(int index) { + if (metadataBuilder_ == null) { + return metadata_.get(index); + } else { + return metadataBuilder_.getMessage(index); + } + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder setMetadata(int index, Types.MetricMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataIsMutable(); + metadata_.set(index, value); + onChanged(); + } else { + metadataBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder setMetadata(int index, Types.MetricMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.set(index, builderForValue.build()); + onChanged(); + } else { + metadataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addMetadata(Types.MetricMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataIsMutable(); + metadata_.add(value); + onChanged(); + } else { + metadataBuilder_.addMessage(value); + } + return this; + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addMetadata(int index, Types.MetricMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetadataIsMutable(); + metadata_.add(index, value); + onChanged(); + } else { + metadataBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addMetadata(Types.MetricMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.add(builderForValue.build()); + onChanged(); + } else { + metadataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addMetadata(int index, Types.MetricMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.add(index, builderForValue.build()); + onChanged(); + } else { + metadataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addAllMetadata(Iterable values) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metadata_); + onChanged(); + } else { + metadataBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + metadataBuilder_.clear(); + } + return this; + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder removeMetadata(int index) { + if (metadataBuilder_ == null) { + ensureMetadataIsMutable(); + metadata_.remove(index); + onChanged(); + } else { + metadataBuilder_.remove(index); + } + return this; + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.MetricMetadata.Builder getMetadataBuilder(int index) { + return getMetadataFieldBuilder().getBuilder(index); + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.MetricMetadataOrBuilder getMetadataOrBuilder(int index) { + if (metadataBuilder_ == null) { + return metadata_.get(index); + } else { + return metadataBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List + getMetadataOrBuilderList() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metadata_); + } + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.MetricMetadata.Builder addMetadataBuilder() { + return getMetadataFieldBuilder() + .addBuilder(Types.MetricMetadata.getDefaultInstance()); + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.MetricMetadata.Builder addMetadataBuilder(int index) { + return getMetadataFieldBuilder() + .addBuilder(index, Types.MetricMetadata.getDefaultInstance()); + } + + /** + * + * repeated .prometheus.MetricMetadata metadata = 3 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getMetadataBuilderList() { + return getMetadataFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.MetricMetadata, + Types.MetricMetadata.Builder, + Types.MetricMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.MetricMetadata, + Types.MetricMetadata.Builder, + Types.MetricMetadataOrBuilder>( + metadata_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.WriteRequest) + } + + // @@protoc_insertion_point(class_scope:prometheus.WriteRequest) + private static final Remote.WriteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Remote.WriteRequest(); + } + + public static Remote.WriteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public WriteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Remote.WriteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ReadRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.ReadRequest) + com.google.protobuf.MessageOrBuilder { + + /** repeated .prometheus.Query queries = 1; */ + java.util.List getQueriesList(); + + /** repeated .prometheus.Query queries = 1; */ + Remote.Query getQueries(int index); + + /** repeated .prometheus.Query queries = 1; */ + int getQueriesCount(); + + /** repeated .prometheus.Query queries = 1; */ + java.util.List getQueriesOrBuilderList(); + + /** repeated .prometheus.Query queries = 1; */ + Remote.QueryOrBuilder getQueriesOrBuilder(int index); + + /** + * + * + *

+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @return A list containing the acceptedResponseTypes. + */ + java.util.List getAcceptedResponseTypesList(); + + /** + * + * + *
+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @return The count of acceptedResponseTypes. + */ + int getAcceptedResponseTypesCount(); + + /** + * + * + *
+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @param index The index of the element to return. + * @return The acceptedResponseTypes at the given index. + */ + Remote.ReadRequest.ResponseType getAcceptedResponseTypes(int index); + + /** + * + * + *
+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @return A list containing the enum numeric values on the wire for acceptedResponseTypes. + */ + java.util.List getAcceptedResponseTypesValueList(); + + /** + * + * + *
+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of acceptedResponseTypes at the given index. + */ + int getAcceptedResponseTypesValue(int index); + } + + /** + * + * + *
+     * ReadRequest represents a remote read request.
+     * 
+ * + *

Protobuf type {@code prometheus.ReadRequest} + */ + public static final class ReadRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.ReadRequest) + ReadRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ReadRequest.newBuilder() to construct. + private ReadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadRequest() { + queries_ = java.util.Collections.emptyList(); + acceptedResponseTypes_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new ReadRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_ReadRequest_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_ReadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.ReadRequest.class, Remote.ReadRequest.Builder.class); + } + + /** Protobuf enum {@code prometheus.ReadRequest.ResponseType} */ + public enum ResponseType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *

+             * Server will return a single ReadResponse message with matched series that includes list of raw samples.
+             * It's recommended to use streamed response types instead.
+             *
+             * Response headers:
+             * Content-Type: "application/x-protobuf"
+             * Content-Encoding: "snappy"
+             * 
+ * + * SAMPLES = 0; + */ + SAMPLES(0), + /** + * + * + *
+             * Server will stream a delimited ChunkedReadResponse message that
+             * contains XOR or HISTOGRAM(!) encoded chunks for a single series.
+             * Each message is following varint size and fixed size bigendian
+             * uint32 for CRC32 Castagnoli checksum.
+             *
+             * Response headers:
+             * Content-Type: "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse"
+             * Content-Encoding: ""
+             * 
+ * + * STREAMED_XOR_CHUNKS = 1; + */ + STREAMED_XOR_CHUNKS(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+             * Server will return a single ReadResponse message with matched series that includes list of raw samples.
+             * It's recommended to use streamed response types instead.
+             *
+             * Response headers:
+             * Content-Type: "application/x-protobuf"
+             * Content-Encoding: "snappy"
+             * 
+ * + * SAMPLES = 0; + */ + public static final int SAMPLES_VALUE = 0; + /** + * + * + *
+             * Server will stream a delimited ChunkedReadResponse message that
+             * contains XOR or HISTOGRAM(!) encoded chunks for a single series.
+             * Each message is following varint size and fixed size bigendian
+             * uint32 for CRC32 Castagnoli checksum.
+             *
+             * Response headers:
+             * Content-Type: "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse"
+             * Content-Encoding: ""
+             * 
+ * + * STREAMED_XOR_CHUNKS = 1; + */ + public static final int STREAMED_XOR_CHUNKS_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static ResponseType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ResponseType forNumber(int value) { + switch (value) { + case 0: + return SAMPLES; + case 1: + return STREAMED_XOR_CHUNKS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ResponseType findValueByNumber(int number) { + return ResponseType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return Remote.ReadRequest.getDescriptor().getEnumTypes().get(0); + } + + private static final ResponseType[] VALUES = values(); + + public static ResponseType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ResponseType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:prometheus.ReadRequest.ResponseType) + } + + public static final int QUERIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List queries_; + + /** repeated .prometheus.Query queries = 1; */ + @Override + public java.util.List getQueriesList() { + return queries_; + } + + /** repeated .prometheus.Query queries = 1; */ + @Override + public java.util.List getQueriesOrBuilderList() { + return queries_; + } + + /** repeated .prometheus.Query queries = 1; */ + @Override + public int getQueriesCount() { + return queries_.size(); + } + + /** repeated .prometheus.Query queries = 1; */ + @Override + public Remote.Query getQueries(int index) { + return queries_.get(index); + } + + /** repeated .prometheus.Query queries = 1; */ + @Override + public Remote.QueryOrBuilder getQueriesOrBuilder(int index) { + return queries_.get(index); + } + + public static final int ACCEPTED_RESPONSE_TYPES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List acceptedResponseTypes_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + Integer, Remote.ReadRequest.ResponseType> + acceptedResponseTypes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + Integer, Remote.ReadRequest.ResponseType>() { + public Remote.ReadRequest.ResponseType convert(Integer from) { + Remote.ReadRequest.ResponseType result = + Remote.ReadRequest.ResponseType.forNumber(from); + return result == null + ? Remote.ReadRequest.ResponseType.UNRECOGNIZED + : result; + } + }; + + /** + * + * + *
+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @return A list containing the acceptedResponseTypes. + */ + @Override + public java.util.List getAcceptedResponseTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + Integer, Remote.ReadRequest.ResponseType>( + acceptedResponseTypes_, acceptedResponseTypes_converter_); + } + + /** + * + * + *
+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @return The count of acceptedResponseTypes. + */ + @Override + public int getAcceptedResponseTypesCount() { + return acceptedResponseTypes_.size(); + } + + /** + * + * + *
+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @param index The index of the element to return. + * @return The acceptedResponseTypes at the given index. + */ + @Override + public Remote.ReadRequest.ResponseType getAcceptedResponseTypes(int index) { + return acceptedResponseTypes_converter_.convert(acceptedResponseTypes_.get(index)); + } + + /** + * + * + *
+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @return A list containing the enum numeric values on the wire for acceptedResponseTypes. + */ + @Override + public java.util.List getAcceptedResponseTypesValueList() { + return acceptedResponseTypes_; + } + + /** + * + * + *
+         * accepted_response_types allows negotiating the content type of the response.
+         *
+         * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+         * implemented by server, error is returned.
+         * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+         * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of acceptedResponseTypes at the given index. + */ + @Override + public int getAcceptedResponseTypesValue(int index) { + return acceptedResponseTypes_.get(index); + } + + private int acceptedResponseTypesMemoizedSerializedSize; + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < queries_.size(); i++) { + output.writeMessage(1, queries_.get(i)); + } + if (getAcceptedResponseTypesList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(acceptedResponseTypesMemoizedSerializedSize); + } + for (int i = 0; i < acceptedResponseTypes_.size(); i++) { + output.writeEnumNoTag(acceptedResponseTypes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + for (int i = 0; i < queries_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, queries_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < acceptedResponseTypes_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + acceptedResponseTypes_.get(i)); + } + size += dataSize; + if (!getAcceptedResponseTypesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + acceptedResponseTypesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Remote.ReadRequest)) { + return super.equals(obj); + } + Remote.ReadRequest other = (Remote.ReadRequest) obj; + + if (!getQueriesList().equals(other.getQueriesList())) { + return false; + } + if (!acceptedResponseTypes_.equals(other.acceptedResponseTypes_)) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getQueriesCount() > 0) { + hash = (37 * hash) + QUERIES_FIELD_NUMBER; + hash = (53 * hash) + getQueriesList().hashCode(); + } + if (getAcceptedResponseTypesCount() > 0) { + hash = (37 * hash) + ACCEPTED_RESPONSE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + acceptedResponseTypes_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Remote.ReadRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.ReadRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.ReadRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.ReadRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.ReadRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.ReadRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.ReadRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.ReadRequest 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 Remote.ReadRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Remote.ReadRequest 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 Remote.ReadRequest parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.ReadRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Remote.ReadRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * ReadRequest represents a remote read request.
+         * 
+ * + *

Protobuf type {@code prometheus.ReadRequest} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.ReadRequest) + Remote.ReadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_ReadRequest_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_ReadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.ReadRequest.class, Remote.ReadRequest.Builder.class); + } + + // Construct using Remote.ReadRequest.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (queriesBuilder_ == null) { + queries_ = java.util.Collections.emptyList(); + } else { + queries_ = null; + queriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + acceptedResponseTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Remote.internal_static_prometheus_ReadRequest_descriptor; + } + + @Override + public Remote.ReadRequest getDefaultInstanceForType() { + return Remote.ReadRequest.getDefaultInstance(); + } + + @Override + public Remote.ReadRequest build() { + Remote.ReadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Remote.ReadRequest buildPartial() { + Remote.ReadRequest result = new Remote.ReadRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Remote.ReadRequest result) { + if (queriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + queries_ = java.util.Collections.unmodifiableList(queries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.queries_ = queries_; + } else { + result.queries_ = queriesBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + acceptedResponseTypes_ = + java.util.Collections.unmodifiableList(acceptedResponseTypes_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.acceptedResponseTypes_ = acceptedResponseTypes_; + } + + private void buildPartial0(Remote.ReadRequest result) { + int from_bitField0_ = bitField0_; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Remote.ReadRequest) { + return mergeFrom((Remote.ReadRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Remote.ReadRequest other) { + if (other == Remote.ReadRequest.getDefaultInstance()) { + return this; + } + if (queriesBuilder_ == null) { + if (!other.queries_.isEmpty()) { + if (queries_.isEmpty()) { + queries_ = other.queries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQueriesIsMutable(); + queries_.addAll(other.queries_); + } + onChanged(); + } + } else { + if (!other.queries_.isEmpty()) { + if (queriesBuilder_.isEmpty()) { + queriesBuilder_.dispose(); + queriesBuilder_ = null; + queries_ = other.queries_; + bitField0_ = (bitField0_ & ~0x00000001); + queriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQueriesFieldBuilder() + : null; + } else { + queriesBuilder_.addAllMessages(other.queries_); + } + } + } + if (!other.acceptedResponseTypes_.isEmpty()) { + if (acceptedResponseTypes_.isEmpty()) { + acceptedResponseTypes_ = other.acceptedResponseTypes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAcceptedResponseTypesIsMutable(); + acceptedResponseTypes_.addAll(other.acceptedResponseTypes_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + Remote.Query m = + input.readMessage( + Remote.Query.parser(), extensionRegistry); + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.add(m); + } else { + queriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + int tmpRaw = input.readEnum(); + ensureAcceptedResponseTypesIsMutable(); + acceptedResponseTypes_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureAcceptedResponseTypesIsMutable(); + acceptedResponseTypes_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List queries_ = java.util.Collections.emptyList(); + + private void ensureQueriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + queries_ = new java.util.ArrayList(queries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Remote.Query, Remote.Query.Builder, Remote.QueryOrBuilder> + queriesBuilder_; + + /** repeated .prometheus.Query queries = 1; */ + public java.util.List getQueriesList() { + if (queriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(queries_); + } else { + return queriesBuilder_.getMessageList(); + } + } + + /** repeated .prometheus.Query queries = 1; */ + public int getQueriesCount() { + if (queriesBuilder_ == null) { + return queries_.size(); + } else { + return queriesBuilder_.getCount(); + } + } + + /** repeated .prometheus.Query queries = 1; */ + public Remote.Query getQueries(int index) { + if (queriesBuilder_ == null) { + return queries_.get(index); + } else { + return queriesBuilder_.getMessage(index); + } + } + + /** repeated .prometheus.Query queries = 1; */ + public Builder setQueries(int index, Remote.Query value) { + if (queriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueriesIsMutable(); + queries_.set(index, value); + onChanged(); + } else { + queriesBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .prometheus.Query queries = 1; */ + public Builder setQueries(int index, Remote.Query.Builder builderForValue) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.set(index, builderForValue.build()); + onChanged(); + } else { + queriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .prometheus.Query queries = 1; */ + public Builder addQueries(Remote.Query value) { + if (queriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueriesIsMutable(); + queries_.add(value); + onChanged(); + } else { + queriesBuilder_.addMessage(value); + } + return this; + } + + /** repeated .prometheus.Query queries = 1; */ + public Builder addQueries(int index, Remote.Query value) { + if (queriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQueriesIsMutable(); + queries_.add(index, value); + onChanged(); + } else { + queriesBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .prometheus.Query queries = 1; */ + public Builder addQueries(Remote.Query.Builder builderForValue) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.add(builderForValue.build()); + onChanged(); + } else { + queriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .prometheus.Query queries = 1; */ + public Builder addQueries(int index, Remote.Query.Builder builderForValue) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.add(index, builderForValue.build()); + onChanged(); + } else { + queriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .prometheus.Query queries = 1; */ + public Builder addAllQueries(Iterable values) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, queries_); + onChanged(); + } else { + queriesBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .prometheus.Query queries = 1; */ + public Builder clearQueries() { + if (queriesBuilder_ == null) { + queries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + queriesBuilder_.clear(); + } + return this; + } + + /** repeated .prometheus.Query queries = 1; */ + public Builder removeQueries(int index) { + if (queriesBuilder_ == null) { + ensureQueriesIsMutable(); + queries_.remove(index); + onChanged(); + } else { + queriesBuilder_.remove(index); + } + return this; + } + + /** repeated .prometheus.Query queries = 1; */ + public Remote.Query.Builder getQueriesBuilder(int index) { + return getQueriesFieldBuilder().getBuilder(index); + } + + /** repeated .prometheus.Query queries = 1; */ + public Remote.QueryOrBuilder getQueriesOrBuilder(int index) { + if (queriesBuilder_ == null) { + return queries_.get(index); + } else { + return queriesBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .prometheus.Query queries = 1; */ + public java.util.List getQueriesOrBuilderList() { + if (queriesBuilder_ != null) { + return queriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(queries_); + } + } + + /** repeated .prometheus.Query queries = 1; */ + public Remote.Query.Builder addQueriesBuilder() { + return getQueriesFieldBuilder().addBuilder(Remote.Query.getDefaultInstance()); + } + + /** repeated .prometheus.Query queries = 1; */ + public Remote.Query.Builder addQueriesBuilder(int index) { + return getQueriesFieldBuilder() + .addBuilder(index, Remote.Query.getDefaultInstance()); + } + + /** repeated .prometheus.Query queries = 1; */ + public java.util.List getQueriesBuilderList() { + return getQueriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Remote.Query, Remote.Query.Builder, Remote.QueryOrBuilder> + getQueriesFieldBuilder() { + if (queriesBuilder_ == null) { + queriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Remote.Query, Remote.Query.Builder, Remote.QueryOrBuilder>( + queries_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + queries_ = null; + } + return queriesBuilder_; + } + + private java.util.List acceptedResponseTypes_ = + java.util.Collections.emptyList(); + + private void ensureAcceptedResponseTypesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + acceptedResponseTypes_ = + new java.util.ArrayList(acceptedResponseTypes_); + bitField0_ |= 0x00000002; + } + } + + /** + * + * + *

+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @return A list containing the acceptedResponseTypes. + */ + public java.util.List getAcceptedResponseTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + Integer, Remote.ReadRequest.ResponseType>( + acceptedResponseTypes_, acceptedResponseTypes_converter_); + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @return The count of acceptedResponseTypes. + */ + public int getAcceptedResponseTypesCount() { + return acceptedResponseTypes_.size(); + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @param index The index of the element to return. + * @return The acceptedResponseTypes at the given index. + */ + public Remote.ReadRequest.ResponseType getAcceptedResponseTypes(int index) { + return acceptedResponseTypes_converter_.convert(acceptedResponseTypes_.get(index)); + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @param index The index to set the value at. + * @param value The acceptedResponseTypes to set. + * @return This builder for chaining. + */ + public Builder setAcceptedResponseTypes( + int index, Remote.ReadRequest.ResponseType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceptedResponseTypesIsMutable(); + acceptedResponseTypes_.set(index, value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @param value The acceptedResponseTypes to add. + * @return This builder for chaining. + */ + public Builder addAcceptedResponseTypes(Remote.ReadRequest.ResponseType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAcceptedResponseTypesIsMutable(); + acceptedResponseTypes_.add(value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @param values The acceptedResponseTypes to add. + * @return This builder for chaining. + */ + public Builder addAllAcceptedResponseTypes( + Iterable values) { + ensureAcceptedResponseTypesIsMutable(); + for (Remote.ReadRequest.ResponseType value : values) { + acceptedResponseTypes_.add(value.getNumber()); + } + onChanged(); + return this; + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearAcceptedResponseTypes() { + acceptedResponseTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @return A list containing the enum numeric values on the wire for + * acceptedResponseTypes. + */ + public java.util.List getAcceptedResponseTypesValueList() { + return java.util.Collections.unmodifiableList(acceptedResponseTypes_); + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of acceptedResponseTypes at the given + * index. + */ + public int getAcceptedResponseTypesValue(int index) { + return acceptedResponseTypes_.get(index); + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for acceptedResponseTypes to set. + * @return This builder for chaining. + */ + public Builder setAcceptedResponseTypesValue(int index, int value) { + ensureAcceptedResponseTypesIsMutable(); + acceptedResponseTypes_.set(index, value); + onChanged(); + return this; + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @param value The enum numeric value on the wire for acceptedResponseTypes to add. + * @return This builder for chaining. + */ + public Builder addAcceptedResponseTypesValue(int value) { + ensureAcceptedResponseTypesIsMutable(); + acceptedResponseTypes_.add(value); + onChanged(); + return this; + } + + /** + * + * + *
+             * accepted_response_types allows negotiating the content type of the response.
+             *
+             * Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is
+             * implemented by server, error is returned.
+             * For request that do not contain `accepted_response_types` field the SAMPLES response type will be used.
+             * 
+ * + * repeated .prometheus.ReadRequest.ResponseType accepted_response_types = 2; + * + * + * @param values The enum numeric values on the wire for acceptedResponseTypes to add. + * @return This builder for chaining. + */ + public Builder addAllAcceptedResponseTypesValue(Iterable values) { + ensureAcceptedResponseTypesIsMutable(); + for (int value : values) { + acceptedResponseTypes_.add(value); + } + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.ReadRequest) + } + + // @@protoc_insertion_point(class_scope:prometheus.ReadRequest) + private static final Remote.ReadRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Remote.ReadRequest(); + } + + public static Remote.ReadRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public ReadRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Remote.ReadRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ReadResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.ReadResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + java.util.List getResultsList(); + + /** + * + * + *
+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + Remote.QueryResult getResults(int index); + + /** + * + * + *
+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + int getResultsCount(); + + /** + * + * + *
+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + java.util.List getResultsOrBuilderList(); + + /** + * + * + *
+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + Remote.QueryResultOrBuilder getResultsOrBuilder(int index); + } + + /** + * + * + *
+     * ReadResponse is a response when response_type equals SAMPLES.
+     * 
+ * + *

Protobuf type {@code prometheus.ReadResponse} + */ + public static final class ReadResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.ReadResponse) + ReadResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ReadResponse.newBuilder() to construct. + private ReadResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadResponse() { + results_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new ReadResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_ReadResponse_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_ReadResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.ReadResponse.class, Remote.ReadResponse.Builder.class); + } + + public static final int RESULTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List results_; + + /** + * + * + *

+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + @Override + public java.util.List getResultsList() { + return results_; + } + + /** + * + * + *
+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + @Override + public java.util.List getResultsOrBuilderList() { + return results_; + } + + /** + * + * + *
+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + @Override + public int getResultsCount() { + return results_.size(); + } + + /** + * + * + *
+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + @Override + public Remote.QueryResult getResults(int index) { + return results_.get(index); + } + + /** + * + * + *
+         * In same order as the request's queries.
+         * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + @Override + public Remote.QueryResultOrBuilder getResultsOrBuilder(int index) { + return results_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(1, results_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, results_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Remote.ReadResponse)) { + return super.equals(obj); + } + Remote.ReadResponse other = (Remote.ReadResponse) obj; + + if (!getResultsList().equals(other.getResultsList())) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Remote.ReadResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.ReadResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.ReadResponse parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.ReadResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.ReadResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.ReadResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.ReadResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.ReadResponse 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 Remote.ReadResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Remote.ReadResponse 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 Remote.ReadResponse parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.ReadResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Remote.ReadResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * ReadResponse is a response when response_type equals SAMPLES.
+         * 
+ * + *

Protobuf type {@code prometheus.ReadResponse} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.ReadResponse) + Remote.ReadResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_ReadResponse_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_ReadResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.ReadResponse.class, Remote.ReadResponse.Builder.class); + } + + // Construct using Remote.ReadResponse.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + } else { + results_ = null; + resultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Remote.internal_static_prometheus_ReadResponse_descriptor; + } + + @Override + public Remote.ReadResponse getDefaultInstanceForType() { + return Remote.ReadResponse.getDefaultInstance(); + } + + @Override + public Remote.ReadResponse build() { + Remote.ReadResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Remote.ReadResponse buildPartial() { + Remote.ReadResponse result = new Remote.ReadResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Remote.ReadResponse result) { + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + } + + private void buildPartial0(Remote.ReadResponse result) { + int from_bitField0_ = bitField0_; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Remote.ReadResponse) { + return mergeFrom((Remote.ReadResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Remote.ReadResponse other) { + if (other == Remote.ReadResponse.getDefaultInstance()) { + return this; + } + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResultsFieldBuilder() + : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + Remote.QueryResult m = + input.readMessage( + Remote.QueryResult.parser(), extensionRegistry); + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(m); + } else { + resultsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List results_ = java.util.Collections.emptyList(); + + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Remote.QueryResult, + Remote.QueryResult.Builder, + Remote.QueryResultOrBuilder> + resultsBuilder_; + + /** + * + * + *

+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Remote.QueryResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Builder setResults(int index, Remote.QueryResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Builder setResults(int index, Remote.QueryResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Builder addResults(Remote.QueryResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Builder addResults(int index, Remote.QueryResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Builder addResults(Remote.QueryResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Builder addResults(int index, Remote.QueryResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Builder addAllResults(Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Remote.QueryResult.Builder getResultsBuilder(int index) { + return getResultsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Remote.QueryResultOrBuilder getResultsOrBuilder(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public java.util.List getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Remote.QueryResult.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder(Remote.QueryResult.getDefaultInstance()); + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public Remote.QueryResult.Builder addResultsBuilder(int index) { + return getResultsFieldBuilder() + .addBuilder(index, Remote.QueryResult.getDefaultInstance()); + } + + /** + * + * + *
+             * In same order as the request's queries.
+             * 
+ * + * repeated .prometheus.QueryResult results = 1; + */ + public java.util.List getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Remote.QueryResult, + Remote.QueryResult.Builder, + Remote.QueryResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Remote.QueryResult, + Remote.QueryResult.Builder, + Remote.QueryResultOrBuilder>( + results_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.ReadResponse) + } + + // @@protoc_insertion_point(class_scope:prometheus.ReadResponse) + private static final Remote.ReadResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Remote.ReadResponse(); + } + + public static Remote.ReadResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public ReadResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Remote.ReadResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.Query) + com.google.protobuf.MessageOrBuilder { + + /** + * int64 start_timestamp_ms = 1; + * + * @return The startTimestampMs. + */ + long getStartTimestampMs(); + + /** + * int64 end_timestamp_ms = 2; + * + * @return The endTimestampMs. + */ + long getEndTimestampMs(); + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + java.util.List getMatchersList(); + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + Types.LabelMatcher getMatchers(int index); + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + int getMatchersCount(); + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + java.util.List getMatchersOrBuilderList(); + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + Types.LabelMatcherOrBuilder getMatchersOrBuilder(int index); + + /** + * .prometheus.ReadHints hints = 4; + * + * @return Whether the hints field is set. + */ + boolean hasHints(); + + /** + * .prometheus.ReadHints hints = 4; + * + * @return The hints. + */ + Types.ReadHints getHints(); + + /** .prometheus.ReadHints hints = 4; */ + Types.ReadHintsOrBuilder getHintsOrBuilder(); + } + + /** Protobuf type {@code prometheus.Query} */ + public static final class Query extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.Query) + QueryOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Query.newBuilder() to construct. + private Query(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Query() { + matchers_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new Query(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_Query_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_Query_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.Query.class, Remote.Query.Builder.class); + } + + private int bitField0_; + public static final int START_TIMESTAMP_MS_FIELD_NUMBER = 1; + private long startTimestampMs_ = 0L; + + /** + * int64 start_timestamp_ms = 1; + * + * @return The startTimestampMs. + */ + @Override + public long getStartTimestampMs() { + return startTimestampMs_; + } + + public static final int END_TIMESTAMP_MS_FIELD_NUMBER = 2; + private long endTimestampMs_ = 0L; + + /** + * int64 end_timestamp_ms = 2; + * + * @return The endTimestampMs. + */ + @Override + public long getEndTimestampMs() { + return endTimestampMs_; + } + + public static final int MATCHERS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List matchers_; + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + @Override + public java.util.List getMatchersList() { + return matchers_; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + @Override + public java.util.List getMatchersOrBuilderList() { + return matchers_; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + @Override + public int getMatchersCount() { + return matchers_.size(); + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + @Override + public Types.LabelMatcher getMatchers(int index) { + return matchers_.get(index); + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + @Override + public Types.LabelMatcherOrBuilder getMatchersOrBuilder(int index) { + return matchers_.get(index); + } + + public static final int HINTS_FIELD_NUMBER = 4; + private Types.ReadHints hints_; + + /** + * .prometheus.ReadHints hints = 4; + * + * @return Whether the hints field is set. + */ + @Override + public boolean hasHints() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .prometheus.ReadHints hints = 4; + * + * @return The hints. + */ + @Override + public Types.ReadHints getHints() { + return hints_ == null ? Types.ReadHints.getDefaultInstance() : hints_; + } + + /** .prometheus.ReadHints hints = 4; */ + @Override + public Types.ReadHintsOrBuilder getHintsOrBuilder() { + return hints_ == null ? Types.ReadHints.getDefaultInstance() : hints_; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (startTimestampMs_ != 0L) { + output.writeInt64(1, startTimestampMs_); + } + if (endTimestampMs_ != 0L) { + output.writeInt64(2, endTimestampMs_); + } + for (int i = 0; i < matchers_.size(); i++) { + output.writeMessage(3, matchers_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getHints()); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (startTimestampMs_ != 0L) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 1, startTimestampMs_); + } + if (endTimestampMs_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, endTimestampMs_); + } + for (int i = 0; i < matchers_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, matchers_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getHints()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Remote.Query)) { + return super.equals(obj); + } + Remote.Query other = (Remote.Query) obj; + + if (getStartTimestampMs() != other.getStartTimestampMs()) { + return false; + } + if (getEndTimestampMs() != other.getEndTimestampMs()) { + return false; + } + if (!getMatchersList().equals(other.getMatchersList())) { + return false; + } + if (hasHints() != other.hasHints()) { + return false; + } + if (hasHints()) { + if (!getHints().equals(other.getHints())) { + return false; + } + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + START_TIMESTAMP_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStartTimestampMs()); + hash = (37 * hash) + END_TIMESTAMP_MS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEndTimestampMs()); + if (getMatchersCount() > 0) { + hash = (37 * hash) + MATCHERS_FIELD_NUMBER; + hash = (53 * hash) + getMatchersList().hashCode(); + } + if (hasHints()) { + hash = (37 * hash) + HINTS_FIELD_NUMBER; + hash = (53 * hash) + getHints().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Remote.Query parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.Query parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.Query parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.Query parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.Query parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.Query parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.Query parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.Query 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 Remote.Query parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Remote.Query 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 Remote.Query parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.Query parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Remote.Query prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code prometheus.Query} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.Query) + Remote.QueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_Query_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_Query_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.Query.class, Remote.Query.Builder.class); + } + + // Construct using Remote.Query.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMatchersFieldBuilder(); + getHintsFieldBuilder(); + } + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTimestampMs_ = 0L; + endTimestampMs_ = 0L; + if (matchersBuilder_ == null) { + matchers_ = java.util.Collections.emptyList(); + } else { + matchers_ = null; + matchersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + hints_ = null; + if (hintsBuilder_ != null) { + hintsBuilder_.dispose(); + hintsBuilder_ = null; + } + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Remote.internal_static_prometheus_Query_descriptor; + } + + @Override + public Remote.Query getDefaultInstanceForType() { + return Remote.Query.getDefaultInstance(); + } + + @Override + public Remote.Query build() { + Remote.Query result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Remote.Query buildPartial() { + Remote.Query result = new Remote.Query(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Remote.Query result) { + if (matchersBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + matchers_ = java.util.Collections.unmodifiableList(matchers_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.matchers_ = matchers_; + } else { + result.matchers_ = matchersBuilder_.build(); + } + } + + private void buildPartial0(Remote.Query result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTimestampMs_ = startTimestampMs_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTimestampMs_ = endTimestampMs_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.hints_ = hintsBuilder_ == null ? hints_ : hintsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Remote.Query) { + return mergeFrom((Remote.Query) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Remote.Query other) { + if (other == Remote.Query.getDefaultInstance()) { + return this; + } + if (other.getStartTimestampMs() != 0L) { + setStartTimestampMs(other.getStartTimestampMs()); + } + if (other.getEndTimestampMs() != 0L) { + setEndTimestampMs(other.getEndTimestampMs()); + } + if (matchersBuilder_ == null) { + if (!other.matchers_.isEmpty()) { + if (matchers_.isEmpty()) { + matchers_ = other.matchers_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureMatchersIsMutable(); + matchers_.addAll(other.matchers_); + } + onChanged(); + } + } else { + if (!other.matchers_.isEmpty()) { + if (matchersBuilder_.isEmpty()) { + matchersBuilder_.dispose(); + matchersBuilder_ = null; + matchers_ = other.matchers_; + bitField0_ = (bitField0_ & ~0x00000004); + matchersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMatchersFieldBuilder() + : null; + } else { + matchersBuilder_.addAllMessages(other.matchers_); + } + } + } + if (other.hasHints()) { + mergeHints(other.getHints()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + startTimestampMs_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + endTimestampMs_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + Types.LabelMatcher m = + input.readMessage( + Types.LabelMatcher.parser(), extensionRegistry); + if (matchersBuilder_ == null) { + ensureMatchersIsMutable(); + matchers_.add(m); + } else { + matchersBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + input.readMessage( + getHintsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long startTimestampMs_; + + /** + * int64 start_timestamp_ms = 1; + * + * @return The startTimestampMs. + */ + @Override + public long getStartTimestampMs() { + return startTimestampMs_; + } + + /** + * int64 start_timestamp_ms = 1; + * + * @param value The startTimestampMs to set. + * @return This builder for chaining. + */ + public Builder setStartTimestampMs(long value) { + + startTimestampMs_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * int64 start_timestamp_ms = 1; + * + * @return This builder for chaining. + */ + public Builder clearStartTimestampMs() { + bitField0_ = (bitField0_ & ~0x00000001); + startTimestampMs_ = 0L; + onChanged(); + return this; + } + + private long endTimestampMs_; + + /** + * int64 end_timestamp_ms = 2; + * + * @return The endTimestampMs. + */ + @Override + public long getEndTimestampMs() { + return endTimestampMs_; + } + + /** + * int64 end_timestamp_ms = 2; + * + * @param value The endTimestampMs to set. + * @return This builder for chaining. + */ + public Builder setEndTimestampMs(long value) { + + endTimestampMs_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * int64 end_timestamp_ms = 2; + * + * @return This builder for chaining. + */ + public Builder clearEndTimestampMs() { + bitField0_ = (bitField0_ & ~0x00000002); + endTimestampMs_ = 0L; + onChanged(); + return this; + } + + private java.util.List matchers_ = + java.util.Collections.emptyList(); + + private void ensureMatchersIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + matchers_ = new java.util.ArrayList(matchers_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.LabelMatcher, + Types.LabelMatcher.Builder, + Types.LabelMatcherOrBuilder> + matchersBuilder_; + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public java.util.List getMatchersList() { + if (matchersBuilder_ == null) { + return java.util.Collections.unmodifiableList(matchers_); + } else { + return matchersBuilder_.getMessageList(); + } + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public int getMatchersCount() { + if (matchersBuilder_ == null) { + return matchers_.size(); + } else { + return matchersBuilder_.getCount(); + } + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Types.LabelMatcher getMatchers(int index) { + if (matchersBuilder_ == null) { + return matchers_.get(index); + } else { + return matchersBuilder_.getMessage(index); + } + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Builder setMatchers(int index, Types.LabelMatcher value) { + if (matchersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchersIsMutable(); + matchers_.set(index, value); + onChanged(); + } else { + matchersBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Builder setMatchers(int index, Types.LabelMatcher.Builder builderForValue) { + if (matchersBuilder_ == null) { + ensureMatchersIsMutable(); + matchers_.set(index, builderForValue.build()); + onChanged(); + } else { + matchersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Builder addMatchers(Types.LabelMatcher value) { + if (matchersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchersIsMutable(); + matchers_.add(value); + onChanged(); + } else { + matchersBuilder_.addMessage(value); + } + return this; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Builder addMatchers(int index, Types.LabelMatcher value) { + if (matchersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMatchersIsMutable(); + matchers_.add(index, value); + onChanged(); + } else { + matchersBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Builder addMatchers(Types.LabelMatcher.Builder builderForValue) { + if (matchersBuilder_ == null) { + ensureMatchersIsMutable(); + matchers_.add(builderForValue.build()); + onChanged(); + } else { + matchersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Builder addMatchers(int index, Types.LabelMatcher.Builder builderForValue) { + if (matchersBuilder_ == null) { + ensureMatchersIsMutable(); + matchers_.add(index, builderForValue.build()); + onChanged(); + } else { + matchersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Builder addAllMatchers(Iterable values) { + if (matchersBuilder_ == null) { + ensureMatchersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, matchers_); + onChanged(); + } else { + matchersBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Builder clearMatchers() { + if (matchersBuilder_ == null) { + matchers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + matchersBuilder_.clear(); + } + return this; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Builder removeMatchers(int index) { + if (matchersBuilder_ == null) { + ensureMatchersIsMutable(); + matchers_.remove(index); + onChanged(); + } else { + matchersBuilder_.remove(index); + } + return this; + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Types.LabelMatcher.Builder getMatchersBuilder(int index) { + return getMatchersFieldBuilder().getBuilder(index); + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Types.LabelMatcherOrBuilder getMatchersOrBuilder(int index) { + if (matchersBuilder_ == null) { + return matchers_.get(index); + } else { + return matchersBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public java.util.List + getMatchersOrBuilderList() { + if (matchersBuilder_ != null) { + return matchersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(matchers_); + } + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Types.LabelMatcher.Builder addMatchersBuilder() { + return getMatchersFieldBuilder() + .addBuilder(Types.LabelMatcher.getDefaultInstance()); + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public Types.LabelMatcher.Builder addMatchersBuilder(int index) { + return getMatchersFieldBuilder() + .addBuilder(index, Types.LabelMatcher.getDefaultInstance()); + } + + /** repeated .prometheus.LabelMatcher matchers = 3; */ + public java.util.List getMatchersBuilderList() { + return getMatchersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.LabelMatcher, + Types.LabelMatcher.Builder, + Types.LabelMatcherOrBuilder> + getMatchersFieldBuilder() { + if (matchersBuilder_ == null) { + matchersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.LabelMatcher, + Types.LabelMatcher.Builder, + Types.LabelMatcherOrBuilder>( + matchers_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + matchers_ = null; + } + return matchersBuilder_; + } + + private Types.ReadHints hints_; + private com.google.protobuf.SingleFieldBuilderV3< + Types.ReadHints, Types.ReadHints.Builder, Types.ReadHintsOrBuilder> + hintsBuilder_; + + /** + * .prometheus.ReadHints hints = 4; + * + * @return Whether the hints field is set. + */ + public boolean hasHints() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * .prometheus.ReadHints hints = 4; + * + * @return The hints. + */ + public Types.ReadHints getHints() { + if (hintsBuilder_ == null) { + return hints_ == null ? Types.ReadHints.getDefaultInstance() : hints_; + } else { + return hintsBuilder_.getMessage(); + } + } + + /** .prometheus.ReadHints hints = 4; */ + public Builder setHints(Types.ReadHints value) { + if (hintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hints_ = value; + } else { + hintsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .prometheus.ReadHints hints = 4; */ + public Builder setHints(Types.ReadHints.Builder builderForValue) { + if (hintsBuilder_ == null) { + hints_ = builderForValue.build(); + } else { + hintsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** .prometheus.ReadHints hints = 4; */ + public Builder mergeHints(Types.ReadHints value) { + if (hintsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && hints_ != null + && hints_ != Types.ReadHints.getDefaultInstance()) { + getHintsBuilder().mergeFrom(value); + } else { + hints_ = value; + } + } else { + hintsBuilder_.mergeFrom(value); + } + if (hints_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** .prometheus.ReadHints hints = 4; */ + public Builder clearHints() { + bitField0_ = (bitField0_ & ~0x00000008); + hints_ = null; + if (hintsBuilder_ != null) { + hintsBuilder_.dispose(); + hintsBuilder_ = null; + } + onChanged(); + return this; + } + + /** .prometheus.ReadHints hints = 4; */ + public Types.ReadHints.Builder getHintsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getHintsFieldBuilder().getBuilder(); + } + + /** .prometheus.ReadHints hints = 4; */ + public Types.ReadHintsOrBuilder getHintsOrBuilder() { + if (hintsBuilder_ != null) { + return hintsBuilder_.getMessageOrBuilder(); + } else { + return hints_ == null ? Types.ReadHints.getDefaultInstance() : hints_; + } + } + + /** .prometheus.ReadHints hints = 4; */ + private com.google.protobuf.SingleFieldBuilderV3< + Types.ReadHints, Types.ReadHints.Builder, Types.ReadHintsOrBuilder> + getHintsFieldBuilder() { + if (hintsBuilder_ == null) { + hintsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + Types.ReadHints, + Types.ReadHints.Builder, + Types.ReadHintsOrBuilder>( + getHints(), getParentForChildren(), isClean()); + hints_ = null; + } + return hintsBuilder_; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.Query) + } + + // @@protoc_insertion_point(class_scope:prometheus.Query) + private static final Remote.Query DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Remote.Query(); + } + + public static Remote.Query getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public Query parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Remote.Query getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface QueryResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.QueryResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + java.util.List getTimeseriesList(); + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + Types.TimeSeries getTimeseries(int index); + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + int getTimeseriesCount(); + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + java.util.List getTimeseriesOrBuilderList(); + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + Types.TimeSeriesOrBuilder getTimeseriesOrBuilder(int index); + } + + /** Protobuf type {@code prometheus.QueryResult} */ + public static final class QueryResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.QueryResult) + QueryResultOrBuilder { + private static final long serialVersionUID = 0L; + + // Use QueryResult.newBuilder() to construct. + private QueryResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryResult() { + timeseries_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new QueryResult(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_QueryResult_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_QueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.QueryResult.class, Remote.QueryResult.Builder.class); + } + + public static final int TIMESERIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List timeseries_; + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + @Override + public java.util.List getTimeseriesList() { + return timeseries_; + } + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + @Override + public java.util.List getTimeseriesOrBuilderList() { + return timeseries_; + } + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + @Override + public int getTimeseriesCount() { + return timeseries_.size(); + } + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + @Override + public Types.TimeSeries getTimeseries(int index) { + return timeseries_.get(index); + } + + /** + * + * + *
+         * Samples within a time series must be ordered by time.
+         * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + @Override + public Types.TimeSeriesOrBuilder getTimeseriesOrBuilder(int index) { + return timeseries_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < timeseries_.size(); i++) { + output.writeMessage(1, timeseries_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + for (int i = 0; i < timeseries_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, timeseries_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Remote.QueryResult)) { + return super.equals(obj); + } + Remote.QueryResult other = (Remote.QueryResult) obj; + + if (!getTimeseriesList().equals(other.getTimeseriesList())) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTimeseriesCount() > 0) { + hash = (37 * hash) + TIMESERIES_FIELD_NUMBER; + hash = (53 * hash) + getTimeseriesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Remote.QueryResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.QueryResult parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.QueryResult parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.QueryResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.QueryResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.QueryResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.QueryResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.QueryResult 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 Remote.QueryResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Remote.QueryResult 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 Remote.QueryResult parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.QueryResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Remote.QueryResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code prometheus.QueryResult} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.QueryResult) + Remote.QueryResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_QueryResult_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_QueryResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.QueryResult.class, Remote.QueryResult.Builder.class); + } + + // Construct using Remote.QueryResult.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (timeseriesBuilder_ == null) { + timeseries_ = java.util.Collections.emptyList(); + } else { + timeseries_ = null; + timeseriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Remote.internal_static_prometheus_QueryResult_descriptor; + } + + @Override + public Remote.QueryResult getDefaultInstanceForType() { + return Remote.QueryResult.getDefaultInstance(); + } + + @Override + public Remote.QueryResult build() { + Remote.QueryResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Remote.QueryResult buildPartial() { + Remote.QueryResult result = new Remote.QueryResult(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Remote.QueryResult result) { + if (timeseriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + timeseries_ = java.util.Collections.unmodifiableList(timeseries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.timeseries_ = timeseries_; + } else { + result.timeseries_ = timeseriesBuilder_.build(); + } + } + + private void buildPartial0(Remote.QueryResult result) { + int from_bitField0_ = bitField0_; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Remote.QueryResult) { + return mergeFrom((Remote.QueryResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Remote.QueryResult other) { + if (other == Remote.QueryResult.getDefaultInstance()) { + return this; + } + if (timeseriesBuilder_ == null) { + if (!other.timeseries_.isEmpty()) { + if (timeseries_.isEmpty()) { + timeseries_ = other.timeseries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTimeseriesIsMutable(); + timeseries_.addAll(other.timeseries_); + } + onChanged(); + } + } else { + if (!other.timeseries_.isEmpty()) { + if (timeseriesBuilder_.isEmpty()) { + timeseriesBuilder_.dispose(); + timeseriesBuilder_ = null; + timeseries_ = other.timeseries_; + bitField0_ = (bitField0_ & ~0x00000001); + timeseriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTimeseriesFieldBuilder() + : null; + } else { + timeseriesBuilder_.addAllMessages(other.timeseries_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + Types.TimeSeries m = + input.readMessage( + Types.TimeSeries.parser(), extensionRegistry); + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.add(m); + } else { + timeseriesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List timeseries_ = + java.util.Collections.emptyList(); + + private void ensureTimeseriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + timeseries_ = new java.util.ArrayList(timeseries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.TimeSeries, Types.TimeSeries.Builder, Types.TimeSeriesOrBuilder> + timeseriesBuilder_; + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public java.util.List getTimeseriesList() { + if (timeseriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(timeseries_); + } else { + return timeseriesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public int getTimeseriesCount() { + if (timeseriesBuilder_ == null) { + return timeseries_.size(); + } else { + return timeseriesBuilder_.getCount(); + } + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Types.TimeSeries getTimeseries(int index) { + if (timeseriesBuilder_ == null) { + return timeseries_.get(index); + } else { + return timeseriesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Builder setTimeseries(int index, Types.TimeSeries value) { + if (timeseriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeseriesIsMutable(); + timeseries_.set(index, value); + onChanged(); + } else { + timeseriesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Builder setTimeseries(int index, Types.TimeSeries.Builder builderForValue) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.set(index, builderForValue.build()); + onChanged(); + } else { + timeseriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Builder addTimeseries(Types.TimeSeries value) { + if (timeseriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeseriesIsMutable(); + timeseries_.add(value); + onChanged(); + } else { + timeseriesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Builder addTimeseries(int index, Types.TimeSeries value) { + if (timeseriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeseriesIsMutable(); + timeseries_.add(index, value); + onChanged(); + } else { + timeseriesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Builder addTimeseries(Types.TimeSeries.Builder builderForValue) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.add(builderForValue.build()); + onChanged(); + } else { + timeseriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Builder addTimeseries(int index, Types.TimeSeries.Builder builderForValue) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.add(index, builderForValue.build()); + onChanged(); + } else { + timeseriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Builder addAllTimeseries(Iterable values) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, timeseries_); + onChanged(); + } else { + timeseriesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Builder clearTimeseries() { + if (timeseriesBuilder_ == null) { + timeseries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + timeseriesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Builder removeTimeseries(int index) { + if (timeseriesBuilder_ == null) { + ensureTimeseriesIsMutable(); + timeseries_.remove(index); + onChanged(); + } else { + timeseriesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Types.TimeSeries.Builder getTimeseriesBuilder(int index) { + return getTimeseriesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Types.TimeSeriesOrBuilder getTimeseriesOrBuilder(int index) { + if (timeseriesBuilder_ == null) { + return timeseries_.get(index); + } else { + return timeseriesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public java.util.List + getTimeseriesOrBuilderList() { + if (timeseriesBuilder_ != null) { + return timeseriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(timeseries_); + } + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Types.TimeSeries.Builder addTimeseriesBuilder() { + return getTimeseriesFieldBuilder() + .addBuilder(Types.TimeSeries.getDefaultInstance()); + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public Types.TimeSeries.Builder addTimeseriesBuilder(int index) { + return getTimeseriesFieldBuilder() + .addBuilder(index, Types.TimeSeries.getDefaultInstance()); + } + + /** + * + * + *
+             * Samples within a time series must be ordered by time.
+             * 
+ * + * repeated .prometheus.TimeSeries timeseries = 1; + */ + public java.util.List getTimeseriesBuilderList() { + return getTimeseriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.TimeSeries, Types.TimeSeries.Builder, Types.TimeSeriesOrBuilder> + getTimeseriesFieldBuilder() { + if (timeseriesBuilder_ == null) { + timeseriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.TimeSeries, + Types.TimeSeries.Builder, + Types.TimeSeriesOrBuilder>( + timeseries_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + timeseries_ = null; + } + return timeseriesBuilder_; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.QueryResult) + } + + // @@protoc_insertion_point(class_scope:prometheus.QueryResult) + private static final Remote.QueryResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Remote.QueryResult(); + } + + public static Remote.QueryResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public QueryResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Remote.QueryResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ChunkedReadResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.ChunkedReadResponse) + com.google.protobuf.MessageOrBuilder { + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + java.util.List getChunkedSeriesList(); + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + Types.ChunkedSeries getChunkedSeries(int index); + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + int getChunkedSeriesCount(); + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + java.util.List getChunkedSeriesOrBuilderList(); + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + Types.ChunkedSeriesOrBuilder getChunkedSeriesOrBuilder(int index); + + /** + * + * + *
+         * query_index represents an index of the query from ReadRequest.queries these chunks relates to.
+         * 
+ * + * int64 query_index = 2; + * + * @return The queryIndex. + */ + long getQueryIndex(); + } + + /** + * + * + *
+     * ChunkedReadResponse is a response when response_type equals STREAMED_XOR_CHUNKS.
+     * We strictly stream full series after series, optionally split by time. This means that a single frame can contain
+     * partition of the single series, but once a new series is started to be streamed it means that no more chunks will
+     * be sent for previous one. Series are returned sorted in the same way TSDB block are internally.
+     * 
+ * + *

Protobuf type {@code prometheus.ChunkedReadResponse} + */ + public static final class ChunkedReadResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.ChunkedReadResponse) + ChunkedReadResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ChunkedReadResponse.newBuilder() to construct. + private ChunkedReadResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ChunkedReadResponse() { + chunkedSeries_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new ChunkedReadResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_ChunkedReadResponse_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_ChunkedReadResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.ChunkedReadResponse.class, + Remote.ChunkedReadResponse.Builder.class); + } + + public static final int CHUNKED_SERIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List chunkedSeries_; + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + @Override + public java.util.List getChunkedSeriesList() { + return chunkedSeries_; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + @Override + public java.util.List + getChunkedSeriesOrBuilderList() { + return chunkedSeries_; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + @Override + public int getChunkedSeriesCount() { + return chunkedSeries_.size(); + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + @Override + public Types.ChunkedSeries getChunkedSeries(int index) { + return chunkedSeries_.get(index); + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + @Override + public Types.ChunkedSeriesOrBuilder getChunkedSeriesOrBuilder(int index) { + return chunkedSeries_.get(index); + } + + public static final int QUERY_INDEX_FIELD_NUMBER = 2; + private long queryIndex_ = 0L; + + /** + * + * + *

+         * query_index represents an index of the query from ReadRequest.queries these chunks relates to.
+         * 
+ * + * int64 query_index = 2; + * + * @return The queryIndex. + */ + @Override + public long getQueryIndex() { + return queryIndex_; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < chunkedSeries_.size(); i++) { + output.writeMessage(1, chunkedSeries_.get(i)); + } + if (queryIndex_ != 0L) { + output.writeInt64(2, queryIndex_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + for (int i = 0; i < chunkedSeries_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, chunkedSeries_.get(i)); + } + if (queryIndex_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, queryIndex_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Remote.ChunkedReadResponse)) { + return super.equals(obj); + } + Remote.ChunkedReadResponse other = (Remote.ChunkedReadResponse) obj; + + if (!getChunkedSeriesList().equals(other.getChunkedSeriesList())) { + return false; + } + if (getQueryIndex() != other.getQueryIndex()) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getChunkedSeriesCount() > 0) { + hash = (37 * hash) + CHUNKED_SERIES_FIELD_NUMBER; + hash = (53 * hash) + getChunkedSeriesList().hashCode(); + } + hash = (37 * hash) + QUERY_INDEX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getQueryIndex()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Remote.ChunkedReadResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.ChunkedReadResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.ChunkedReadResponse parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.ChunkedReadResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.ChunkedReadResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Remote.ChunkedReadResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Remote.ChunkedReadResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.ChunkedReadResponse 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 Remote.ChunkedReadResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Remote.ChunkedReadResponse 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 Remote.ChunkedReadResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Remote.ChunkedReadResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Remote.ChunkedReadResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * ChunkedReadResponse is a response when response_type equals STREAMED_XOR_CHUNKS.
+         * We strictly stream full series after series, optionally split by time. This means that a single frame can contain
+         * partition of the single series, but once a new series is started to be streamed it means that no more chunks will
+         * be sent for previous one. Series are returned sorted in the same way TSDB block are internally.
+         * 
+ * + *

Protobuf type {@code prometheus.ChunkedReadResponse} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.ChunkedReadResponse) + Remote.ChunkedReadResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Remote.internal_static_prometheus_ChunkedReadResponse_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Remote.internal_static_prometheus_ChunkedReadResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Remote.ChunkedReadResponse.class, + Remote.ChunkedReadResponse.Builder.class); + } + + // Construct using Remote.ChunkedReadResponse.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (chunkedSeriesBuilder_ == null) { + chunkedSeries_ = java.util.Collections.emptyList(); + } else { + chunkedSeries_ = null; + chunkedSeriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + queryIndex_ = 0L; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Remote.internal_static_prometheus_ChunkedReadResponse_descriptor; + } + + @Override + public Remote.ChunkedReadResponse getDefaultInstanceForType() { + return Remote.ChunkedReadResponse.getDefaultInstance(); + } + + @Override + public Remote.ChunkedReadResponse build() { + Remote.ChunkedReadResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Remote.ChunkedReadResponse buildPartial() { + Remote.ChunkedReadResponse result = new Remote.ChunkedReadResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Remote.ChunkedReadResponse result) { + if (chunkedSeriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + chunkedSeries_ = java.util.Collections.unmodifiableList(chunkedSeries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.chunkedSeries_ = chunkedSeries_; + } else { + result.chunkedSeries_ = chunkedSeriesBuilder_.build(); + } + } + + private void buildPartial0(Remote.ChunkedReadResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.queryIndex_ = queryIndex_; + } + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Remote.ChunkedReadResponse) { + return mergeFrom((Remote.ChunkedReadResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Remote.ChunkedReadResponse other) { + if (other == Remote.ChunkedReadResponse.getDefaultInstance()) { + return this; + } + if (chunkedSeriesBuilder_ == null) { + if (!other.chunkedSeries_.isEmpty()) { + if (chunkedSeries_.isEmpty()) { + chunkedSeries_ = other.chunkedSeries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureChunkedSeriesIsMutable(); + chunkedSeries_.addAll(other.chunkedSeries_); + } + onChanged(); + } + } else { + if (!other.chunkedSeries_.isEmpty()) { + if (chunkedSeriesBuilder_.isEmpty()) { + chunkedSeriesBuilder_.dispose(); + chunkedSeriesBuilder_ = null; + chunkedSeries_ = other.chunkedSeries_; + bitField0_ = (bitField0_ & ~0x00000001); + chunkedSeriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getChunkedSeriesFieldBuilder() + : null; + } else { + chunkedSeriesBuilder_.addAllMessages(other.chunkedSeries_); + } + } + } + if (other.getQueryIndex() != 0L) { + setQueryIndex(other.getQueryIndex()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + Types.ChunkedSeries m = + input.readMessage( + Types.ChunkedSeries.parser(), + extensionRegistry); + if (chunkedSeriesBuilder_ == null) { + ensureChunkedSeriesIsMutable(); + chunkedSeries_.add(m); + } else { + chunkedSeriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + queryIndex_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List chunkedSeries_ = + java.util.Collections.emptyList(); + + private void ensureChunkedSeriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + chunkedSeries_ = new java.util.ArrayList(chunkedSeries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.ChunkedSeries, + Types.ChunkedSeries.Builder, + Types.ChunkedSeriesOrBuilder> + chunkedSeriesBuilder_; + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public java.util.List getChunkedSeriesList() { + if (chunkedSeriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(chunkedSeries_); + } else { + return chunkedSeriesBuilder_.getMessageList(); + } + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public int getChunkedSeriesCount() { + if (chunkedSeriesBuilder_ == null) { + return chunkedSeries_.size(); + } else { + return chunkedSeriesBuilder_.getCount(); + } + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Types.ChunkedSeries getChunkedSeries(int index) { + if (chunkedSeriesBuilder_ == null) { + return chunkedSeries_.get(index); + } else { + return chunkedSeriesBuilder_.getMessage(index); + } + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Builder setChunkedSeries(int index, Types.ChunkedSeries value) { + if (chunkedSeriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunkedSeriesIsMutable(); + chunkedSeries_.set(index, value); + onChanged(); + } else { + chunkedSeriesBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Builder setChunkedSeries( + int index, Types.ChunkedSeries.Builder builderForValue) { + if (chunkedSeriesBuilder_ == null) { + ensureChunkedSeriesIsMutable(); + chunkedSeries_.set(index, builderForValue.build()); + onChanged(); + } else { + chunkedSeriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Builder addChunkedSeries(Types.ChunkedSeries value) { + if (chunkedSeriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunkedSeriesIsMutable(); + chunkedSeries_.add(value); + onChanged(); + } else { + chunkedSeriesBuilder_.addMessage(value); + } + return this; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Builder addChunkedSeries(int index, Types.ChunkedSeries value) { + if (chunkedSeriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChunkedSeriesIsMutable(); + chunkedSeries_.add(index, value); + onChanged(); + } else { + chunkedSeriesBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Builder addChunkedSeries(Types.ChunkedSeries.Builder builderForValue) { + if (chunkedSeriesBuilder_ == null) { + ensureChunkedSeriesIsMutable(); + chunkedSeries_.add(builderForValue.build()); + onChanged(); + } else { + chunkedSeriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Builder addChunkedSeries( + int index, Types.ChunkedSeries.Builder builderForValue) { + if (chunkedSeriesBuilder_ == null) { + ensureChunkedSeriesIsMutable(); + chunkedSeries_.add(index, builderForValue.build()); + onChanged(); + } else { + chunkedSeriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Builder addAllChunkedSeries(Iterable values) { + if (chunkedSeriesBuilder_ == null) { + ensureChunkedSeriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, chunkedSeries_); + onChanged(); + } else { + chunkedSeriesBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Builder clearChunkedSeries() { + if (chunkedSeriesBuilder_ == null) { + chunkedSeries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + chunkedSeriesBuilder_.clear(); + } + return this; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Builder removeChunkedSeries(int index) { + if (chunkedSeriesBuilder_ == null) { + ensureChunkedSeriesIsMutable(); + chunkedSeries_.remove(index); + onChanged(); + } else { + chunkedSeriesBuilder_.remove(index); + } + return this; + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Types.ChunkedSeries.Builder getChunkedSeriesBuilder(int index) { + return getChunkedSeriesFieldBuilder().getBuilder(index); + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Types.ChunkedSeriesOrBuilder getChunkedSeriesOrBuilder(int index) { + if (chunkedSeriesBuilder_ == null) { + return chunkedSeries_.get(index); + } else { + return chunkedSeriesBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public java.util.List + getChunkedSeriesOrBuilderList() { + if (chunkedSeriesBuilder_ != null) { + return chunkedSeriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(chunkedSeries_); + } + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Types.ChunkedSeries.Builder addChunkedSeriesBuilder() { + return getChunkedSeriesFieldBuilder() + .addBuilder(Types.ChunkedSeries.getDefaultInstance()); + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public Types.ChunkedSeries.Builder addChunkedSeriesBuilder(int index) { + return getChunkedSeriesFieldBuilder() + .addBuilder(index, Types.ChunkedSeries.getDefaultInstance()); + } + + /** repeated .prometheus.ChunkedSeries chunked_series = 1; */ + public java.util.List getChunkedSeriesBuilderList() { + return getChunkedSeriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.ChunkedSeries, + Types.ChunkedSeries.Builder, + Types.ChunkedSeriesOrBuilder> + getChunkedSeriesFieldBuilder() { + if (chunkedSeriesBuilder_ == null) { + chunkedSeriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.ChunkedSeries, + Types.ChunkedSeries.Builder, + Types.ChunkedSeriesOrBuilder>( + chunkedSeries_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + chunkedSeries_ = null; + } + return chunkedSeriesBuilder_; + } + + private long queryIndex_; + + /** + * + * + *

+             * query_index represents an index of the query from ReadRequest.queries these chunks relates to.
+             * 
+ * + * int64 query_index = 2; + * + * @return The queryIndex. + */ + @Override + public long getQueryIndex() { + return queryIndex_; + } + + /** + * + * + *
+             * query_index represents an index of the query from ReadRequest.queries these chunks relates to.
+             * 
+ * + * int64 query_index = 2; + * + * @param value The queryIndex to set. + * @return This builder for chaining. + */ + public Builder setQueryIndex(long value) { + + queryIndex_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+             * query_index represents an index of the query from ReadRequest.queries these chunks relates to.
+             * 
+ * + * int64 query_index = 2; + * + * @return This builder for chaining. + */ + public Builder clearQueryIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + queryIndex_ = 0L; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.ChunkedReadResponse) + } + + // @@protoc_insertion_point(class_scope:prometheus.ChunkedReadResponse) + private static final Remote.ChunkedReadResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Remote.ChunkedReadResponse(); + } + + public static Remote.ChunkedReadResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public ChunkedReadResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Remote.ChunkedReadResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_prometheus_WriteRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_prometheus_WriteRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_prometheus_ReadRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_prometheus_ReadRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_prometheus_ReadResponse_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_prometheus_ReadResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_prometheus_Query_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_prometheus_Query_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_prometheus_QueryResult_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_prometheus_QueryResult_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_prometheus_ChunkedReadResponse_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_prometheus_ChunkedReadResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + String[] descriptorData = { + "\n\014remote.proto\022\nprometheus\032\013types.proto\032" + + "\ngogo.proto\"z\n\014WriteRequest\0220\n\ntimeserie" + + "s\030\001 \003(\0132\026.prometheus.TimeSeriesB\004\310\336\037\000\0222\n" + + "\010metadata\030\003 \003(\0132\032.prometheus.MetricMetad" + + "ataB\004\310\336\037\000J\004\010\002\020\003\"\256\001\n\013ReadRequest\022\"\n\007queri" + + "es\030\001 \003(\0132\021.prometheus.Query\022E\n\027accepted_" + + "response_types\030\002 \003(\0162$.prometheus.ReadRe" + + "quest.ResponseType\"4\n\014ResponseType\022\013\n\007SA" + + "MPLES\020\000\022\027\n\023STREAMED_XOR_CHUNKS\020\001\"8\n\014Read" + + "Response\022(\n\007results\030\001 \003(\0132\027.prometheus.Q" + + "ueryResult\"\217\001\n\005Query\022\032\n\022start_timestamp_" + + "ms\030\001 \001(\003\022\030\n\020end_timestamp_ms\030\002 \001(\003\022*\n\010ma" + + "tchers\030\003 \003(\0132\030.prometheus.LabelMatcher\022$" + + "\n\005hints\030\004 \001(\0132\025.prometheus.ReadHints\"9\n\013" + + "QueryResult\022*\n\ntimeseries\030\001 \003(\0132\026.promet" + + "heus.TimeSeries\"]\n\023ChunkedReadResponse\0221" + + "\n\016chunked_series\030\001 \003(\0132\031.prometheus.Chun" + + "kedSeries\022\023\n\013query_index\030\002 \001(\003B\010Z\006prompb" + + "b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + Types.getDescriptor(), GoGoProtos.getDescriptor(), + }); + internal_static_prometheus_WriteRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_prometheus_WriteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_prometheus_WriteRequest_descriptor, + new String[] { + "Timeseries", "Metadata", + }); + internal_static_prometheus_ReadRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_prometheus_ReadRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_prometheus_ReadRequest_descriptor, + new String[] { + "Queries", "AcceptedResponseTypes", + }); + internal_static_prometheus_ReadResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_prometheus_ReadResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_prometheus_ReadResponse_descriptor, + new String[] { + "Results", + }); + internal_static_prometheus_Query_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_prometheus_Query_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_prometheus_Query_descriptor, + new String[] { + "StartTimestampMs", "EndTimestampMs", "Matchers", "Hints", + }); + internal_static_prometheus_QueryResult_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_prometheus_QueryResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_prometheus_QueryResult_descriptor, + new String[] { + "Timeseries", + }); + internal_static_prometheus_ChunkedReadResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_prometheus_ChunkedReadResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_prometheus_ChunkedReadResponse_descriptor, + new String[] { + "ChunkedSeries", "QueryIndex", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(GoGoProtos.nullable); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + Types.getDescriptor(); + GoGoProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/proto/Types.java b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/proto/Types.java new file mode 100644 index 00000000000..0dc5e20d3c4 --- /dev/null +++ b/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/sink/proto/Types.java @@ -0,0 +1,17105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.seatunnel.connectors.seatunnel.prometheus.sink.proto; + +public final class Types { + private Types() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public interface MetricMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.MetricMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Represents the metric type, these match the set from Prometheus.
+         * Refer to github.com/prometheus/common/model/metadata.go for details.
+         * 
+ * + * .prometheus.MetricMetadata.MetricType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+         * Represents the metric type, these match the set from Prometheus.
+         * Refer to github.com/prometheus/common/model/metadata.go for details.
+         * 
+ * + * .prometheus.MetricMetadata.MetricType type = 1; + * + * @return The type. + */ + Types.MetricMetadata.MetricType getType(); + + /** + * string metric_family_name = 2; + * + * @return The metricFamilyName. + */ + String getMetricFamilyName(); + + /** + * string metric_family_name = 2; + * + * @return The bytes for metricFamilyName. + */ + com.google.protobuf.ByteString getMetricFamilyNameBytes(); + + /** + * string help = 4; + * + * @return The help. + */ + String getHelp(); + + /** + * string help = 4; + * + * @return The bytes for help. + */ + com.google.protobuf.ByteString getHelpBytes(); + + /** + * string unit = 5; + * + * @return The unit. + */ + String getUnit(); + + /** + * string unit = 5; + * + * @return The bytes for unit. + */ + com.google.protobuf.ByteString getUnitBytes(); + } + + /** Protobuf type {@code prometheus.MetricMetadata} */ + public static final class MetricMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.MetricMetadata) + MetricMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use MetricMetadata.newBuilder() to construct. + private MetricMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MetricMetadata() { + type_ = 0; + metricFamilyName_ = ""; + help_ = ""; + unit_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new MetricMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_MetricMetadata_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_MetricMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.MetricMetadata.class, Types.MetricMetadata.Builder.class); + } + + /** Protobuf enum {@code prometheus.MetricMetadata.MetricType} */ + public enum MetricType implements com.google.protobuf.ProtocolMessageEnum { + /** UNKNOWN = 0; */ + UNKNOWN(0), + /** COUNTER = 1; */ + COUNTER(1), + /** GAUGE = 2; */ + GAUGE(2), + /** HISTOGRAM = 3; */ + HISTOGRAM(3), + /** GAUGEHISTOGRAM = 4; */ + GAUGEHISTOGRAM(4), + /** SUMMARY = 5; */ + SUMMARY(5), + /** INFO = 6; */ + INFO(6), + /** STATESET = 7; */ + STATESET(7), + UNRECOGNIZED(-1), + ; + + /** UNKNOWN = 0; */ + public static final int UNKNOWN_VALUE = 0; + /** COUNTER = 1; */ + public static final int COUNTER_VALUE = 1; + /** GAUGE = 2; */ + public static final int GAUGE_VALUE = 2; + /** HISTOGRAM = 3; */ + public static final int HISTOGRAM_VALUE = 3; + /** GAUGEHISTOGRAM = 4; */ + public static final int GAUGEHISTOGRAM_VALUE = 4; + /** SUMMARY = 5; */ + public static final int SUMMARY_VALUE = 5; + /** INFO = 6; */ + public static final int INFO_VALUE = 6; + /** STATESET = 7; */ + public static final int STATESET_VALUE = 7; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static MetricType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static MetricType forNumber(int value) { + switch (value) { + case 0: + return UNKNOWN; + case 1: + return COUNTER; + case 2: + return GAUGE; + case 3: + return HISTOGRAM; + case 4: + return GAUGEHISTOGRAM; + case 5: + return SUMMARY; + case 6: + return INFO; + case 7: + return STATESET; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MetricType findValueByNumber(int number) { + return MetricType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return Types.MetricMetadata.getDescriptor().getEnumTypes().get(0); + } + + private static final MetricType[] VALUES = values(); + + public static MetricType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private MetricType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:prometheus.MetricMetadata.MetricType) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * + * + *
+         * Represents the metric type, these match the set from Prometheus.
+         * Refer to github.com/prometheus/common/model/metadata.go for details.
+         * 
+ * + * .prometheus.MetricMetadata.MetricType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+         * Represents the metric type, these match the set from Prometheus.
+         * Refer to github.com/prometheus/common/model/metadata.go for details.
+         * 
+ * + * .prometheus.MetricMetadata.MetricType type = 1; + * + * @return The type. + */ + @Override + public Types.MetricMetadata.MetricType getType() { + Types.MetricMetadata.MetricType result = + Types.MetricMetadata.MetricType.forNumber(type_); + return result == null ? Types.MetricMetadata.MetricType.UNRECOGNIZED : result; + } + + public static final int METRIC_FAMILY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile Object metricFamilyName_ = ""; + + /** + * string metric_family_name = 2; + * + * @return The metricFamilyName. + */ + @Override + public String getMetricFamilyName() { + Object ref = metricFamilyName_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + metricFamilyName_ = s; + return s; + } + } + + /** + * string metric_family_name = 2; + * + * @return The bytes for metricFamilyName. + */ + @Override + public com.google.protobuf.ByteString getMetricFamilyNameBytes() { + Object ref = metricFamilyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + metricFamilyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HELP_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile Object help_ = ""; + + /** + * string help = 4; + * + * @return The help. + */ + @Override + public String getHelp() { + Object ref = help_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + help_ = s; + return s; + } + } + + /** + * string help = 4; + * + * @return The bytes for help. + */ + @Override + public com.google.protobuf.ByteString getHelpBytes() { + Object ref = help_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + help_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNIT_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile Object unit_ = ""; + + /** + * string unit = 5; + * + * @return The unit. + */ + @Override + public String getUnit() { + Object ref = unit_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + unit_ = s; + return s; + } + } + + /** + * string unit = 5; + * + * @return The bytes for unit. + */ + @Override + public com.google.protobuf.ByteString getUnitBytes() { + Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != Types.MetricMetadata.MetricType.UNKNOWN.getNumber()) { + output.writeEnum(1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricFamilyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, metricFamilyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(help_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, help_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, unit_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (type_ != Types.MetricMetadata.MetricType.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricFamilyName_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 2, metricFamilyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(help_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, help_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, unit_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Types.MetricMetadata)) { + return super.equals(obj); + } + Types.MetricMetadata other = (Types.MetricMetadata) obj; + + if (type_ != other.type_) { + return false; + } + if (!getMetricFamilyName().equals(other.getMetricFamilyName())) { + return false; + } + if (!getHelp().equals(other.getHelp())) { + return false; + } + if (!getUnit().equals(other.getUnit())) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + METRIC_FAMILY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMetricFamilyName().hashCode(); + hash = (37 * hash) + HELP_FIELD_NUMBER; + hash = (53 * hash) + getHelp().hashCode(); + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Types.MetricMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.MetricMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.MetricMetadata parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.MetricMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.MetricMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.MetricMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.MetricMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.MetricMetadata 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 Types.MetricMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Types.MetricMetadata 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 Types.MetricMetadata parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.MetricMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Types.MetricMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code prometheus.MetricMetadata} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.MetricMetadata) + Types.MetricMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_MetricMetadata_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_MetricMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.MetricMetadata.class, Types.MetricMetadata.Builder.class); + } + + // Construct using Types.MetricMetadata.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + metricFamilyName_ = ""; + help_ = ""; + unit_ = ""; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Types.internal_static_prometheus_MetricMetadata_descriptor; + } + + @Override + public Types.MetricMetadata getDefaultInstanceForType() { + return Types.MetricMetadata.getDefaultInstance(); + } + + @Override + public Types.MetricMetadata build() { + Types.MetricMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Types.MetricMetadata buildPartial() { + Types.MetricMetadata result = new Types.MetricMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(Types.MetricMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metricFamilyName_ = metricFamilyName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.help_ = help_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.unit_ = unit_; + } + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Types.MetricMetadata) { + return mergeFrom((Types.MetricMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Types.MetricMetadata other) { + if (other == Types.MetricMetadata.getDefaultInstance()) { + return this; + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getMetricFamilyName().isEmpty()) { + metricFamilyName_ = other.metricFamilyName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getHelp().isEmpty()) { + help_ = other.help_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getUnit().isEmpty()) { + unit_ = other.unit_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + metricFamilyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + help_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + unit_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int type_ = 0; + + /** + * + * + *
+             * Represents the metric type, these match the set from Prometheus.
+             * Refer to github.com/prometheus/common/model/metadata.go for details.
+             * 
+ * + * .prometheus.MetricMetadata.MetricType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+             * Represents the metric type, these match the set from Prometheus.
+             * Refer to github.com/prometheus/common/model/metadata.go for details.
+             * 
+ * + * .prometheus.MetricMetadata.MetricType type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+             * Represents the metric type, these match the set from Prometheus.
+             * Refer to github.com/prometheus/common/model/metadata.go for details.
+             * 
+ * + * .prometheus.MetricMetadata.MetricType type = 1; + * + * @return The type. + */ + @Override + public Types.MetricMetadata.MetricType getType() { + Types.MetricMetadata.MetricType result = + Types.MetricMetadata.MetricType.forNumber(type_); + return result == null ? Types.MetricMetadata.MetricType.UNRECOGNIZED : result; + } + + /** + * + * + *
+             * Represents the metric type, these match the set from Prometheus.
+             * Refer to github.com/prometheus/common/model/metadata.go for details.
+             * 
+ * + * .prometheus.MetricMetadata.MetricType type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(Types.MetricMetadata.MetricType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+             * Represents the metric type, these match the set from Prometheus.
+             * Refer to github.com/prometheus/common/model/metadata.go for details.
+             * 
+ * + * .prometheus.MetricMetadata.MetricType type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private Object metricFamilyName_ = ""; + + /** + * string metric_family_name = 2; + * + * @return The metricFamilyName. + */ + public String getMetricFamilyName() { + Object ref = metricFamilyName_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + metricFamilyName_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string metric_family_name = 2; + * + * @return The bytes for metricFamilyName. + */ + public com.google.protobuf.ByteString getMetricFamilyNameBytes() { + Object ref = metricFamilyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + metricFamilyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string metric_family_name = 2; + * + * @param value The metricFamilyName to set. + * @return This builder for chaining. + */ + public Builder setMetricFamilyName(String value) { + if (value == null) { + throw new NullPointerException(); + } + metricFamilyName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string metric_family_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearMetricFamilyName() { + metricFamilyName_ = getDefaultInstance().getMetricFamilyName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string metric_family_name = 2; + * + * @param value The bytes for metricFamilyName to set. + * @return This builder for chaining. + */ + public Builder setMetricFamilyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metricFamilyName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private Object help_ = ""; + + /** + * string help = 4; + * + * @return The help. + */ + public String getHelp() { + Object ref = help_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + help_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string help = 4; + * + * @return The bytes for help. + */ + public com.google.protobuf.ByteString getHelpBytes() { + Object ref = help_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + help_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string help = 4; + * + * @param value The help to set. + * @return This builder for chaining. + */ + public Builder setHelp(String value) { + if (value == null) { + throw new NullPointerException(); + } + help_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * string help = 4; + * + * @return This builder for chaining. + */ + public Builder clearHelp() { + help_ = getDefaultInstance().getHelp(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * string help = 4; + * + * @param value The bytes for help to set. + * @return This builder for chaining. + */ + public Builder setHelpBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + help_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private Object unit_ = ""; + + /** + * string unit = 5; + * + * @return The unit. + */ + public String getUnit() { + Object ref = unit_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + unit_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string unit = 5; + * + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString getUnitBytes() { + Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string unit = 5; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit(String value) { + if (value == null) { + throw new NullPointerException(); + } + unit_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * string unit = 5; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + unit_ = getDefaultInstance().getUnit(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * string unit = 5; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + unit_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.MetricMetadata) + } + + // @@protoc_insertion_point(class_scope:prometheus.MetricMetadata) + private static final Types.MetricMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Types.MetricMetadata(); + } + + public static Types.MetricMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public MetricMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Types.MetricMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface SampleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.Sample) + com.google.protobuf.MessageOrBuilder { + + /** + * double value = 1; + * + * @return The value. + */ + double getValue(); + + /** + * + * + *
+         * timestamp is in ms format, see model/timestamp/timestamp.go for
+         * conversion from time.Time to Prometheus timestamp.
+         * 
+ * + * int64 timestamp = 2; + * + * @return The timestamp. + */ + long getTimestamp(); + } + + /** Protobuf type {@code prometheus.Sample} */ + public static final class Sample extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.Sample) + SampleOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Sample.newBuilder() to construct. + private Sample(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Sample() {} + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new Sample(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_Sample_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_Sample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.Sample.class, Types.Sample.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private double value_ = 0D; + + /** + * double value = 1; + * + * @return The value. + */ + @Override + public double getValue() { + return value_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private long timestamp_ = 0L; + + /** + * + * + *
+         * timestamp is in ms format, see model/timestamp/timestamp.go for
+         * conversion from time.Time to Prometheus timestamp.
+         * 
+ * + * int64 timestamp = 2; + * + * @return The timestamp. + */ + @Override + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (Double.doubleToRawLongBits(value_) != 0) { + output.writeDouble(1, value_); + } + if (timestamp_ != 0L) { + output.writeInt64(2, timestamp_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (Double.doubleToRawLongBits(value_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, value_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, timestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Types.Sample)) { + return super.equals(obj); + } + Types.Sample other = (Types.Sample) obj; + + if (Double.doubleToLongBits(getValue()) != Double.doubleToLongBits(other.getValue())) { + return false; + } + if (getTimestamp() != other.getTimestamp()) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + Double.doubleToLongBits(getValue())); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestamp()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Types.Sample parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Sample parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Sample parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Sample parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Sample parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Sample parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Sample parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.Sample 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 Types.Sample parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Types.Sample 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 Types.Sample parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.Sample parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Types.Sample prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code prometheus.Sample} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.Sample) + Types.SampleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_Sample_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_Sample_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.Sample.class, Types.Sample.Builder.class); + } + + // Construct using Types.Sample.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = 0D; + timestamp_ = 0L; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Types.internal_static_prometheus_Sample_descriptor; + } + + @Override + public Types.Sample getDefaultInstanceForType() { + return Types.Sample.getDefaultInstance(); + } + + @Override + public Types.Sample build() { + Types.Sample result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Types.Sample buildPartial() { + Types.Sample result = new Types.Sample(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(Types.Sample result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.timestamp_ = timestamp_; + } + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Types.Sample) { + return mergeFrom((Types.Sample) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Types.Sample other) { + if (other == Types.Sample.getDefaultInstance()) { + return this; + } + if (other.getValue() != 0D) { + setValue(other.getValue()); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + value_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 16: + { + timestamp_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private double value_; + + /** + * double value = 1; + * + * @return The value. + */ + @Override + public double getValue() { + return value_; + } + + /** + * double value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * double value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0D; + onChanged(); + return this; + } + + private long timestamp_; + + /** + * + * + *
+             * timestamp is in ms format, see model/timestamp/timestamp.go for
+             * conversion from time.Time to Prometheus timestamp.
+             * 
+ * + * int64 timestamp = 2; + * + * @return The timestamp. + */ + @Override + public long getTimestamp() { + return timestamp_; + } + + /** + * + * + *
+             * timestamp is in ms format, see model/timestamp/timestamp.go for
+             * conversion from time.Time to Prometheus timestamp.
+             * 
+ * + * int64 timestamp = 2; + * + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+             * timestamp is in ms format, see model/timestamp/timestamp.go for
+             * conversion from time.Time to Prometheus timestamp.
+             * 
+ * + * int64 timestamp = 2; + * + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000002); + timestamp_ = 0L; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.Sample) + } + + // @@protoc_insertion_point(class_scope:prometheus.Sample) + private static final Types.Sample DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Types.Sample(); + } + + public static Types.Sample getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public Sample parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Types.Sample getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ExemplarOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.Exemplar) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + java.util.List getLabelsList(); + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + Types.Label getLabels(int index); + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + int getLabelsCount(); + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + java.util.List getLabelsOrBuilderList(); + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + Types.LabelOrBuilder getLabelsOrBuilder(int index); + + /** + * double value = 2; + * + * @return The value. + */ + double getValue(); + + /** + * + * + *
+         * timestamp is in ms format, see model/timestamp/timestamp.go for
+         * conversion from time.Time to Prometheus timestamp.
+         * 
+ * + * int64 timestamp = 3; + * + * @return The timestamp. + */ + long getTimestamp(); + } + + /** Protobuf type {@code prometheus.Exemplar} */ + public static final class Exemplar extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.Exemplar) + ExemplarOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Exemplar.newBuilder() to construct. + private Exemplar(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Exemplar() { + labels_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new Exemplar(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_Exemplar_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_Exemplar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.Exemplar.class, Types.Exemplar.Builder.class); + } + + public static final int LABELS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List labels_; + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public java.util.List getLabelsList() { + return labels_; + } + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public java.util.List getLabelsOrBuilderList() { + return labels_; + } + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public int getLabelsCount() { + return labels_.size(); + } + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public Types.Label getLabels(int index) { + return labels_.get(index); + } + + /** + * + * + *
+         * Optional, can be empty.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public Types.LabelOrBuilder getLabelsOrBuilder(int index) { + return labels_.get(index); + } + + public static final int VALUE_FIELD_NUMBER = 2; + private double value_ = 0D; + + /** + * double value = 2; + * + * @return The value. + */ + @Override + public double getValue() { + return value_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private long timestamp_ = 0L; + + /** + * + * + *
+         * timestamp is in ms format, see model/timestamp/timestamp.go for
+         * conversion from time.Time to Prometheus timestamp.
+         * 
+ * + * int64 timestamp = 3; + * + * @return The timestamp. + */ + @Override + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < labels_.size(); i++) { + output.writeMessage(1, labels_.get(i)); + } + if (Double.doubleToRawLongBits(value_) != 0) { + output.writeDouble(2, value_); + } + if (timestamp_ != 0L) { + output.writeInt64(3, timestamp_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + for (int i = 0; i < labels_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, labels_.get(i)); + } + if (Double.doubleToRawLongBits(value_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, value_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, timestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Types.Exemplar)) { + return super.equals(obj); + } + Types.Exemplar other = (Types.Exemplar) obj; + + if (!getLabelsList().equals(other.getLabelsList())) { + return false; + } + if (Double.doubleToLongBits(getValue()) != Double.doubleToLongBits(other.getValue())) { + return false; + } + if (getTimestamp() != other.getTimestamp()) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLabelsCount() > 0) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + getLabelsList().hashCode(); + } + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + Double.doubleToLongBits(getValue())); + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestamp()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Types.Exemplar parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Exemplar parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Exemplar parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Exemplar parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Exemplar parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Exemplar parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Exemplar parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.Exemplar 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 Types.Exemplar parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Types.Exemplar 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 Types.Exemplar parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.Exemplar parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Types.Exemplar prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code prometheus.Exemplar} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.Exemplar) + Types.ExemplarOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_Exemplar_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_Exemplar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.Exemplar.class, Types.Exemplar.Builder.class); + } + + // Construct using Types.Exemplar.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (labelsBuilder_ == null) { + labels_ = java.util.Collections.emptyList(); + } else { + labels_ = null; + labelsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0D; + timestamp_ = 0L; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Types.internal_static_prometheus_Exemplar_descriptor; + } + + @Override + public Types.Exemplar getDefaultInstanceForType() { + return Types.Exemplar.getDefaultInstance(); + } + + @Override + public Types.Exemplar build() { + Types.Exemplar result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Types.Exemplar buildPartial() { + Types.Exemplar result = new Types.Exemplar(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Types.Exemplar result) { + if (labelsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + labels_ = java.util.Collections.unmodifiableList(labels_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.labels_ = labels_; + } else { + result.labels_ = labelsBuilder_.build(); + } + } + + private void buildPartial0(Types.Exemplar result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timestamp_ = timestamp_; + } + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Types.Exemplar) { + return mergeFrom((Types.Exemplar) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Types.Exemplar other) { + if (other == Types.Exemplar.getDefaultInstance()) { + return this; + } + if (labelsBuilder_ == null) { + if (!other.labels_.isEmpty()) { + if (labels_.isEmpty()) { + labels_ = other.labels_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLabelsIsMutable(); + labels_.addAll(other.labels_); + } + onChanged(); + } + } else { + if (!other.labels_.isEmpty()) { + if (labelsBuilder_.isEmpty()) { + labelsBuilder_.dispose(); + labelsBuilder_ = null; + labels_ = other.labels_; + bitField0_ = (bitField0_ & ~0x00000001); + labelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLabelsFieldBuilder() + : null; + } else { + labelsBuilder_.addAllMessages(other.labels_); + } + } + } + if (other.getValue() != 0D) { + setValue(other.getValue()); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + Types.Label m = + input.readMessage( + Types.Label.parser(), extensionRegistry); + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.add(m); + } else { + labelsBuilder_.addMessage(m); + } + break; + } // case 10 + case 17: + { + value_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 24: + { + timestamp_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List labels_ = java.util.Collections.emptyList(); + + private void ensureLabelsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + labels_ = new java.util.ArrayList(labels_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Label, Types.Label.Builder, Types.LabelOrBuilder> + labelsBuilder_; + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public java.util.List getLabelsList() { + if (labelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(labels_); + } else { + return labelsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public int getLabelsCount() { + if (labelsBuilder_ == null) { + return labels_.size(); + } else { + return labelsBuilder_.getCount(); + } + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.Label getLabels(int index) { + if (labelsBuilder_ == null) { + return labels_.get(index); + } else { + return labelsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder setLabels(int index, Types.Label value) { + if (labelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.set(index, value); + onChanged(); + } else { + labelsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder setLabels(int index, Types.Label.Builder builderForValue) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.set(index, builderForValue.build()); + onChanged(); + } else { + labelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addLabels(Types.Label value) { + if (labelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.add(value); + onChanged(); + } else { + labelsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addLabels(int index, Types.Label value) { + if (labelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.add(index, value); + onChanged(); + } else { + labelsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addLabels(Types.Label.Builder builderForValue) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.add(builderForValue.build()); + onChanged(); + } else { + labelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addLabels(int index, Types.Label.Builder builderForValue) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.add(index, builderForValue.build()); + onChanged(); + } else { + labelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addAllLabels(Iterable values) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, labels_); + onChanged(); + } else { + labelsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder clearLabels() { + if (labelsBuilder_ == null) { + labels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + labelsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder removeLabels(int index) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.remove(index); + onChanged(); + } else { + labelsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.Label.Builder getLabelsBuilder(int index) { + return getLabelsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.LabelOrBuilder getLabelsOrBuilder(int index) { + if (labelsBuilder_ == null) { + return labels_.get(index); + } else { + return labelsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public java.util.List getLabelsOrBuilderList() { + if (labelsBuilder_ != null) { + return labelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(labels_); + } + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.Label.Builder addLabelsBuilder() { + return getLabelsFieldBuilder().addBuilder(Types.Label.getDefaultInstance()); + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.Label.Builder addLabelsBuilder(int index) { + return getLabelsFieldBuilder().addBuilder(index, Types.Label.getDefaultInstance()); + } + + /** + * + * + *
+             * Optional, can be empty.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public java.util.List getLabelsBuilderList() { + return getLabelsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Label, Types.Label.Builder, Types.LabelOrBuilder> + getLabelsFieldBuilder() { + if (labelsBuilder_ == null) { + labelsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.Label, Types.Label.Builder, Types.LabelOrBuilder>( + labels_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + labels_ = null; + } + return labelsBuilder_; + } + + private double value_; + + /** + * double value = 2; + * + * @return The value. + */ + @Override + public double getValue() { + return value_; + } + + /** + * double value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * double value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000002); + value_ = 0D; + onChanged(); + return this; + } + + private long timestamp_; + + /** + * + * + *
+             * timestamp is in ms format, see model/timestamp/timestamp.go for
+             * conversion from time.Time to Prometheus timestamp.
+             * 
+ * + * int64 timestamp = 3; + * + * @return The timestamp. + */ + @Override + public long getTimestamp() { + return timestamp_; + } + + /** + * + * + *
+             * timestamp is in ms format, see model/timestamp/timestamp.go for
+             * conversion from time.Time to Prometheus timestamp.
+             * 
+ * + * int64 timestamp = 3; + * + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+             * timestamp is in ms format, see model/timestamp/timestamp.go for
+             * conversion from time.Time to Prometheus timestamp.
+             * 
+ * + * int64 timestamp = 3; + * + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + timestamp_ = 0L; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.Exemplar) + } + + // @@protoc_insertion_point(class_scope:prometheus.Exemplar) + private static final Types.Exemplar DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Types.Exemplar(); + } + + public static Types.Exemplar getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public Exemplar parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Types.Exemplar getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface HistogramOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.Histogram) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 count_int = 1; + * + * @return Whether the countInt field is set. + */ + boolean hasCountInt(); + + /** + * uint64 count_int = 1; + * + * @return The countInt. + */ + long getCountInt(); + + /** + * double count_float = 2; + * + * @return Whether the countFloat field is set. + */ + boolean hasCountFloat(); + + /** + * double count_float = 2; + * + * @return The countFloat. + */ + double getCountFloat(); + + /** + * + * + *
+         * Sum of observations in the histogram.
+         * 
+ * + * double sum = 3; + * + * @return The sum. + */ + double getSum(); + + /** + * + * + *
+         * The schema defines the bucket schema. Currently, valid numbers
+         * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+         * is a bucket boundary in each case, and then each power of two is
+         * divided into 2^n logarithmic buckets. Or in other words, each
+         * bucket boundary is the previous boundary times 2^(2^-n). In the
+         * future, more bucket schemas may be added using numbers < -4 or >
+         * 8.
+         * 
+ * + * sint32 schema = 4; + * + * @return The schema. + */ + int getSchema(); + + /** + * + * + *
+         * Breadth of the zero bucket.
+         * 
+ * + * double zero_threshold = 5; + * + * @return The zeroThreshold. + */ + double getZeroThreshold(); + + /** + * uint64 zero_count_int = 6; + * + * @return Whether the zeroCountInt field is set. + */ + boolean hasZeroCountInt(); + + /** + * uint64 zero_count_int = 6; + * + * @return The zeroCountInt. + */ + long getZeroCountInt(); + + /** + * double zero_count_float = 7; + * + * @return Whether the zeroCountFloat field is set. + */ + boolean hasZeroCountFloat(); + + /** + * double zero_count_float = 7; + * + * @return The zeroCountFloat. + */ + double getZeroCountFloat(); + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getNegativeSpansList(); + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + Types.BucketSpan getNegativeSpans(int index); + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + int getNegativeSpansCount(); + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getNegativeSpansOrBuilderList(); + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + Types.BucketSpanOrBuilder getNegativeSpansOrBuilder(int index); + + /** + * + * + *
+         * Use either "negative_deltas" or "negative_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @return A list containing the negativeDeltas. + */ + java.util.List getNegativeDeltasList(); + + /** + * + * + *
+         * Use either "negative_deltas" or "negative_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @return The count of negativeDeltas. + */ + int getNegativeDeltasCount(); + + /** + * + * + *
+         * Use either "negative_deltas" or "negative_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @param index The index of the element to return. + * @return The negativeDeltas at the given index. + */ + long getNegativeDeltas(int index); + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double negative_counts = 10; + * + * @return A list containing the negativeCounts. + */ + java.util.List getNegativeCountsList(); + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double negative_counts = 10; + * + * @return The count of negativeCounts. + */ + int getNegativeCountsCount(); + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double negative_counts = 10; + * + * @param index The index of the element to return. + * @return The negativeCounts at the given index. + */ + double getNegativeCounts(int index); + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getPositiveSpansList(); + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + Types.BucketSpan getPositiveSpans(int index); + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + int getPositiveSpansCount(); + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getPositiveSpansOrBuilderList(); + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + Types.BucketSpanOrBuilder getPositiveSpansOrBuilder(int index); + + /** + * + * + *
+         * Use either "positive_deltas" or "positive_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @return A list containing the positiveDeltas. + */ + java.util.List getPositiveDeltasList(); + + /** + * + * + *
+         * Use either "positive_deltas" or "positive_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @return The count of positiveDeltas. + */ + int getPositiveDeltasCount(); + + /** + * + * + *
+         * Use either "positive_deltas" or "positive_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @param index The index of the element to return. + * @return The positiveDeltas at the given index. + */ + long getPositiveDeltas(int index); + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double positive_counts = 13; + * + * @return A list containing the positiveCounts. + */ + java.util.List getPositiveCountsList(); + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double positive_counts = 13; + * + * @return The count of positiveCounts. + */ + int getPositiveCountsCount(); + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double positive_counts = 13; + * + * @param index The index of the element to return. + * @return The positiveCounts at the given index. + */ + double getPositiveCounts(int index); + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * + * @return The enum numeric value on the wire for resetHint. + */ + int getResetHintValue(); + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * + * @return The resetHint. + */ + Types.Histogram.ResetHint getResetHint(); + + /** + * + * + *
+         * timestamp is in ms format, see model/timestamp/timestamp.go for
+         * conversion from time.Time to Prometheus timestamp.
+         * 
+ * + * int64 timestamp = 15; + * + * @return The timestamp. + */ + long getTimestamp(); + + Types.Histogram.CountCase getCountCase(); + + Types.Histogram.ZeroCountCase getZeroCountCase(); + } + + /** + * + * + *
+     * A native histogram, also known as a sparse histogram.
+     * Original design doc:
+     * https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit
+     * The appendix of this design doc also explains the concept of float
+     * histograms. This Histogram message can represent both, the usual
+     * integer histogram as well as a float histogram.
+     * 
+ * + *

Protobuf type {@code prometheus.Histogram} + */ + public static final class Histogram extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.Histogram) + HistogramOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Histogram.newBuilder() to construct. + private Histogram(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Histogram() { + negativeSpans_ = java.util.Collections.emptyList(); + negativeDeltas_ = emptyLongList(); + negativeCounts_ = emptyDoubleList(); + positiveSpans_ = java.util.Collections.emptyList(); + positiveDeltas_ = emptyLongList(); + positiveCounts_ = emptyDoubleList(); + resetHint_ = 0; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new Histogram(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_Histogram_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_Histogram_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.Histogram.class, Types.Histogram.Builder.class); + } + + /** Protobuf enum {@code prometheus.Histogram.ResetHint} */ + public enum ResetHint implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *

+             * Need to test for a counter reset explicitly.
+             * 
+ * + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + * + * + *
+             * This is the 1st histogram after a counter reset.
+             * 
+ * + * YES = 1; + */ + YES(1), + /** + * + * + *
+             * There was no counter reset between this and the previous Histogram.
+             * 
+ * + * NO = 2; + */ + NO(2), + /** + * + * + *
+             * This is a gauge histogram where counter resets don't happen.
+             * 
+ * + * GAUGE = 3; + */ + GAUGE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+             * Need to test for a counter reset explicitly.
+             * 
+ * + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + * + * + *
+             * This is the 1st histogram after a counter reset.
+             * 
+ * + * YES = 1; + */ + public static final int YES_VALUE = 1; + /** + * + * + *
+             * There was no counter reset between this and the previous Histogram.
+             * 
+ * + * NO = 2; + */ + public static final int NO_VALUE = 2; + /** + * + * + *
+             * This is a gauge histogram where counter resets don't happen.
+             * 
+ * + * GAUGE = 3; + */ + public static final int GAUGE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static ResetHint valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ResetHint forNumber(int value) { + switch (value) { + case 0: + return UNKNOWN; + case 1: + return YES; + case 2: + return NO; + case 3: + return GAUGE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ResetHint findValueByNumber(int number) { + return ResetHint.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return Types.Histogram.getDescriptor().getEnumTypes().get(0); + } + + private static final ResetHint[] VALUES = values(); + + public static ResetHint valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ResetHint(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:prometheus.Histogram.ResetHint) + } + + private int countCase_ = 0; + + @SuppressWarnings("serial") + private Object count_; + + public enum CountCase implements com.google.protobuf.Internal.EnumLite, InternalOneOfEnum { + COUNT_INT(1), + COUNT_FLOAT(2), + COUNT_NOT_SET(0); + private final int value; + + private CountCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static CountCase valueOf(int value) { + return forNumber(value); + } + + public static CountCase forNumber(int value) { + switch (value) { + case 1: + return COUNT_INT; + case 2: + return COUNT_FLOAT; + case 0: + return COUNT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public CountCase getCountCase() { + return CountCase.forNumber(countCase_); + } + + private int zeroCountCase_ = 0; + + @SuppressWarnings("serial") + private Object zeroCount_; + + public enum ZeroCountCase + implements com.google.protobuf.Internal.EnumLite, InternalOneOfEnum { + ZERO_COUNT_INT(6), + ZERO_COUNT_FLOAT(7), + ZEROCOUNT_NOT_SET(0); + private final int value; + + private ZeroCountCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @Deprecated + public static ZeroCountCase valueOf(int value) { + return forNumber(value); + } + + public static ZeroCountCase forNumber(int value) { + switch (value) { + case 6: + return ZERO_COUNT_INT; + case 7: + return ZERO_COUNT_FLOAT; + case 0: + return ZEROCOUNT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ZeroCountCase getZeroCountCase() { + return ZeroCountCase.forNumber(zeroCountCase_); + } + + public static final int COUNT_INT_FIELD_NUMBER = 1; + + /** + * uint64 count_int = 1; + * + * @return Whether the countInt field is set. + */ + @Override + public boolean hasCountInt() { + return countCase_ == 1; + } + + /** + * uint64 count_int = 1; + * + * @return The countInt. + */ + @Override + public long getCountInt() { + if (countCase_ == 1) { + return (Long) count_; + } + return 0L; + } + + public static final int COUNT_FLOAT_FIELD_NUMBER = 2; + + /** + * double count_float = 2; + * + * @return Whether the countFloat field is set. + */ + @Override + public boolean hasCountFloat() { + return countCase_ == 2; + } + + /** + * double count_float = 2; + * + * @return The countFloat. + */ + @Override + public double getCountFloat() { + if (countCase_ == 2) { + return (Double) count_; + } + return 0D; + } + + public static final int SUM_FIELD_NUMBER = 3; + private double sum_ = 0D; + + /** + * + * + *
+         * Sum of observations in the histogram.
+         * 
+ * + * double sum = 3; + * + * @return The sum. + */ + @Override + public double getSum() { + return sum_; + } + + public static final int SCHEMA_FIELD_NUMBER = 4; + private int schema_ = 0; + + /** + * + * + *
+         * The schema defines the bucket schema. Currently, valid numbers
+         * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+         * is a bucket boundary in each case, and then each power of two is
+         * divided into 2^n logarithmic buckets. Or in other words, each
+         * bucket boundary is the previous boundary times 2^(2^-n). In the
+         * future, more bucket schemas may be added using numbers < -4 or >
+         * 8.
+         * 
+ * + * sint32 schema = 4; + * + * @return The schema. + */ + @Override + public int getSchema() { + return schema_; + } + + public static final int ZERO_THRESHOLD_FIELD_NUMBER = 5; + private double zeroThreshold_ = 0D; + + /** + * + * + *
+         * Breadth of the zero bucket.
+         * 
+ * + * double zero_threshold = 5; + * + * @return The zeroThreshold. + */ + @Override + public double getZeroThreshold() { + return zeroThreshold_; + } + + public static final int ZERO_COUNT_INT_FIELD_NUMBER = 6; + + /** + * uint64 zero_count_int = 6; + * + * @return Whether the zeroCountInt field is set. + */ + @Override + public boolean hasZeroCountInt() { + return zeroCountCase_ == 6; + } + + /** + * uint64 zero_count_int = 6; + * + * @return The zeroCountInt. + */ + @Override + public long getZeroCountInt() { + if (zeroCountCase_ == 6) { + return (Long) zeroCount_; + } + return 0L; + } + + public static final int ZERO_COUNT_FLOAT_FIELD_NUMBER = 7; + + /** + * double zero_count_float = 7; + * + * @return Whether the zeroCountFloat field is set. + */ + @Override + public boolean hasZeroCountFloat() { + return zeroCountCase_ == 7; + } + + /** + * double zero_count_float = 7; + * + * @return The zeroCountFloat. + */ + @Override + public double getZeroCountFloat() { + if (zeroCountCase_ == 7) { + return (Double) zeroCount_; + } + return 0D; + } + + public static final int NEGATIVE_SPANS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List negativeSpans_; + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getNegativeSpansList() { + return negativeSpans_; + } + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getNegativeSpansOrBuilderList() { + return negativeSpans_; + } + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + @Override + public int getNegativeSpansCount() { + return negativeSpans_.size(); + } + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.BucketSpan getNegativeSpans(int index) { + return negativeSpans_.get(index); + } + + /** + * + * + *
+         * Negative Buckets.
+         * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.BucketSpanOrBuilder getNegativeSpansOrBuilder(int index) { + return negativeSpans_.get(index); + } + + public static final int NEGATIVE_DELTAS_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList negativeDeltas_ = emptyLongList(); + + /** + * + * + *
+         * Use either "negative_deltas" or "negative_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @return A list containing the negativeDeltas. + */ + @Override + public java.util.List getNegativeDeltasList() { + return negativeDeltas_; + } + + /** + * + * + *
+         * Use either "negative_deltas" or "negative_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @return The count of negativeDeltas. + */ + public int getNegativeDeltasCount() { + return negativeDeltas_.size(); + } + + /** + * + * + *
+         * Use either "negative_deltas" or "negative_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @param index The index of the element to return. + * @return The negativeDeltas at the given index. + */ + public long getNegativeDeltas(int index) { + return negativeDeltas_.getLong(index); + } + + private int negativeDeltasMemoizedSerializedSize = -1; + + public static final int NEGATIVE_COUNTS_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList negativeCounts_ = emptyDoubleList(); + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double negative_counts = 10; + * + * @return A list containing the negativeCounts. + */ + @Override + public java.util.List getNegativeCountsList() { + return negativeCounts_; + } + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double negative_counts = 10; + * + * @return The count of negativeCounts. + */ + public int getNegativeCountsCount() { + return negativeCounts_.size(); + } + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double negative_counts = 10; + * + * @param index The index of the element to return. + * @return The negativeCounts at the given index. + */ + public double getNegativeCounts(int index) { + return negativeCounts_.getDouble(index); + } + + private int negativeCountsMemoizedSerializedSize = -1; + + public static final int POSITIVE_SPANS_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private java.util.List positiveSpans_; + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getPositiveSpansList() { + return positiveSpans_; + } + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getPositiveSpansOrBuilderList() { + return positiveSpans_; + } + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + @Override + public int getPositiveSpansCount() { + return positiveSpans_.size(); + } + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.BucketSpan getPositiveSpans(int index) { + return positiveSpans_.get(index); + } + + /** + * + * + *
+         * Positive Buckets.
+         * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.BucketSpanOrBuilder getPositiveSpansOrBuilder(int index) { + return positiveSpans_.get(index); + } + + public static final int POSITIVE_DELTAS_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList positiveDeltas_ = emptyLongList(); + + /** + * + * + *
+         * Use either "positive_deltas" or "positive_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @return A list containing the positiveDeltas. + */ + @Override + public java.util.List getPositiveDeltasList() { + return positiveDeltas_; + } + + /** + * + * + *
+         * Use either "positive_deltas" or "positive_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @return The count of positiveDeltas. + */ + public int getPositiveDeltasCount() { + return positiveDeltas_.size(); + } + + /** + * + * + *
+         * Use either "positive_deltas" or "positive_counts", the former for
+         * regular histograms with integer counts, the latter for float
+         * histograms.
+         * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @param index The index of the element to return. + * @return The positiveDeltas at the given index. + */ + public long getPositiveDeltas(int index) { + return positiveDeltas_.getLong(index); + } + + private int positiveDeltasMemoizedSerializedSize = -1; + + public static final int POSITIVE_COUNTS_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.DoubleList positiveCounts_ = emptyDoubleList(); + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double positive_counts = 13; + * + * @return A list containing the positiveCounts. + */ + @Override + public java.util.List getPositiveCountsList() { + return positiveCounts_; + } + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double positive_counts = 13; + * + * @return The count of positiveCounts. + */ + public int getPositiveCountsCount() { + return positiveCounts_.size(); + } + + /** + * + * + *
+         * Absolute count of each bucket.
+         * 
+ * + * repeated double positive_counts = 13; + * + * @param index The index of the element to return. + * @return The positiveCounts at the given index. + */ + public double getPositiveCounts(int index) { + return positiveCounts_.getDouble(index); + } + + private int positiveCountsMemoizedSerializedSize = -1; + + public static final int RESET_HINT_FIELD_NUMBER = 14; + private int resetHint_ = 0; + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * + * @return The enum numeric value on the wire for resetHint. + */ + @Override + public int getResetHintValue() { + return resetHint_; + } + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * + * @return The resetHint. + */ + @Override + public Types.Histogram.ResetHint getResetHint() { + Types.Histogram.ResetHint result = Types.Histogram.ResetHint.forNumber(resetHint_); + return result == null ? Types.Histogram.ResetHint.UNRECOGNIZED : result; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 15; + private long timestamp_ = 0L; + + /** + * + * + *
+         * timestamp is in ms format, see model/timestamp/timestamp.go for
+         * conversion from time.Time to Prometheus timestamp.
+         * 
+ * + * int64 timestamp = 15; + * + * @return The timestamp. + */ + @Override + public long getTimestamp() { + return timestamp_; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (countCase_ == 1) { + output.writeUInt64(1, (long) ((Long) count_)); + } + if (countCase_ == 2) { + output.writeDouble(2, (double) ((Double) count_)); + } + if (Double.doubleToRawLongBits(sum_) != 0) { + output.writeDouble(3, sum_); + } + if (schema_ != 0) { + output.writeSInt32(4, schema_); + } + if (Double.doubleToRawLongBits(zeroThreshold_) != 0) { + output.writeDouble(5, zeroThreshold_); + } + if (zeroCountCase_ == 6) { + output.writeUInt64(6, (long) ((Long) zeroCount_)); + } + if (zeroCountCase_ == 7) { + output.writeDouble(7, (double) ((Double) zeroCount_)); + } + for (int i = 0; i < negativeSpans_.size(); i++) { + output.writeMessage(8, negativeSpans_.get(i)); + } + if (getNegativeDeltasList().size() > 0) { + output.writeUInt32NoTag(74); + output.writeUInt32NoTag(negativeDeltasMemoizedSerializedSize); + } + for (int i = 0; i < negativeDeltas_.size(); i++) { + output.writeSInt64NoTag(negativeDeltas_.getLong(i)); + } + if (getNegativeCountsList().size() > 0) { + output.writeUInt32NoTag(82); + output.writeUInt32NoTag(negativeCountsMemoizedSerializedSize); + } + for (int i = 0; i < negativeCounts_.size(); i++) { + output.writeDoubleNoTag(negativeCounts_.getDouble(i)); + } + for (int i = 0; i < positiveSpans_.size(); i++) { + output.writeMessage(11, positiveSpans_.get(i)); + } + if (getPositiveDeltasList().size() > 0) { + output.writeUInt32NoTag(98); + output.writeUInt32NoTag(positiveDeltasMemoizedSerializedSize); + } + for (int i = 0; i < positiveDeltas_.size(); i++) { + output.writeSInt64NoTag(positiveDeltas_.getLong(i)); + } + if (getPositiveCountsList().size() > 0) { + output.writeUInt32NoTag(106); + output.writeUInt32NoTag(positiveCountsMemoizedSerializedSize); + } + for (int i = 0; i < positiveCounts_.size(); i++) { + output.writeDoubleNoTag(positiveCounts_.getDouble(i)); + } + if (resetHint_ != Types.Histogram.ResetHint.UNKNOWN.getNumber()) { + output.writeEnum(14, resetHint_); + } + if (timestamp_ != 0L) { + output.writeInt64(15, timestamp_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (countCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeUInt64Size( + 1, (long) ((Long) count_)); + } + if (countCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 2, (double) ((Double) count_)); + } + if (Double.doubleToRawLongBits(sum_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, sum_); + } + if (schema_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeSInt32Size(4, schema_); + } + if (Double.doubleToRawLongBits(zeroThreshold_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(5, zeroThreshold_); + } + if (zeroCountCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeUInt64Size( + 6, (long) ((Long) zeroCount_)); + } + if (zeroCountCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeDoubleSize( + 7, (double) ((Double) zeroCount_)); + } + for (int i = 0; i < negativeSpans_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, negativeSpans_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < negativeDeltas_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeSInt64SizeNoTag( + negativeDeltas_.getLong(i)); + } + size += dataSize; + if (!getNegativeDeltasList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + negativeDeltasMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * getNegativeCountsList().size(); + size += dataSize; + if (!getNegativeCountsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + negativeCountsMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < positiveSpans_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 11, positiveSpans_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < positiveDeltas_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeSInt64SizeNoTag( + positiveDeltas_.getLong(i)); + } + size += dataSize; + if (!getPositiveDeltasList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + positiveDeltasMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * getPositiveCountsList().size(); + size += dataSize; + if (!getPositiveCountsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + positiveCountsMemoizedSerializedSize = dataSize; + } + if (resetHint_ != Types.Histogram.ResetHint.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(14, resetHint_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(15, timestamp_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Types.Histogram)) { + return super.equals(obj); + } + Types.Histogram other = (Types.Histogram) obj; + + if (Double.doubleToLongBits(getSum()) != Double.doubleToLongBits(other.getSum())) { + return false; + } + if (getSchema() != other.getSchema()) { + return false; + } + if (Double.doubleToLongBits(getZeroThreshold()) + != Double.doubleToLongBits(other.getZeroThreshold())) { + return false; + } + if (!getNegativeSpansList().equals(other.getNegativeSpansList())) { + return false; + } + if (!getNegativeDeltasList().equals(other.getNegativeDeltasList())) { + return false; + } + if (!getNegativeCountsList().equals(other.getNegativeCountsList())) { + return false; + } + if (!getPositiveSpansList().equals(other.getPositiveSpansList())) { + return false; + } + if (!getPositiveDeltasList().equals(other.getPositiveDeltasList())) { + return false; + } + if (!getPositiveCountsList().equals(other.getPositiveCountsList())) { + return false; + } + if (resetHint_ != other.resetHint_) { + return false; + } + if (getTimestamp() != other.getTimestamp()) { + return false; + } + if (!getCountCase().equals(other.getCountCase())) { + return false; + } + switch (countCase_) { + case 1: + if (getCountInt() != other.getCountInt()) { + return false; + } + break; + case 2: + if (Double.doubleToLongBits(getCountFloat()) + != Double.doubleToLongBits(other.getCountFloat())) { + return false; + } + break; + case 0: + default: + } + if (!getZeroCountCase().equals(other.getZeroCountCase())) { + return false; + } + switch (zeroCountCase_) { + case 6: + if (getZeroCountInt() != other.getZeroCountInt()) { + return false; + } + break; + case 7: + if (Double.doubleToLongBits(getZeroCountFloat()) + != Double.doubleToLongBits(other.getZeroCountFloat())) { + return false; + } + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUM_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + Double.doubleToLongBits(getSum())); + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema(); + hash = (37 * hash) + ZERO_THRESHOLD_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + Double.doubleToLongBits(getZeroThreshold())); + if (getNegativeSpansCount() > 0) { + hash = (37 * hash) + NEGATIVE_SPANS_FIELD_NUMBER; + hash = (53 * hash) + getNegativeSpansList().hashCode(); + } + if (getNegativeDeltasCount() > 0) { + hash = (37 * hash) + NEGATIVE_DELTAS_FIELD_NUMBER; + hash = (53 * hash) + getNegativeDeltasList().hashCode(); + } + if (getNegativeCountsCount() > 0) { + hash = (37 * hash) + NEGATIVE_COUNTS_FIELD_NUMBER; + hash = (53 * hash) + getNegativeCountsList().hashCode(); + } + if (getPositiveSpansCount() > 0) { + hash = (37 * hash) + POSITIVE_SPANS_FIELD_NUMBER; + hash = (53 * hash) + getPositiveSpansList().hashCode(); + } + if (getPositiveDeltasCount() > 0) { + hash = (37 * hash) + POSITIVE_DELTAS_FIELD_NUMBER; + hash = (53 * hash) + getPositiveDeltasList().hashCode(); + } + if (getPositiveCountsCount() > 0) { + hash = (37 * hash) + POSITIVE_COUNTS_FIELD_NUMBER; + hash = (53 * hash) + getPositiveCountsList().hashCode(); + } + hash = (37 * hash) + RESET_HINT_FIELD_NUMBER; + hash = (53 * hash) + resetHint_; + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestamp()); + switch (countCase_) { + case 1: + hash = (37 * hash) + COUNT_INT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCountInt()); + break; + case 2: + hash = (37 * hash) + COUNT_FLOAT_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + Double.doubleToLongBits(getCountFloat())); + break; + case 0: + default: + } + switch (zeroCountCase_) { + case 6: + hash = (37 * hash) + ZERO_COUNT_INT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getZeroCountInt()); + break; + case 7: + hash = (37 * hash) + ZERO_COUNT_FLOAT_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + Double.doubleToLongBits(getZeroCountFloat())); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Types.Histogram parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Histogram parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Histogram parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Histogram parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Histogram parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Histogram parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Histogram parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.Histogram 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 Types.Histogram parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Types.Histogram 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 Types.Histogram parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.Histogram parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Types.Histogram prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * A native histogram, also known as a sparse histogram.
+         * Original design doc:
+         * https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit
+         * The appendix of this design doc also explains the concept of float
+         * histograms. This Histogram message can represent both, the usual
+         * integer histogram as well as a float histogram.
+         * 
+ * + *

Protobuf type {@code prometheus.Histogram} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.Histogram) + Types.HistogramOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_Histogram_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_Histogram_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.Histogram.class, Types.Histogram.Builder.class); + } + + // Construct using Types.Histogram.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sum_ = 0D; + schema_ = 0; + zeroThreshold_ = 0D; + if (negativeSpansBuilder_ == null) { + negativeSpans_ = java.util.Collections.emptyList(); + } else { + negativeSpans_ = null; + negativeSpansBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + negativeDeltas_ = emptyLongList(); + negativeCounts_ = emptyDoubleList(); + if (positiveSpansBuilder_ == null) { + positiveSpans_ = java.util.Collections.emptyList(); + } else { + positiveSpans_ = null; + positiveSpansBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + positiveDeltas_ = emptyLongList(); + positiveCounts_ = emptyDoubleList(); + resetHint_ = 0; + timestamp_ = 0L; + countCase_ = 0; + count_ = null; + zeroCountCase_ = 0; + zeroCount_ = null; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Types.internal_static_prometheus_Histogram_descriptor; + } + + @Override + public Types.Histogram getDefaultInstanceForType() { + return Types.Histogram.getDefaultInstance(); + } + + @Override + public Types.Histogram build() { + Types.Histogram result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Types.Histogram buildPartial() { + Types.Histogram result = new Types.Histogram(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Types.Histogram result) { + if (negativeSpansBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + negativeSpans_ = java.util.Collections.unmodifiableList(negativeSpans_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.negativeSpans_ = negativeSpans_; + } else { + result.negativeSpans_ = negativeSpansBuilder_.build(); + } + if (positiveSpansBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + positiveSpans_ = java.util.Collections.unmodifiableList(positiveSpans_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.positiveSpans_ = positiveSpans_; + } else { + result.positiveSpans_ = positiveSpansBuilder_.build(); + } + } + + private void buildPartial0(Types.Histogram result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sum_ = sum_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.schema_ = schema_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.zeroThreshold_ = zeroThreshold_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + negativeDeltas_.makeImmutable(); + result.negativeDeltas_ = negativeDeltas_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + negativeCounts_.makeImmutable(); + result.negativeCounts_ = negativeCounts_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + positiveDeltas_.makeImmutable(); + result.positiveDeltas_ = positiveDeltas_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + positiveCounts_.makeImmutable(); + result.positiveCounts_ = positiveCounts_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.resetHint_ = resetHint_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.timestamp_ = timestamp_; + } + } + + private void buildPartialOneofs(Types.Histogram result) { + result.countCase_ = countCase_; + result.count_ = this.count_; + result.zeroCountCase_ = zeroCountCase_; + result.zeroCount_ = this.zeroCount_; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Types.Histogram) { + return mergeFrom((Types.Histogram) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Types.Histogram other) { + if (other == Types.Histogram.getDefaultInstance()) { + return this; + } + if (other.getSum() != 0D) { + setSum(other.getSum()); + } + if (other.getSchema() != 0) { + setSchema(other.getSchema()); + } + if (other.getZeroThreshold() != 0D) { + setZeroThreshold(other.getZeroThreshold()); + } + if (negativeSpansBuilder_ == null) { + if (!other.negativeSpans_.isEmpty()) { + if (negativeSpans_.isEmpty()) { + negativeSpans_ = other.negativeSpans_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureNegativeSpansIsMutable(); + negativeSpans_.addAll(other.negativeSpans_); + } + onChanged(); + } + } else { + if (!other.negativeSpans_.isEmpty()) { + if (negativeSpansBuilder_.isEmpty()) { + negativeSpansBuilder_.dispose(); + negativeSpansBuilder_ = null; + negativeSpans_ = other.negativeSpans_; + bitField0_ = (bitField0_ & ~0x00000080); + negativeSpansBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNegativeSpansFieldBuilder() + : null; + } else { + negativeSpansBuilder_.addAllMessages(other.negativeSpans_); + } + } + } + if (!other.negativeDeltas_.isEmpty()) { + if (negativeDeltas_.isEmpty()) { + negativeDeltas_ = other.negativeDeltas_; + negativeDeltas_.makeImmutable(); + bitField0_ |= 0x00000100; + } else { + ensureNegativeDeltasIsMutable(); + negativeDeltas_.addAll(other.negativeDeltas_); + } + onChanged(); + } + if (!other.negativeCounts_.isEmpty()) { + if (negativeCounts_.isEmpty()) { + negativeCounts_ = other.negativeCounts_; + negativeCounts_.makeImmutable(); + bitField0_ |= 0x00000200; + } else { + ensureNegativeCountsIsMutable(); + negativeCounts_.addAll(other.negativeCounts_); + } + onChanged(); + } + if (positiveSpansBuilder_ == null) { + if (!other.positiveSpans_.isEmpty()) { + if (positiveSpans_.isEmpty()) { + positiveSpans_ = other.positiveSpans_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensurePositiveSpansIsMutable(); + positiveSpans_.addAll(other.positiveSpans_); + } + onChanged(); + } + } else { + if (!other.positiveSpans_.isEmpty()) { + if (positiveSpansBuilder_.isEmpty()) { + positiveSpansBuilder_.dispose(); + positiveSpansBuilder_ = null; + positiveSpans_ = other.positiveSpans_; + bitField0_ = (bitField0_ & ~0x00000400); + positiveSpansBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPositiveSpansFieldBuilder() + : null; + } else { + positiveSpansBuilder_.addAllMessages(other.positiveSpans_); + } + } + } + if (!other.positiveDeltas_.isEmpty()) { + if (positiveDeltas_.isEmpty()) { + positiveDeltas_ = other.positiveDeltas_; + positiveDeltas_.makeImmutable(); + bitField0_ |= 0x00000800; + } else { + ensurePositiveDeltasIsMutable(); + positiveDeltas_.addAll(other.positiveDeltas_); + } + onChanged(); + } + if (!other.positiveCounts_.isEmpty()) { + if (positiveCounts_.isEmpty()) { + positiveCounts_ = other.positiveCounts_; + positiveCounts_.makeImmutable(); + bitField0_ |= 0x00001000; + } else { + ensurePositiveCountsIsMutable(); + positiveCounts_.addAll(other.positiveCounts_); + } + onChanged(); + } + if (other.resetHint_ != 0) { + setResetHintValue(other.getResetHintValue()); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + switch (other.getCountCase()) { + case COUNT_INT: + { + setCountInt(other.getCountInt()); + break; + } + case COUNT_FLOAT: + { + setCountFloat(other.getCountFloat()); + break; + } + case COUNT_NOT_SET: + { + break; + } + } + switch (other.getZeroCountCase()) { + case ZERO_COUNT_INT: + { + setZeroCountInt(other.getZeroCountInt()); + break; + } + case ZERO_COUNT_FLOAT: + { + setZeroCountFloat(other.getZeroCountFloat()); + break; + } + case ZEROCOUNT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + count_ = input.readUInt64(); + countCase_ = 1; + break; + } // case 8 + case 17: + { + count_ = input.readDouble(); + countCase_ = 2; + break; + } // case 17 + case 25: + { + sum_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 32: + { + schema_ = input.readSInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 41: + { + zeroThreshold_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 41 + case 48: + { + zeroCount_ = input.readUInt64(); + zeroCountCase_ = 6; + break; + } // case 48 + case 57: + { + zeroCount_ = input.readDouble(); + zeroCountCase_ = 7; + break; + } // case 57 + case 66: + { + Types.BucketSpan m = + input.readMessage( + Types.BucketSpan.parser(), extensionRegistry); + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + negativeSpans_.add(m); + } else { + negativeSpansBuilder_.addMessage(m); + } + break; + } // case 66 + case 72: + { + long v = input.readSInt64(); + ensureNegativeDeltasIsMutable(); + negativeDeltas_.addLong(v); + break; + } // case 72 + case 74: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureNegativeDeltasIsMutable(); + while (input.getBytesUntilLimit() > 0) { + negativeDeltas_.addLong(input.readSInt64()); + } + input.popLimit(limit); + break; + } // case 74 + case 81: + { + double v = input.readDouble(); + ensureNegativeCountsIsMutable(); + negativeCounts_.addDouble(v); + break; + } // case 81 + case 82: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureNegativeCountsIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + negativeCounts_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 82 + case 90: + { + Types.BucketSpan m = + input.readMessage( + Types.BucketSpan.parser(), extensionRegistry); + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + positiveSpans_.add(m); + } else { + positiveSpansBuilder_.addMessage(m); + } + break; + } // case 90 + case 96: + { + long v = input.readSInt64(); + ensurePositiveDeltasIsMutable(); + positiveDeltas_.addLong(v); + break; + } // case 96 + case 98: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensurePositiveDeltasIsMutable(); + while (input.getBytesUntilLimit() > 0) { + positiveDeltas_.addLong(input.readSInt64()); + } + input.popLimit(limit); + break; + } // case 98 + case 105: + { + double v = input.readDouble(); + ensurePositiveCountsIsMutable(); + positiveCounts_.addDouble(v); + break; + } // case 105 + case 106: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensurePositiveCountsIsMutable(alloc / 8); + while (input.getBytesUntilLimit() > 0) { + positiveCounts_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } // case 106 + case 112: + { + resetHint_ = input.readEnum(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 120: + { + timestamp_ = input.readInt64(); + bitField0_ |= 0x00004000; + break; + } // case 120 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int countCase_ = 0; + private Object count_; + + public CountCase getCountCase() { + return CountCase.forNumber(countCase_); + } + + public Builder clearCount() { + countCase_ = 0; + count_ = null; + onChanged(); + return this; + } + + private int zeroCountCase_ = 0; + private Object zeroCount_; + + public ZeroCountCase getZeroCountCase() { + return ZeroCountCase.forNumber(zeroCountCase_); + } + + public Builder clearZeroCount() { + zeroCountCase_ = 0; + zeroCount_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * uint64 count_int = 1; + * + * @return Whether the countInt field is set. + */ + public boolean hasCountInt() { + return countCase_ == 1; + } + + /** + * uint64 count_int = 1; + * + * @return The countInt. + */ + public long getCountInt() { + if (countCase_ == 1) { + return (Long) count_; + } + return 0L; + } + + /** + * uint64 count_int = 1; + * + * @param value The countInt to set. + * @return This builder for chaining. + */ + public Builder setCountInt(long value) { + + countCase_ = 1; + count_ = value; + onChanged(); + return this; + } + + /** + * uint64 count_int = 1; + * + * @return This builder for chaining. + */ + public Builder clearCountInt() { + if (countCase_ == 1) { + countCase_ = 0; + count_ = null; + onChanged(); + } + return this; + } + + /** + * double count_float = 2; + * + * @return Whether the countFloat field is set. + */ + public boolean hasCountFloat() { + return countCase_ == 2; + } + + /** + * double count_float = 2; + * + * @return The countFloat. + */ + public double getCountFloat() { + if (countCase_ == 2) { + return (Double) count_; + } + return 0D; + } + + /** + * double count_float = 2; + * + * @param value The countFloat to set. + * @return This builder for chaining. + */ + public Builder setCountFloat(double value) { + + countCase_ = 2; + count_ = value; + onChanged(); + return this; + } + + /** + * double count_float = 2; + * + * @return This builder for chaining. + */ + public Builder clearCountFloat() { + if (countCase_ == 2) { + countCase_ = 0; + count_ = null; + onChanged(); + } + return this; + } + + private double sum_; + + /** + * + * + *

+             * Sum of observations in the histogram.
+             * 
+ * + * double sum = 3; + * + * @return The sum. + */ + @Override + public double getSum() { + return sum_; + } + + /** + * + * + *
+             * Sum of observations in the histogram.
+             * 
+ * + * double sum = 3; + * + * @param value The sum to set. + * @return This builder for chaining. + */ + public Builder setSum(double value) { + + sum_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+             * Sum of observations in the histogram.
+             * 
+ * + * double sum = 3; + * + * @return This builder for chaining. + */ + public Builder clearSum() { + bitField0_ = (bitField0_ & ~0x00000004); + sum_ = 0D; + onChanged(); + return this; + } + + private int schema_; + + /** + * + * + *
+             * The schema defines the bucket schema. Currently, valid numbers
+             * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+             * is a bucket boundary in each case, and then each power of two is
+             * divided into 2^n logarithmic buckets. Or in other words, each
+             * bucket boundary is the previous boundary times 2^(2^-n). In the
+             * future, more bucket schemas may be added using numbers < -4 or >
+             * 8.
+             * 
+ * + * sint32 schema = 4; + * + * @return The schema. + */ + @Override + public int getSchema() { + return schema_; + } + + /** + * + * + *
+             * The schema defines the bucket schema. Currently, valid numbers
+             * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+             * is a bucket boundary in each case, and then each power of two is
+             * divided into 2^n logarithmic buckets. Or in other words, each
+             * bucket boundary is the previous boundary times 2^(2^-n). In the
+             * future, more bucket schemas may be added using numbers < -4 or >
+             * 8.
+             * 
+ * + * sint32 schema = 4; + * + * @param value The schema to set. + * @return This builder for chaining. + */ + public Builder setSchema(int value) { + + schema_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+             * The schema defines the bucket schema. Currently, valid numbers
+             * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+             * is a bucket boundary in each case, and then each power of two is
+             * divided into 2^n logarithmic buckets. Or in other words, each
+             * bucket boundary is the previous boundary times 2^(2^-n). In the
+             * future, more bucket schemas may be added using numbers < -4 or >
+             * 8.
+             * 
+ * + * sint32 schema = 4; + * + * @return This builder for chaining. + */ + public Builder clearSchema() { + bitField0_ = (bitField0_ & ~0x00000008); + schema_ = 0; + onChanged(); + return this; + } + + private double zeroThreshold_; + + /** + * + * + *
+             * Breadth of the zero bucket.
+             * 
+ * + * double zero_threshold = 5; + * + * @return The zeroThreshold. + */ + @Override + public double getZeroThreshold() { + return zeroThreshold_; + } + + /** + * + * + *
+             * Breadth of the zero bucket.
+             * 
+ * + * double zero_threshold = 5; + * + * @param value The zeroThreshold to set. + * @return This builder for chaining. + */ + public Builder setZeroThreshold(double value) { + + zeroThreshold_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+             * Breadth of the zero bucket.
+             * 
+ * + * double zero_threshold = 5; + * + * @return This builder for chaining. + */ + public Builder clearZeroThreshold() { + bitField0_ = (bitField0_ & ~0x00000010); + zeroThreshold_ = 0D; + onChanged(); + return this; + } + + /** + * uint64 zero_count_int = 6; + * + * @return Whether the zeroCountInt field is set. + */ + public boolean hasZeroCountInt() { + return zeroCountCase_ == 6; + } + + /** + * uint64 zero_count_int = 6; + * + * @return The zeroCountInt. + */ + public long getZeroCountInt() { + if (zeroCountCase_ == 6) { + return (Long) zeroCount_; + } + return 0L; + } + + /** + * uint64 zero_count_int = 6; + * + * @param value The zeroCountInt to set. + * @return This builder for chaining. + */ + public Builder setZeroCountInt(long value) { + + zeroCountCase_ = 6; + zeroCount_ = value; + onChanged(); + return this; + } + + /** + * uint64 zero_count_int = 6; + * + * @return This builder for chaining. + */ + public Builder clearZeroCountInt() { + if (zeroCountCase_ == 6) { + zeroCountCase_ = 0; + zeroCount_ = null; + onChanged(); + } + return this; + } + + /** + * double zero_count_float = 7; + * + * @return Whether the zeroCountFloat field is set. + */ + public boolean hasZeroCountFloat() { + return zeroCountCase_ == 7; + } + + /** + * double zero_count_float = 7; + * + * @return The zeroCountFloat. + */ + public double getZeroCountFloat() { + if (zeroCountCase_ == 7) { + return (Double) zeroCount_; + } + return 0D; + } + + /** + * double zero_count_float = 7; + * + * @param value The zeroCountFloat to set. + * @return This builder for chaining. + */ + public Builder setZeroCountFloat(double value) { + + zeroCountCase_ = 7; + zeroCount_ = value; + onChanged(); + return this; + } + + /** + * double zero_count_float = 7; + * + * @return This builder for chaining. + */ + public Builder clearZeroCountFloat() { + if (zeroCountCase_ == 7) { + zeroCountCase_ = 0; + zeroCount_ = null; + onChanged(); + } + return this; + } + + private java.util.List negativeSpans_ = + java.util.Collections.emptyList(); + + private void ensureNegativeSpansIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + negativeSpans_ = new java.util.ArrayList(negativeSpans_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.BucketSpan, Types.BucketSpan.Builder, Types.BucketSpanOrBuilder> + negativeSpansBuilder_; + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getNegativeSpansList() { + if (negativeSpansBuilder_ == null) { + return java.util.Collections.unmodifiableList(negativeSpans_); + } else { + return negativeSpansBuilder_.getMessageList(); + } + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public int getNegativeSpansCount() { + if (negativeSpansBuilder_ == null) { + return negativeSpans_.size(); + } else { + return negativeSpansBuilder_.getCount(); + } + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpan getNegativeSpans(int index) { + if (negativeSpansBuilder_ == null) { + return negativeSpans_.get(index); + } else { + return negativeSpansBuilder_.getMessage(index); + } + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Builder setNegativeSpans(int index, Types.BucketSpan value) { + if (negativeSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNegativeSpansIsMutable(); + negativeSpans_.set(index, value); + onChanged(); + } else { + negativeSpansBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Builder setNegativeSpans(int index, Types.BucketSpan.Builder builderForValue) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + negativeSpans_.set(index, builderForValue.build()); + onChanged(); + } else { + negativeSpansBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Builder addNegativeSpans(Types.BucketSpan value) { + if (negativeSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNegativeSpansIsMutable(); + negativeSpans_.add(value); + onChanged(); + } else { + negativeSpansBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Builder addNegativeSpans(int index, Types.BucketSpan value) { + if (negativeSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNegativeSpansIsMutable(); + negativeSpans_.add(index, value); + onChanged(); + } else { + negativeSpansBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Builder addNegativeSpans(Types.BucketSpan.Builder builderForValue) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + negativeSpans_.add(builderForValue.build()); + onChanged(); + } else { + negativeSpansBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Builder addNegativeSpans(int index, Types.BucketSpan.Builder builderForValue) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + negativeSpans_.add(index, builderForValue.build()); + onChanged(); + } else { + negativeSpansBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Builder addAllNegativeSpans(Iterable values) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, negativeSpans_); + onChanged(); + } else { + negativeSpansBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Builder clearNegativeSpans() { + if (negativeSpansBuilder_ == null) { + negativeSpans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + negativeSpansBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Builder removeNegativeSpans(int index) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + negativeSpans_.remove(index); + onChanged(); + } else { + negativeSpansBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpan.Builder getNegativeSpansBuilder(int index) { + return getNegativeSpansFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpanOrBuilder getNegativeSpansOrBuilder(int index) { + if (negativeSpansBuilder_ == null) { + return negativeSpans_.get(index); + } else { + return negativeSpansBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List + getNegativeSpansOrBuilderList() { + if (negativeSpansBuilder_ != null) { + return negativeSpansBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(negativeSpans_); + } + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpan.Builder addNegativeSpansBuilder() { + return getNegativeSpansFieldBuilder() + .addBuilder(Types.BucketSpan.getDefaultInstance()); + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpan.Builder addNegativeSpansBuilder(int index) { + return getNegativeSpansFieldBuilder() + .addBuilder(index, Types.BucketSpan.getDefaultInstance()); + } + + /** + * + * + *
+             * Negative Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan negative_spans = 8 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getNegativeSpansBuilderList() { + return getNegativeSpansFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.BucketSpan, Types.BucketSpan.Builder, Types.BucketSpanOrBuilder> + getNegativeSpansFieldBuilder() { + if (negativeSpansBuilder_ == null) { + negativeSpansBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.BucketSpan, + Types.BucketSpan.Builder, + Types.BucketSpanOrBuilder>( + negativeSpans_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + negativeSpans_ = null; + } + return negativeSpansBuilder_; + } + + private com.google.protobuf.Internal.LongList negativeDeltas_ = emptyLongList(); + + private void ensureNegativeDeltasIsMutable() { + if (!negativeDeltas_.isModifiable()) { + negativeDeltas_ = makeMutableCopy(negativeDeltas_); + } + bitField0_ |= 0x00000100; + } + + /** + * + * + *
+             * Use either "negative_deltas" or "negative_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @return A list containing the negativeDeltas. + */ + public java.util.List getNegativeDeltasList() { + negativeDeltas_.makeImmutable(); + return negativeDeltas_; + } + + /** + * + * + *
+             * Use either "negative_deltas" or "negative_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @return The count of negativeDeltas. + */ + public int getNegativeDeltasCount() { + return negativeDeltas_.size(); + } + + /** + * + * + *
+             * Use either "negative_deltas" or "negative_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @param index The index of the element to return. + * @return The negativeDeltas at the given index. + */ + public long getNegativeDeltas(int index) { + return negativeDeltas_.getLong(index); + } + + /** + * + * + *
+             * Use either "negative_deltas" or "negative_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @param index The index to set the value at. + * @param value The negativeDeltas to set. + * @return This builder for chaining. + */ + public Builder setNegativeDeltas(int index, long value) { + + ensureNegativeDeltasIsMutable(); + negativeDeltas_.setLong(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+             * Use either "negative_deltas" or "negative_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @param value The negativeDeltas to add. + * @return This builder for chaining. + */ + public Builder addNegativeDeltas(long value) { + + ensureNegativeDeltasIsMutable(); + negativeDeltas_.addLong(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+             * Use either "negative_deltas" or "negative_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @param values The negativeDeltas to add. + * @return This builder for chaining. + */ + public Builder addAllNegativeDeltas(Iterable values) { + ensureNegativeDeltasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, negativeDeltas_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+             * Use either "negative_deltas" or "negative_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 negative_deltas = 9; + * + * @return This builder for chaining. + */ + public Builder clearNegativeDeltas() { + negativeDeltas_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList negativeCounts_ = emptyDoubleList(); + + private void ensureNegativeCountsIsMutable() { + if (!negativeCounts_.isModifiable()) { + negativeCounts_ = makeMutableCopy(negativeCounts_); + } + bitField0_ |= 0x00000200; + } + + private void ensureNegativeCountsIsMutable(int capacity) { + if (!negativeCounts_.isModifiable()) { + negativeCounts_ = makeMutableCopy(negativeCounts_, capacity); + } + bitField0_ |= 0x00000200; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double negative_counts = 10; + * + * @return A list containing the negativeCounts. + */ + public java.util.List getNegativeCountsList() { + negativeCounts_.makeImmutable(); + return negativeCounts_; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double negative_counts = 10; + * + * @return The count of negativeCounts. + */ + public int getNegativeCountsCount() { + return negativeCounts_.size(); + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double negative_counts = 10; + * + * @param index The index of the element to return. + * @return The negativeCounts at the given index. + */ + public double getNegativeCounts(int index) { + return negativeCounts_.getDouble(index); + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double negative_counts = 10; + * + * @param index The index to set the value at. + * @param value The negativeCounts to set. + * @return This builder for chaining. + */ + public Builder setNegativeCounts(int index, double value) { + + ensureNegativeCountsIsMutable(); + negativeCounts_.setDouble(index, value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double negative_counts = 10; + * + * @param value The negativeCounts to add. + * @return This builder for chaining. + */ + public Builder addNegativeCounts(double value) { + + ensureNegativeCountsIsMutable(); + negativeCounts_.addDouble(value); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double negative_counts = 10; + * + * @param values The negativeCounts to add. + * @return This builder for chaining. + */ + public Builder addAllNegativeCounts(Iterable values) { + ensureNegativeCountsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, negativeCounts_); + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double negative_counts = 10; + * + * @return This builder for chaining. + */ + public Builder clearNegativeCounts() { + negativeCounts_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + private java.util.List positiveSpans_ = + java.util.Collections.emptyList(); + + private void ensurePositiveSpansIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + positiveSpans_ = new java.util.ArrayList(positiveSpans_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.BucketSpan, Types.BucketSpan.Builder, Types.BucketSpanOrBuilder> + positiveSpansBuilder_; + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getPositiveSpansList() { + if (positiveSpansBuilder_ == null) { + return java.util.Collections.unmodifiableList(positiveSpans_); + } else { + return positiveSpansBuilder_.getMessageList(); + } + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public int getPositiveSpansCount() { + if (positiveSpansBuilder_ == null) { + return positiveSpans_.size(); + } else { + return positiveSpansBuilder_.getCount(); + } + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpan getPositiveSpans(int index) { + if (positiveSpansBuilder_ == null) { + return positiveSpans_.get(index); + } else { + return positiveSpansBuilder_.getMessage(index); + } + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Builder setPositiveSpans(int index, Types.BucketSpan value) { + if (positiveSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositiveSpansIsMutable(); + positiveSpans_.set(index, value); + onChanged(); + } else { + positiveSpansBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Builder setPositiveSpans(int index, Types.BucketSpan.Builder builderForValue) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + positiveSpans_.set(index, builderForValue.build()); + onChanged(); + } else { + positiveSpansBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Builder addPositiveSpans(Types.BucketSpan value) { + if (positiveSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositiveSpansIsMutable(); + positiveSpans_.add(value); + onChanged(); + } else { + positiveSpansBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Builder addPositiveSpans(int index, Types.BucketSpan value) { + if (positiveSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositiveSpansIsMutable(); + positiveSpans_.add(index, value); + onChanged(); + } else { + positiveSpansBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Builder addPositiveSpans(Types.BucketSpan.Builder builderForValue) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + positiveSpans_.add(builderForValue.build()); + onChanged(); + } else { + positiveSpansBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Builder addPositiveSpans(int index, Types.BucketSpan.Builder builderForValue) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + positiveSpans_.add(index, builderForValue.build()); + onChanged(); + } else { + positiveSpansBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Builder addAllPositiveSpans(Iterable values) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, positiveSpans_); + onChanged(); + } else { + positiveSpansBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Builder clearPositiveSpans() { + if (positiveSpansBuilder_ == null) { + positiveSpans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + positiveSpansBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Builder removePositiveSpans(int index) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + positiveSpans_.remove(index); + onChanged(); + } else { + positiveSpansBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpan.Builder getPositiveSpansBuilder(int index) { + return getPositiveSpansFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpanOrBuilder getPositiveSpansOrBuilder(int index) { + if (positiveSpansBuilder_ == null) { + return positiveSpans_.get(index); + } else { + return positiveSpansBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List + getPositiveSpansOrBuilderList() { + if (positiveSpansBuilder_ != null) { + return positiveSpansBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(positiveSpans_); + } + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpan.Builder addPositiveSpansBuilder() { + return getPositiveSpansFieldBuilder() + .addBuilder(Types.BucketSpan.getDefaultInstance()); + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public Types.BucketSpan.Builder addPositiveSpansBuilder(int index) { + return getPositiveSpansFieldBuilder() + .addBuilder(index, Types.BucketSpan.getDefaultInstance()); + } + + /** + * + * + *
+             * Positive Buckets.
+             * 
+ * + * + * repeated .prometheus.BucketSpan positive_spans = 11 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getPositiveSpansBuilderList() { + return getPositiveSpansFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.BucketSpan, Types.BucketSpan.Builder, Types.BucketSpanOrBuilder> + getPositiveSpansFieldBuilder() { + if (positiveSpansBuilder_ == null) { + positiveSpansBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.BucketSpan, + Types.BucketSpan.Builder, + Types.BucketSpanOrBuilder>( + positiveSpans_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + positiveSpans_ = null; + } + return positiveSpansBuilder_; + } + + private com.google.protobuf.Internal.LongList positiveDeltas_ = emptyLongList(); + + private void ensurePositiveDeltasIsMutable() { + if (!positiveDeltas_.isModifiable()) { + positiveDeltas_ = makeMutableCopy(positiveDeltas_); + } + bitField0_ |= 0x00000800; + } + + /** + * + * + *
+             * Use either "positive_deltas" or "positive_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @return A list containing the positiveDeltas. + */ + public java.util.List getPositiveDeltasList() { + positiveDeltas_.makeImmutable(); + return positiveDeltas_; + } + + /** + * + * + *
+             * Use either "positive_deltas" or "positive_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @return The count of positiveDeltas. + */ + public int getPositiveDeltasCount() { + return positiveDeltas_.size(); + } + + /** + * + * + *
+             * Use either "positive_deltas" or "positive_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @param index The index of the element to return. + * @return The positiveDeltas at the given index. + */ + public long getPositiveDeltas(int index) { + return positiveDeltas_.getLong(index); + } + + /** + * + * + *
+             * Use either "positive_deltas" or "positive_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @param index The index to set the value at. + * @param value The positiveDeltas to set. + * @return This builder for chaining. + */ + public Builder setPositiveDeltas(int index, long value) { + + ensurePositiveDeltasIsMutable(); + positiveDeltas_.setLong(index, value); + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+             * Use either "positive_deltas" or "positive_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @param value The positiveDeltas to add. + * @return This builder for chaining. + */ + public Builder addPositiveDeltas(long value) { + + ensurePositiveDeltasIsMutable(); + positiveDeltas_.addLong(value); + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+             * Use either "positive_deltas" or "positive_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @param values The positiveDeltas to add. + * @return This builder for chaining. + */ + public Builder addAllPositiveDeltas(Iterable values) { + ensurePositiveDeltasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, positiveDeltas_); + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+             * Use either "positive_deltas" or "positive_counts", the former for
+             * regular histograms with integer counts, the latter for float
+             * histograms.
+             * 
+ * + * repeated sint64 positive_deltas = 12; + * + * @return This builder for chaining. + */ + public Builder clearPositiveDeltas() { + positiveDeltas_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList positiveCounts_ = emptyDoubleList(); + + private void ensurePositiveCountsIsMutable() { + if (!positiveCounts_.isModifiable()) { + positiveCounts_ = makeMutableCopy(positiveCounts_); + } + bitField0_ |= 0x00001000; + } + + private void ensurePositiveCountsIsMutable(int capacity) { + if (!positiveCounts_.isModifiable()) { + positiveCounts_ = makeMutableCopy(positiveCounts_, capacity); + } + bitField0_ |= 0x00001000; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double positive_counts = 13; + * + * @return A list containing the positiveCounts. + */ + public java.util.List getPositiveCountsList() { + positiveCounts_.makeImmutable(); + return positiveCounts_; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double positive_counts = 13; + * + * @return The count of positiveCounts. + */ + public int getPositiveCountsCount() { + return positiveCounts_.size(); + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double positive_counts = 13; + * + * @param index The index of the element to return. + * @return The positiveCounts at the given index. + */ + public double getPositiveCounts(int index) { + return positiveCounts_.getDouble(index); + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double positive_counts = 13; + * + * @param index The index to set the value at. + * @param value The positiveCounts to set. + * @return This builder for chaining. + */ + public Builder setPositiveCounts(int index, double value) { + + ensurePositiveCountsIsMutable(); + positiveCounts_.setDouble(index, value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double positive_counts = 13; + * + * @param value The positiveCounts to add. + * @return This builder for chaining. + */ + public Builder addPositiveCounts(double value) { + + ensurePositiveCountsIsMutable(); + positiveCounts_.addDouble(value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double positive_counts = 13; + * + * @param values The positiveCounts to add. + * @return This builder for chaining. + */ + public Builder addAllPositiveCounts(Iterable values) { + ensurePositiveCountsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, positiveCounts_); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+             * Absolute count of each bucket.
+             * 
+ * + * repeated double positive_counts = 13; + * + * @return This builder for chaining. + */ + public Builder clearPositiveCounts() { + positiveCounts_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + + private int resetHint_ = 0; + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * + * @return The enum numeric value on the wire for resetHint. + */ + @Override + public int getResetHintValue() { + return resetHint_; + } + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * + * @param value The enum numeric value on the wire for resetHint to set. + * @return This builder for chaining. + */ + public Builder setResetHintValue(int value) { + resetHint_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * + * @return The resetHint. + */ + @Override + public Types.Histogram.ResetHint getResetHint() { + Types.Histogram.ResetHint result = Types.Histogram.ResetHint.forNumber(resetHint_); + return result == null ? Types.Histogram.ResetHint.UNRECOGNIZED : result; + } + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * + * @param value The resetHint to set. + * @return This builder for chaining. + */ + public Builder setResetHint(Types.Histogram.ResetHint value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + resetHint_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * + * @return This builder for chaining. + */ + public Builder clearResetHint() { + bitField0_ = (bitField0_ & ~0x00002000); + resetHint_ = 0; + onChanged(); + return this; + } + + private long timestamp_; + + /** + * + * + *
+             * timestamp is in ms format, see model/timestamp/timestamp.go for
+             * conversion from time.Time to Prometheus timestamp.
+             * 
+ * + * int64 timestamp = 15; + * + * @return The timestamp. + */ + @Override + public long getTimestamp() { + return timestamp_; + } + + /** + * + * + *
+             * timestamp is in ms format, see model/timestamp/timestamp.go for
+             * conversion from time.Time to Prometheus timestamp.
+             * 
+ * + * int64 timestamp = 15; + * + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+             * timestamp is in ms format, see model/timestamp/timestamp.go for
+             * conversion from time.Time to Prometheus timestamp.
+             * 
+ * + * int64 timestamp = 15; + * + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00004000); + timestamp_ = 0L; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.Histogram) + } + + // @@protoc_insertion_point(class_scope:prometheus.Histogram) + private static final Types.Histogram DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Types.Histogram(); + } + + public static Types.Histogram getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public Histogram parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Types.Histogram getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BucketSpanOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.BucketSpan) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Gap to previous span, or starting point for 1st span (which can be negative).
+         * 
+ * + * sint32 offset = 1; + * + * @return The offset. + */ + int getOffset(); + + /** + * + * + *
+         * Length of consecutive buckets.
+         * 
+ * + * uint32 length = 2; + * + * @return The length. + */ + int getLength(); + } + + /** + * + * + *
+     * A BucketSpan defines a number of consecutive buckets with their
+     * offset. Logically, it would be more straightforward to include the
+     * bucket counts in the Span. However, the protobuf representation is
+     * more compact in the way the data is structured here (with all the
+     * buckets in a single array separate from the Spans).
+     * 
+ * + *

Protobuf type {@code prometheus.BucketSpan} + */ + public static final class BucketSpan extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.BucketSpan) + BucketSpanOrBuilder { + private static final long serialVersionUID = 0L; + + // Use BucketSpan.newBuilder() to construct. + private BucketSpan(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BucketSpan() {} + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new BucketSpan(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_BucketSpan_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_BucketSpan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.BucketSpan.class, Types.BucketSpan.Builder.class); + } + + public static final int OFFSET_FIELD_NUMBER = 1; + private int offset_ = 0; + + /** + * + * + *

+         * Gap to previous span, or starting point for 1st span (which can be negative).
+         * 
+ * + * sint32 offset = 1; + * + * @return The offset. + */ + @Override + public int getOffset() { + return offset_; + } + + public static final int LENGTH_FIELD_NUMBER = 2; + private int length_ = 0; + + /** + * + * + *
+         * Length of consecutive buckets.
+         * 
+ * + * uint32 length = 2; + * + * @return The length. + */ + @Override + public int getLength() { + return length_; + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (offset_ != 0) { + output.writeSInt32(1, offset_); + } + if (length_ != 0) { + output.writeUInt32(2, length_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeSInt32Size(1, offset_); + } + if (length_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(2, length_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Types.BucketSpan)) { + return super.equals(obj); + } + Types.BucketSpan other = (Types.BucketSpan) obj; + + if (getOffset() != other.getOffset()) { + return false; + } + if (getLength() != other.getLength()) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + hash = (37 * hash) + LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getLength(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Types.BucketSpan parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.BucketSpan parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.BucketSpan parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.BucketSpan parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.BucketSpan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.BucketSpan parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.BucketSpan parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.BucketSpan 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 Types.BucketSpan parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Types.BucketSpan 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 Types.BucketSpan parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.BucketSpan parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Types.BucketSpan prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * A BucketSpan defines a number of consecutive buckets with their
+         * offset. Logically, it would be more straightforward to include the
+         * bucket counts in the Span. However, the protobuf representation is
+         * more compact in the way the data is structured here (with all the
+         * buckets in a single array separate from the Spans).
+         * 
+ * + *

Protobuf type {@code prometheus.BucketSpan} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.BucketSpan) + Types.BucketSpanOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_BucketSpan_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_BucketSpan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.BucketSpan.class, Types.BucketSpan.Builder.class); + } + + // Construct using Types.BucketSpan.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + offset_ = 0; + length_ = 0; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Types.internal_static_prometheus_BucketSpan_descriptor; + } + + @Override + public Types.BucketSpan getDefaultInstanceForType() { + return Types.BucketSpan.getDefaultInstance(); + } + + @Override + public Types.BucketSpan build() { + Types.BucketSpan result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Types.BucketSpan buildPartial() { + Types.BucketSpan result = new Types.BucketSpan(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(Types.BucketSpan result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.offset_ = offset_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.length_ = length_; + } + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Types.BucketSpan) { + return mergeFrom((Types.BucketSpan) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Types.BucketSpan other) { + if (other == Types.BucketSpan.getDefaultInstance()) { + return this; + } + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (other.getLength() != 0) { + setLength(other.getLength()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + offset_ = input.readSInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + length_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int offset_; + + /** + * + * + *

+             * Gap to previous span, or starting point for 1st span (which can be negative).
+             * 
+ * + * sint32 offset = 1; + * + * @return The offset. + */ + @Override + public int getOffset() { + return offset_; + } + + /** + * + * + *
+             * Gap to previous span, or starting point for 1st span (which can be negative).
+             * 
+ * + * sint32 offset = 1; + * + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+             * Gap to previous span, or starting point for 1st span (which can be negative).
+             * 
+ * + * sint32 offset = 1; + * + * @return This builder for chaining. + */ + public Builder clearOffset() { + bitField0_ = (bitField0_ & ~0x00000001); + offset_ = 0; + onChanged(); + return this; + } + + private int length_; + + /** + * + * + *
+             * Length of consecutive buckets.
+             * 
+ * + * uint32 length = 2; + * + * @return The length. + */ + @Override + public int getLength() { + return length_; + } + + /** + * + * + *
+             * Length of consecutive buckets.
+             * 
+ * + * uint32 length = 2; + * + * @param value The length to set. + * @return This builder for chaining. + */ + public Builder setLength(int value) { + + length_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+             * Length of consecutive buckets.
+             * 
+ * + * uint32 length = 2; + * + * @return This builder for chaining. + */ + public Builder clearLength() { + bitField0_ = (bitField0_ & ~0x00000002); + length_ = 0; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.BucketSpan) + } + + // @@protoc_insertion_point(class_scope:prometheus.BucketSpan) + private static final Types.BucketSpan DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Types.BucketSpan(); + } + + public static Types.BucketSpan getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public BucketSpan parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Types.BucketSpan getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface TimeSeriesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.TimeSeries) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + java.util.List getLabelsList(); + + /** + * + * + *
+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + Types.Label getLabels(int index); + + /** + * + * + *
+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + int getLabelsCount(); + + /** + * + * + *
+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + java.util.List getLabelsOrBuilderList(); + + /** + * + * + *
+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + Types.LabelOrBuilder getLabelsOrBuilder(int index); + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + java.util.List getSamplesList(); + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + Types.Sample getSamples(int index); + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + int getSamplesCount(); + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + java.util.List getSamplesOrBuilderList(); + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + Types.SampleOrBuilder getSamplesOrBuilder(int index); + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + java.util.List getExemplarsList(); + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + Types.Exemplar getExemplars(int index); + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + int getExemplarsCount(); + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + java.util.List getExemplarsOrBuilderList(); + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + Types.ExemplarOrBuilder getExemplarsOrBuilder(int index); + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getHistogramsList(); + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + Types.Histogram getHistograms(int index); + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + int getHistogramsCount(); + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + java.util.List getHistogramsOrBuilderList(); + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + Types.HistogramOrBuilder getHistogramsOrBuilder(int index); + } + + /** + * + * + *
+     * TimeSeries represents samples and labels for a single time series.
+     * 
+ * + *

Protobuf type {@code prometheus.TimeSeries} + */ + public static final class TimeSeries extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.TimeSeries) + TimeSeriesOrBuilder { + private static final long serialVersionUID = 0L; + + // Use TimeSeries.newBuilder() to construct. + private TimeSeries(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeSeries() { + labels_ = java.util.Collections.emptyList(); + samples_ = java.util.Collections.emptyList(); + exemplars_ = java.util.Collections.emptyList(); + histograms_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new TimeSeries(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_TimeSeries_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_TimeSeries_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.TimeSeries.class, Types.TimeSeries.Builder.class); + } + + public static final int LABELS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List labels_; + + /** + * + * + *

+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public java.util.List getLabelsList() { + return labels_; + } + + /** + * + * + *
+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public java.util.List getLabelsOrBuilderList() { + return labels_; + } + + /** + * + * + *
+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public int getLabelsCount() { + return labels_.size(); + } + + /** + * + * + *
+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public Types.Label getLabels(int index) { + return labels_.get(index); + } + + /** + * + * + *
+         * For a timeseries to be valid, and for the samples and exemplars
+         * to be ingested by the remote system properly, the labels field is required.
+         * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + @Override + public Types.LabelOrBuilder getLabelsOrBuilder(int index) { + return labels_.get(index); + } + + public static final int SAMPLES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List samples_; + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + @Override + public java.util.List getSamplesList() { + return samples_; + } + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + @Override + public java.util.List getSamplesOrBuilderList() { + return samples_; + } + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + @Override + public int getSamplesCount() { + return samples_.size(); + } + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + @Override + public Types.Sample getSamples(int index) { + return samples_.get(index); + } + + /** repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; */ + @Override + public Types.SampleOrBuilder getSamplesOrBuilder(int index) { + return samples_.get(index); + } + + public static final int EXEMPLARS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List exemplars_; + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + @Override + public java.util.List getExemplarsList() { + return exemplars_; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + @Override + public java.util.List getExemplarsOrBuilderList() { + return exemplars_; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + @Override + public int getExemplarsCount() { + return exemplars_.size(); + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + @Override + public Types.Exemplar getExemplars(int index) { + return exemplars_.get(index); + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + */ + @Override + public Types.ExemplarOrBuilder getExemplarsOrBuilder(int index) { + return exemplars_.get(index); + } + + public static final int HISTOGRAMS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List histograms_; + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getHistogramsList() { + return histograms_; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + @Override + public java.util.List getHistogramsOrBuilderList() { + return histograms_; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + @Override + public int getHistogramsCount() { + return histograms_.size(); + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.Histogram getHistograms(int index) { + return histograms_.get(index); + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + @Override + public Types.HistogramOrBuilder getHistogramsOrBuilder(int index) { + return histograms_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < labels_.size(); i++) { + output.writeMessage(1, labels_.get(i)); + } + for (int i = 0; i < samples_.size(); i++) { + output.writeMessage(2, samples_.get(i)); + } + for (int i = 0; i < exemplars_.size(); i++) { + output.writeMessage(3, exemplars_.get(i)); + } + for (int i = 0; i < histograms_.size(); i++) { + output.writeMessage(4, histograms_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + for (int i = 0; i < labels_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, labels_.get(i)); + } + for (int i = 0; i < samples_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, samples_.get(i)); + } + for (int i = 0; i < exemplars_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, exemplars_.get(i)); + } + for (int i = 0; i < histograms_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, histograms_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Types.TimeSeries)) { + return super.equals(obj); + } + Types.TimeSeries other = (Types.TimeSeries) obj; + + if (!getLabelsList().equals(other.getLabelsList())) { + return false; + } + if (!getSamplesList().equals(other.getSamplesList())) { + return false; + } + if (!getExemplarsList().equals(other.getExemplarsList())) { + return false; + } + if (!getHistogramsList().equals(other.getHistogramsList())) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLabelsCount() > 0) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + getLabelsList().hashCode(); + } + if (getSamplesCount() > 0) { + hash = (37 * hash) + SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getSamplesList().hashCode(); + } + if (getExemplarsCount() > 0) { + hash = (37 * hash) + EXEMPLARS_FIELD_NUMBER; + hash = (53 * hash) + getExemplarsList().hashCode(); + } + if (getHistogramsCount() > 0) { + hash = (37 * hash) + HISTOGRAMS_FIELD_NUMBER; + hash = (53 * hash) + getHistogramsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Types.TimeSeries parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.TimeSeries parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.TimeSeries parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.TimeSeries parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.TimeSeries parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.TimeSeries parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.TimeSeries parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.TimeSeries 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 Types.TimeSeries parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Types.TimeSeries 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 Types.TimeSeries parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.TimeSeries parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Types.TimeSeries prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+         * TimeSeries represents samples and labels for a single time series.
+         * 
+ * + *

Protobuf type {@code prometheus.TimeSeries} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.TimeSeries) + Types.TimeSeriesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_TimeSeries_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_TimeSeries_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.TimeSeries.class, Types.TimeSeries.Builder.class); + } + + // Construct using Types.TimeSeries.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (labelsBuilder_ == null) { + labels_ = java.util.Collections.emptyList(); + } else { + labels_ = null; + labelsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (samplesBuilder_ == null) { + samples_ = java.util.Collections.emptyList(); + } else { + samples_ = null; + samplesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (exemplarsBuilder_ == null) { + exemplars_ = java.util.Collections.emptyList(); + } else { + exemplars_ = null; + exemplarsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + if (histogramsBuilder_ == null) { + histograms_ = java.util.Collections.emptyList(); + } else { + histograms_ = null; + histogramsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Types.internal_static_prometheus_TimeSeries_descriptor; + } + + @Override + public Types.TimeSeries getDefaultInstanceForType() { + return Types.TimeSeries.getDefaultInstance(); + } + + @Override + public Types.TimeSeries build() { + Types.TimeSeries result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Types.TimeSeries buildPartial() { + Types.TimeSeries result = new Types.TimeSeries(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(Types.TimeSeries result) { + if (labelsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + labels_ = java.util.Collections.unmodifiableList(labels_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.labels_ = labels_; + } else { + result.labels_ = labelsBuilder_.build(); + } + if (samplesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + samples_ = java.util.Collections.unmodifiableList(samples_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.samples_ = samples_; + } else { + result.samples_ = samplesBuilder_.build(); + } + if (exemplarsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + exemplars_ = java.util.Collections.unmodifiableList(exemplars_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.exemplars_ = exemplars_; + } else { + result.exemplars_ = exemplarsBuilder_.build(); + } + if (histogramsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + histograms_ = java.util.Collections.unmodifiableList(histograms_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.histograms_ = histograms_; + } else { + result.histograms_ = histogramsBuilder_.build(); + } + } + + private void buildPartial0(Types.TimeSeries result) { + int from_bitField0_ = bitField0_; + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Types.TimeSeries) { + return mergeFrom((Types.TimeSeries) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Types.TimeSeries other) { + if (other == Types.TimeSeries.getDefaultInstance()) { + return this; + } + if (labelsBuilder_ == null) { + if (!other.labels_.isEmpty()) { + if (labels_.isEmpty()) { + labels_ = other.labels_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLabelsIsMutable(); + labels_.addAll(other.labels_); + } + onChanged(); + } + } else { + if (!other.labels_.isEmpty()) { + if (labelsBuilder_.isEmpty()) { + labelsBuilder_.dispose(); + labelsBuilder_ = null; + labels_ = other.labels_; + bitField0_ = (bitField0_ & ~0x00000001); + labelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLabelsFieldBuilder() + : null; + } else { + labelsBuilder_.addAllMessages(other.labels_); + } + } + } + if (samplesBuilder_ == null) { + if (!other.samples_.isEmpty()) { + if (samples_.isEmpty()) { + samples_ = other.samples_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSamplesIsMutable(); + samples_.addAll(other.samples_); + } + onChanged(); + } + } else { + if (!other.samples_.isEmpty()) { + if (samplesBuilder_.isEmpty()) { + samplesBuilder_.dispose(); + samplesBuilder_ = null; + samples_ = other.samples_; + bitField0_ = (bitField0_ & ~0x00000002); + samplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSamplesFieldBuilder() + : null; + } else { + samplesBuilder_.addAllMessages(other.samples_); + } + } + } + if (exemplarsBuilder_ == null) { + if (!other.exemplars_.isEmpty()) { + if (exemplars_.isEmpty()) { + exemplars_ = other.exemplars_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureExemplarsIsMutable(); + exemplars_.addAll(other.exemplars_); + } + onChanged(); + } + } else { + if (!other.exemplars_.isEmpty()) { + if (exemplarsBuilder_.isEmpty()) { + exemplarsBuilder_.dispose(); + exemplarsBuilder_ = null; + exemplars_ = other.exemplars_; + bitField0_ = (bitField0_ & ~0x00000004); + exemplarsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExemplarsFieldBuilder() + : null; + } else { + exemplarsBuilder_.addAllMessages(other.exemplars_); + } + } + } + if (histogramsBuilder_ == null) { + if (!other.histograms_.isEmpty()) { + if (histograms_.isEmpty()) { + histograms_ = other.histograms_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureHistogramsIsMutable(); + histograms_.addAll(other.histograms_); + } + onChanged(); + } + } else { + if (!other.histograms_.isEmpty()) { + if (histogramsBuilder_.isEmpty()) { + histogramsBuilder_.dispose(); + histogramsBuilder_ = null; + histograms_ = other.histograms_; + bitField0_ = (bitField0_ & ~0x00000008); + histogramsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHistogramsFieldBuilder() + : null; + } else { + histogramsBuilder_.addAllMessages(other.histograms_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + Types.Label m = + input.readMessage( + Types.Label.parser(), extensionRegistry); + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.add(m); + } else { + labelsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + Types.Sample m = + input.readMessage( + Types.Sample.parser(), extensionRegistry); + if (samplesBuilder_ == null) { + ensureSamplesIsMutable(); + samples_.add(m); + } else { + samplesBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + Types.Exemplar m = + input.readMessage( + Types.Exemplar.parser(), extensionRegistry); + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.add(m); + } else { + exemplarsBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + Types.Histogram m = + input.readMessage( + Types.Histogram.parser(), extensionRegistry); + if (histogramsBuilder_ == null) { + ensureHistogramsIsMutable(); + histograms_.add(m); + } else { + histogramsBuilder_.addMessage(m); + } + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List labels_ = java.util.Collections.emptyList(); + + private void ensureLabelsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + labels_ = new java.util.ArrayList(labels_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Label, Types.Label.Builder, Types.LabelOrBuilder> + labelsBuilder_; + + /** + * + * + *

+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public java.util.List getLabelsList() { + if (labelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(labels_); + } else { + return labelsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public int getLabelsCount() { + if (labelsBuilder_ == null) { + return labels_.size(); + } else { + return labelsBuilder_.getCount(); + } + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.Label getLabels(int index) { + if (labelsBuilder_ == null) { + return labels_.get(index); + } else { + return labelsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder setLabels(int index, Types.Label value) { + if (labelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.set(index, value); + onChanged(); + } else { + labelsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder setLabels(int index, Types.Label.Builder builderForValue) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.set(index, builderForValue.build()); + onChanged(); + } else { + labelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addLabels(Types.Label value) { + if (labelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.add(value); + onChanged(); + } else { + labelsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addLabels(int index, Types.Label value) { + if (labelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLabelsIsMutable(); + labels_.add(index, value); + onChanged(); + } else { + labelsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addLabels(Types.Label.Builder builderForValue) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.add(builderForValue.build()); + onChanged(); + } else { + labelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addLabels(int index, Types.Label.Builder builderForValue) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.add(index, builderForValue.build()); + onChanged(); + } else { + labelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder addAllLabels(Iterable values) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, labels_); + onChanged(); + } else { + labelsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder clearLabels() { + if (labelsBuilder_ == null) { + labels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + labelsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Builder removeLabels(int index) { + if (labelsBuilder_ == null) { + ensureLabelsIsMutable(); + labels_.remove(index); + onChanged(); + } else { + labelsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.Label.Builder getLabelsBuilder(int index) { + return getLabelsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.LabelOrBuilder getLabelsOrBuilder(int index) { + if (labelsBuilder_ == null) { + return labels_.get(index); + } else { + return labelsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public java.util.List getLabelsOrBuilderList() { + if (labelsBuilder_ != null) { + return labelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(labels_); + } + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.Label.Builder addLabelsBuilder() { + return getLabelsFieldBuilder().addBuilder(Types.Label.getDefaultInstance()); + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public Types.Label.Builder addLabelsBuilder(int index) { + return getLabelsFieldBuilder().addBuilder(index, Types.Label.getDefaultInstance()); + } + + /** + * + * + *
+             * For a timeseries to be valid, and for the samples and exemplars
+             * to be ingested by the remote system properly, the labels field is required.
+             * 
+ * + * repeated .prometheus.Label labels = 1 [(.gogoproto.nullable) = false]; + */ + public java.util.List getLabelsBuilderList() { + return getLabelsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Label, Types.Label.Builder, Types.LabelOrBuilder> + getLabelsFieldBuilder() { + if (labelsBuilder_ == null) { + labelsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.Label, Types.Label.Builder, Types.LabelOrBuilder>( + labels_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + labels_ = null; + } + return labelsBuilder_; + } + + private java.util.List samples_ = java.util.Collections.emptyList(); + + private void ensureSamplesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + samples_ = new java.util.ArrayList(samples_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Sample, Types.Sample.Builder, Types.SampleOrBuilder> + samplesBuilder_; + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public java.util.List getSamplesList() { + if (samplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(samples_); + } else { + return samplesBuilder_.getMessageList(); + } + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public int getSamplesCount() { + if (samplesBuilder_ == null) { + return samples_.size(); + } else { + return samplesBuilder_.getCount(); + } + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Types.Sample getSamples(int index) { + if (samplesBuilder_ == null) { + return samples_.get(index); + } else { + return samplesBuilder_.getMessage(index); + } + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Builder setSamples(int index, Types.Sample value) { + if (samplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSamplesIsMutable(); + samples_.set(index, value); + onChanged(); + } else { + samplesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Builder setSamples(int index, Types.Sample.Builder builderForValue) { + if (samplesBuilder_ == null) { + ensureSamplesIsMutable(); + samples_.set(index, builderForValue.build()); + onChanged(); + } else { + samplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Builder addSamples(Types.Sample value) { + if (samplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSamplesIsMutable(); + samples_.add(value); + onChanged(); + } else { + samplesBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Builder addSamples(int index, Types.Sample value) { + if (samplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSamplesIsMutable(); + samples_.add(index, value); + onChanged(); + } else { + samplesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Builder addSamples(Types.Sample.Builder builderForValue) { + if (samplesBuilder_ == null) { + ensureSamplesIsMutable(); + samples_.add(builderForValue.build()); + onChanged(); + } else { + samplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Builder addSamples(int index, Types.Sample.Builder builderForValue) { + if (samplesBuilder_ == null) { + ensureSamplesIsMutable(); + samples_.add(index, builderForValue.build()); + onChanged(); + } else { + samplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Builder addAllSamples(Iterable values) { + if (samplesBuilder_ == null) { + ensureSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, samples_); + onChanged(); + } else { + samplesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Builder clearSamples() { + if (samplesBuilder_ == null) { + samples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + samplesBuilder_.clear(); + } + return this; + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Builder removeSamples(int index) { + if (samplesBuilder_ == null) { + ensureSamplesIsMutable(); + samples_.remove(index); + onChanged(); + } else { + samplesBuilder_.remove(index); + } + return this; + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Types.Sample.Builder getSamplesBuilder(int index) { + return getSamplesFieldBuilder().getBuilder(index); + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Types.SampleOrBuilder getSamplesOrBuilder(int index) { + if (samplesBuilder_ == null) { + return samples_.get(index); + } else { + return samplesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public java.util.List getSamplesOrBuilderList() { + if (samplesBuilder_ != null) { + return samplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(samples_); + } + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Types.Sample.Builder addSamplesBuilder() { + return getSamplesFieldBuilder().addBuilder(Types.Sample.getDefaultInstance()); + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public Types.Sample.Builder addSamplesBuilder(int index) { + return getSamplesFieldBuilder() + .addBuilder(index, Types.Sample.getDefaultInstance()); + } + + /** + * repeated .prometheus.Sample samples = 2 [(.gogoproto.nullable) = false]; + */ + public java.util.List getSamplesBuilderList() { + return getSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Sample, Types.Sample.Builder, Types.SampleOrBuilder> + getSamplesFieldBuilder() { + if (samplesBuilder_ == null) { + samplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.Sample, Types.Sample.Builder, Types.SampleOrBuilder>( + samples_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + samples_ = null; + } + return samplesBuilder_; + } + + private java.util.List exemplars_ = java.util.Collections.emptyList(); + + private void ensureExemplarsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + exemplars_ = new java.util.ArrayList(exemplars_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Exemplar, Types.Exemplar.Builder, Types.ExemplarOrBuilder> + exemplarsBuilder_; + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getExemplarsList() { + if (exemplarsBuilder_ == null) { + return java.util.Collections.unmodifiableList(exemplars_); + } else { + return exemplarsBuilder_.getMessageList(); + } + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public int getExemplarsCount() { + if (exemplarsBuilder_ == null) { + return exemplars_.size(); + } else { + return exemplarsBuilder_.getCount(); + } + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.Exemplar getExemplars(int index) { + if (exemplarsBuilder_ == null) { + return exemplars_.get(index); + } else { + return exemplarsBuilder_.getMessage(index); + } + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder setExemplars(int index, Types.Exemplar value) { + if (exemplarsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExemplarsIsMutable(); + exemplars_.set(index, value); + onChanged(); + } else { + exemplarsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder setExemplars(int index, Types.Exemplar.Builder builderForValue) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.set(index, builderForValue.build()); + onChanged(); + } else { + exemplarsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addExemplars(Types.Exemplar value) { + if (exemplarsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExemplarsIsMutable(); + exemplars_.add(value); + onChanged(); + } else { + exemplarsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addExemplars(int index, Types.Exemplar value) { + if (exemplarsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExemplarsIsMutable(); + exemplars_.add(index, value); + onChanged(); + } else { + exemplarsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addExemplars(Types.Exemplar.Builder builderForValue) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.add(builderForValue.build()); + onChanged(); + } else { + exemplarsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addExemplars(int index, Types.Exemplar.Builder builderForValue) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.add(index, builderForValue.build()); + onChanged(); + } else { + exemplarsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder addAllExemplars(Iterable values) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exemplars_); + onChanged(); + } else { + exemplarsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder clearExemplars() { + if (exemplarsBuilder_ == null) { + exemplars_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + exemplarsBuilder_.clear(); + } + return this; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Builder removeExemplars(int index) { + if (exemplarsBuilder_ == null) { + ensureExemplarsIsMutable(); + exemplars_.remove(index); + onChanged(); + } else { + exemplarsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.Exemplar.Builder getExemplarsBuilder(int index) { + return getExemplarsFieldBuilder().getBuilder(index); + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.ExemplarOrBuilder getExemplarsOrBuilder(int index) { + if (exemplarsBuilder_ == null) { + return exemplars_.get(index); + } else { + return exemplarsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getExemplarsOrBuilderList() { + if (exemplarsBuilder_ != null) { + return exemplarsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(exemplars_); + } + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.Exemplar.Builder addExemplarsBuilder() { + return getExemplarsFieldBuilder().addBuilder(Types.Exemplar.getDefaultInstance()); + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public Types.Exemplar.Builder addExemplarsBuilder(int index) { + return getExemplarsFieldBuilder() + .addBuilder(index, Types.Exemplar.getDefaultInstance()); + } + + /** + * repeated .prometheus.Exemplar exemplars = 3 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getExemplarsBuilderList() { + return getExemplarsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Exemplar, Types.Exemplar.Builder, Types.ExemplarOrBuilder> + getExemplarsFieldBuilder() { + if (exemplarsBuilder_ == null) { + exemplarsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.Exemplar, + Types.Exemplar.Builder, + Types.ExemplarOrBuilder>( + exemplars_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + exemplars_ = null; + } + return exemplarsBuilder_; + } + + private java.util.List histograms_ = java.util.Collections.emptyList(); + + private void ensureHistogramsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + histograms_ = new java.util.ArrayList(histograms_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Histogram, Types.Histogram.Builder, Types.HistogramOrBuilder> + histogramsBuilder_; + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getHistogramsList() { + if (histogramsBuilder_ == null) { + return java.util.Collections.unmodifiableList(histograms_); + } else { + return histogramsBuilder_.getMessageList(); + } + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public int getHistogramsCount() { + if (histogramsBuilder_ == null) { + return histograms_.size(); + } else { + return histogramsBuilder_.getCount(); + } + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Types.Histogram getHistograms(int index) { + if (histogramsBuilder_ == null) { + return histograms_.get(index); + } else { + return histogramsBuilder_.getMessage(index); + } + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Builder setHistograms(int index, Types.Histogram value) { + if (histogramsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistogramsIsMutable(); + histograms_.set(index, value); + onChanged(); + } else { + histogramsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Builder setHistograms(int index, Types.Histogram.Builder builderForValue) { + if (histogramsBuilder_ == null) { + ensureHistogramsIsMutable(); + histograms_.set(index, builderForValue.build()); + onChanged(); + } else { + histogramsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Builder addHistograms(Types.Histogram value) { + if (histogramsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistogramsIsMutable(); + histograms_.add(value); + onChanged(); + } else { + histogramsBuilder_.addMessage(value); + } + return this; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Builder addHistograms(int index, Types.Histogram value) { + if (histogramsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistogramsIsMutable(); + histograms_.add(index, value); + onChanged(); + } else { + histogramsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Builder addHistograms(Types.Histogram.Builder builderForValue) { + if (histogramsBuilder_ == null) { + ensureHistogramsIsMutable(); + histograms_.add(builderForValue.build()); + onChanged(); + } else { + histogramsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Builder addHistograms(int index, Types.Histogram.Builder builderForValue) { + if (histogramsBuilder_ == null) { + ensureHistogramsIsMutable(); + histograms_.add(index, builderForValue.build()); + onChanged(); + } else { + histogramsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Builder addAllHistograms(Iterable values) { + if (histogramsBuilder_ == null) { + ensureHistogramsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, histograms_); + onChanged(); + } else { + histogramsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Builder clearHistograms() { + if (histogramsBuilder_ == null) { + histograms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + histogramsBuilder_.clear(); + } + return this; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Builder removeHistograms(int index) { + if (histogramsBuilder_ == null) { + ensureHistogramsIsMutable(); + histograms_.remove(index); + onChanged(); + } else { + histogramsBuilder_.remove(index); + } + return this; + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Types.Histogram.Builder getHistogramsBuilder(int index) { + return getHistogramsFieldBuilder().getBuilder(index); + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Types.HistogramOrBuilder getHistogramsOrBuilder(int index) { + if (histogramsBuilder_ == null) { + return histograms_.get(index); + } else { + return histogramsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getHistogramsOrBuilderList() { + if (histogramsBuilder_ != null) { + return histogramsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(histograms_); + } + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Types.Histogram.Builder addHistogramsBuilder() { + return getHistogramsFieldBuilder().addBuilder(Types.Histogram.getDefaultInstance()); + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public Types.Histogram.Builder addHistogramsBuilder(int index) { + return getHistogramsFieldBuilder() + .addBuilder(index, Types.Histogram.getDefaultInstance()); + } + + /** + * repeated .prometheus.Histogram histograms = 4 [(.gogoproto.nullable) = false]; + * + */ + public java.util.List getHistogramsBuilderList() { + return getHistogramsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Types.Histogram, Types.Histogram.Builder, Types.HistogramOrBuilder> + getHistogramsFieldBuilder() { + if (histogramsBuilder_ == null) { + histogramsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + Types.Histogram, + Types.Histogram.Builder, + Types.HistogramOrBuilder>( + histograms_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + histograms_ = null; + } + return histogramsBuilder_; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.TimeSeries) + } + + // @@protoc_insertion_point(class_scope:prometheus.TimeSeries) + private static final Types.TimeSeries DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Types.TimeSeries(); + } + + public static Types.TimeSeries getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @Override + public TimeSeries parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Types.TimeSeries getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface LabelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:prometheus.Label) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * string value = 2; + * + * @return The value. + */ + String getValue(); + + /** + * string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + } + + /** Protobuf type {@code prometheus.Label} */ + public static final class Label extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:prometheus.Label) + LabelOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Label.newBuilder() to construct. + private Label(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Label() { + name_ = ""; + value_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance(UnusedPrivateParameter unused) { + return new Label(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_Label_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_Label_fieldAccessorTable + .ensureFieldAccessorsInitialized(Types.Label.class, Types.Label.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + @Override + public String getName() { + Object ref = name_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + @Override + public com.google.protobuf.ByteString getNameBytes() { + Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile Object value_ = ""; + + /** + * string value = 2; + * + * @return The value. + */ + @Override + public String getValue() { + Object ref = value_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * string value = 2; + * + * @return The bytes for value. + */ + @Override + public com.google.protobuf.ByteString getValueBytes() { + Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) { + return true; + } + if (isInitialized == 0) { + return false; + } + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) { + return size; + } + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Types.Label)) { + return super.equals(obj); + } + Types.Label other = (Types.Label) obj; + + if (!getName().equals(other.getName())) { + return false; + } + if (!getValue().equals(other.getValue())) { + return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) { + return false; + } + return true; + } + + @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) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Types.Label parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Label parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Label parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Label parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Label parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static Types.Label parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static Types.Label parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.Label 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 Types.Label parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static Types.Label 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 Types.Label parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static Types.Label parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(Types.Label prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType(BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code prometheus.Label} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:prometheus.Label) + Types.LabelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return Types.internal_static_prometheus_Label_descriptor; + } + + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { + return Types.internal_static_prometheus_Label_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Types.Label.class, Types.Label.Builder.class); + } + + // Construct using Types.Label.newBuilder() + private Builder() {} + + private Builder(BuilderParent parent) { + super(parent); + } + + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return Types.internal_static_prometheus_Label_descriptor; + } + + @Override + public Types.Label getDefaultInstanceForType() { + return Types.Label.getDefaultInstance(); + } + + @Override + public Types.Label build() { + Types.Label result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Types.Label buildPartial() { + Types.Label result = new Types.Label(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(Types.Label result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @Override + public Builder clone() { + return super.clone(); + } + + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.setField(field, value); + } + + @Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + Object value) { + return super.setRepeatedField(field, index, value); + } + + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { + return super.addRepeatedField(field, value); + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Types.Label) { + return mergeFrom((Types.Label) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Types.Label other) { + if (other == Types.Label.getDefaultInstance()) { + return this; + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + public String getName() { + Object ref = name_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((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(String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private Object value_ = ""; + + /** + * string value = 2; + * + * @return The value. + */ + public String getValue() { + Object ref = value_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (String) ref; + } + } + + /** + * string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:prometheus.Label) + } + + // @@protoc_insertion_point(class_scope:prometheus.Label) + private static final Types.Label DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new Types.Label(); + } + + public static Types.Label getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser