Skip to content

Commit 9b3873b

Browse files
authored
Add gRPC reflection service (#5697)
* Add gRPC reflection service * Update `LICENSE-3rdparty.csv` file
1 parent 54f9667 commit 9b3873b

File tree

14 files changed

+93
-7
lines changed

14 files changed

+93
-7
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ QUESTIONS.txt
1919
# These are backup files generated by rustfmt
2020
**/*.rs.bk
2121

22+
.env
2223
.idea
2324
.vscode
2425
.vscode-license
2526
deps
26-
qwdata
2727
elastic-search-artifacts
28-
.env
28+
qwdata
29+
30+
# Generated by prost/tonic build
31+
*_descriptor.bin

LICENSE-3rdparty.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ tokio-tungstenite,https://github.com/snapview/tokio-tungstenite,MIT,"Daniel Abra
454454
toml,https://github.com/toml-rs/toml,MIT OR Apache-2.0,Alex Crichton <alex@alexcrichton.com>
455455
toml_edit,https://github.com/toml-rs/toml,MIT OR Apache-2.0,"Andronik Ordian <write@reusable.software>, Ed Page <eopage@gmail.com>"
456456
tonic,https://github.com/hyperium/tonic,MIT,Lucio Franco <luciofranco14@gmail.com>
457+
tonic-reflection,https://github.com/hyperium/tonic,MIT,"James Nugent <james@jen20.com>, Samani G. Gikandi <samani@gojulas.com>"
457458
tower,https://github.com/tower-rs/tower,MIT,Tower Maintainers <team@tower-rs.com>
458459
tower-http,https://github.com/tower-rs/tower-http,MIT,Tower Maintainers <team@tower-rs.com>
459460
tracing,https://github.com/tokio-rs/tracing,MIT,"Eliza Weisman <eliza@buoyant.io>, Tokio Contributors <team@tokio.rs>"

quickwit/Cargo.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quickwit/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ tokio-util = { version = "0.7", features = ["full"] }
245245
toml = "0.7.6"
246246
tonic = { version = "0.9.0", features = ["gzip"] }
247247
tonic-build = "0.9.0"
248+
tonic-reflection = "0.9"
248249
tower = { version = "0.4.13", features = [
249250
"balance",
250251
"buffer",

quickwit/quickwit-proto/build.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2222
// services.
2323
//
2424
// Cluster service.
25+
let mut prost_config = prost_build::Config::default();
26+
prost_config.file_descriptor_set_path("src/codegen/quickwit/cluster_descriptor.bin");
27+
2528
Codegen::builder()
29+
.with_prost_config(prost_config)
2630
.with_protos(&["protos/quickwit/cluster.proto"])
2731
.with_output_dir("src/codegen/quickwit")
2832
.with_result_type_path("crate::cluster::ClusterResult")
@@ -33,6 +37,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
3337

3438
// Control plane.
3539
let mut prost_config = prost_build::Config::default();
40+
prost_config.file_descriptor_set_path("src/codegen/quickwit/control_plane_descriptor.bin");
41+
3642
prost_config
3743
.extern_path(
3844
".quickwit.common.DocMappingUid",
@@ -52,7 +58,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
5258

5359
// Developer service.
5460
let mut prost_config = prost_build::Config::default();
55-
prost_config.bytes(["GetDebugInfoResponse.debug_info_json"]);
61+
prost_config
62+
.bytes(["GetDebugInfoResponse.debug_info_json"])
63+
.file_descriptor_set_path("src/codegen/quickwit/developer_descriptor.bin");
5664

5765
Codegen::builder()
5866
.with_prost_config(prost_config)
@@ -72,7 +80,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
7280
"crate::types::PipelineUid",
7381
)
7482
.extern_path(".quickwit.common.IndexUid", "crate::types::IndexUid")
75-
.extern_path(".quickwit.ingest.ShardId", "crate::types::ShardId");
83+
.extern_path(".quickwit.ingest.ShardId", "crate::types::ShardId")
84+
.file_descriptor_set_path("src/codegen/quickwit/indexing_descriptor.bin");
7685

7786
Codegen::builder()
7887
.with_prost_config(prost_config)
@@ -107,7 +116,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
107116
.field_attribute(
108117
"DeleteQuery.end_timestamp",
109118
"#[serde(skip_serializing_if = \"Option::is_none\")]",
110-
);
119+
)
120+
.file_descriptor_set_path("src/codegen/quickwit/metastore_descriptor.bin");
111121

112122
Codegen::builder()
113123
.with_prost_config(prost_config)
@@ -157,7 +167,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
157167
.field_attribute(
158168
"Shard.update_timestamp",
159169
"#[serde(default = \"super::compatibility_shard_update_timestamp\")]",
160-
);
170+
)
171+
.file_descriptor_set_path("src/codegen/quickwit/ingest_descriptor.bin");
161172

162173
Codegen::builder()
163174
.with_prost_config(prost_config)
@@ -175,7 +186,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
175186

176187
// Search service.
177188
let mut prost_config = prost_build::Config::default();
178-
prost_config.protoc_arg("--experimental_allow_proto3_optional");
189+
prost_config
190+
.file_descriptor_set_path("src/codegen/quickwit/search_descriptor.bin")
191+
.protoc_arg("--experimental_allow_proto3_optional");
179192

180193
tonic_build::configure()
181194
.enum_attribute(".", "#[serde(rename_all=\"snake_case\")]")

quickwit/quickwit-proto/src/cluster/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ use crate::GrpcServiceError;
2222

2323
include!("../codegen/quickwit/quickwit.cluster.rs");
2424

25+
pub const CLUSTER_PLANE_FILE_DESCRIPTOR_SET: &[u8] =
26+
include_bytes!("../codegen/quickwit/cluster_descriptor.bin");
27+
2528
pub type ClusterResult<T> = std::result::Result<T, ClusterError>;
2629

2730
#[derive(Debug, thiserror::Error, Eq, PartialEq, Serialize, Deserialize)]

quickwit/quickwit-proto/src/control_plane/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ use crate::{GrpcServiceError, ServiceError, ServiceErrorCode};
2323

2424
include!("../codegen/quickwit/quickwit.control_plane.rs");
2525

26+
pub const CONTROL_PLANE_FILE_DESCRIPTOR_SET: &[u8] =
27+
include_bytes!("../codegen/quickwit/control_plane_descriptor.bin");
28+
2629
pub type ControlPlaneResult<T> = std::result::Result<T, ControlPlaneError>;
2730

2831
#[derive(Debug, thiserror::Error, Eq, PartialEq, Serialize, Deserialize)]

quickwit/quickwit-proto/src/developer/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ use crate::{GrpcServiceError, ServiceError, ServiceErrorCode};
1818

1919
include!("../codegen/quickwit/quickwit.developer.rs");
2020

21+
pub const DEVELOPER_FILE_DESCRIPTOR_SET: &[u8] =
22+
include_bytes!("../codegen/quickwit/developer_descriptor.bin");
23+
2124
pub type DeveloperResult<T> = std::result::Result<T, DeveloperError>;
2225

2326
#[derive(Debug, thiserror::Error, Eq, PartialEq, serde::Serialize, serde::Deserialize)]

quickwit/quickwit-proto/src/indexing/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ use crate::{GrpcServiceError, ServiceError, ServiceErrorCode};
3131

3232
include!("../codegen/quickwit/quickwit.indexing.rs");
3333

34+
pub const INDEXING_FILE_DESCRIPTOR_SET: &[u8] =
35+
include_bytes!("../codegen/quickwit/indexing_descriptor.bin");
36+
3437
pub type IndexingResult<T> = std::result::Result<T, IndexingError>;
3538

3639
#[derive(Debug, thiserror::Error, Eq, PartialEq, Serialize, Deserialize)]

quickwit/quickwit-proto/src/ingest/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ pub mod ingester;
3030
pub mod router;
3131

3232
include!("../codegen/quickwit/quickwit.ingest.rs");
33+
34+
pub const INGEST_FILE_DESCRIPTOR_SET: &[u8] =
35+
include_bytes!("../codegen/quickwit/ingest_descriptor.bin");
36+
3337
pub type IngestV2Result<T> = std::result::Result<T, IngestV2Error>;
3438

3539
#[derive(Debug, Copy, Clone, thiserror::Error, Eq, PartialEq, Serialize, Deserialize)]

0 commit comments

Comments
 (0)