├── .github ├── pull_request_template.md └── workflows │ ├── license.yaml │ ├── main.yml │ ├── mvn_publish.yml │ └── semantic-pr.yml ├── .gitignore ├── .typos.toml ├── Cargo.toml ├── LICENSE ├── Makefile ├── README.md ├── build.rs ├── c++ ├── CMakeLists.txt ├── greptime │ └── v1 │ │ ├── column.grpc.pb.cc │ │ ├── column.grpc.pb.h │ │ ├── column.pb.cc │ │ ├── column.pb.h │ │ ├── common.grpc.pb.cc │ │ ├── common.grpc.pb.h │ │ ├── common.pb.cc │ │ ├── common.pb.h │ │ ├── database.grpc.pb.cc │ │ ├── database.grpc.pb.h │ │ ├── database.pb.cc │ │ ├── database.pb.h │ │ ├── ddl.grpc.pb.cc │ │ ├── ddl.grpc.pb.h │ │ ├── ddl.pb.cc │ │ ├── ddl.pb.h │ │ ├── flow │ │ ├── server.grpc.pb.cc │ │ ├── server.grpc.pb.h │ │ ├── server.pb.cc │ │ └── server.pb.h │ │ ├── health.grpc.pb.cc │ │ ├── health.grpc.pb.h │ │ ├── health.pb.cc │ │ ├── health.pb.h │ │ ├── index │ │ ├── bloom_filter.grpc.pb.cc │ │ ├── bloom_filter.grpc.pb.h │ │ ├── bloom_filter.pb.cc │ │ ├── bloom_filter.pb.h │ │ ├── inverted_index.grpc.pb.cc │ │ ├── inverted_index.grpc.pb.h │ │ ├── inverted_index.pb.cc │ │ └── inverted_index.pb.h │ │ ├── meta │ │ ├── cluster.grpc.pb.cc │ │ ├── cluster.grpc.pb.h │ │ ├── cluster.pb.cc │ │ ├── cluster.pb.h │ │ ├── common.grpc.pb.cc │ │ ├── common.grpc.pb.h │ │ ├── common.pb.cc │ │ ├── common.pb.h │ │ ├── ddl.grpc.pb.cc │ │ ├── ddl.grpc.pb.h │ │ ├── ddl.pb.cc │ │ ├── ddl.pb.h │ │ ├── heartbeat.grpc.pb.cc │ │ ├── heartbeat.grpc.pb.h │ │ ├── heartbeat.pb.cc │ │ ├── heartbeat.pb.h │ │ ├── lock.grpc.pb.cc │ │ ├── lock.grpc.pb.h │ │ ├── lock.pb.cc │ │ ├── lock.pb.h │ │ ├── procedure.grpc.pb.cc │ │ ├── procedure.grpc.pb.h │ │ ├── procedure.pb.cc │ │ ├── procedure.pb.h │ │ ├── region.grpc.pb.cc │ │ ├── region.grpc.pb.h │ │ ├── region.pb.cc │ │ ├── region.pb.h │ │ ├── route.grpc.pb.cc │ │ ├── route.grpc.pb.h │ │ ├── route.pb.cc │ │ ├── route.pb.h │ │ ├── store.grpc.pb.cc │ │ ├── store.grpc.pb.h │ │ ├── store.pb.cc │ │ └── store.pb.h │ │ ├── prom.grpc.pb.cc │ │ ├── prom.grpc.pb.h │ │ ├── prom.pb.cc │ │ ├── prom.pb.h │ │ ├── region │ │ ├── server.grpc.pb.cc │ │ ├── server.grpc.pb.h │ │ ├── server.pb.cc │ │ └── server.pb.h │ │ ├── row.grpc.pb.cc │ │ ├── row.grpc.pb.h │ │ ├── row.pb.cc │ │ ├── row.pb.h │ │ ├── wal.grpc.pb.cc │ │ ├── wal.grpc.pb.h │ │ ├── wal.pb.cc │ │ └── wal.pb.h ├── prometheus │ └── remote │ │ ├── remote.grpc.pb.cc │ │ ├── remote.grpc.pb.h │ │ ├── remote.pb.cc │ │ ├── remote.pb.h │ │ ├── types.grpc.pb.cc │ │ ├── types.grpc.pb.h │ │ ├── types.pb.cc │ │ └── types.pb.h └── substrait_extension │ ├── dist_plan.grpc.pb.cc │ ├── dist_plan.grpc.pb.h │ ├── dist_plan.pb.cc │ ├── dist_plan.pb.h │ ├── promql_plan.grpc.pb.cc │ ├── promql_plan.grpc.pb.h │ ├── promql_plan.pb.cc │ └── promql_plan.pb.h ├── go.mod ├── go.sum ├── go ├── greptime │ └── v1 │ │ ├── column.pb.go │ │ ├── common.pb.go │ │ ├── database.pb.go │ │ ├── database_grpc.pb.go │ │ ├── ddl.pb.go │ │ ├── health.pb.go │ │ ├── health_grpc.pb.go │ │ ├── meta │ │ ├── cluster.pb.go │ │ ├── cluster_grpc.pb.go │ │ ├── common.pb.go │ │ ├── ddl.pb.go │ │ ├── ddl_grpc.pb.go │ │ ├── heartbeat.pb.go │ │ ├── heartbeat_grpc.pb.go │ │ ├── lock.pb.go │ │ ├── lock_grpc.pb.go │ │ ├── procedure.pb.go │ │ ├── procedure_grpc.pb.go │ │ ├── region.pb.go │ │ ├── route.pb.go │ │ ├── route_grpc.pb.go │ │ ├── store.pb.go │ │ └── store_grpc.pb.go │ │ ├── prom.pb.go │ │ ├── prom_grpc.pb.go │ │ ├── row.pb.go │ │ └── wal.pb.go ├── prometheus │ └── remote │ │ ├── remote.pb.go │ │ └── types.pb.go └── substrait_extension │ ├── dist_plan.pb.go │ └── promql_plan.pb.go ├── java ├── pom.xml └── src │ └── main │ └── java │ ├── greptime │ └── v1 │ │ ├── Wal.java │ │ ├── index │ │ ├── BloomFilter.java │ │ └── InvertedIndex.java │ │ └── meta │ │ ├── ClusterOuterClass.java │ │ ├── Common.java │ │ ├── Ddl.java │ │ ├── HeartbeatOuterClass.java │ │ ├── LockOuterClass.java │ │ ├── Procedure.java │ │ ├── ProcedureOuterClass.java │ │ ├── Region.java │ │ ├── Route.java │ │ └── StoreOuterClass.java │ ├── io │ └── greptime │ │ └── v1 │ │ ├── Columns.java │ │ ├── Common.java │ │ ├── Database.java │ │ ├── Ddl.java │ │ ├── Health.java │ │ ├── Prometheus.java │ │ ├── RowData.java │ │ ├── flow │ │ └── Server.java │ │ ├── index │ │ ├── Index.java │ │ └── InvertedIndex.java │ │ └── region │ │ └── Server.java │ ├── prometheus │ ├── Remote.java │ └── Types.java │ └── substrait_extension │ ├── DistPlan.java │ └── PromqlPlan.java ├── jitpack.yml ├── licenserc.toml ├── proto ├── greptime │ └── v1 │ │ ├── column.proto │ │ ├── common.proto │ │ ├── database.proto │ │ ├── ddl.proto │ │ ├── flow │ │ └── server.proto │ │ ├── health.proto │ │ ├── index │ │ ├── bloom_filter.proto │ │ └── inverted_index.proto │ │ ├── meta │ │ ├── cluster.proto │ │ ├── common.proto │ │ ├── ddl.proto │ │ ├── heartbeat.proto │ │ ├── lock.proto │ │ ├── procedure.proto │ │ ├── region.proto │ │ ├── route.proto │ │ └── store.proto │ │ ├── prom.proto │ │ ├── region │ │ └── server.proto │ │ ├── row.proto │ │ └── wal.proto ├── prometheus │ └── remote │ │ ├── remote.proto │ │ └── types.proto └── substrait_extension │ ├── dist_plan.proto │ └── promql_plan.proto ├── scripts ├── generate-cpp.sh ├── generate-go.sh └── generate-java.sh └── src ├── lib.rs ├── v1.rs └── v1 ├── flow.rs ├── index.rs ├── meta.rs ├── meta └── mailbox.rs └── region.rs /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | I hereby agree to the terms of the [GreptimeDB CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md). 2 | 3 | ## Refer to a related PR or issue link (optional) 4 | 5 | ## What's changed and what's your intention? 6 | 7 | __!!! DO NOT LEAVE THIS BLOCK EMPTY !!!__ 8 | 9 | Please explain IN DETAIL what the changes are in this PR and why they are needed: 10 | 11 | - Summarize your change (**mandatory**) 12 | - How does this PR work? Need a brief introduction for the changed logic (optional) 13 | - Describe clearly one logical change and avoid lazy messages (optional) 14 | - Describe any limitations of the current code (optional) 15 | 16 | ## Checklist 17 | 18 | - [ ] I have written the necessary comments. 19 | - [ ] I have added the necessary unit tests and integration tests. 20 | -------------------------------------------------------------------------------- /.github/workflows/license.yaml: -------------------------------------------------------------------------------- 1 | name: License checker 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | types: [opened, synchronize, reopened, ready_for_review] 9 | jobs: 10 | license-header-check: 11 | runs-on: ubuntu-24.04 12 | name: license-header-check 13 | steps: 14 | - uses: actions/checkout@v4 15 | - name: Check License Header 16 | uses: korandoru/hawkeye@v5 17 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | types: [opened, synchronize, reopened, ready_for_review] 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | name: CI 10 | 11 | env: 12 | RUST_TOOLCHAIN: stable 13 | 14 | jobs: 15 | typos: 16 | name: Spell Check with Typos 17 | runs-on: ubuntu-24.04 18 | steps: 19 | - uses: actions/checkout@v4 20 | - uses: crate-ci/typos@master 21 | 22 | check: 23 | name: Check 24 | if: github.event.pull_request.draft == false 25 | runs-on: ubuntu-24.04 26 | timeout-minutes: 60 27 | steps: 28 | - uses: actions/checkout@v4 29 | - name: Setup Go 30 | uses: actions/setup-go@v5 31 | with: 32 | go-version: "1.18.4" 33 | - uses: arduino/setup-protoc@v3 34 | with: 35 | repo-token: ${{ secrets.GITHUB_TOKEN }} 36 | - uses: dtolnay/rust-toolchain@master 37 | with: 38 | toolchain: ${{ env.RUST_TOOLCHAIN }} 39 | - name: Rust Cache 40 | uses: Swatinem/rust-cache@v2 41 | - name: Run cargo check 42 | run: cargo check --workspace --all-targets 43 | - name: Check Go protbuf generation 44 | run: | 45 | make go 46 | test $(git status --porcelain=v1 | wc -l) -eq 0 || (echo "Fail: generated go protobuf in github action is different from pushed ones" ; exit 1) 47 | 48 | fmt: 49 | name: Rustfmt 50 | if: github.event.pull_request.draft == false 51 | runs-on: ubuntu-24.04 52 | timeout-minutes: 60 53 | steps: 54 | - uses: actions/checkout@v4 55 | - uses: arduino/setup-protoc@v3 56 | with: 57 | repo-token: ${{ secrets.GITHUB_TOKEN }} 58 | - uses: dtolnay/rust-toolchain@master 59 | with: 60 | toolchain: ${{ env.RUST_TOOLCHAIN }} 61 | components: rustfmt 62 | - name: Rust Cache 63 | uses: Swatinem/rust-cache@v2 64 | - name: Run cargo fmt 65 | run: cargo fmt --all -- --check 66 | 67 | clippy: 68 | name: Clippy 69 | if: github.event.pull_request.draft == false 70 | runs-on: ubuntu-24.04 71 | timeout-minutes: 60 72 | steps: 73 | - uses: actions/checkout@v4 74 | - uses: arduino/setup-protoc@v3 75 | with: 76 | repo-token: ${{ secrets.GITHUB_TOKEN }} 77 | - uses: dtolnay/rust-toolchain@master 78 | with: 79 | toolchain: ${{ env.RUST_TOOLCHAIN }} 80 | components: clippy 81 | - name: Rust Cache 82 | uses: Swatinem/rust-cache@v2 83 | - name: Run cargo clippy 84 | run: cargo clippy --workspace --all-targets -- -D warnings -D clippy::print_stdout -D clippy::print_stderr 85 | -------------------------------------------------------------------------------- /.github/workflows/mvn_publish.yml: -------------------------------------------------------------------------------- 1 | name: Maven Publish 2 | 3 | on: 4 | release: 5 | types: [ created ] 6 | workflow_dispatch: 7 | 8 | jobs: 9 | publish: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout Git Repo 13 | uses: actions/checkout@v4 14 | 15 | - name: Set up JDK 1.8 16 | uses: actions/setup-java@v4 17 | with: 18 | java-version: '8' 19 | distribution: 'zulu' 20 | server-id: ossrh 21 | server-username: MAVEN_USERNAME 22 | server-password: MAVEN_PASSWORD 23 | gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import 24 | gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase 25 | 26 | - name: Build with Maven 27 | run: | 28 | cd java 29 | mvn clean deploy --batch-mode -DskipTests -P release -B -U -e 30 | env: 31 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 32 | MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} 33 | MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} 34 | -------------------------------------------------------------------------------- /.github/workflows/semantic-pr.yml: -------------------------------------------------------------------------------- 1 | name: "Semantic Pull Request" 2 | on: 3 | pull_request_target: 4 | types: 5 | - opened 6 | - edited 7 | - synchronize 8 | - labeled 9 | - unlabeled 10 | 11 | jobs: 12 | check: 13 | runs-on: ubuntu-24.04 14 | timeout-minutes: 10 15 | steps: 16 | - uses: amannn/action-semantic-pull-request@v5 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | 12 | # JetBrains IDE config directory 13 | .idea/ 14 | *.iml 15 | 16 | # VSCode IDE config directory 17 | .vscode/ 18 | 19 | # ccls cache dir 20 | .ccls-cache/ 21 | -------------------------------------------------------------------------------- /.typos.toml: -------------------------------------------------------------------------------- 1 | [files] 2 | extend-exclude = [ 3 | # Exclude all generated files 4 | "**/greptime/v1/**", 5 | ] 6 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "greptime-proto" 3 | version = "0.1.0" 4 | edition = "2021" 5 | license = "Apache-2.0" 6 | 7 | [dependencies] 8 | prost = "0.13" 9 | serde = { version = "1.0", features = ["derive"] } 10 | serde_json = "1.0" 11 | strum = "0.25" 12 | strum_macros = "0.25" 13 | tonic = "0.12" 14 | 15 | [build-dependencies] 16 | tonic-build = "0.12" 17 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all rust go go-deps java 2 | 3 | BUILDER_CONTAINER=namely/protoc-all:1.51_1 4 | 5 | all: rust go java cpp 6 | 7 | rust: 8 | cargo build 9 | 10 | go: go-deps 11 | docker run --rm -t -w /greptime-proto \ 12 | --entrypoint ./scripts/generate-go.sh \ 13 | -v ${PWD}:/greptime-proto ${BUILDER_CONTAINER} 14 | 15 | go-deps: 16 | go mod download 17 | 18 | java: 19 | docker run --rm -t -w /greptime-proto \ 20 | --entrypoint ./scripts/generate-java.sh \ 21 | -v ${PWD}:/greptime-proto ${BUILDER_CONTAINER} 22 | 23 | cpp: 24 | docker run --rm -t -w /greptime-proto \ 25 | --entrypoint ./scripts/generate-cpp.sh \ 26 | -v ${PWD}:/greptime-proto ${BUILDER_CONTAINER} 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # greptime-proto 2 | 3 | GreptimeDB protobuf files. 4 | 5 | ## Build 6 | 7 | ### Requirement 8 | 9 | - [google/protobuf][protobuf] v3 10 | 11 | ### Command 12 | 13 | - **Compile for Rust** 14 | 15 | ```console 16 | make rust 17 | ``` 18 | 19 | - **Compile for Go** 20 | 21 | ```console 22 | make go 23 | ``` 24 | 25 | - **Compile for Java** 26 | 27 | ```console 28 | make java 29 | ``` 30 | 31 | The compilation for Go and Java will use builder container `namely/protoc-all`. 32 | 33 | ## Usage 34 | 35 | ### Rust 36 | 37 | ```Toml 38 | # Add this repository as dependency to your Cargo.toml file: 39 | greptime-proto = { git = "https://github.com/GreptimeTeam/greptime-proto.git" } 40 | ``` 41 | 42 | ```Rust 43 | // To use the GreptimeDB's gRPC service: 44 | use greptime_proto::v1::*; 45 | 46 | // To talk to GreptimeDB Meta service: 47 | use greptime_proto::v1::meta::*; 48 | 49 | // To request GreptimeDB as Prometheus remote read/write: 50 | use greptime_proto::prometheus::remote::*; 51 | ``` 52 | 53 | ### Go 54 | 55 | Download the go module: 56 | 57 | ```console 58 | go get github.com/GreptimeTeam/greptime-proto@main 59 | ``` 60 | 61 | Then use greptime-proto as the normal Go module: 62 | 63 | ```go 64 | import ( 65 | greptimev1 "github.com/GreptimeTeam/greptime-proto/go/greptime/v1" 66 | ) 67 | ... 68 | ``` 69 | 70 | ## For SDK developers 71 | 72 | GreptimeDB's gRPC service is built on top of [Arrow Flight RPC][flight]. You can find the Arrow's 73 | official implementation status of each programming language [flight rpc][flight-rpc]. 74 | 75 | > If you can't find the language you are using, you can always generate the Arrow Flight gRPC 76 | > service from the raw protobuf definition [flight protobuf definitions][flight-protobuf]. Or call 77 | > into other language binding like C++. 78 | 79 | Once the Arrow Flight client is ready, you only need to care about the following protobuf files to 80 | accomplish our SDK writing: 81 | 82 | ```console 83 | . 84 | ├── greptime 85 | │   └── v1 86 | │   ├── column.proto 87 | │   ├── common.proto 88 | │   ├── database.proto 89 | │   ├── ddl.proto 90 | │   ├── health.proto 91 | │   └── prom.proto 92 | ``` 93 | 94 | > You can find all protobuf files in the directory "proto" under the project's root. 95 | 96 | Right now the GreptimeDB only responds to Arrow Flight's `do_get` interface. All the reads and 97 | writes (that are from clients) are handled there. `do_get` needs a "ticket" as the input request, 98 | you need to serialize the `GreptimeRequest` message defined in "database.proto" for it. 99 | 100 | There are 3 kinds of `GreptimeRequest`, which are: 101 | 102 | - `InsertRequest`, carries the data to be ingested. It's a little verbose to assemble, especially 103 | the "column"s that define the schema and value of the input data. You can find the definition of 104 | "column" in "column.proto". 105 | - `QueryRequest` has the SQL in it. Note that you can `INSERT INTO` GreptimeDB as well as `SELECT` 106 | it. 107 | - `DdlRequest` defines the "Data Definition Language" request, like table creation or deletion. It's 108 | sometimes more representative than the normal SQL. `DdlRequest`s are defined in "ddl.proto". 109 | 110 | There's also `RequestHeader` in the `GreptimeRequest` to specify the "catalog" and "schema" to be 111 | used in this request. If either one is not set (or left empty), GreptimeDB will use the default 112 | catalog "greptime" and default schema "public". 113 | 114 | The response of `do_get` is handled in Arrow Flight's client. It's a stream of `FlightData`. You can 115 | find its definition in Arrow Flight's protobuf file. Special care must be taken when dealing with 116 | insertion, that GreptimeDB puts insertion result in `FlightData`'s metadata. Insertion results, 117 | either from `InsertRequest` or `INSERT INTO` SQL, are both have the same format, that "Affected 118 | Rows: x". "x" represents the rows that are successfully inserted. When dealing with this special 119 | `FlightData`, please ignore its `data_body` field, but directly strip the `app_metadata` field from 120 | it, and deserialize the bytes as `FlightMetadata` message. You will find the "affected rows" result 121 | in it. 122 | 123 | We already have our SDK written in [Java][java-sdk], [Rust]() and [Go][go-sdk], feel free to take 124 | any of them as an example. 125 | 126 | 127 | [protobuf]: https://github.com/protocolbuffers/protobuf 128 | [flight]: https://arrow.apache.org/docs/format/Flight.html 129 | [flight-rpc]: https://arrow.apache.org/docs/status.html#flight-rpc 130 | [flight-protobuf]: https://arrow.apache.org/docs/format/Flight.html#protocol-buffer-definitions 131 | [java-sdk]: https://github.com/GreptimeTeam/greptimedb-client-java 132 | [go-sdk]: https://github.com/GreptimeTeam/greptimedb-client-go 133 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | use std::path::PathBuf; 16 | 17 | fn main() { 18 | let out_dir = PathBuf::from( 19 | std::env::var("OUT_DIR") 20 | .expect("cargo built-in env value 'OUT_DIR' must be set during compilation"), 21 | ); 22 | 23 | tonic_build::configure() 24 | .file_descriptor_set_path(out_dir.join("greptime_grpc_desc.bin")) 25 | .type_attribute( 26 | ".greptime.v1.SemanticType", 27 | "#[derive(::serde::Serialize, ::serde::Deserialize)]", 28 | ) 29 | .type_attribute( 30 | ".greptime.v1.meta.Peer", 31 | "#[derive(::serde::Serialize, ::serde::Deserialize)]", 32 | ) 33 | .type_attribute( 34 | ".greptime.v1.meta.HeartbeatRequest.node_workloads", 35 | "#[derive(::serde::Serialize, ::serde::Deserialize)]", 36 | ) 37 | .type_attribute( 38 | ".greptime.v1.meta.DatanodeWorkloads", 39 | "#[derive(::serde::Serialize, ::serde::Deserialize)]", 40 | ) 41 | .type_attribute( 42 | ".greptime.v1.meta.FrontendWorkloads", 43 | "#[derive(::serde::Serialize, ::serde::Deserialize)]", 44 | ) 45 | .type_attribute( 46 | ".greptime.v1.meta.FlownodeWorkloads", 47 | "#[derive(::serde::Serialize, ::serde::Deserialize)]", 48 | ) 49 | .enum_attribute( 50 | "region.RegionRequest.body", 51 | "#[derive(strum_macros::AsRefStr)]", 52 | ) 53 | .bytes([".greptime.v1.ArrowIpc"]) 54 | .compile_protos( 55 | &[ 56 | "proto/greptime/v1/database.proto", 57 | "proto/greptime/v1/health.proto", 58 | "proto/greptime/v1/wal.proto", 59 | "proto/greptime/v1/meta/common.proto", 60 | "proto/greptime/v1/meta/heartbeat.proto", 61 | "proto/greptime/v1/meta/route.proto", 62 | "proto/greptime/v1/meta/ddl.proto", 63 | "proto/greptime/v1/meta/region.proto", 64 | "proto/greptime/v1/meta/store.proto", 65 | "proto/greptime/v1/meta/lock.proto", 66 | "proto/greptime/v1/meta/cluster.proto", 67 | "proto/greptime/v1/meta/procedure.proto", 68 | "proto/greptime/v1/region/server.proto", 69 | "proto/greptime/v1/flow/server.proto", 70 | "proto/greptime/v1/index/bloom_filter.proto", 71 | "proto/greptime/v1/index/inverted_index.proto", 72 | "proto/prometheus/remote/remote.proto", 73 | "proto/substrait_extension/promql_plan.proto", 74 | "proto/substrait_extension/dist_plan.proto", 75 | ], 76 | &["proto"], 77 | ) 78 | .expect("compile proto"); 79 | } 80 | -------------------------------------------------------------------------------- /c++/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Greptime Team 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy of 5 | # the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations under 13 | # the License. 14 | 15 | cmake_minimum_required(VERSION 3.22) 16 | 17 | project(greptime_proto_cpp_lib) 18 | 19 | file(GLOB_RECURSE OUTPUT_SOURCES "*.h" "*.cc") 20 | 21 | add_library(${PROJECT_NAME} ${OUTPUT_SOURCES}) 22 | 23 | target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 24 | -------------------------------------------------------------------------------- /c++/greptime/v1/column.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/column.proto 4 | 5 | #include "greptime/v1/column.pb.h" 6 | #include "greptime/v1/column.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | 25 | } // namespace greptime 26 | } // namespace v1 27 | 28 | -------------------------------------------------------------------------------- /c++/greptime/v1/column.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/column.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2fcolumn_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2fcolumn_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/column.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | 46 | } // namespace v1 47 | } // namespace greptime 48 | 49 | 50 | #endif // GRPC_greptime_2fv1_2fcolumn_2eproto__INCLUDED 51 | -------------------------------------------------------------------------------- /c++/greptime/v1/common.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/common.proto 4 | 5 | #include "greptime/v1/common.pb.h" 6 | #include "greptime/v1/common.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | 25 | } // namespace greptime 26 | } // namespace v1 27 | 28 | -------------------------------------------------------------------------------- /c++/greptime/v1/common.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/common.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2fcommon_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2fcommon_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/common.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | 46 | } // namespace v1 47 | } // namespace greptime 48 | 49 | 50 | #endif // GRPC_greptime_2fv1_2fcommon_2eproto__INCLUDED 51 | -------------------------------------------------------------------------------- /c++/greptime/v1/ddl.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/ddl.proto 4 | 5 | #include "greptime/v1/ddl.pb.h" 6 | #include "greptime/v1/ddl.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | 25 | } // namespace greptime 26 | } // namespace v1 27 | 28 | -------------------------------------------------------------------------------- /c++/greptime/v1/ddl.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/ddl.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2fddl_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2fddl_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/ddl.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | 46 | } // namespace v1 47 | } // namespace greptime 48 | 49 | 50 | #endif // GRPC_greptime_2fv1_2fddl_2eproto__INCLUDED 51 | -------------------------------------------------------------------------------- /c++/greptime/v1/health.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/health.proto 4 | 5 | #include "greptime/v1/health.pb.h" 6 | #include "greptime/v1/health.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | 25 | static const char* HealthCheck_method_names[] = { 26 | "/greptime.v1.HealthCheck/HealthCheck", 27 | }; 28 | 29 | std::unique_ptr< HealthCheck::Stub> HealthCheck::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { 30 | (void)options; 31 | std::unique_ptr< HealthCheck::Stub> stub(new HealthCheck::Stub(channel, options)); 32 | return stub; 33 | } 34 | 35 | HealthCheck::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) 36 | : channel_(channel), rpcmethod_HealthCheck_(HealthCheck_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) 37 | {} 38 | 39 | ::grpc::Status HealthCheck::Stub::HealthCheck(::grpc::ClientContext* context, const ::greptime::v1::HealthCheckRequest& request, ::greptime::v1::HealthCheckResponse* response) { 40 | return ::grpc::internal::BlockingUnaryCall< ::greptime::v1::HealthCheckRequest, ::greptime::v1::HealthCheckResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_HealthCheck_, context, request, response); 41 | } 42 | 43 | void HealthCheck::Stub::async::HealthCheck(::grpc::ClientContext* context, const ::greptime::v1::HealthCheckRequest* request, ::greptime::v1::HealthCheckResponse* response, std::function f) { 44 | ::grpc::internal::CallbackUnaryCall< ::greptime::v1::HealthCheckRequest, ::greptime::v1::HealthCheckResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_HealthCheck_, context, request, response, std::move(f)); 45 | } 46 | 47 | void HealthCheck::Stub::async::HealthCheck(::grpc::ClientContext* context, const ::greptime::v1::HealthCheckRequest* request, ::greptime::v1::HealthCheckResponse* response, ::grpc::ClientUnaryReactor* reactor) { 48 | ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_HealthCheck_, context, request, response, reactor); 49 | } 50 | 51 | ::grpc::ClientAsyncResponseReader< ::greptime::v1::HealthCheckResponse>* HealthCheck::Stub::PrepareAsyncHealthCheckRaw(::grpc::ClientContext* context, const ::greptime::v1::HealthCheckRequest& request, ::grpc::CompletionQueue* cq) { 52 | return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::greptime::v1::HealthCheckResponse, ::greptime::v1::HealthCheckRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_HealthCheck_, context, request); 53 | } 54 | 55 | ::grpc::ClientAsyncResponseReader< ::greptime::v1::HealthCheckResponse>* HealthCheck::Stub::AsyncHealthCheckRaw(::grpc::ClientContext* context, const ::greptime::v1::HealthCheckRequest& request, ::grpc::CompletionQueue* cq) { 56 | auto* result = 57 | this->PrepareAsyncHealthCheckRaw(context, request, cq); 58 | result->StartCall(); 59 | return result; 60 | } 61 | 62 | HealthCheck::Service::Service() { 63 | AddMethod(new ::grpc::internal::RpcServiceMethod( 64 | HealthCheck_method_names[0], 65 | ::grpc::internal::RpcMethod::NORMAL_RPC, 66 | new ::grpc::internal::RpcMethodHandler< HealthCheck::Service, ::greptime::v1::HealthCheckRequest, ::greptime::v1::HealthCheckResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( 67 | [](HealthCheck::Service* service, 68 | ::grpc::ServerContext* ctx, 69 | const ::greptime::v1::HealthCheckRequest* req, 70 | ::greptime::v1::HealthCheckResponse* resp) { 71 | return service->HealthCheck(ctx, req, resp); 72 | }, this))); 73 | } 74 | 75 | HealthCheck::Service::~Service() { 76 | } 77 | 78 | ::grpc::Status HealthCheck::Service::HealthCheck(::grpc::ServerContext* context, const ::greptime::v1::HealthCheckRequest* request, ::greptime::v1::HealthCheckResponse* response) { 79 | (void) context; 80 | (void) request; 81 | (void) response; 82 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 83 | } 84 | 85 | 86 | } // namespace greptime 87 | } // namespace v1 88 | 89 | -------------------------------------------------------------------------------- /c++/greptime/v1/index/bloom_filter.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/index/bloom_filter.proto 4 | 5 | #include "greptime/v1/index/bloom_filter.pb.h" 6 | #include "greptime/v1/index/bloom_filter.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | namespace index { 25 | 26 | } // namespace greptime 27 | } // namespace v1 28 | } // namespace index 29 | 30 | -------------------------------------------------------------------------------- /c++/greptime/v1/index/bloom_filter.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/index/bloom_filter.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2findex_2fbloom_5ffilter_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2findex_2fbloom_5ffilter_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/index/bloom_filter.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | namespace index { 46 | 47 | } // namespace index 48 | } // namespace v1 49 | } // namespace greptime 50 | 51 | 52 | #endif // GRPC_greptime_2fv1_2findex_2fbloom_5ffilter_2eproto__INCLUDED 53 | -------------------------------------------------------------------------------- /c++/greptime/v1/index/inverted_index.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/index/inverted_index.proto 4 | 5 | #include "greptime/v1/index/inverted_index.pb.h" 6 | #include "greptime/v1/index/inverted_index.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | namespace index { 25 | 26 | } // namespace greptime 27 | } // namespace v1 28 | } // namespace index 29 | 30 | -------------------------------------------------------------------------------- /c++/greptime/v1/index/inverted_index.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/index/inverted_index.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2findex_2finverted_5findex_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2findex_2finverted_5findex_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/index/inverted_index.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | namespace index { 46 | 47 | } // namespace index 48 | } // namespace v1 49 | } // namespace greptime 50 | 51 | 52 | #endif // GRPC_greptime_2fv1_2findex_2finverted_5findex_2eproto__INCLUDED 53 | -------------------------------------------------------------------------------- /c++/greptime/v1/meta/common.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/meta/common.proto 4 | 5 | #include "greptime/v1/meta/common.pb.h" 6 | #include "greptime/v1/meta/common.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | namespace meta { 25 | 26 | } // namespace greptime 27 | } // namespace v1 28 | } // namespace meta 29 | 30 | -------------------------------------------------------------------------------- /c++/greptime/v1/meta/common.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/meta/common.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2fmeta_2fcommon_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2fmeta_2fcommon_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/meta/common.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | namespace meta { 46 | 47 | } // namespace meta 48 | } // namespace v1 49 | } // namespace greptime 50 | 51 | 52 | #endif // GRPC_greptime_2fv1_2fmeta_2fcommon_2eproto__INCLUDED 53 | -------------------------------------------------------------------------------- /c++/greptime/v1/meta/ddl.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/meta/ddl.proto 4 | 5 | #include "greptime/v1/meta/ddl.pb.h" 6 | #include "greptime/v1/meta/ddl.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | namespace meta { 25 | 26 | } // namespace greptime 27 | } // namespace v1 28 | } // namespace meta 29 | 30 | -------------------------------------------------------------------------------- /c++/greptime/v1/meta/ddl.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/meta/ddl.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2fmeta_2fddl_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2fmeta_2fddl_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/meta/ddl.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | namespace meta { 46 | 47 | } // namespace meta 48 | } // namespace v1 49 | } // namespace greptime 50 | 51 | 52 | #endif // GRPC_greptime_2fv1_2fmeta_2fddl_2eproto__INCLUDED 53 | -------------------------------------------------------------------------------- /c++/greptime/v1/meta/region.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/meta/region.proto 4 | 5 | #include "greptime/v1/meta/region.pb.h" 6 | #include "greptime/v1/meta/region.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | namespace meta { 25 | 26 | } // namespace greptime 27 | } // namespace v1 28 | } // namespace meta 29 | 30 | -------------------------------------------------------------------------------- /c++/greptime/v1/meta/region.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/meta/region.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2fmeta_2fregion_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2fmeta_2fregion_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/meta/region.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | namespace meta { 46 | 47 | } // namespace meta 48 | } // namespace v1 49 | } // namespace greptime 50 | 51 | 52 | #endif // GRPC_greptime_2fv1_2fmeta_2fregion_2eproto__INCLUDED 53 | -------------------------------------------------------------------------------- /c++/greptime/v1/meta/route.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/meta/route.proto 4 | 5 | #include "greptime/v1/meta/route.pb.h" 6 | #include "greptime/v1/meta/route.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | namespace meta { 25 | 26 | } // namespace greptime 27 | } // namespace v1 28 | } // namespace meta 29 | 30 | -------------------------------------------------------------------------------- /c++/greptime/v1/meta/route.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/meta/route.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2fmeta_2froute_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2fmeta_2froute_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/meta/route.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | namespace meta { 46 | 47 | } // namespace meta 48 | } // namespace v1 49 | } // namespace greptime 50 | 51 | 52 | #endif // GRPC_greptime_2fv1_2fmeta_2froute_2eproto__INCLUDED 53 | -------------------------------------------------------------------------------- /c++/greptime/v1/prom.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/prom.proto 4 | 5 | #include "greptime/v1/prom.pb.h" 6 | #include "greptime/v1/prom.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | 25 | static const char* PrometheusGateway_method_names[] = { 26 | "/greptime.v1.PrometheusGateway/Handle", 27 | }; 28 | 29 | std::unique_ptr< PrometheusGateway::Stub> PrometheusGateway::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { 30 | (void)options; 31 | std::unique_ptr< PrometheusGateway::Stub> stub(new PrometheusGateway::Stub(channel, options)); 32 | return stub; 33 | } 34 | 35 | PrometheusGateway::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) 36 | : channel_(channel), rpcmethod_Handle_(PrometheusGateway_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) 37 | {} 38 | 39 | ::grpc::Status PrometheusGateway::Stub::Handle(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest& request, ::greptime::v1::PromqlResponse* response) { 40 | return ::grpc::internal::BlockingUnaryCall< ::greptime::v1::PromqlRequest, ::greptime::v1::PromqlResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Handle_, context, request, response); 41 | } 42 | 43 | void PrometheusGateway::Stub::async::Handle(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest* request, ::greptime::v1::PromqlResponse* response, std::function f) { 44 | ::grpc::internal::CallbackUnaryCall< ::greptime::v1::PromqlRequest, ::greptime::v1::PromqlResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Handle_, context, request, response, std::move(f)); 45 | } 46 | 47 | void PrometheusGateway::Stub::async::Handle(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest* request, ::greptime::v1::PromqlResponse* response, ::grpc::ClientUnaryReactor* reactor) { 48 | ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Handle_, context, request, response, reactor); 49 | } 50 | 51 | ::grpc::ClientAsyncResponseReader< ::greptime::v1::PromqlResponse>* PrometheusGateway::Stub::PrepareAsyncHandleRaw(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest& request, ::grpc::CompletionQueue* cq) { 52 | return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::greptime::v1::PromqlResponse, ::greptime::v1::PromqlRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Handle_, context, request); 53 | } 54 | 55 | ::grpc::ClientAsyncResponseReader< ::greptime::v1::PromqlResponse>* PrometheusGateway::Stub::AsyncHandleRaw(::grpc::ClientContext* context, const ::greptime::v1::PromqlRequest& request, ::grpc::CompletionQueue* cq) { 56 | auto* result = 57 | this->PrepareAsyncHandleRaw(context, request, cq); 58 | result->StartCall(); 59 | return result; 60 | } 61 | 62 | PrometheusGateway::Service::Service() { 63 | AddMethod(new ::grpc::internal::RpcServiceMethod( 64 | PrometheusGateway_method_names[0], 65 | ::grpc::internal::RpcMethod::NORMAL_RPC, 66 | new ::grpc::internal::RpcMethodHandler< PrometheusGateway::Service, ::greptime::v1::PromqlRequest, ::greptime::v1::PromqlResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( 67 | [](PrometheusGateway::Service* service, 68 | ::grpc::ServerContext* ctx, 69 | const ::greptime::v1::PromqlRequest* req, 70 | ::greptime::v1::PromqlResponse* resp) { 71 | return service->Handle(ctx, req, resp); 72 | }, this))); 73 | } 74 | 75 | PrometheusGateway::Service::~Service() { 76 | } 77 | 78 | ::grpc::Status PrometheusGateway::Service::Handle(::grpc::ServerContext* context, const ::greptime::v1::PromqlRequest* request, ::greptime::v1::PromqlResponse* response) { 79 | (void) context; 80 | (void) request; 81 | (void) response; 82 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 83 | } 84 | 85 | 86 | } // namespace greptime 87 | } // namespace v1 88 | 89 | -------------------------------------------------------------------------------- /c++/greptime/v1/region/server.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/region/server.proto 4 | 5 | #include "greptime/v1/region/server.pb.h" 6 | #include "greptime/v1/region/server.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | namespace region { 25 | 26 | static const char* Region_method_names[] = { 27 | "/greptime.v1.region.Region/Handle", 28 | }; 29 | 30 | std::unique_ptr< Region::Stub> Region::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { 31 | (void)options; 32 | std::unique_ptr< Region::Stub> stub(new Region::Stub(channel, options)); 33 | return stub; 34 | } 35 | 36 | Region::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) 37 | : channel_(channel), rpcmethod_Handle_(Region_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel) 38 | {} 39 | 40 | ::grpc::Status Region::Stub::Handle(::grpc::ClientContext* context, const ::greptime::v1::region::RegionRequest& request, ::greptime::v1::region::RegionResponse* response) { 41 | return ::grpc::internal::BlockingUnaryCall< ::greptime::v1::region::RegionRequest, ::greptime::v1::region::RegionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_Handle_, context, request, response); 42 | } 43 | 44 | void Region::Stub::async::Handle(::grpc::ClientContext* context, const ::greptime::v1::region::RegionRequest* request, ::greptime::v1::region::RegionResponse* response, std::function f) { 45 | ::grpc::internal::CallbackUnaryCall< ::greptime::v1::region::RegionRequest, ::greptime::v1::region::RegionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Handle_, context, request, response, std::move(f)); 46 | } 47 | 48 | void Region::Stub::async::Handle(::grpc::ClientContext* context, const ::greptime::v1::region::RegionRequest* request, ::greptime::v1::region::RegionResponse* response, ::grpc::ClientUnaryReactor* reactor) { 49 | ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_Handle_, context, request, response, reactor); 50 | } 51 | 52 | ::grpc::ClientAsyncResponseReader< ::greptime::v1::region::RegionResponse>* Region::Stub::PrepareAsyncHandleRaw(::grpc::ClientContext* context, const ::greptime::v1::region::RegionRequest& request, ::grpc::CompletionQueue* cq) { 53 | return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::greptime::v1::region::RegionResponse, ::greptime::v1::region::RegionRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_Handle_, context, request); 54 | } 55 | 56 | ::grpc::ClientAsyncResponseReader< ::greptime::v1::region::RegionResponse>* Region::Stub::AsyncHandleRaw(::grpc::ClientContext* context, const ::greptime::v1::region::RegionRequest& request, ::grpc::CompletionQueue* cq) { 57 | auto* result = 58 | this->PrepareAsyncHandleRaw(context, request, cq); 59 | result->StartCall(); 60 | return result; 61 | } 62 | 63 | Region::Service::Service() { 64 | AddMethod(new ::grpc::internal::RpcServiceMethod( 65 | Region_method_names[0], 66 | ::grpc::internal::RpcMethod::NORMAL_RPC, 67 | new ::grpc::internal::RpcMethodHandler< Region::Service, ::greptime::v1::region::RegionRequest, ::greptime::v1::region::RegionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>( 68 | [](Region::Service* service, 69 | ::grpc::ServerContext* ctx, 70 | const ::greptime::v1::region::RegionRequest* req, 71 | ::greptime::v1::region::RegionResponse* resp) { 72 | return service->Handle(ctx, req, resp); 73 | }, this))); 74 | } 75 | 76 | Region::Service::~Service() { 77 | } 78 | 79 | ::grpc::Status Region::Service::Handle(::grpc::ServerContext* context, const ::greptime::v1::region::RegionRequest* request, ::greptime::v1::region::RegionResponse* response) { 80 | (void) context; 81 | (void) request; 82 | (void) response; 83 | return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); 84 | } 85 | 86 | 87 | } // namespace greptime 88 | } // namespace v1 89 | } // namespace region 90 | 91 | -------------------------------------------------------------------------------- /c++/greptime/v1/row.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/row.proto 4 | 5 | #include "greptime/v1/row.pb.h" 6 | #include "greptime/v1/row.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | 25 | } // namespace greptime 26 | } // namespace v1 27 | 28 | -------------------------------------------------------------------------------- /c++/greptime/v1/row.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/row.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2frow_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2frow_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/row.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | 46 | } // namespace v1 47 | } // namespace greptime 48 | 49 | 50 | #endif // GRPC_greptime_2fv1_2frow_2eproto__INCLUDED 51 | -------------------------------------------------------------------------------- /c++/greptime/v1/wal.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/wal.proto 4 | 5 | #include "greptime/v1/wal.pb.h" 6 | #include "greptime/v1/wal.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace greptime { 23 | namespace v1 { 24 | 25 | } // namespace greptime 26 | } // namespace v1 27 | 28 | -------------------------------------------------------------------------------- /c++/greptime/v1/wal.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: greptime/v1/wal.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_greptime_2fv1_2fwal_2eproto__INCLUDED 20 | #define GRPC_greptime_2fv1_2fwal_2eproto__INCLUDED 21 | 22 | #include "greptime/v1/wal.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace greptime { 44 | namespace v1 { 45 | 46 | } // namespace v1 47 | } // namespace greptime 48 | 49 | 50 | #endif // GRPC_greptime_2fv1_2fwal_2eproto__INCLUDED 51 | -------------------------------------------------------------------------------- /c++/prometheus/remote/remote.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: prometheus/remote/remote.proto 4 | 5 | #include "prometheus/remote/remote.pb.h" 6 | #include "prometheus/remote/remote.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace prometheus { 23 | 24 | } // namespace prometheus 25 | 26 | -------------------------------------------------------------------------------- /c++/prometheus/remote/remote.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: prometheus/remote/remote.proto 4 | // Original file comments: 5 | // Copyright 2016 Prometheus Team 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // 18 | #ifndef GRPC_prometheus_2fremote_2fremote_2eproto__INCLUDED 19 | #define GRPC_prometheus_2fremote_2fremote_2eproto__INCLUDED 20 | 21 | #include "prometheus/remote/remote.pb.h" 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | namespace prometheus { 43 | 44 | } // namespace prometheus 45 | 46 | 47 | #endif // GRPC_prometheus_2fremote_2fremote_2eproto__INCLUDED 48 | -------------------------------------------------------------------------------- /c++/prometheus/remote/types.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: prometheus/remote/types.proto 4 | 5 | #include "prometheus/remote/types.pb.h" 6 | #include "prometheus/remote/types.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace prometheus { 23 | 24 | } // namespace prometheus 25 | 26 | -------------------------------------------------------------------------------- /c++/prometheus/remote/types.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: prometheus/remote/types.proto 4 | // Original file comments: 5 | // Copyright 2017 Prometheus Team 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | // 18 | #ifndef GRPC_prometheus_2fremote_2ftypes_2eproto__INCLUDED 19 | #define GRPC_prometheus_2fremote_2ftypes_2eproto__INCLUDED 20 | 21 | #include "prometheus/remote/types.pb.h" 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | namespace prometheus { 43 | 44 | } // namespace prometheus 45 | 46 | 47 | #endif // GRPC_prometheus_2fremote_2ftypes_2eproto__INCLUDED 48 | -------------------------------------------------------------------------------- /c++/substrait_extension/dist_plan.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: substrait_extension/dist_plan.proto 4 | 5 | #include "substrait_extension/dist_plan.pb.h" 6 | #include "substrait_extension/dist_plan.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace substrait_extension { 23 | 24 | } // namespace substrait_extension 25 | 26 | -------------------------------------------------------------------------------- /c++/substrait_extension/dist_plan.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: substrait_extension/dist_plan.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_substrait_5fextension_2fdist_5fplan_2eproto__INCLUDED 20 | #define GRPC_substrait_5fextension_2fdist_5fplan_2eproto__INCLUDED 21 | 22 | #include "substrait_extension/dist_plan.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace substrait_extension { 44 | 45 | } // namespace substrait_extension 46 | 47 | 48 | #endif // GRPC_substrait_5fextension_2fdist_5fplan_2eproto__INCLUDED 49 | -------------------------------------------------------------------------------- /c++/substrait_extension/promql_plan.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: substrait_extension/promql_plan.proto 4 | 5 | #include "substrait_extension/promql_plan.pb.h" 6 | #include "substrait_extension/promql_plan.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace substrait_extension { 23 | 24 | } // namespace substrait_extension 25 | 26 | -------------------------------------------------------------------------------- /c++/substrait_extension/promql_plan.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: substrait_extension/promql_plan.proto 4 | // Original file comments: 5 | // Copyright 2023 Greptime Team 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | // 19 | #ifndef GRPC_substrait_5fextension_2fpromql_5fplan_2eproto__INCLUDED 20 | #define GRPC_substrait_5fextension_2fpromql_5fplan_2eproto__INCLUDED 21 | 22 | #include "substrait_extension/promql_plan.pb.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace substrait_extension { 44 | 45 | } // namespace substrait_extension 46 | 47 | 48 | #endif // GRPC_substrait_5fextension_2fpromql_5fplan_2eproto__INCLUDED 49 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/GreptimeTeam/greptime-proto 2 | 3 | go 1.18 4 | 5 | require ( 6 | google.golang.org/grpc v1.53.0 7 | google.golang.org/protobuf v1.28.1 8 | ) 9 | 10 | require ( 11 | github.com/golang/protobuf v1.5.2 // indirect 12 | golang.org/x/net v0.5.0 // indirect 13 | golang.org/x/sys v0.4.0 // indirect 14 | golang.org/x/text v0.6.0 // indirect 15 | google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect 16 | ) 17 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 2 | github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= 3 | github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 4 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 5 | github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= 6 | golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= 7 | golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= 8 | golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= 9 | golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 10 | golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= 11 | golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 12 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 13 | google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= 14 | google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= 15 | google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= 16 | google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= 17 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 18 | google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= 19 | google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= 20 | google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 21 | -------------------------------------------------------------------------------- /go/greptime/v1/database_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.2.0 4 | // - protoc v3.21.6 5 | // source: greptime/v1/database.proto 6 | 7 | package v1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.32.0 or later. 19 | const _ = grpc.SupportPackageIsVersion7 20 | 21 | // GreptimeDatabaseClient is the client API for GreptimeDatabase service. 22 | // 23 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 | type GreptimeDatabaseClient interface { 25 | Handle(ctx context.Context, in *GreptimeRequest, opts ...grpc.CallOption) (*GreptimeResponse, error) 26 | HandleRequests(ctx context.Context, opts ...grpc.CallOption) (GreptimeDatabase_HandleRequestsClient, error) 27 | } 28 | 29 | type greptimeDatabaseClient struct { 30 | cc grpc.ClientConnInterface 31 | } 32 | 33 | func NewGreptimeDatabaseClient(cc grpc.ClientConnInterface) GreptimeDatabaseClient { 34 | return &greptimeDatabaseClient{cc} 35 | } 36 | 37 | func (c *greptimeDatabaseClient) Handle(ctx context.Context, in *GreptimeRequest, opts ...grpc.CallOption) (*GreptimeResponse, error) { 38 | out := new(GreptimeResponse) 39 | err := c.cc.Invoke(ctx, "/greptime.v1.GreptimeDatabase/Handle", in, out, opts...) 40 | if err != nil { 41 | return nil, err 42 | } 43 | return out, nil 44 | } 45 | 46 | func (c *greptimeDatabaseClient) HandleRequests(ctx context.Context, opts ...grpc.CallOption) (GreptimeDatabase_HandleRequestsClient, error) { 47 | stream, err := c.cc.NewStream(ctx, &GreptimeDatabase_ServiceDesc.Streams[0], "/greptime.v1.GreptimeDatabase/HandleRequests", opts...) 48 | if err != nil { 49 | return nil, err 50 | } 51 | x := &greptimeDatabaseHandleRequestsClient{stream} 52 | return x, nil 53 | } 54 | 55 | type GreptimeDatabase_HandleRequestsClient interface { 56 | Send(*GreptimeRequest) error 57 | CloseAndRecv() (*GreptimeResponse, error) 58 | grpc.ClientStream 59 | } 60 | 61 | type greptimeDatabaseHandleRequestsClient struct { 62 | grpc.ClientStream 63 | } 64 | 65 | func (x *greptimeDatabaseHandleRequestsClient) Send(m *GreptimeRequest) error { 66 | return x.ClientStream.SendMsg(m) 67 | } 68 | 69 | func (x *greptimeDatabaseHandleRequestsClient) CloseAndRecv() (*GreptimeResponse, error) { 70 | if err := x.ClientStream.CloseSend(); err != nil { 71 | return nil, err 72 | } 73 | m := new(GreptimeResponse) 74 | if err := x.ClientStream.RecvMsg(m); err != nil { 75 | return nil, err 76 | } 77 | return m, nil 78 | } 79 | 80 | // GreptimeDatabaseServer is the server API for GreptimeDatabase service. 81 | // All implementations must embed UnimplementedGreptimeDatabaseServer 82 | // for forward compatibility 83 | type GreptimeDatabaseServer interface { 84 | Handle(context.Context, *GreptimeRequest) (*GreptimeResponse, error) 85 | HandleRequests(GreptimeDatabase_HandleRequestsServer) error 86 | mustEmbedUnimplementedGreptimeDatabaseServer() 87 | } 88 | 89 | // UnimplementedGreptimeDatabaseServer must be embedded to have forward compatible implementations. 90 | type UnimplementedGreptimeDatabaseServer struct { 91 | } 92 | 93 | func (UnimplementedGreptimeDatabaseServer) Handle(context.Context, *GreptimeRequest) (*GreptimeResponse, error) { 94 | return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") 95 | } 96 | func (UnimplementedGreptimeDatabaseServer) HandleRequests(GreptimeDatabase_HandleRequestsServer) error { 97 | return status.Errorf(codes.Unimplemented, "method HandleRequests not implemented") 98 | } 99 | func (UnimplementedGreptimeDatabaseServer) mustEmbedUnimplementedGreptimeDatabaseServer() {} 100 | 101 | // UnsafeGreptimeDatabaseServer may be embedded to opt out of forward compatibility for this service. 102 | // Use of this interface is not recommended, as added methods to GreptimeDatabaseServer will 103 | // result in compilation errors. 104 | type UnsafeGreptimeDatabaseServer interface { 105 | mustEmbedUnimplementedGreptimeDatabaseServer() 106 | } 107 | 108 | func RegisterGreptimeDatabaseServer(s grpc.ServiceRegistrar, srv GreptimeDatabaseServer) { 109 | s.RegisterService(&GreptimeDatabase_ServiceDesc, srv) 110 | } 111 | 112 | func _GreptimeDatabase_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 113 | in := new(GreptimeRequest) 114 | if err := dec(in); err != nil { 115 | return nil, err 116 | } 117 | if interceptor == nil { 118 | return srv.(GreptimeDatabaseServer).Handle(ctx, in) 119 | } 120 | info := &grpc.UnaryServerInfo{ 121 | Server: srv, 122 | FullMethod: "/greptime.v1.GreptimeDatabase/Handle", 123 | } 124 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 125 | return srv.(GreptimeDatabaseServer).Handle(ctx, req.(*GreptimeRequest)) 126 | } 127 | return interceptor(ctx, in, info, handler) 128 | } 129 | 130 | func _GreptimeDatabase_HandleRequests_Handler(srv interface{}, stream grpc.ServerStream) error { 131 | return srv.(GreptimeDatabaseServer).HandleRequests(&greptimeDatabaseHandleRequestsServer{stream}) 132 | } 133 | 134 | type GreptimeDatabase_HandleRequestsServer interface { 135 | SendAndClose(*GreptimeResponse) error 136 | Recv() (*GreptimeRequest, error) 137 | grpc.ServerStream 138 | } 139 | 140 | type greptimeDatabaseHandleRequestsServer struct { 141 | grpc.ServerStream 142 | } 143 | 144 | func (x *greptimeDatabaseHandleRequestsServer) SendAndClose(m *GreptimeResponse) error { 145 | return x.ServerStream.SendMsg(m) 146 | } 147 | 148 | func (x *greptimeDatabaseHandleRequestsServer) Recv() (*GreptimeRequest, error) { 149 | m := new(GreptimeRequest) 150 | if err := x.ServerStream.RecvMsg(m); err != nil { 151 | return nil, err 152 | } 153 | return m, nil 154 | } 155 | 156 | // GreptimeDatabase_ServiceDesc is the grpc.ServiceDesc for GreptimeDatabase service. 157 | // It's only intended for direct use with grpc.RegisterService, 158 | // and not to be introspected or modified (even as a copy) 159 | var GreptimeDatabase_ServiceDesc = grpc.ServiceDesc{ 160 | ServiceName: "greptime.v1.GreptimeDatabase", 161 | HandlerType: (*GreptimeDatabaseServer)(nil), 162 | Methods: []grpc.MethodDesc{ 163 | { 164 | MethodName: "Handle", 165 | Handler: _GreptimeDatabase_Handle_Handler, 166 | }, 167 | }, 168 | Streams: []grpc.StreamDesc{ 169 | { 170 | StreamName: "HandleRequests", 171 | Handler: _GreptimeDatabase_HandleRequests_Handler, 172 | ClientStreams: true, 173 | }, 174 | }, 175 | Metadata: "greptime/v1/database.proto", 176 | } 177 | -------------------------------------------------------------------------------- /go/greptime/v1/health_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.2.0 4 | // - protoc v3.21.6 5 | // source: greptime/v1/health.proto 6 | 7 | package v1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.32.0 or later. 19 | const _ = grpc.SupportPackageIsVersion7 20 | 21 | // HealthCheckClient is the client API for HealthCheck service. 22 | // 23 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 | type HealthCheckClient interface { 25 | HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) 26 | } 27 | 28 | type healthCheckClient struct { 29 | cc grpc.ClientConnInterface 30 | } 31 | 32 | func NewHealthCheckClient(cc grpc.ClientConnInterface) HealthCheckClient { 33 | return &healthCheckClient{cc} 34 | } 35 | 36 | func (c *healthCheckClient) HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { 37 | out := new(HealthCheckResponse) 38 | err := c.cc.Invoke(ctx, "/greptime.v1.HealthCheck/HealthCheck", in, out, opts...) 39 | if err != nil { 40 | return nil, err 41 | } 42 | return out, nil 43 | } 44 | 45 | // HealthCheckServer is the server API for HealthCheck service. 46 | // All implementations must embed UnimplementedHealthCheckServer 47 | // for forward compatibility 48 | type HealthCheckServer interface { 49 | HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) 50 | mustEmbedUnimplementedHealthCheckServer() 51 | } 52 | 53 | // UnimplementedHealthCheckServer must be embedded to have forward compatible implementations. 54 | type UnimplementedHealthCheckServer struct { 55 | } 56 | 57 | func (UnimplementedHealthCheckServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { 58 | return nil, status.Errorf(codes.Unimplemented, "method HealthCheck not implemented") 59 | } 60 | func (UnimplementedHealthCheckServer) mustEmbedUnimplementedHealthCheckServer() {} 61 | 62 | // UnsafeHealthCheckServer may be embedded to opt out of forward compatibility for this service. 63 | // Use of this interface is not recommended, as added methods to HealthCheckServer will 64 | // result in compilation errors. 65 | type UnsafeHealthCheckServer interface { 66 | mustEmbedUnimplementedHealthCheckServer() 67 | } 68 | 69 | func RegisterHealthCheckServer(s grpc.ServiceRegistrar, srv HealthCheckServer) { 70 | s.RegisterService(&HealthCheck_ServiceDesc, srv) 71 | } 72 | 73 | func _HealthCheck_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 74 | in := new(HealthCheckRequest) 75 | if err := dec(in); err != nil { 76 | return nil, err 77 | } 78 | if interceptor == nil { 79 | return srv.(HealthCheckServer).HealthCheck(ctx, in) 80 | } 81 | info := &grpc.UnaryServerInfo{ 82 | Server: srv, 83 | FullMethod: "/greptime.v1.HealthCheck/HealthCheck", 84 | } 85 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 86 | return srv.(HealthCheckServer).HealthCheck(ctx, req.(*HealthCheckRequest)) 87 | } 88 | return interceptor(ctx, in, info, handler) 89 | } 90 | 91 | // HealthCheck_ServiceDesc is the grpc.ServiceDesc for HealthCheck service. 92 | // It's only intended for direct use with grpc.RegisterService, 93 | // and not to be introspected or modified (even as a copy) 94 | var HealthCheck_ServiceDesc = grpc.ServiceDesc{ 95 | ServiceName: "greptime.v1.HealthCheck", 96 | HandlerType: (*HealthCheckServer)(nil), 97 | Methods: []grpc.MethodDesc{ 98 | { 99 | MethodName: "HealthCheck", 100 | Handler: _HealthCheck_HealthCheck_Handler, 101 | }, 102 | }, 103 | Streams: []grpc.StreamDesc{}, 104 | Metadata: "greptime/v1/health.proto", 105 | } 106 | -------------------------------------------------------------------------------- /go/greptime/v1/meta/ddl_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.2.0 4 | // - protoc v3.21.6 5 | // source: greptime/v1/meta/ddl.proto 6 | 7 | package meta 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.32.0 or later. 19 | const _ = grpc.SupportPackageIsVersion7 20 | 21 | // DdlTaskClient is the client API for DdlTask service. 22 | // 23 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 | type DdlTaskClient interface { 25 | // Submits a DDL task to meta. 26 | SubmitDdlTask(ctx context.Context, in *SubmitDdlTaskRequest, opts ...grpc.CallOption) (*SubmitDdlTaskResponse, error) 27 | } 28 | 29 | type ddlTaskClient struct { 30 | cc grpc.ClientConnInterface 31 | } 32 | 33 | func NewDdlTaskClient(cc grpc.ClientConnInterface) DdlTaskClient { 34 | return &ddlTaskClient{cc} 35 | } 36 | 37 | func (c *ddlTaskClient) SubmitDdlTask(ctx context.Context, in *SubmitDdlTaskRequest, opts ...grpc.CallOption) (*SubmitDdlTaskResponse, error) { 38 | out := new(SubmitDdlTaskResponse) 39 | err := c.cc.Invoke(ctx, "/greptime.v1.meta.DdlTask/SubmitDdlTask", in, out, opts...) 40 | if err != nil { 41 | return nil, err 42 | } 43 | return out, nil 44 | } 45 | 46 | // DdlTaskServer is the server API for DdlTask service. 47 | // All implementations must embed UnimplementedDdlTaskServer 48 | // for forward compatibility 49 | type DdlTaskServer interface { 50 | // Submits a DDL task to meta. 51 | SubmitDdlTask(context.Context, *SubmitDdlTaskRequest) (*SubmitDdlTaskResponse, error) 52 | mustEmbedUnimplementedDdlTaskServer() 53 | } 54 | 55 | // UnimplementedDdlTaskServer must be embedded to have forward compatible implementations. 56 | type UnimplementedDdlTaskServer struct { 57 | } 58 | 59 | func (UnimplementedDdlTaskServer) SubmitDdlTask(context.Context, *SubmitDdlTaskRequest) (*SubmitDdlTaskResponse, error) { 60 | return nil, status.Errorf(codes.Unimplemented, "method SubmitDdlTask not implemented") 61 | } 62 | func (UnimplementedDdlTaskServer) mustEmbedUnimplementedDdlTaskServer() {} 63 | 64 | // UnsafeDdlTaskServer may be embedded to opt out of forward compatibility for this service. 65 | // Use of this interface is not recommended, as added methods to DdlTaskServer will 66 | // result in compilation errors. 67 | type UnsafeDdlTaskServer interface { 68 | mustEmbedUnimplementedDdlTaskServer() 69 | } 70 | 71 | func RegisterDdlTaskServer(s grpc.ServiceRegistrar, srv DdlTaskServer) { 72 | s.RegisterService(&DdlTask_ServiceDesc, srv) 73 | } 74 | 75 | func _DdlTask_SubmitDdlTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 76 | in := new(SubmitDdlTaskRequest) 77 | if err := dec(in); err != nil { 78 | return nil, err 79 | } 80 | if interceptor == nil { 81 | return srv.(DdlTaskServer).SubmitDdlTask(ctx, in) 82 | } 83 | info := &grpc.UnaryServerInfo{ 84 | Server: srv, 85 | FullMethod: "/greptime.v1.meta.DdlTask/SubmitDdlTask", 86 | } 87 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 88 | return srv.(DdlTaskServer).SubmitDdlTask(ctx, req.(*SubmitDdlTaskRequest)) 89 | } 90 | return interceptor(ctx, in, info, handler) 91 | } 92 | 93 | // DdlTask_ServiceDesc is the grpc.ServiceDesc for DdlTask service. 94 | // It's only intended for direct use with grpc.RegisterService, 95 | // and not to be introspected or modified (even as a copy) 96 | var DdlTask_ServiceDesc = grpc.ServiceDesc{ 97 | ServiceName: "greptime.v1.meta.DdlTask", 98 | HandlerType: (*DdlTaskServer)(nil), 99 | Methods: []grpc.MethodDesc{ 100 | { 101 | MethodName: "SubmitDdlTask", 102 | Handler: _DdlTask_SubmitDdlTask_Handler, 103 | }, 104 | }, 105 | Streams: []grpc.StreamDesc{}, 106 | Metadata: "greptime/v1/meta/ddl.proto", 107 | } 108 | -------------------------------------------------------------------------------- /go/greptime/v1/meta/heartbeat_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.2.0 4 | // - protoc v3.21.6 5 | // source: greptime/v1/meta/heartbeat.proto 6 | 7 | package meta 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.32.0 or later. 19 | const _ = grpc.SupportPackageIsVersion7 20 | 21 | // HeartbeatClient is the client API for Heartbeat service. 22 | // 23 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 | type HeartbeatClient interface { 25 | // Heartbeat, there may be many contents of the heartbeat, such as: 26 | // 1. Metadata to be registered to meta server and discoverable by other 27 | // nodes. 28 | // 2. Some performance metrics, such as Load, CPU usage, etc. 29 | // 3. The number of computing tasks being executed. 30 | Heartbeat(ctx context.Context, opts ...grpc.CallOption) (Heartbeat_HeartbeatClient, error) 31 | // Ask leader's endpoint. 32 | AskLeader(ctx context.Context, in *AskLeaderRequest, opts ...grpc.CallOption) (*AskLeaderResponse, error) 33 | } 34 | 35 | type heartbeatClient struct { 36 | cc grpc.ClientConnInterface 37 | } 38 | 39 | func NewHeartbeatClient(cc grpc.ClientConnInterface) HeartbeatClient { 40 | return &heartbeatClient{cc} 41 | } 42 | 43 | func (c *heartbeatClient) Heartbeat(ctx context.Context, opts ...grpc.CallOption) (Heartbeat_HeartbeatClient, error) { 44 | stream, err := c.cc.NewStream(ctx, &Heartbeat_ServiceDesc.Streams[0], "/greptime.v1.meta.Heartbeat/Heartbeat", opts...) 45 | if err != nil { 46 | return nil, err 47 | } 48 | x := &heartbeatHeartbeatClient{stream} 49 | return x, nil 50 | } 51 | 52 | type Heartbeat_HeartbeatClient interface { 53 | Send(*HeartbeatRequest) error 54 | Recv() (*HeartbeatResponse, error) 55 | grpc.ClientStream 56 | } 57 | 58 | type heartbeatHeartbeatClient struct { 59 | grpc.ClientStream 60 | } 61 | 62 | func (x *heartbeatHeartbeatClient) Send(m *HeartbeatRequest) error { 63 | return x.ClientStream.SendMsg(m) 64 | } 65 | 66 | func (x *heartbeatHeartbeatClient) Recv() (*HeartbeatResponse, error) { 67 | m := new(HeartbeatResponse) 68 | if err := x.ClientStream.RecvMsg(m); err != nil { 69 | return nil, err 70 | } 71 | return m, nil 72 | } 73 | 74 | func (c *heartbeatClient) AskLeader(ctx context.Context, in *AskLeaderRequest, opts ...grpc.CallOption) (*AskLeaderResponse, error) { 75 | out := new(AskLeaderResponse) 76 | err := c.cc.Invoke(ctx, "/greptime.v1.meta.Heartbeat/AskLeader", in, out, opts...) 77 | if err != nil { 78 | return nil, err 79 | } 80 | return out, nil 81 | } 82 | 83 | // HeartbeatServer is the server API for Heartbeat service. 84 | // All implementations must embed UnimplementedHeartbeatServer 85 | // for forward compatibility 86 | type HeartbeatServer interface { 87 | // Heartbeat, there may be many contents of the heartbeat, such as: 88 | // 1. Metadata to be registered to meta server and discoverable by other 89 | // nodes. 90 | // 2. Some performance metrics, such as Load, CPU usage, etc. 91 | // 3. The number of computing tasks being executed. 92 | Heartbeat(Heartbeat_HeartbeatServer) error 93 | // Ask leader's endpoint. 94 | AskLeader(context.Context, *AskLeaderRequest) (*AskLeaderResponse, error) 95 | mustEmbedUnimplementedHeartbeatServer() 96 | } 97 | 98 | // UnimplementedHeartbeatServer must be embedded to have forward compatible implementations. 99 | type UnimplementedHeartbeatServer struct { 100 | } 101 | 102 | func (UnimplementedHeartbeatServer) Heartbeat(Heartbeat_HeartbeatServer) error { 103 | return status.Errorf(codes.Unimplemented, "method Heartbeat not implemented") 104 | } 105 | func (UnimplementedHeartbeatServer) AskLeader(context.Context, *AskLeaderRequest) (*AskLeaderResponse, error) { 106 | return nil, status.Errorf(codes.Unimplemented, "method AskLeader not implemented") 107 | } 108 | func (UnimplementedHeartbeatServer) mustEmbedUnimplementedHeartbeatServer() {} 109 | 110 | // UnsafeHeartbeatServer may be embedded to opt out of forward compatibility for this service. 111 | // Use of this interface is not recommended, as added methods to HeartbeatServer will 112 | // result in compilation errors. 113 | type UnsafeHeartbeatServer interface { 114 | mustEmbedUnimplementedHeartbeatServer() 115 | } 116 | 117 | func RegisterHeartbeatServer(s grpc.ServiceRegistrar, srv HeartbeatServer) { 118 | s.RegisterService(&Heartbeat_ServiceDesc, srv) 119 | } 120 | 121 | func _Heartbeat_Heartbeat_Handler(srv interface{}, stream grpc.ServerStream) error { 122 | return srv.(HeartbeatServer).Heartbeat(&heartbeatHeartbeatServer{stream}) 123 | } 124 | 125 | type Heartbeat_HeartbeatServer interface { 126 | Send(*HeartbeatResponse) error 127 | Recv() (*HeartbeatRequest, error) 128 | grpc.ServerStream 129 | } 130 | 131 | type heartbeatHeartbeatServer struct { 132 | grpc.ServerStream 133 | } 134 | 135 | func (x *heartbeatHeartbeatServer) Send(m *HeartbeatResponse) error { 136 | return x.ServerStream.SendMsg(m) 137 | } 138 | 139 | func (x *heartbeatHeartbeatServer) Recv() (*HeartbeatRequest, error) { 140 | m := new(HeartbeatRequest) 141 | if err := x.ServerStream.RecvMsg(m); err != nil { 142 | return nil, err 143 | } 144 | return m, nil 145 | } 146 | 147 | func _Heartbeat_AskLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 148 | in := new(AskLeaderRequest) 149 | if err := dec(in); err != nil { 150 | return nil, err 151 | } 152 | if interceptor == nil { 153 | return srv.(HeartbeatServer).AskLeader(ctx, in) 154 | } 155 | info := &grpc.UnaryServerInfo{ 156 | Server: srv, 157 | FullMethod: "/greptime.v1.meta.Heartbeat/AskLeader", 158 | } 159 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 160 | return srv.(HeartbeatServer).AskLeader(ctx, req.(*AskLeaderRequest)) 161 | } 162 | return interceptor(ctx, in, info, handler) 163 | } 164 | 165 | // Heartbeat_ServiceDesc is the grpc.ServiceDesc for Heartbeat service. 166 | // It's only intended for direct use with grpc.RegisterService, 167 | // and not to be introspected or modified (even as a copy) 168 | var Heartbeat_ServiceDesc = grpc.ServiceDesc{ 169 | ServiceName: "greptime.v1.meta.Heartbeat", 170 | HandlerType: (*HeartbeatServer)(nil), 171 | Methods: []grpc.MethodDesc{ 172 | { 173 | MethodName: "AskLeader", 174 | Handler: _Heartbeat_AskLeader_Handler, 175 | }, 176 | }, 177 | Streams: []grpc.StreamDesc{ 178 | { 179 | StreamName: "Heartbeat", 180 | Handler: _Heartbeat_Heartbeat_Handler, 181 | ServerStreams: true, 182 | ClientStreams: true, 183 | }, 184 | }, 185 | Metadata: "greptime/v1/meta/heartbeat.proto", 186 | } 187 | -------------------------------------------------------------------------------- /go/greptime/v1/meta/lock_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.2.0 4 | // - protoc v3.21.6 5 | // source: greptime/v1/meta/lock.proto 6 | 7 | package meta 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.32.0 or later. 19 | const _ = grpc.SupportPackageIsVersion7 20 | 21 | // LockClient is the client API for Lock service. 22 | // 23 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 | type LockClient interface { 25 | // Lock acquires a distributed shared lock on a given named lock. On success, 26 | // it will return a unique key that exists so long as the lock is held by the 27 | // caller. 28 | Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error) 29 | // Unlock takes a key returned by Lock and releases the hold on lock. 30 | Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) 31 | } 32 | 33 | type lockClient struct { 34 | cc grpc.ClientConnInterface 35 | } 36 | 37 | func NewLockClient(cc grpc.ClientConnInterface) LockClient { 38 | return &lockClient{cc} 39 | } 40 | 41 | func (c *lockClient) Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error) { 42 | out := new(LockResponse) 43 | err := c.cc.Invoke(ctx, "/greptime.v1.meta.Lock/Lock", in, out, opts...) 44 | if err != nil { 45 | return nil, err 46 | } 47 | return out, nil 48 | } 49 | 50 | func (c *lockClient) Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) { 51 | out := new(UnlockResponse) 52 | err := c.cc.Invoke(ctx, "/greptime.v1.meta.Lock/Unlock", in, out, opts...) 53 | if err != nil { 54 | return nil, err 55 | } 56 | return out, nil 57 | } 58 | 59 | // LockServer is the server API for Lock service. 60 | // All implementations must embed UnimplementedLockServer 61 | // for forward compatibility 62 | type LockServer interface { 63 | // Lock acquires a distributed shared lock on a given named lock. On success, 64 | // it will return a unique key that exists so long as the lock is held by the 65 | // caller. 66 | Lock(context.Context, *LockRequest) (*LockResponse, error) 67 | // Unlock takes a key returned by Lock and releases the hold on lock. 68 | Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) 69 | mustEmbedUnimplementedLockServer() 70 | } 71 | 72 | // UnimplementedLockServer must be embedded to have forward compatible implementations. 73 | type UnimplementedLockServer struct { 74 | } 75 | 76 | func (UnimplementedLockServer) Lock(context.Context, *LockRequest) (*LockResponse, error) { 77 | return nil, status.Errorf(codes.Unimplemented, "method Lock not implemented") 78 | } 79 | func (UnimplementedLockServer) Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) { 80 | return nil, status.Errorf(codes.Unimplemented, "method Unlock not implemented") 81 | } 82 | func (UnimplementedLockServer) mustEmbedUnimplementedLockServer() {} 83 | 84 | // UnsafeLockServer may be embedded to opt out of forward compatibility for this service. 85 | // Use of this interface is not recommended, as added methods to LockServer will 86 | // result in compilation errors. 87 | type UnsafeLockServer interface { 88 | mustEmbedUnimplementedLockServer() 89 | } 90 | 91 | func RegisterLockServer(s grpc.ServiceRegistrar, srv LockServer) { 92 | s.RegisterService(&Lock_ServiceDesc, srv) 93 | } 94 | 95 | func _Lock_Lock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 96 | in := new(LockRequest) 97 | if err := dec(in); err != nil { 98 | return nil, err 99 | } 100 | if interceptor == nil { 101 | return srv.(LockServer).Lock(ctx, in) 102 | } 103 | info := &grpc.UnaryServerInfo{ 104 | Server: srv, 105 | FullMethod: "/greptime.v1.meta.Lock/Lock", 106 | } 107 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 108 | return srv.(LockServer).Lock(ctx, req.(*LockRequest)) 109 | } 110 | return interceptor(ctx, in, info, handler) 111 | } 112 | 113 | func _Lock_Unlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 114 | in := new(UnlockRequest) 115 | if err := dec(in); err != nil { 116 | return nil, err 117 | } 118 | if interceptor == nil { 119 | return srv.(LockServer).Unlock(ctx, in) 120 | } 121 | info := &grpc.UnaryServerInfo{ 122 | Server: srv, 123 | FullMethod: "/greptime.v1.meta.Lock/Unlock", 124 | } 125 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 126 | return srv.(LockServer).Unlock(ctx, req.(*UnlockRequest)) 127 | } 128 | return interceptor(ctx, in, info, handler) 129 | } 130 | 131 | // Lock_ServiceDesc is the grpc.ServiceDesc for Lock service. 132 | // It's only intended for direct use with grpc.RegisterService, 133 | // and not to be introspected or modified (even as a copy) 134 | var Lock_ServiceDesc = grpc.ServiceDesc{ 135 | ServiceName: "greptime.v1.meta.Lock", 136 | HandlerType: (*LockServer)(nil), 137 | Methods: []grpc.MethodDesc{ 138 | { 139 | MethodName: "Lock", 140 | Handler: _Lock_Lock_Handler, 141 | }, 142 | { 143 | MethodName: "Unlock", 144 | Handler: _Lock_Unlock_Handler, 145 | }, 146 | }, 147 | Streams: []grpc.StreamDesc{}, 148 | Metadata: "greptime/v1/meta/lock.proto", 149 | } 150 | -------------------------------------------------------------------------------- /go/greptime/v1/meta/route_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.2.0 4 | // - protoc v3.21.6 5 | // source: greptime/v1/meta/route.proto 6 | 7 | package meta 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.32.0 or later. 19 | const _ = grpc.SupportPackageIsVersion7 20 | 21 | // RouterClient is the client API for Router service. 22 | // 23 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 | type RouterClient interface { 25 | // Fetch routing information for tables. The smallest unit is the complete 26 | // routing information(all regions) of a table. 27 | // 28 | // ```text 29 | // table_1 30 | // 31 | // table_name 32 | // table_schema 33 | // regions 34 | // region_1 35 | // leader_peer 36 | // follower_peer_1, follower_peer_2 37 | // region_2 38 | // leader_peer 39 | // follower_peer_1, follower_peer_2, follower_peer_3 40 | // region_xxx 41 | // 42 | // table_2 43 | // 44 | // ... 45 | // 46 | // ``` 47 | Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error) 48 | } 49 | 50 | type routerClient struct { 51 | cc grpc.ClientConnInterface 52 | } 53 | 54 | func NewRouterClient(cc grpc.ClientConnInterface) RouterClient { 55 | return &routerClient{cc} 56 | } 57 | 58 | func (c *routerClient) Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error) { 59 | out := new(RouteResponse) 60 | err := c.cc.Invoke(ctx, "/greptime.v1.meta.Router/Route", in, out, opts...) 61 | if err != nil { 62 | return nil, err 63 | } 64 | return out, nil 65 | } 66 | 67 | // RouterServer is the server API for Router service. 68 | // All implementations must embed UnimplementedRouterServer 69 | // for forward compatibility 70 | type RouterServer interface { 71 | // Fetch routing information for tables. The smallest unit is the complete 72 | // routing information(all regions) of a table. 73 | // 74 | // ```text 75 | // table_1 76 | // 77 | // table_name 78 | // table_schema 79 | // regions 80 | // region_1 81 | // leader_peer 82 | // follower_peer_1, follower_peer_2 83 | // region_2 84 | // leader_peer 85 | // follower_peer_1, follower_peer_2, follower_peer_3 86 | // region_xxx 87 | // 88 | // table_2 89 | // 90 | // ... 91 | // 92 | // ``` 93 | Route(context.Context, *RouteRequest) (*RouteResponse, error) 94 | mustEmbedUnimplementedRouterServer() 95 | } 96 | 97 | // UnimplementedRouterServer must be embedded to have forward compatible implementations. 98 | type UnimplementedRouterServer struct { 99 | } 100 | 101 | func (UnimplementedRouterServer) Route(context.Context, *RouteRequest) (*RouteResponse, error) { 102 | return nil, status.Errorf(codes.Unimplemented, "method Route not implemented") 103 | } 104 | func (UnimplementedRouterServer) mustEmbedUnimplementedRouterServer() {} 105 | 106 | // UnsafeRouterServer may be embedded to opt out of forward compatibility for this service. 107 | // Use of this interface is not recommended, as added methods to RouterServer will 108 | // result in compilation errors. 109 | type UnsafeRouterServer interface { 110 | mustEmbedUnimplementedRouterServer() 111 | } 112 | 113 | func RegisterRouterServer(s grpc.ServiceRegistrar, srv RouterServer) { 114 | s.RegisterService(&Router_ServiceDesc, srv) 115 | } 116 | 117 | func _Router_Route_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 118 | in := new(RouteRequest) 119 | if err := dec(in); err != nil { 120 | return nil, err 121 | } 122 | if interceptor == nil { 123 | return srv.(RouterServer).Route(ctx, in) 124 | } 125 | info := &grpc.UnaryServerInfo{ 126 | Server: srv, 127 | FullMethod: "/greptime.v1.meta.Router/Route", 128 | } 129 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 130 | return srv.(RouterServer).Route(ctx, req.(*RouteRequest)) 131 | } 132 | return interceptor(ctx, in, info, handler) 133 | } 134 | 135 | // Router_ServiceDesc is the grpc.ServiceDesc for Router service. 136 | // It's only intended for direct use with grpc.RegisterService, 137 | // and not to be introspected or modified (even as a copy) 138 | var Router_ServiceDesc = grpc.ServiceDesc{ 139 | ServiceName: "greptime.v1.meta.Router", 140 | HandlerType: (*RouterServer)(nil), 141 | Methods: []grpc.MethodDesc{ 142 | { 143 | MethodName: "Route", 144 | Handler: _Router_Route_Handler, 145 | }, 146 | }, 147 | Streams: []grpc.StreamDesc{}, 148 | Metadata: "greptime/v1/meta/route.proto", 149 | } 150 | -------------------------------------------------------------------------------- /go/greptime/v1/prom_grpc.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 | // versions: 3 | // - protoc-gen-go-grpc v1.2.0 4 | // - protoc v3.21.6 5 | // source: greptime/v1/prom.proto 6 | 7 | package v1 8 | 9 | import ( 10 | context "context" 11 | grpc "google.golang.org/grpc" 12 | codes "google.golang.org/grpc/codes" 13 | status "google.golang.org/grpc/status" 14 | ) 15 | 16 | // This is a compile-time assertion to ensure that this generated file 17 | // is compatible with the grpc package it is being compiled against. 18 | // Requires gRPC-Go v1.32.0 or later. 19 | const _ = grpc.SupportPackageIsVersion7 20 | 21 | // PrometheusGatewayClient is the client API for PrometheusGateway service. 22 | // 23 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 24 | type PrometheusGatewayClient interface { 25 | Handle(ctx context.Context, in *PromqlRequest, opts ...grpc.CallOption) (*PromqlResponse, error) 26 | } 27 | 28 | type prometheusGatewayClient struct { 29 | cc grpc.ClientConnInterface 30 | } 31 | 32 | func NewPrometheusGatewayClient(cc grpc.ClientConnInterface) PrometheusGatewayClient { 33 | return &prometheusGatewayClient{cc} 34 | } 35 | 36 | func (c *prometheusGatewayClient) Handle(ctx context.Context, in *PromqlRequest, opts ...grpc.CallOption) (*PromqlResponse, error) { 37 | out := new(PromqlResponse) 38 | err := c.cc.Invoke(ctx, "/greptime.v1.PrometheusGateway/Handle", in, out, opts...) 39 | if err != nil { 40 | return nil, err 41 | } 42 | return out, nil 43 | } 44 | 45 | // PrometheusGatewayServer is the server API for PrometheusGateway service. 46 | // All implementations must embed UnimplementedPrometheusGatewayServer 47 | // for forward compatibility 48 | type PrometheusGatewayServer interface { 49 | Handle(context.Context, *PromqlRequest) (*PromqlResponse, error) 50 | mustEmbedUnimplementedPrometheusGatewayServer() 51 | } 52 | 53 | // UnimplementedPrometheusGatewayServer must be embedded to have forward compatible implementations. 54 | type UnimplementedPrometheusGatewayServer struct { 55 | } 56 | 57 | func (UnimplementedPrometheusGatewayServer) Handle(context.Context, *PromqlRequest) (*PromqlResponse, error) { 58 | return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") 59 | } 60 | func (UnimplementedPrometheusGatewayServer) mustEmbedUnimplementedPrometheusGatewayServer() {} 61 | 62 | // UnsafePrometheusGatewayServer may be embedded to opt out of forward compatibility for this service. 63 | // Use of this interface is not recommended, as added methods to PrometheusGatewayServer will 64 | // result in compilation errors. 65 | type UnsafePrometheusGatewayServer interface { 66 | mustEmbedUnimplementedPrometheusGatewayServer() 67 | } 68 | 69 | func RegisterPrometheusGatewayServer(s grpc.ServiceRegistrar, srv PrometheusGatewayServer) { 70 | s.RegisterService(&PrometheusGateway_ServiceDesc, srv) 71 | } 72 | 73 | func _PrometheusGateway_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 74 | in := new(PromqlRequest) 75 | if err := dec(in); err != nil { 76 | return nil, err 77 | } 78 | if interceptor == nil { 79 | return srv.(PrometheusGatewayServer).Handle(ctx, in) 80 | } 81 | info := &grpc.UnaryServerInfo{ 82 | Server: srv, 83 | FullMethod: "/greptime.v1.PrometheusGateway/Handle", 84 | } 85 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 86 | return srv.(PrometheusGatewayServer).Handle(ctx, req.(*PromqlRequest)) 87 | } 88 | return interceptor(ctx, in, info, handler) 89 | } 90 | 91 | // PrometheusGateway_ServiceDesc is the grpc.ServiceDesc for PrometheusGateway service. 92 | // It's only intended for direct use with grpc.RegisterService, 93 | // and not to be introspected or modified (even as a copy) 94 | var PrometheusGateway_ServiceDesc = grpc.ServiceDesc{ 95 | ServiceName: "greptime.v1.PrometheusGateway", 96 | HandlerType: (*PrometheusGatewayServer)(nil), 97 | Methods: []grpc.MethodDesc{ 98 | { 99 | MethodName: "Handle", 100 | Handler: _PrometheusGateway_Handle_Handler, 101 | }, 102 | }, 103 | Streams: []grpc.StreamDesc{}, 104 | Metadata: "greptime/v1/prom.proto", 105 | } 106 | -------------------------------------------------------------------------------- /go/substrait_extension/dist_plan.pb.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Code generated by protoc-gen-go. DO NOT EDIT. 16 | // versions: 17 | // protoc-gen-go v1.28.1 18 | // protoc v3.21.6 19 | // source: substrait_extension/dist_plan.proto 20 | 21 | package substrait_extension 22 | 23 | import ( 24 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 25 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 26 | reflect "reflect" 27 | sync "sync" 28 | ) 29 | 30 | const ( 31 | // Verify that this generated code is sufficiently up-to-date. 32 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 33 | // Verify that runtime/protoimpl is sufficiently up-to-date. 34 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 35 | ) 36 | 37 | type MergeScan struct { 38 | state protoimpl.MessageState 39 | sizeCache protoimpl.SizeCache 40 | unknownFields protoimpl.UnknownFields 41 | 42 | // the input logical plan 43 | Input []byte `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"` 44 | // whether this plan is a placeholder 45 | IsPlaceholder bool `protobuf:"varint,2,opt,name=is_placeholder,json=isPlaceholder,proto3" json:"is_placeholder,omitempty"` 46 | } 47 | 48 | func (x *MergeScan) Reset() { 49 | *x = MergeScan{} 50 | if protoimpl.UnsafeEnabled { 51 | mi := &file_substrait_extension_dist_plan_proto_msgTypes[0] 52 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 53 | ms.StoreMessageInfo(mi) 54 | } 55 | } 56 | 57 | func (x *MergeScan) String() string { 58 | return protoimpl.X.MessageStringOf(x) 59 | } 60 | 61 | func (*MergeScan) ProtoMessage() {} 62 | 63 | func (x *MergeScan) ProtoReflect() protoreflect.Message { 64 | mi := &file_substrait_extension_dist_plan_proto_msgTypes[0] 65 | if protoimpl.UnsafeEnabled && x != nil { 66 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 67 | if ms.LoadMessageInfo() == nil { 68 | ms.StoreMessageInfo(mi) 69 | } 70 | return ms 71 | } 72 | return mi.MessageOf(x) 73 | } 74 | 75 | // Deprecated: Use MergeScan.ProtoReflect.Descriptor instead. 76 | func (*MergeScan) Descriptor() ([]byte, []int) { 77 | return file_substrait_extension_dist_plan_proto_rawDescGZIP(), []int{0} 78 | } 79 | 80 | func (x *MergeScan) GetInput() []byte { 81 | if x != nil { 82 | return x.Input 83 | } 84 | return nil 85 | } 86 | 87 | func (x *MergeScan) GetIsPlaceholder() bool { 88 | if x != nil { 89 | return x.IsPlaceholder 90 | } 91 | return false 92 | } 93 | 94 | var File_substrait_extension_dist_plan_proto protoreflect.FileDescriptor 95 | 96 | var file_substrait_extension_dist_plan_proto_rawDesc = []byte{ 97 | 0x0a, 0x23, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x61, 0x69, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 98 | 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 99 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x61, 0x69, 0x74, 100 | 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x48, 0x0a, 0x09, 0x4d, 0x65, 101 | 0x72, 0x67, 0x65, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 102 | 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x25, 0x0a, 103 | 0x0e, 0x69, 0x73, 0x5f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 104 | 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 105 | 0x6c, 0x64, 0x65, 0x72, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 106 | 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 107 | 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 108 | 0x6f, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x61, 0x69, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 109 | 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 110 | } 111 | 112 | var ( 113 | file_substrait_extension_dist_plan_proto_rawDescOnce sync.Once 114 | file_substrait_extension_dist_plan_proto_rawDescData = file_substrait_extension_dist_plan_proto_rawDesc 115 | ) 116 | 117 | func file_substrait_extension_dist_plan_proto_rawDescGZIP() []byte { 118 | file_substrait_extension_dist_plan_proto_rawDescOnce.Do(func() { 119 | file_substrait_extension_dist_plan_proto_rawDescData = protoimpl.X.CompressGZIP(file_substrait_extension_dist_plan_proto_rawDescData) 120 | }) 121 | return file_substrait_extension_dist_plan_proto_rawDescData 122 | } 123 | 124 | var file_substrait_extension_dist_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 125 | var file_substrait_extension_dist_plan_proto_goTypes = []interface{}{ 126 | (*MergeScan)(nil), // 0: substrait_extension.MergeScan 127 | } 128 | var file_substrait_extension_dist_plan_proto_depIdxs = []int32{ 129 | 0, // [0:0] is the sub-list for method output_type 130 | 0, // [0:0] is the sub-list for method input_type 131 | 0, // [0:0] is the sub-list for extension type_name 132 | 0, // [0:0] is the sub-list for extension extendee 133 | 0, // [0:0] is the sub-list for field type_name 134 | } 135 | 136 | func init() { file_substrait_extension_dist_plan_proto_init() } 137 | func file_substrait_extension_dist_plan_proto_init() { 138 | if File_substrait_extension_dist_plan_proto != nil { 139 | return 140 | } 141 | if !protoimpl.UnsafeEnabled { 142 | file_substrait_extension_dist_plan_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 143 | switch v := v.(*MergeScan); i { 144 | case 0: 145 | return &v.state 146 | case 1: 147 | return &v.sizeCache 148 | case 2: 149 | return &v.unknownFields 150 | default: 151 | return nil 152 | } 153 | } 154 | } 155 | type x struct{} 156 | out := protoimpl.TypeBuilder{ 157 | File: protoimpl.DescBuilder{ 158 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 159 | RawDescriptor: file_substrait_extension_dist_plan_proto_rawDesc, 160 | NumEnums: 0, 161 | NumMessages: 1, 162 | NumExtensions: 0, 163 | NumServices: 0, 164 | }, 165 | GoTypes: file_substrait_extension_dist_plan_proto_goTypes, 166 | DependencyIndexes: file_substrait_extension_dist_plan_proto_depIdxs, 167 | MessageInfos: file_substrait_extension_dist_plan_proto_msgTypes, 168 | }.Build() 169 | File_substrait_extension_dist_plan_proto = out.File 170 | file_substrait_extension_dist_plan_proto_rawDesc = nil 171 | file_substrait_extension_dist_plan_proto_goTypes = nil 172 | file_substrait_extension_dist_plan_proto_depIdxs = nil 173 | } 174 | -------------------------------------------------------------------------------- /java/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | io.greptime 7 | greptimedb-proto 8 | 0.9.0 9 | 10 | ${project.groupId}:${project.artifactId} 11 | GreptimeDB protobuf files for Java 12 | https://github.com/GreptimeTeam/greptime-proto 13 | 14 | 15 | 16 | The Apache License, Version 2.0 17 | http://www.apache.org/licenses/LICENSE-2.0.txt 18 | 19 | 20 | 21 | 22 | 23 | Jeremy 24 | jiachun@greptime.com 25 | GreptimeTeam 26 | https://greptime.com 27 | 28 | 29 | 30 | 31 | scm:git:git://github.com/GreptimeTeam/greptimedb-client-java.git 32 | scm:git:ssh://github.com:GreptimeTeam/greptimedb-client-java.git 33 | https://github.com/GreptimeTeam/greptimedb-client-java/tree/main 34 | 35 | 36 | 37 | 38 | ossrh 39 | https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ 40 | 41 | 42 | ossrh 43 | https://s01.oss.sonatype.org/content/repositories/snapshots/ 44 | 45 | 46 | 47 | 48 | 49 | release 50 | 51 | 52 | 53 | org.sonatype.plugins 54 | nexus-staging-maven-plugin 55 | 1.6.7 56 | true 57 | 58 | ossrh 59 | https://s01.oss.sonatype.org/ 60 | true 61 | 62 | 63 | 64 | org.apache.maven.plugins 65 | maven-gpg-plugin 66 | 3.1.0 67 | 68 | 69 | sign-artifacts 70 | verify 71 | 72 | sign 73 | 74 | 75 | 76 | 77 | 78 | org.apache.maven.plugins 79 | maven-source-plugin 80 | 3.0.1 81 | 82 | 83 | attach-sources 84 | 85 | jar-no-fork 86 | 87 | 88 | 89 | 90 | 91 | org.apache.maven.plugins 92 | maven-javadoc-plugin 93 | 2.9.1 94 | 95 | 96 | attach-javadocs 97 | package 98 | 99 | jar 100 | 101 | 102 | -Xdoclint:none 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 8 114 | 8 115 | UTF-8 116 | 3.21.12 117 | 118 | 119 | 120 | 121 | com.google.protobuf 122 | protobuf-java 123 | ${protobuf.version} 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /jitpack.yml: -------------------------------------------------------------------------------- 1 | jdk: 2 | - openjdk8 3 | install: 4 | - cd java 5 | - mvn install -DskipTests 6 | -------------------------------------------------------------------------------- /licenserc.toml: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Greptime Team 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | headerPath = "Apache-2.0.txt" 16 | 17 | includes = [ 18 | "*.rs", 19 | "*.py", 20 | ] 21 | 22 | [properties] 23 | inceptionYear = 2023 24 | copyrightOwner = "Greptime Team" 25 | -------------------------------------------------------------------------------- /proto/greptime/v1/column.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1; 18 | 19 | option java_package = "io.greptime.v1"; 20 | option java_outer_classname = "Columns"; 21 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; 22 | 23 | import "greptime/v1/common.proto"; 24 | 25 | message Column { 26 | string column_name = 1; 27 | SemanticType semantic_type = 2; 28 | 29 | message Values { 30 | repeated int32 i8_values = 1; 31 | repeated int32 i16_values = 2; 32 | repeated int32 i32_values = 3; 33 | repeated int64 i64_values = 4; 34 | 35 | repeated uint32 u8_values = 5; 36 | repeated uint32 u16_values = 6; 37 | repeated uint32 u32_values = 7; 38 | repeated uint64 u64_values = 8; 39 | 40 | repeated float f32_values = 9; 41 | repeated double f64_values = 10; 42 | 43 | repeated bool bool_values = 11; 44 | repeated bytes binary_values = 12; 45 | repeated string string_values = 13; 46 | 47 | repeated int32 date_values = 14; 48 | repeated int64 datetime_values = 15; 49 | repeated int64 timestamp_second_values = 16; 50 | repeated int64 timestamp_millisecond_values = 17; 51 | repeated int64 timestamp_microsecond_values = 18; 52 | repeated int64 timestamp_nanosecond_values = 19; 53 | repeated int64 time_second_values = 20; 54 | repeated int64 time_millisecond_values = 21; 55 | repeated int64 time_microsecond_values = 22; 56 | repeated int64 time_nanosecond_values = 23; 57 | repeated int32 interval_year_month_values = 24; 58 | repeated int64 interval_day_time_values = 25; 59 | repeated IntervalMonthDayNano interval_month_day_nano_values = 26; 60 | repeated Decimal128 decimal128_values = 31; 61 | } 62 | // The array of non-null values in this column. 63 | // 64 | // For example: suppose there is a column "foo" that contains some int32 65 | // values (1, 2, 3, 4, 5, null, 7, 8, 9, null); 66 | // column: 67 | // column_name: foo 68 | // semantic_type: Tag 69 | // values: 1, 2, 3, 4, 5, 7, 8, 9 70 | // null_masks: 00100000 00000010 71 | Values values = 3; 72 | 73 | // Mask maps the positions of null values. 74 | // If a bit in null_mask is 1, it indicates that the column value at that 75 | // position is null. 76 | bytes null_mask = 4; 77 | 78 | // Helpful in creating vector from column. 79 | ColumnDataType datatype = 5; 80 | 81 | // Extension for ColumnDataType. 82 | ColumnDataTypeExtension datatype_extension = 6; 83 | 84 | // Additional column options. 85 | ColumnOptions options = 7; 86 | } 87 | -------------------------------------------------------------------------------- /proto/greptime/v1/common.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1; 18 | 19 | option java_package = "io.greptime.v1"; 20 | option java_outer_classname = "Common"; 21 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; 22 | 23 | message QueryContext { 24 | string current_catalog = 1; 25 | string current_schema = 2; 26 | string timezone = 4; 27 | map extensions = 5; 28 | uint32 channel = 6; 29 | SnapshotSequences snapshot_seqs = 7; 30 | // Explain options for the query. 31 | ExplainOptions explain = 8; 32 | } 33 | 34 | message SnapshotSequences { 35 | // Mappings of the RegionId to the minimal sequence of SST file to scan. 36 | map sst_min_sequences = 1; 37 | // mapping of RegionId to SequenceNumber, for snapshot read, meaning that the 38 | // read should only container data that was committed before (and include) the 39 | // given sequence number 40 | map snapshot_seqs = 7; 41 | } 42 | 43 | message ExplainOptions { 44 | // Whether to enable verbose explain output. 45 | bool verbose = 1; 46 | } 47 | 48 | message RequestHeader { 49 | // The `catalog` that is selected to be used in this request. 50 | string catalog = 1; 51 | // The `schema` that is selected to be used in this request. 52 | string schema = 2; 53 | // The `authorization` header, much like http's authorization header. 54 | AuthHeader authorization = 3; 55 | // The `dbname` for the request 56 | string dbname = 4; 57 | // Encoded trace_id & span_id, follow the w3c Trace Context 58 | // https://www.w3.org/TR/trace-context/#header-name 59 | map tracing_context = 5; 60 | // The `timezone` for the request 61 | string timezone = 6; 62 | } 63 | 64 | message ResponseHeader { Status status = 1; } 65 | 66 | message Status { 67 | // Corresponding to the `StatusCode` definition of GreptimeDB 68 | uint32 status_code = 1; 69 | string err_msg = 2; 70 | } 71 | 72 | message AuthHeader { 73 | oneof auth_scheme { 74 | Basic basic = 1; 75 | Token token = 2; 76 | } 77 | } 78 | 79 | message Basic { 80 | string username = 1; 81 | string password = 2; 82 | } 83 | 84 | message Token { string token = 1; } 85 | 86 | message TableName { 87 | string catalog_name = 1; 88 | string schema_name = 2; 89 | string table_name = 3; 90 | } 91 | 92 | message AffectedRows { uint32 value = 1; } 93 | 94 | message Metrics { bytes metrics = 1; } 95 | 96 | message ExpireAfter { int64 value = 1; } 97 | 98 | message FlightMetadata { 99 | AffectedRows affected_rows = 1; 100 | Metrics metrics = 2; 101 | } 102 | 103 | enum SemanticType { 104 | TAG = 0; 105 | FIELD = 1; 106 | TIMESTAMP = 2; 107 | } 108 | 109 | enum ColumnDataType { 110 | BOOLEAN = 0; 111 | INT8 = 1; 112 | INT16 = 2; 113 | INT32 = 3; 114 | INT64 = 4; 115 | UINT8 = 5; 116 | UINT16 = 6; 117 | UINT32 = 7; 118 | UINT64 = 8; 119 | FLOAT32 = 9; 120 | FLOAT64 = 10; 121 | BINARY = 11; 122 | STRING = 12; 123 | DATE = 13; 124 | DATETIME = 14; 125 | TIMESTAMP_SECOND = 15; 126 | TIMESTAMP_MILLISECOND = 16; 127 | TIMESTAMP_MICROSECOND = 17; 128 | TIMESTAMP_NANOSECOND = 18; 129 | TIME_SECOND = 19; 130 | TIME_MILLISECOND = 20; 131 | TIME_MICROSECOND = 21; 132 | TIME_NANOSECOND = 22; 133 | INTERVAL_YEAR_MONTH = 23; 134 | INTERVAL_DAY_TIME = 24; 135 | INTERVAL_MONTH_DAY_NANO = 25; 136 | DECIMAL128 = 30; 137 | JSON = 31; 138 | VECTOR = 32; 139 | } 140 | 141 | message IntervalMonthDayNano { 142 | int32 months = 1; 143 | int32 days = 2; 144 | int64 nanoseconds = 3; 145 | } 146 | 147 | // (hi: high 64 bits, lo: low 64 bits) are used to keep the decimal128 value. 148 | message Decimal128 { 149 | int64 hi = 1; 150 | int64 lo = 2; 151 | } 152 | 153 | // Type extension for some complex types 154 | message ColumnDataTypeExtension { 155 | oneof type_ext { 156 | DecimalTypeExtension decimal_type = 1; 157 | // Marks the binary column in proto is actually a JSON column. 158 | JsonTypeExtension json_type = 2; 159 | VectorTypeExtension vector_type = 3; 160 | } 161 | } 162 | 163 | message DecimalTypeExtension { 164 | int32 precision = 1; 165 | int32 scale = 2; 166 | } 167 | 168 | enum JsonTypeExtension { 169 | JSON_BINARY = 0; 170 | } 171 | 172 | message VectorTypeExtension { 173 | uint32 dim = 1; 174 | } 175 | 176 | // Additional options for the column. 177 | message ColumnOptions { 178 | // Supported keys: 179 | // "fulltext": 180 | // A JSON encoded string containing full-text search options for the column. 181 | // 182 | // The fulltext options JSON structure: 183 | // { 184 | // "enable": bool, // Indicates whether full-text search is 185 | // // enabled for the column. 186 | // 187 | // "analyzer": string, // The language-specific text analyzer to 188 | // // use for indexing and searching text. 189 | // // Supported values: ["English" (Default), "Chinese"]. 190 | // 191 | // "case-sensitive": bool // Indicates whether the text should be treated 192 | // // as case-sensitive during full-text search. 193 | // } 194 | // 195 | // Example: 196 | // "fulltext": "{\"enable\": true, \"analyzer\": \"English\", \"case-sensitive\": false}" 197 | map options = 1; 198 | } 199 | 200 | message ArrowIpc { 201 | bytes schema = 1; 202 | bytes data_header = 2; 203 | bytes payload = 3; 204 | } 205 | -------------------------------------------------------------------------------- /proto/greptime/v1/database.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1; 18 | 19 | option java_package = "io.greptime.v1"; 20 | option java_outer_classname = "Database"; 21 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; 22 | 23 | import "greptime/v1/ddl.proto"; 24 | import "greptime/v1/column.proto"; 25 | import "greptime/v1/row.proto"; 26 | import "greptime/v1/prom.proto"; 27 | import "greptime/v1/common.proto"; 28 | 29 | service GreptimeDatabase { 30 | rpc Handle(GreptimeRequest) returns (GreptimeResponse); 31 | 32 | rpc HandleRequests(stream GreptimeRequest) returns (GreptimeResponse); 33 | } 34 | 35 | message GreptimeRequest { 36 | RequestHeader header = 1; 37 | oneof request { 38 | InsertRequests inserts = 2; 39 | QueryRequest query = 3; 40 | DdlRequest ddl = 4; 41 | DeleteRequests deletes = 5; 42 | RowInsertRequests row_inserts = 6; 43 | RowDeleteRequests row_deletes = 7; 44 | } 45 | } 46 | 47 | message GreptimeResponse { 48 | ResponseHeader header = 1; 49 | oneof response { AffectedRows affected_rows = 2; } 50 | } 51 | 52 | message QueryRequest { 53 | oneof query { 54 | string sql = 1; 55 | bytes logical_plan = 2; 56 | PromRangeQuery prom_range_query = 3; 57 | InsertIntoPlan insert_into_plan = 4; 58 | } 59 | } 60 | 61 | // A temporary solution for executing insert into table SELECT .. with logical plan 62 | // since substrait to logical plan doesn't support dml yet. 63 | message InsertIntoPlan { 64 | TableName table_name = 1; 65 | bytes logical_plan = 2; 66 | } 67 | 68 | message InsertRequests { repeated InsertRequest inserts = 1; } 69 | 70 | message InsertRequest { 71 | string table_name = 1; 72 | 73 | // Data is represented here. 74 | repeated Column columns = 3; 75 | 76 | // The row_count of all columns, which include null and non-null values. 77 | // 78 | // Note: the row_count of all columns in a InsertRequest must be same. 79 | uint32 row_count = 4; 80 | } 81 | 82 | message DeleteRequests { repeated DeleteRequest deletes = 1; } 83 | 84 | message DeleteRequest { 85 | // The table name to delete from. Catalog name and schema name are in the 86 | // `RequestHeader`. 87 | string table_name = 1; 88 | 89 | // The data to delete, indexed by key columns. 90 | repeated Column key_columns = 3; 91 | 92 | // The row count of all columns above. 93 | uint32 row_count = 4; 94 | } 95 | 96 | message RowInsertRequests { repeated RowInsertRequest inserts = 1; } 97 | 98 | message RowInsertRequest { 99 | string table_name = 1; 100 | 101 | // Data is represented here. 102 | Rows rows = 2; 103 | } 104 | 105 | message RowDeleteRequests { repeated RowDeleteRequest deletes = 1; } 106 | 107 | message RowDeleteRequest { 108 | // The table name to delete from. Catalog name and schema name are in the 109 | // `RequestHeader`. 110 | string table_name = 1; 111 | 112 | // The data to delete. 113 | Rows rows = 2; 114 | } 115 | -------------------------------------------------------------------------------- /proto/greptime/v1/flow/server.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.flow; 18 | 19 | option java_package = "io.greptime.v1.flow"; 20 | option java_outer_classname = "Server"; 21 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/flow"; 22 | 23 | import "greptime/v1/common.proto"; 24 | import "greptime/v1/ddl.proto"; 25 | import "greptime/v1/row.proto"; 26 | 27 | service Flow { 28 | // Handle the control plane request for creating or removing a flow. 29 | rpc HandleCreateRemove(FlowRequest) returns (FlowResponse); 30 | // Handle the data plane request for inserting or deleting rows 31 | // only expect `RegionRequest` to be one of `InsertRequests` or 32 | // `DeleteRequests` other types of `RegionRequest` will be ignored 33 | rpc HandleMirrorRequest(InsertRequests) returns (FlowResponse); 34 | } 35 | 36 | message FlowRequestHeader { 37 | // Encoded trace_id & span_id, follow the w3c Trace Context 38 | // https://www.w3.org/TR/trace-context/#header-name 39 | map tracing_context = 1; 40 | // The contextual information of the query 41 | QueryContext query_context = 2; 42 | } 43 | 44 | message InsertRequests { repeated InsertRequest requests = 1; } 45 | 46 | message InsertRequest { 47 | uint64 region_id = 1; 48 | Rows rows = 2; 49 | } 50 | 51 | message FlowRequest { 52 | FlowRequestHeader header = 64; 53 | oneof body { 54 | CreateRequest create = 1; 55 | DropRequest drop = 2; 56 | FlushFlow flush = 3; 57 | } 58 | } 59 | 60 | message FlowResponse { 61 | ResponseHeader header = 1; 62 | uint64 affected_rows = 2; 63 | // affected flow ids 64 | repeated FlowId affected_flows = 3; 65 | map extensions = 4; 66 | } 67 | 68 | // Create a flow 69 | // 70 | // Very similar to `ddl.CreateTaskExpr`, 71 | // replace `source_table_names` with `source_table_ids` 72 | message CreateRequest { 73 | FlowId flow_id = 1; 74 | repeated TableId source_table_ids = 2; 75 | TableName sink_table_name = 3; 76 | bool create_if_not_exists = 4; 77 | // Expire data older than the given duration seconds. 78 | ExpireAfter expire_after = 5; 79 | string comment = 6; 80 | string sql = 7; 81 | map flow_options = 8; 82 | // Set to true if the flow should be created or replaced. 83 | bool or_replace = 9; 84 | } 85 | 86 | message DropRequest { FlowId flow_id = 1; } 87 | 88 | message FlushFlow { 89 | FlowId flow_id = 1; 90 | } 91 | -------------------------------------------------------------------------------- /proto/greptime/v1/health.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1; 18 | 19 | option java_package = "io.greptime.v1"; 20 | option java_outer_classname = "Health"; 21 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; 22 | 23 | service HealthCheck { 24 | rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse); 25 | } 26 | 27 | message HealthCheckRequest {} 28 | 29 | message HealthCheckResponse {} 30 | -------------------------------------------------------------------------------- /proto/greptime/v1/index/bloom_filter.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.index; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/index"; 20 | 21 | // BloomFilterMeta defines the metadata for a bloom filter. 22 | message BloomFilterMeta { 23 | // The number of rows per segment. 24 | uint64 rows_per_segment = 1; 25 | 26 | // The number of segments. 27 | uint64 segment_count = 2; 28 | 29 | // The number of total rows. 30 | uint64 row_count = 3; 31 | 32 | // The size of the bloom filter in bytes excluding the metadata. 33 | uint64 bloom_filter_size = 4; 34 | 35 | // The indices to the bloom filter location of each segment. 36 | repeated uint64 segment_loc_indices = 5; 37 | 38 | // The bloom filter locations. 39 | repeated BloomFilterLoc bloom_filter_locs = 6; 40 | } 41 | 42 | // BloomFilterLoc defines the location of a bloom filter. 43 | message BloomFilterLoc { 44 | // The byte offset of the bloom filter data. 45 | uint64 offset = 1; 46 | 47 | // The size of the bloom filter data. 48 | uint64 size = 2; 49 | 50 | // The number of elements in the bloom filter. 51 | uint64 element_count = 3; 52 | } 53 | -------------------------------------------------------------------------------- /proto/greptime/v1/index/inverted_index.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.index; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/index"; 20 | 21 | // InvertedIndexMetas defines the metadata for an inverted index 22 | // within an inverted index blob. 23 | message InvertedIndexMetas { 24 | // A map of tag names to their respective metadata corresponding to an individual 25 | // inverted index within the inverted index blob. 26 | map metas = 1; 27 | 28 | // The total count of rows within the inverted index blob. 29 | // This is used to determine the number of segments within the bitmap. 30 | uint64 total_row_count = 2; 31 | 32 | // The number of rows per group for bitmap indexing which determines how rows are 33 | // batched for indexing. Each batch corresponds to a segment in the bitmap and allows 34 | // for efficient retrieval during queries by reducing the search space. 35 | uint64 segment_row_count = 3; 36 | } 37 | 38 | // InvertedIndexMeta contains the metadata for a specific tag's inverted index. 39 | message InvertedIndexMeta { 40 | // Name of the tag associated with the inverted index. 41 | string name = 1; 42 | 43 | // The base byte offset for this tag's inverted index data within the blob. 44 | // Other offsets in this message are relative to this base offset. 45 | uint64 base_offset = 2; 46 | 47 | // The total size in bytes of this tag's inverted index data, including bitmaps, 48 | // FST data. 49 | uint64 inverted_index_size = 3; 50 | 51 | // The byte offset of the Finite State Transducer (FST) data relative to the `base_offset`. 52 | uint32 relative_fst_offset = 4; 53 | 54 | // The size in bytes of the FST data. 55 | uint32 fst_size = 5; 56 | 57 | // The byte offset relative to the `base_offset` where the null bitmap for this tag 58 | // starts. 59 | uint32 relative_null_bitmap_offset = 6; 60 | 61 | // The size in bytes of the null bitmap. 62 | uint32 null_bitmap_size = 7; 63 | 64 | // Statistical information about the tag's inverted index. 65 | InvertedIndexStats stats = 8; 66 | 67 | // The type of bitmap used for indexing. 68 | BitmapType bitmap_type = 9; 69 | } 70 | 71 | // InvertedIndexStats provides statistical data on a tag's inverted index. 72 | message InvertedIndexStats { 73 | // The count of null entries within the tag's column. 74 | uint64 null_count = 1; 75 | 76 | // The number of distinct values within the tag's column. 77 | uint64 distinct_count = 2; 78 | 79 | // The minimum value found within the tag's column, encoded as bytes. 80 | bytes min_value = 3; 81 | 82 | // The maximum value found within the tag's column, encoded as bytes. 83 | bytes max_value = 4; 84 | } 85 | 86 | // BitmapType defines the type of bitmap used for indexing. 87 | enum BitmapType { 88 | BitVec = 0; 89 | Roaring = 1; 90 | } 91 | -------------------------------------------------------------------------------- /proto/greptime/v1/meta/cluster.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.meta; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; 20 | 21 | import "greptime/v1/meta/common.proto"; 22 | import "greptime/v1/meta/store.proto"; 23 | 24 | // Cluster service is used for communication between meta nodes. 25 | service Cluster { 26 | // Batch get kvs by input keys from leader's in_memory kv store. 27 | rpc BatchGet(BatchGetRequest) returns (BatchGetResponse); 28 | 29 | // Range get the kvs from leader's in_memory kv store. 30 | rpc Range(RangeRequest) returns (RangeResponse); 31 | 32 | // Returns all the peers of metasrv. 33 | rpc MetasrvPeers(MetasrvPeersRequest) returns (MetasrvPeersResponse); 34 | } 35 | 36 | message MetasrvPeersRequest { RequestHeader header = 1; } 37 | 38 | message MetasrvPeersResponse { 39 | ResponseHeader header = 1; 40 | 41 | MetasrvNodeInfo leader = 2; 42 | repeated MetasrvNodeInfo followers = 3; 43 | } 44 | 45 | message MetasrvNodeInfo { 46 | Peer peer = 1; 47 | string version = 2; 48 | string git_commit = 3; 49 | // The node start timestamp in milliseconds. 50 | uint64 start_time_ms = 4; 51 | } 52 | -------------------------------------------------------------------------------- /proto/greptime/v1/meta/common.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.meta; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; 20 | 21 | message RequestHeader { 22 | uint64 protocol_version = 1; 23 | // member_id is the ID of the sender server. 24 | uint64 member_id = 3; 25 | // The role of the sender server. 26 | Role role = 4; 27 | // Encoded trace_id & span_id, follow the w3c Trace Context 28 | // https://www.w3.org/TR/trace-context/#header-name 29 | map tracing_context = 5; 30 | } 31 | 32 | enum Role { 33 | DATANODE = 0; 34 | FRONTEND = 1; 35 | FLOWNODE = 2; 36 | } 37 | 38 | message ResponseHeader { 39 | uint64 protocol_version = 1; 40 | Error error = 3; 41 | } 42 | 43 | message Error { 44 | int32 code = 1; 45 | string err_msg = 2; 46 | } 47 | 48 | message Peer { 49 | uint64 id = 1; 50 | string addr = 2; 51 | } 52 | 53 | message TimeInterval { 54 | // The unix timestamp in millis of the start of this period. 55 | int64 start_timestamp_millis = 1; 56 | // The unix timestamp in millis of the end of this period. 57 | int64 end_timestamp_millis = 2; 58 | } 59 | 60 | message KeyValue { 61 | // key is the key in bytes. An empty key is not allowed. 62 | bytes key = 1; 63 | // value is the value held by the key, in bytes. 64 | bytes value = 2; 65 | } 66 | 67 | // Procedure identifier 68 | message ProcedureId { bytes key = 1; } 69 | -------------------------------------------------------------------------------- /proto/greptime/v1/meta/ddl.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.meta; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; 20 | 21 | import "greptime/v1/meta/common.proto"; 22 | import "greptime/v1/meta/route.proto"; 23 | import "greptime/v1/ddl.proto"; 24 | import "greptime/v1/common.proto"; 25 | 26 | enum DdlTaskType { 27 | Create = 0; 28 | Drop = 1; 29 | } 30 | 31 | message CreateDatabaseTask { 32 | CreateDatabaseExpr create_database = 1; 33 | } 34 | 35 | message CreateTableTask { 36 | CreateTableExpr create_table = 1; 37 | repeated Partition partitions = 2; 38 | bytes table_info = 3; 39 | } 40 | 41 | message CreateTableTasks { repeated CreateTableTask tasks = 1; } 42 | 43 | message DropTableTask{ 44 | DropTableExpr drop_table = 1; 45 | } 46 | 47 | message DropTableTasks { repeated DropTableTask tasks = 1; } 48 | 49 | message AlterTableTask{ 50 | AlterTableExpr alter_table = 1; 51 | } 52 | 53 | message AlterTableTasks { repeated AlterTableTask tasks = 1; } 54 | 55 | message TruncateTableTask { 56 | TruncateTableExpr truncate_table = 1; 57 | } 58 | 59 | message DropDatabaseTask { 60 | DropDatabaseExpr drop_database = 1; 61 | } 62 | 63 | message CreateFlowTask { 64 | CreateFlowExpr create_flow = 1; 65 | } 66 | 67 | message DropFlowTask { 68 | DropFlowExpr drop_flow = 1; 69 | } 70 | 71 | // Create a view task 72 | message CreateViewTask { 73 | CreateViewExpr create_view = 1; 74 | bytes view_info = 2; 75 | } 76 | 77 | // Drop a view task 78 | message DropViewTask { 79 | DropViewExpr drop_view = 1; 80 | } 81 | 82 | // Alter database tasks 83 | message AlterDatabaseTask { 84 | AlterDatabaseExpr task = 1; 85 | } 86 | 87 | message CreateTriggerTask { 88 | CreateTriggerExpr create_trigger = 1; 89 | } 90 | 91 | message DdlTaskRequest { 92 | RequestHeader header = 1; 93 | QueryContext query_context = 64; 94 | 95 | oneof task { 96 | CreateTableTask create_table_task = 2; 97 | DropTableTask drop_table_task = 3; 98 | AlterTableTask alter_table_task = 4; 99 | TruncateTableTask truncate_table_task = 5; 100 | CreateTableTasks create_table_tasks = 6; 101 | DropTableTasks drop_table_tasks = 7; 102 | AlterTableTasks alter_table_tasks = 8; 103 | DropDatabaseTask drop_database_task = 9; 104 | CreateDatabaseTask create_database_task = 10; 105 | CreateFlowTask create_flow_task = 11; 106 | DropFlowTask drop_flow_task = 12; 107 | CreateViewTask create_view_task = 13; 108 | DropViewTask drop_view_task = 14; 109 | AlterDatabaseTask alter_database_task = 15; 110 | CreateTriggerTask create_trigger_task = 16; 111 | } 112 | } 113 | 114 | message DdlTaskResponse { 115 | ResponseHeader header = 1; 116 | ProcedureId pid = 2; 117 | 118 | // Returns if the tables created. 119 | repeated TableId table_ids = 5; 120 | } 121 | -------------------------------------------------------------------------------- /proto/greptime/v1/meta/heartbeat.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.meta; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; 20 | 21 | import "greptime/v1/meta/common.proto"; 22 | 23 | service Heartbeat { 24 | // Heartbeat, there may be many contents of the heartbeat, such as: 25 | // 1. Metadata to be registered to meta server and discoverable by other 26 | // nodes. 27 | // 2. Some performance metrics, such as Load, CPU usage, etc. 28 | // 3. The number of computing tasks being executed. 29 | rpc Heartbeat(stream HeartbeatRequest) returns (stream HeartbeatResponse) {} 30 | 31 | // Ask leader's endpoint. 32 | rpc AskLeader(AskLeaderRequest) returns (AskLeaderResponse) {} 33 | } 34 | 35 | message HeartbeatRequest { 36 | RequestHeader header = 1; 37 | // Self peer 38 | Peer peer = 2; 39 | // Actually reported time interval 40 | TimeInterval report_interval = 3; 41 | // Region stats on this node 42 | repeated RegionStat region_stats = 4; 43 | // Mailbox send message to Metasrv 44 | MailboxMessage mailbox_message = 5; 45 | // The duration since the heartbeat task's epoch in milliseconds. 46 | uint64 duration_since_epoch = 6; 47 | // The node's epoch 48 | uint64 node_epoch = 7; 49 | NodeInfo info = 8; 50 | FlowStat flow_stat = 9; 51 | /// The workloads of the node. 52 | oneof node_workloads { 53 | DatanodeWorkloads datanode = 10; 54 | FrontendWorkloads frontend = 11; 55 | FlownodeWorkloads flownode = 12; 56 | } 57 | } 58 | 59 | /// The workload types of the datanode. 60 | message DatanodeWorkloads { 61 | repeated int32 types = 1; 62 | } 63 | 64 | /// The workload types of the frontend. 65 | message FrontendWorkloads { 66 | repeated int32 types = 1; 67 | } 68 | 69 | /// The workload types of the flownode. 70 | message FlownodeWorkloads { 71 | repeated int32 types = 1; 72 | } 73 | 74 | enum RegionRole { 75 | // Writable region(mito2), Readonly region(file). 76 | Leader = 0; 77 | // Readonly region. 78 | Follower = 1; 79 | // A downgrading region, which is in the process of downgrading from Leader to 80 | // Follower. 81 | // 82 | // This role is used to prevent the region from being written during the 83 | // downgrade process. 84 | DowngradingLeader = 2; 85 | } 86 | 87 | message NodeInfo { 88 | // The node build version 89 | string version = 1; 90 | // The node build git commit hash 91 | string git_commit = 2; 92 | // The node start timestamp 93 | uint64 start_time_ms = 3; 94 | // The CPU cores number in the node. 95 | uint32 cpus = 4; 96 | } 97 | 98 | message RegionStat { 99 | uint64 region_id = 1; 100 | // The read capacity units during this period 101 | int64 rcus = 2; 102 | // The write capacity units during this period 103 | int64 wcus = 3; 104 | // Approximate bytes of this region 105 | int64 approximate_bytes = 4; 106 | // Engine name 107 | string engine = 6; 108 | // Region role 109 | RegionRole role = 7; 110 | map extensions = 99; 111 | } 112 | 113 | message FlowStat { 114 | // Each flow's in mem state's size in bytes 115 | // due to protobuf's key can't be a message, so we use uint32 as the key which 116 | // is [`FlowId`]'s inner field `id` 117 | map flow_stat_size = 1; 118 | map flow_last_exec_time_map = 2; 119 | } 120 | 121 | message HeartbeatResponse { 122 | ResponseHeader header = 1; 123 | MailboxMessage mailbox_message = 2; 124 | RegionLease region_lease = 3; 125 | } 126 | 127 | // The granted region is the region that the meta server granted leases. 128 | message GrantedRegion { 129 | uint64 region_id = 1; 130 | RegionRole role = 2; 131 | map extensions = 99; 132 | } 133 | 134 | message RegionLease { 135 | repeated GrantedRegion regions = 1; 136 | uint64 duration_since_epoch = 2; 137 | uint64 lease_seconds = 3; 138 | repeated uint64 closeable_region_ids = 4; 139 | } 140 | 141 | message AskLeaderRequest { RequestHeader header = 1; } 142 | 143 | message AskLeaderResponse { 144 | ResponseHeader header = 1; 145 | Peer leader = 2; 146 | } 147 | 148 | message MailboxMessage { 149 | // The id is used to associate request and response. 150 | uint64 id = 1; 151 | // The following information plays a bigger role in making messages traceable 152 | // and facilitating debugging. 153 | string subject = 2; 154 | string from = 3; 155 | string to = 4; 156 | // The unix timestamp in milliseconds. 157 | int64 timestamp_millis = 5; 158 | // The message body. 159 | oneof payload { string json = 6; } 160 | } 161 | -------------------------------------------------------------------------------- /proto/greptime/v1/meta/lock.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.meta; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; 20 | 21 | import "greptime/v1/meta/common.proto"; 22 | 23 | service Lock { 24 | // Lock acquires a distributed shared lock on a given named lock. On success, 25 | // it will return a unique key that exists so long as the lock is held by the 26 | // caller. 27 | rpc Lock(LockRequest) returns (LockResponse); 28 | 29 | // Unlock takes a key returned by Lock and releases the hold on lock. 30 | rpc Unlock(UnlockRequest) returns (UnlockResponse); 31 | } 32 | 33 | message LockRequest { 34 | RequestHeader header = 1; 35 | 36 | // Name is the identifier for the distributed shared lock to be acquired. 37 | bytes name = 2; 38 | 39 | // If the expiration time is exceeded and currently holds the lock, the lock 40 | // is automatically released. 41 | int64 expire_secs = 3; 42 | } 43 | 44 | message LockResponse { 45 | ResponseHeader header = 1; 46 | 47 | // Key will exist as long as lock is held by the caller. 48 | bytes key = 2; 49 | } 50 | 51 | message UnlockRequest { 52 | RequestHeader header = 1; 53 | 54 | // key is the lock ownership key granted by Lock. 55 | bytes key = 2; 56 | } 57 | 58 | message UnlockResponse { ResponseHeader header = 1; } 59 | -------------------------------------------------------------------------------- /proto/greptime/v1/meta/procedure.proto: -------------------------------------------------------------------------------- 1 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2 | // See the License for the specific language governing permissions and 3 | // limitations under the License. 4 | 5 | syntax = "proto3"; 6 | 7 | package greptime.v1.meta; 8 | 9 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; 10 | 11 | import "greptime/v1/meta/common.proto"; 12 | import "greptime/v1/meta/ddl.proto"; 13 | import "greptime/v1/meta/region.proto"; 14 | 15 | enum ProcedureStatus { 16 | Running = 0; 17 | Done = 1; 18 | Retrying = 2; 19 | Failed = 3; 20 | PrepareRollback = 4; 21 | RollingBack = 5; 22 | Poisoned = 6; 23 | } 24 | 25 | message ProcedureMeta { 26 | ProcedureId id = 1; 27 | string type_name = 2; 28 | ProcedureStatus status = 3; 29 | int64 start_time_ms = 4; 30 | int64 end_time_ms = 5; 31 | repeated string lock_keys = 6; 32 | string error = 7; 33 | } 34 | 35 | message QueryProcedureRequest { 36 | RequestHeader header = 1; 37 | ProcedureId pid = 2; 38 | } 39 | 40 | message ProcedureStateResponse { 41 | ResponseHeader header = 1; 42 | ProcedureStatus status = 2; 43 | string error = 3; 44 | } 45 | 46 | message ProcedureDetailRequest { 47 | RequestHeader header = 1; 48 | } 49 | 50 | message ProcedureDetailResponse { 51 | ResponseHeader header = 1; 52 | repeated ProcedureMeta procedures = 2; 53 | } 54 | 55 | service ProcedureService { 56 | // Query a submitted procedure state 57 | rpc query(QueryProcedureRequest) returns (ProcedureStateResponse); 58 | 59 | // Submits a DDL task 60 | rpc ddl(DdlTaskRequest) returns (DdlTaskResponse); 61 | 62 | // Submits a region migration task 63 | rpc migrate(MigrateRegionRequest) returns (MigrateRegionResponse); 64 | 65 | // Query all submitted procedures details 66 | rpc details(ProcedureDetailRequest) returns (ProcedureDetailResponse); 67 | } 68 | -------------------------------------------------------------------------------- /proto/greptime/v1/meta/region.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.meta; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; 20 | 21 | import "greptime/v1/meta/common.proto"; 22 | 23 | message MigrateRegionRequest { 24 | RequestHeader header = 1; 25 | uint64 region_id = 3; 26 | uint64 from_peer = 4; 27 | uint64 to_peer = 5; 28 | uint32 timeout_secs = 6; 29 | } 30 | 31 | message MigrateRegionResponse { 32 | ResponseHeader header = 1; 33 | ProcedureId pid = 2; 34 | } 35 | -------------------------------------------------------------------------------- /proto/greptime/v1/meta/route.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.meta; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; 20 | 21 | import "greptime/v1/meta/common.proto"; 22 | import "greptime/v1/common.proto"; 23 | 24 | message TableRoute { 25 | Table table = 1; 26 | repeated RegionRoute region_routes = 2; 27 | } 28 | 29 | message RegionRoute { 30 | Region region = 1; 31 | // single leader node for write task 32 | uint64 leader_peer_index = 2; 33 | // multiple follower nodes for read task 34 | repeated uint64 follower_peer_indexes = 3; 35 | } 36 | 37 | message Table { 38 | uint64 id = 1; 39 | TableName table_name = 2; 40 | bytes table_schema = 3; 41 | } 42 | 43 | message Region { 44 | // TODO(LFC): Maybe use message RegionNumber? 45 | uint64 id = 1; 46 | string name = 2; 47 | Partition partition = 3; 48 | 49 | map attrs = 100; 50 | } 51 | 52 | // PARTITION `region_name` VALUES LESS THAN (value_list) 53 | message Partition { 54 | repeated bytes column_list = 1; 55 | repeated bytes value_list = 2; 56 | } 57 | 58 | // This message is only for saving into store. 59 | // TODO(weny): Remove it, Now, the upgrade tool is still dependent on it. 60 | message TableRouteValue { 61 | repeated Peer peers = 1; 62 | TableRoute table_route = 2; 63 | } -------------------------------------------------------------------------------- /proto/greptime/v1/meta/store.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.meta; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; 20 | 21 | import "greptime/v1/meta/common.proto"; 22 | 23 | service Store { 24 | // Range gets the keys in the range from the key-value store. 25 | rpc Range(RangeRequest) returns (RangeResponse); 26 | 27 | // Put puts the given key into the key-value store. 28 | rpc Put(PutRequest) returns (PutResponse); 29 | 30 | // BatchGet atomically get values by the given keys from the key-value store. 31 | rpc BatchGet(BatchGetRequest) returns (BatchGetResponse); 32 | 33 | // BatchPut atomically puts the given keys into the key-value store. 34 | rpc BatchPut(BatchPutRequest) returns (BatchPutResponse); 35 | 36 | // BatchDelete atomically deletes the given keys and its associating values 37 | // from the key-value store. 38 | rpc BatchDelete(BatchDeleteRequest) returns (BatchDeleteResponse); 39 | 40 | // CompareAndPut atomically puts the value to the given updated 41 | // value if the current value == the expected value. 42 | rpc CompareAndPut(CompareAndPutRequest) returns (CompareAndPutResponse); 43 | 44 | // DeleteRange deletes the given range from the key-value store. 45 | rpc DeleteRange(DeleteRangeRequest) returns (DeleteRangeResponse); 46 | } 47 | 48 | message RangeRequest { 49 | RequestHeader header = 1; 50 | 51 | // key is the first key for the range, If range_end is not given, the 52 | // request only looks up key. 53 | bytes key = 2; 54 | // range_end is the upper bound on the requested range [key, range_end). 55 | // If range_end is '\0', the range is all keys >= key. 56 | // If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), 57 | // then the range request gets all keys prefixed with key. 58 | // If both key and range_end are '\0', then the range request returns all 59 | // keys. 60 | bytes range_end = 3; 61 | // limit is a limit on the number of keys returned for the request. When 62 | // limit is set to 0, it is treated as no limit. 63 | int64 limit = 4; 64 | // keys_only when set returns only the keys and not the values. 65 | bool keys_only = 5; 66 | } 67 | 68 | message RangeResponse { 69 | ResponseHeader header = 1; 70 | 71 | // kvs is the list of key-value pairs matched by the range request. 72 | repeated KeyValue kvs = 2; 73 | // more indicates if there are more keys to return in the requested range. 74 | bool more = 3; 75 | } 76 | 77 | message PutRequest { 78 | RequestHeader header = 1; 79 | 80 | // key is the key, in bytes, to put into the key-value store. 81 | bytes key = 2; 82 | // value is the value, in bytes, to associate with the key in the 83 | // key-value store. 84 | bytes value = 3; 85 | // If prev_kv is set, gets the previous key-value pair before changing it. 86 | // The previous key-value pair will be returned in the put response. 87 | bool prev_kv = 4; 88 | } 89 | 90 | message PutResponse { 91 | ResponseHeader header = 1; 92 | 93 | // If prev_kv is set in the request, the previous key-value pair will be 94 | // returned. 95 | KeyValue prev_kv = 2; 96 | } 97 | 98 | message BatchGetRequest { 99 | RequestHeader header = 1; 100 | 101 | repeated bytes keys = 2; 102 | } 103 | 104 | message BatchGetResponse { 105 | ResponseHeader header = 1; 106 | 107 | repeated KeyValue kvs = 2; 108 | } 109 | 110 | message BatchPutRequest { 111 | RequestHeader header = 1; 112 | 113 | repeated KeyValue kvs = 2; 114 | // If prev_kv is set, gets the previous key-value pairs before changing it. 115 | // The previous key-value pairs will be returned in the batch put response. 116 | bool prev_kv = 3; 117 | } 118 | 119 | message BatchPutResponse { 120 | ResponseHeader header = 1; 121 | 122 | // If prev_kv is set in the request, the previous key-value pairs will be 123 | // returned. 124 | repeated KeyValue prev_kvs = 2; 125 | } 126 | 127 | message BatchDeleteRequest { 128 | RequestHeader header = 1; 129 | 130 | repeated bytes keys = 2; 131 | // If prev_kv is set, gets the previous key-value pairs before deleting it. 132 | // The previous key-value pairs will be returned in the batch delete response. 133 | bool prev_kv = 3; 134 | } 135 | 136 | message BatchDeleteResponse { 137 | ResponseHeader header = 1; 138 | 139 | // If prev_kv is set in the request, the previous key-value pairs will be 140 | // returned. 141 | repeated KeyValue prev_kvs = 2; 142 | } 143 | 144 | message CompareAndPutRequest { 145 | RequestHeader header = 1; 146 | 147 | // key is the key, in bytes, to put into the key-value store. 148 | bytes key = 2; 149 | // expect is the previous value, in bytes 150 | bytes expect = 3; 151 | // value is the value, in bytes, to associate with the key in the 152 | // key-value store. 153 | bytes value = 4; 154 | } 155 | 156 | message CompareAndPutResponse { 157 | ResponseHeader header = 1; 158 | 159 | bool success = 2; 160 | KeyValue prev_kv = 3; 161 | } 162 | 163 | message DeleteRangeRequest { 164 | RequestHeader header = 1; 165 | 166 | // key is the first key to delete in the range. 167 | bytes key = 2; 168 | // range_end is the key following the last key to delete for the range 169 | // [key, range_end). 170 | // If range_end is not given, the range is defined to contain only the key 171 | // argument. 172 | // If range_end is one bit larger than the given key, then the range is all 173 | // the keys with the prefix (the given key). 174 | // If range_end is '\0', the range is all keys greater than or equal to the 175 | // key argument. 176 | bytes range_end = 3; 177 | // If prev_kv is set, gets the previous key-value pairs before deleting it. 178 | // The previous key-value pairs will be returned in the delete response. 179 | bool prev_kv = 4; 180 | } 181 | 182 | message DeleteRangeResponse { 183 | ResponseHeader header = 1; 184 | 185 | // deleted is the number of keys deleted by the delete range request. 186 | int64 deleted = 2; 187 | // If prev_kv is set in the request, the previous key-value pairs will be 188 | // returned. 189 | repeated KeyValue prev_kvs = 3; 190 | } 191 | -------------------------------------------------------------------------------- /proto/greptime/v1/prom.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1; 18 | 19 | option java_package = "io.greptime.v1"; 20 | option java_outer_classname = "Prometheus"; 21 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; 22 | 23 | import "greptime/v1/common.proto"; 24 | 25 | // PrometheusGateway behaves absolutely the same as Prometheus HTTP API 26 | service PrometheusGateway { 27 | rpc Handle(PromqlRequest) returns (PromqlResponse); 28 | } 29 | 30 | message PromqlRequest { 31 | RequestHeader header = 1; 32 | oneof promql { 33 | PromInstantQuery instant_query = 2; 34 | PromRangeQuery range_query = 3; 35 | } 36 | } 37 | 38 | message PromqlResponse { 39 | ResponseHeader header = 1; 40 | bytes body = 2; // absolutely same format as Prometheus in JSON 41 | } 42 | 43 | message PromInstantQuery { 44 | string query = 1; 45 | string time = 2; 46 | string lookback = 3; 47 | } 48 | 49 | message PromRangeQuery { 50 | string query = 1; 51 | string start = 2; 52 | string end = 3; 53 | string step = 4; 54 | string lookback = 5; 55 | } 56 | -------------------------------------------------------------------------------- /proto/greptime/v1/region/server.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1.region; 18 | 19 | option java_package = "io.greptime.v1.region"; 20 | option java_outer_classname = "Server"; 21 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/region"; 22 | 23 | import "greptime/v1/common.proto"; 24 | import "greptime/v1/row.proto"; 25 | import "greptime/v1/ddl.proto"; 26 | 27 | service Region { rpc Handle(RegionRequest) returns (RegionResponse); } 28 | 29 | message RegionRequestHeader { 30 | // Encoded trace_id & span_id, follow the w3c Trace Context 31 | // https://www.w3.org/TR/trace-context/#header-name 32 | map tracing_context = 5; 33 | // DB Name of request, tracking only 34 | string dbname = 3; 35 | // The contextual information of the query 36 | QueryContext query_context = 6; 37 | } 38 | 39 | message RegionRequest { 40 | RegionRequestHeader header = 1; 41 | // query request is handled in flight services. 42 | oneof body { 43 | InsertRequests inserts = 3; 44 | DeleteRequests deletes = 4; 45 | CreateRequest create = 5; 46 | DropRequest drop = 6; 47 | OpenRequest open = 7; 48 | CloseRequest close = 8; 49 | AlterRequest alter = 9; 50 | FlushRequest flush = 10; 51 | CompactRequest compact = 11; 52 | TruncateRequest truncate = 12; 53 | CreateRequests creates = 13; 54 | DropRequests drops = 14; 55 | AlterRequests alters = 15; 56 | BulkInsertRequest bulk_insert = 16; 57 | SyncRequest sync = 17; 58 | } 59 | } 60 | 61 | message RegionResponse { 62 | ResponseHeader header = 1; 63 | uint64 affected_rows = 2; 64 | map extensions = 3; 65 | } 66 | 67 | message InsertRequests { repeated InsertRequest requests = 1; } 68 | 69 | message DeleteRequests { repeated DeleteRequest requests = 1; } 70 | 71 | message InsertRequest { 72 | uint64 region_id = 1; 73 | Rows rows = 2; 74 | } 75 | 76 | message DeleteRequest { 77 | uint64 region_id = 1; 78 | Rows rows = 2; 79 | } 80 | 81 | message QueryRequest { 82 | RegionRequestHeader header = 1; 83 | uint64 region_id = 2; 84 | // substrait plan to query 85 | bytes plan = 3; 86 | } 87 | 88 | // Create a batch of regions at once, usually used to create multiple logical 89 | // regions at once. Different engines can choose whether to support this 90 | // request. Metric Engine needs it. 91 | message CreateRequests { repeated CreateRequest requests = 1; } 92 | 93 | message CreateRequest { 94 | uint64 region_id = 1; 95 | // Region engine name 96 | string engine = 2; 97 | // Columns in this region. 98 | repeated RegionColumnDef column_defs = 3; 99 | // Column Id of primary keys. 100 | repeated uint32 primary_key = 4; 101 | // Region storage path 102 | string path = 5; 103 | // Options of the created region. 104 | map options = 6; 105 | // TODO: add partition def 106 | } 107 | 108 | // Same as CreateRequests, but for dropping regions. 109 | message DropRequests { repeated DropRequest requests = 1; } 110 | 111 | message DropRequest { 112 | uint64 region_id = 1; 113 | // Only used by Metric Engine, for fast path drop. 114 | // It only works for Metric Engine, and will be ignored by other engines. 115 | // If true, the Metric Engine will delete logical tables in memory, and drop the physical region eventually. 116 | bool fast_path = 2; 117 | } 118 | 119 | message OpenRequest { 120 | uint64 region_id = 1; 121 | // Region engine name 122 | string engine = 2; 123 | // Region storage path 124 | string path = 3; 125 | // Options of the opened region. 126 | map options = 4; 127 | } 128 | 129 | message CloseRequest { uint64 region_id = 1; } 130 | 131 | message AlterRequests { repeated AlterRequest requests = 1; } 132 | 133 | message AlterRequest { 134 | uint64 region_id = 1; 135 | oneof kind { 136 | AddColumns add_columns = 2; 137 | DropColumns drop_columns = 3; 138 | ModifyColumnTypes modify_column_types = 5; 139 | SetTableOptions set_table_options = 6; 140 | UnsetTableOptions unset_table_options = 9; 141 | SetIndex set_index = 10; 142 | UnsetIndex unset_index = 11; 143 | } 144 | // The version of the schema before applying the alteration. 145 | uint64 schema_version = 4; 146 | } 147 | 148 | message AddColumns { repeated AddColumn add_columns = 1; } 149 | 150 | message DropColumns { repeated DropColumn drop_columns = 1; } 151 | 152 | message AddColumn { 153 | RegionColumnDef column_def = 1; 154 | AddColumnLocation location = 3; 155 | } 156 | 157 | message DropColumn { string name = 1; } 158 | 159 | message FlushRequest { uint64 region_id = 1; } 160 | 161 | /// Regular compaction 162 | message Regular {} 163 | 164 | /// Strictly-windowed compaction. 165 | message StrictWindow { 166 | int64 window_seconds = 1; 167 | } 168 | 169 | message CompactRequest { 170 | uint64 region_id = 1; 171 | oneof options { 172 | Regular regular = 2; 173 | StrictWindow strict_window = 3; 174 | } 175 | } 176 | 177 | message TruncateRequest { uint64 region_id = 1; } 178 | 179 | // The column definition of a region. Unlike the message `ColumnDef` in 180 | // `ddl.proto` which is for clients outside GreptimeDB, this `RegionColumnDef` 181 | // is for region requests use only. So it carries an extra field `column_id` 182 | // that is known internally. 183 | message RegionColumnDef { 184 | ColumnDef column_def = 1; 185 | uint32 column_id = 2; 186 | } 187 | 188 | // Request of bulk ingestion API. 189 | message BulkInsertRequest { 190 | uint64 region_id = 1; 191 | oneof body { 192 | ArrowIpc arrow_ipc = 2; 193 | } 194 | } 195 | 196 | // Manifest info for mito engine. 197 | message MitoManifestInfo { 198 | uint64 data_manifest_version = 1; 199 | } 200 | 201 | // Manifest info for metric engine. 202 | message MetricManifestInfo { 203 | uint64 data_manifest_version = 1; 204 | uint64 metadata_manifest_version = 2; 205 | } 206 | 207 | // Sync request for region. 208 | message SyncRequest { 209 | uint64 region_id = 1; 210 | oneof manifest_info { 211 | MitoManifestInfo mito_manifest_info = 2; 212 | MetricManifestInfo metric_manifest_info = 3; 213 | } 214 | } 215 | -------------------------------------------------------------------------------- /proto/greptime/v1/row.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1; 18 | 19 | option java_package = "io.greptime.v1"; 20 | option java_outer_classname = "RowData"; 21 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; 22 | 23 | import "greptime/v1/common.proto"; 24 | 25 | message Rows { 26 | repeated ColumnSchema schema = 1; 27 | repeated Row rows = 2; 28 | } 29 | 30 | message ColumnSchema { 31 | string column_name = 1; 32 | ColumnDataType datatype = 2; 33 | SemanticType semantic_type = 3; 34 | 35 | // Extension for ColumnDataType. 36 | ColumnDataTypeExtension datatype_extension = 4; 37 | 38 | // Additional column options. 39 | ColumnOptions options = 5; 40 | } 41 | 42 | message Row { repeated Value values = 1; } 43 | 44 | message Value { 45 | oneof value_data { 46 | int32 i8_value = 1; 47 | int32 i16_value = 2; 48 | int32 i32_value = 3; 49 | int64 i64_value = 4; 50 | 51 | uint32 u8_value = 5; 52 | uint32 u16_value = 6; 53 | uint32 u32_value = 7; 54 | uint64 u64_value = 8; 55 | 56 | float f32_value = 9; 57 | double f64_value = 10; 58 | 59 | bool bool_value = 11; 60 | bytes binary_value = 12; 61 | string string_value = 13; 62 | 63 | int32 date_value = 14; 64 | int64 datetime_value = 15; 65 | int64 timestamp_second_value = 16; 66 | int64 timestamp_millisecond_value = 17; 67 | int64 timestamp_microsecond_value = 18; 68 | int64 timestamp_nanosecond_value = 19; 69 | int64 time_second_value = 20; 70 | int64 time_millisecond_value = 21; 71 | int64 time_microsecond_value = 22; 72 | int64 time_nanosecond_value = 23; 73 | int32 interval_year_month_value = 24; 74 | int64 interval_day_time_value = 25; 75 | IntervalMonthDayNano interval_month_day_nano_value = 26; 76 | Decimal128 decimal128_value = 31; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /proto/greptime/v1/wal.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package greptime.v1; 18 | 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; 20 | 21 | import "greptime/v1/row.proto"; 22 | import "greptime/v1/common.proto"; 23 | 24 | // Type of operation to rows. 25 | enum OpType { 26 | // Delete rows. 27 | DELETE = 0; 28 | // Put rows. 29 | PUT = 1; 30 | } 31 | 32 | // Encoding of primary key. 33 | enum PrimaryKeyEncoding { 34 | DENSE = 0; 35 | SPARSE = 1; 36 | } 37 | 38 | // Write hint of the mutation. 39 | message WriteHint { 40 | PrimaryKeyEncoding primary_key_encoding = 1; 41 | } 42 | 43 | // Mutation contains updates to a set of rows. 44 | message Mutation { 45 | // Type of this mutation. 46 | OpType op_type = 1; 47 | // Start WAL sequence of this mutation. 48 | uint64 sequence = 2; 49 | // Row updates to write to the WAL. 50 | Rows rows = 3; 51 | // Write hint of the mutation. 52 | WriteHint write_hint = 4; 53 | } 54 | 55 | // A WAL entry contains a list of mutations for a region to write. 56 | message WalEntry { 57 | // List of mutations for a region. 58 | repeated Mutation mutations = 1; 59 | // List of bulk insert requests. 60 | repeated BulkWalEntry bulk_entries = 2; 61 | } 62 | 63 | message BulkWalEntry { 64 | // Start WAL sequence of this entry. 65 | uint64 sequence = 1; 66 | // Max timestamp value. 67 | int64 max_ts = 2; 68 | // Min timestamp value. 69 | int64 min_ts = 3; 70 | // Timestamp column index. 71 | uint32 timestamp_index = 4; 72 | oneof body { 73 | ArrowIpc arrow_ipc = 5; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /proto/prometheus/remote/remote.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Prometheus Team 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | syntax = "proto3"; 15 | package prometheus; 16 | 17 | // GreptimeTeam modify the original go_package definition to make it consistent with the go package name. 18 | // And we also remove the gogoproto dependency which is now deprecated. 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/prometheus/remote"; 20 | 21 | import "prometheus/remote/types.proto"; 22 | 23 | message WriteRequest { 24 | repeated prometheus.TimeSeries timeseries = 1; 25 | // Cortex uses this field to determine the source of the write request. 26 | // We reserve it to avoid any compatibility issues. 27 | reserved 2; 28 | repeated prometheus.MetricMetadata metadata = 3; 29 | } 30 | 31 | // ReadRequest represents a remote read request. 32 | message ReadRequest { 33 | repeated Query queries = 1; 34 | 35 | enum ResponseType { 36 | // Server will return a single ReadResponse message with matched series that includes list of raw samples. 37 | // It's recommended to use streamed response types instead. 38 | // 39 | // Response headers: 40 | // Content-Type: "application/x-protobuf" 41 | // Content-Encoding: "snappy" 42 | SAMPLES = 0; 43 | // Server will stream a delimited ChunkedReadResponse message that contains XOR encoded chunks for a single series. 44 | // Each message is following varint size and fixed size bigendian uint32 for CRC32 Castagnoli checksum. 45 | // 46 | // Response headers: 47 | // Content-Type: "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse" 48 | // Content-Encoding: "" 49 | STREAMED_XOR_CHUNKS = 1; 50 | } 51 | 52 | // accepted_response_types allows negotiating the content type of the response. 53 | // 54 | // Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is 55 | // implemented by server, error is returned. 56 | // For request that do not contain `accepted_response_types` field the SAMPLES response type will be used. 57 | repeated ResponseType accepted_response_types = 2; 58 | } 59 | 60 | // ReadResponse is a response when response_type equals SAMPLES. 61 | message ReadResponse { 62 | // In same order as the request's queries. 63 | repeated QueryResult results = 1; 64 | } 65 | 66 | message Query { 67 | int64 start_timestamp_ms = 1; 68 | int64 end_timestamp_ms = 2; 69 | repeated prometheus.LabelMatcher matchers = 3; 70 | prometheus.ReadHints hints = 4; 71 | } 72 | 73 | message QueryResult { 74 | // Samples within a time series must be ordered by time. 75 | repeated prometheus.TimeSeries timeseries = 1; 76 | } 77 | 78 | // ChunkedReadResponse is a response when response_type equals STREAMED_XOR_CHUNKS. 79 | // We strictly stream full series after series, optionally split by time. This means that a single frame can contain 80 | // partition of the single series, but once a new series is started to be streamed it means that no more chunks will 81 | // be sent for previous one. Series are returned sorted in the same way TSDB block are internally. 82 | message ChunkedReadResponse { 83 | repeated prometheus.ChunkedSeries chunked_series = 1; 84 | 85 | // query_index represents an index of the query from ReadRequest.queries these chunks relates to. 86 | int64 query_index = 2; 87 | } 88 | -------------------------------------------------------------------------------- /proto/prometheus/remote/types.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Prometheus Team 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | syntax = "proto3"; 15 | package prometheus; 16 | 17 | // GreptimeTeam modify the original go_package definition to make it consistent with the go package name. 18 | // And we also remove the gogoproto dependency which is now deprecated. 19 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/prometheus/remote"; 20 | 21 | message MetricMetadata { 22 | enum MetricType { 23 | UNKNOWN = 0; 24 | COUNTER = 1; 25 | GAUGE = 2; 26 | HISTOGRAM = 3; 27 | GAUGEHISTOGRAM = 4; 28 | SUMMARY = 5; 29 | INFO = 6; 30 | STATESET = 7; 31 | } 32 | 33 | // Represents the metric type, these match the set from Prometheus. 34 | // Refer to model/textparse/interface.go for details. 35 | MetricType type = 1; 36 | string metric_family_name = 2; 37 | string help = 4; 38 | string unit = 5; 39 | } 40 | 41 | message Sample { 42 | double value = 1; 43 | // timestamp is in ms format, see model/timestamp/timestamp.go for 44 | // conversion from time.Time to Prometheus timestamp. 45 | int64 timestamp = 2; 46 | } 47 | 48 | message Exemplar { 49 | // Optional, can be empty. 50 | repeated Label labels = 1; 51 | double value = 2; 52 | // timestamp is in ms format, see model/timestamp/timestamp.go for 53 | // conversion from time.Time to Prometheus timestamp. 54 | int64 timestamp = 3; 55 | } 56 | 57 | // TimeSeries represents samples and labels for a single time series. 58 | message TimeSeries { 59 | // For a timeseries to be valid, and for the samples and exemplars 60 | // to be ingested by the remote system properly, the labels field is required. 61 | repeated Label labels = 1; 62 | repeated Sample samples = 2; 63 | repeated Exemplar exemplars = 3; 64 | } 65 | 66 | message Label { 67 | string name = 1; 68 | string value = 2; 69 | } 70 | 71 | message Labels { 72 | repeated Label labels = 1; 73 | } 74 | 75 | // Matcher specifies a rule, which can match or set of labels or not. 76 | message LabelMatcher { 77 | enum Type { 78 | EQ = 0; 79 | NEQ = 1; 80 | RE = 2; 81 | NRE = 3; 82 | } 83 | Type type = 1; 84 | string name = 2; 85 | string value = 3; 86 | } 87 | 88 | message ReadHints { 89 | int64 step_ms = 1; // Query step size in milliseconds. 90 | string func = 2; // String representation of surrounding function or aggregation. 91 | int64 start_ms = 3; // Start time in milliseconds. 92 | int64 end_ms = 4; // End time in milliseconds. 93 | repeated string grouping = 5; // List of label names used in aggregation. 94 | bool by = 6; // Indicate whether it is without or by. 95 | int64 range_ms = 7; // Range vector selector range in milliseconds. 96 | } 97 | 98 | // Chunk represents a TSDB chunk. 99 | // Time range [min, max] is inclusive. 100 | message Chunk { 101 | int64 min_time_ms = 1; 102 | int64 max_time_ms = 2; 103 | 104 | // We require this to match chunkenc.Encoding. 105 | enum Encoding { 106 | UNKNOWN = 0; 107 | XOR = 1; 108 | } 109 | Encoding type = 3; 110 | bytes data = 4; 111 | } 112 | 113 | // ChunkedSeries represents single, encoded time series. 114 | message ChunkedSeries { 115 | // Labels should be sorted. 116 | repeated Label labels = 1; 117 | // Chunks will be in start time order and may overlap. 118 | repeated Chunk chunks = 2; 119 | } 120 | -------------------------------------------------------------------------------- /proto/substrait_extension/dist_plan.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/substrait_extension"; 18 | 19 | package substrait_extension; 20 | 21 | message MergeScan { 22 | // the input logical plan 23 | bytes input = 1; 24 | // whether this plan is a placeholder 25 | bool is_placeholder = 2; 26 | } 27 | -------------------------------------------------------------------------------- /proto/substrait_extension/promql_plan.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | option go_package = "github.com/GreptimeTeam/greptime-proto/go/substrait_extension"; 18 | 19 | package substrait_extension; 20 | 21 | message EmptyMetric { 22 | // Start timestamp in millisecond 23 | int64 start = 1; 24 | // End timestamp in millisecond 25 | int64 end = 2; 26 | // Interval in millisecond 27 | int64 interval = 3; 28 | } 29 | 30 | message InstantManipulate { 31 | // Start timestamp in millisecond 32 | int64 start = 1; 33 | // End timestamp in millisecond 34 | int64 end = 2; 35 | // Interval in millisecond 36 | int64 interval = 3; 37 | // Look-back delta in millisecond 38 | int64 lookback_delta = 4; 39 | // Column name of time index column 40 | string time_index = 5; 41 | // Optional field column name for validating staleness 42 | string field_index = 6; 43 | } 44 | 45 | message SeriesNormalize { 46 | // Offset in millisecond 47 | int64 offset = 1; 48 | // Column name of time index column 49 | string time_index = 2; 50 | // Whether to filter out NaN value 51 | bool filter_nan = 3; 52 | // Names of tag columns 53 | repeated string tag_columns = 4; 54 | } 55 | 56 | message SeriesDivide { 57 | // Names of tag columns 58 | repeated string tag_columns = 1; 59 | // Name of time index column 60 | string time_index_column = 2; 61 | } 62 | 63 | message RangeManipulate { 64 | // Start timestamp in millisecond 65 | int64 start = 1; 66 | // End timestamp in millisecond 67 | int64 end = 2; 68 | // Interval in millisecond 69 | int64 interval = 3; 70 | // Range in millisecond 71 | int64 range = 4; 72 | // Column name of time index column 73 | string time_index = 5; 74 | // Names of tag columns 75 | repeated string tag_columns = 6; 76 | } 77 | 78 | message ScalarCalculate { 79 | // Start timestamp in millisecond 80 | int64 start = 1; 81 | // End timestamp in millisecond 82 | int64 end = 2; 83 | // Interval in millisecond 84 | int64 interval = 3; 85 | // Column name of time index column 86 | string time_index = 5; 87 | // Names of tag columns 88 | repeated string tag_columns = 6; 89 | // Column name of field column 90 | string field_column = 7; 91 | } 92 | -------------------------------------------------------------------------------- /scripts/generate-cpp.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -e 4 | 5 | PROTO_ROOT=./proto 6 | CPP_OUTPUT=./c++ 7 | 8 | protoc -I ${PROTO_ROOT} --cpp_out=${CPP_OUTPUT} $(find ./proto/ -type f -iname "*.proto") 9 | protoc -I ${PROTO_ROOT} --grpc_out=${CPP_OUTPUT} --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` $(find ./proto/ -type f -iname "*.proto") 10 | -------------------------------------------------------------------------------- /scripts/generate-go.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -e 4 | 5 | GO_OUTPUT=./go 6 | 7 | # TODO(zyy17): Can we make the following commands as one command? 8 | protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ 9 | --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ 10 | -Iproto proto/greptime/v1/meta/*.proto 11 | 12 | protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ 13 | --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ 14 | -Iproto proto/greptime/v1/*.proto 15 | 16 | protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ 17 | --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ 18 | -Iproto proto/prometheus/remote/*.proto 19 | 20 | protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ 21 | --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ 22 | -Iproto proto/substrait_extension/*.proto 23 | -------------------------------------------------------------------------------- /scripts/generate-java.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | PROTO_ROOT=./proto 4 | JAVA_OUTPUT=./java/src/main/java/ 5 | 6 | protoc -I=${PROTO_ROOT} --java_out=${JAVA_OUTPUT} $(find ./proto/ -type f -iname "*.proto") 7 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #[allow(clippy::large_enum_variant)] 16 | pub mod v1; 17 | 18 | pub mod prometheus { 19 | pub mod remote { 20 | tonic::include_proto!("prometheus"); 21 | } 22 | } 23 | 24 | pub mod substrait_extension { 25 | tonic::include_proto!("substrait_extension"); 26 | } 27 | -------------------------------------------------------------------------------- /src/v1.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | tonic::include_proto!("greptime.v1"); 16 | 17 | use crate::v1::value::ValueData; 18 | 19 | pub const GREPTIME_GRPC_DESC: &[u8] = tonic::include_file_descriptor_set!("greptime_grpc_desc"); 20 | 21 | pub mod flow; 22 | pub mod index; 23 | pub mod meta; 24 | pub mod region; 25 | 26 | impl From for Value { 27 | fn from(value: ValueData) -> Self { 28 | Value { 29 | value_data: Some(value), 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/v1/flow.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | tonic::include_proto!("greptime.v1.flow"); 16 | -------------------------------------------------------------------------------- /src/v1/index.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | tonic::include_proto!("greptime.v1.index"); 16 | -------------------------------------------------------------------------------- /src/v1/meta.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | tonic::include_proto!("greptime.v1.meta"); 16 | 17 | mod mailbox; 18 | 19 | use std::collections::HashMap; 20 | use std::fmt::{Display, Formatter}; 21 | use std::hash::{Hash, Hasher}; 22 | 23 | pub const PROTOCOL_VERSION: u64 = 1; 24 | 25 | #[derive(Default)] 26 | pub struct PeerDict { 27 | peers: HashMap, 28 | index: usize, 29 | } 30 | 31 | impl PeerDict { 32 | pub fn get_or_insert(&mut self, peer: Peer) -> usize { 33 | let index = self.peers.entry(peer).or_insert_with(|| { 34 | let v = self.index; 35 | self.index += 1; 36 | v 37 | }); 38 | 39 | *index 40 | } 41 | 42 | pub fn into_peers(self) -> Vec { 43 | let mut array = vec![Peer::default(); self.index]; 44 | for (p, i) in self.peers { 45 | array[i] = p; 46 | } 47 | array 48 | } 49 | } 50 | 51 | #[allow(clippy::derived_hash_with_manual_eq)] 52 | impl Hash for Peer { 53 | fn hash(&self, state: &mut H) { 54 | self.id.hash(state); 55 | self.addr.hash(state); 56 | } 57 | } 58 | 59 | impl Eq for Peer {} 60 | 61 | impl Display for Peer { 62 | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { 63 | write!(f, "peer-{}({})", self.id, self.addr) 64 | } 65 | } 66 | 67 | impl Peer { 68 | pub fn new(id: u64, addr: impl Into) -> Self { 69 | Self { 70 | id, 71 | addr: addr.into(), 72 | } 73 | } 74 | pub fn empty(id: u64) -> Self { 75 | Self { 76 | id, 77 | addr: String::new(), 78 | } 79 | } 80 | } 81 | 82 | impl RequestHeader { 83 | #[inline] 84 | pub fn new(member_id: u64, role: Role, tracing_context: HashMap) -> Self { 85 | Self { 86 | protocol_version: PROTOCOL_VERSION, 87 | member_id, 88 | role: role.into(), 89 | tracing_context, 90 | } 91 | } 92 | } 93 | 94 | impl ResponseHeader { 95 | #[inline] 96 | pub fn success() -> Self { 97 | Self { 98 | protocol_version: PROTOCOL_VERSION, 99 | ..Default::default() 100 | } 101 | } 102 | 103 | #[inline] 104 | pub fn failed(error: Error) -> Self { 105 | Self { 106 | protocol_version: PROTOCOL_VERSION, 107 | error: Some(error), 108 | } 109 | } 110 | 111 | #[inline] 112 | pub fn is_not_leader(&self) -> bool { 113 | if let Some(error) = &self.error { 114 | if error.code == ErrorCode::NotLeader as i32 { 115 | return true; 116 | } 117 | } 118 | false 119 | } 120 | } 121 | 122 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 123 | pub enum ErrorCode { 124 | NotEnoughAvailableDatanodes = 1, 125 | NotLeader = 2, 126 | } 127 | 128 | impl Error { 129 | #[inline] 130 | pub fn not_enough_available_datanodes(expected: usize, actual: usize) -> Self { 131 | Self { 132 | code: ErrorCode::NotEnoughAvailableDatanodes as i32, 133 | err_msg: format!( 134 | "There are not enough active datanodes, expected: {expected}, actual: {actual}." 135 | ), 136 | } 137 | } 138 | 139 | #[inline] 140 | pub fn is_not_leader() -> Self { 141 | Self { 142 | code: ErrorCode::NotLeader as i32, 143 | err_msg: "Current server is not leader".to_string(), 144 | } 145 | } 146 | } 147 | 148 | impl HeartbeatResponse { 149 | #[inline] 150 | pub fn is_not_leader(&self) -> bool { 151 | if let Some(header) = &self.header { 152 | return header.is_not_leader(); 153 | } 154 | false 155 | } 156 | } 157 | macro_rules! gen_set_header { 158 | ($req: ty) => { 159 | impl $req { 160 | #[inline] 161 | pub fn set_header( 162 | &mut self, 163 | member_id: u64, 164 | role: Role, 165 | tracing_context: HashMap, 166 | ) { 167 | match self.header.as_mut() { 168 | Some(header) => { 169 | header.member_id = member_id; 170 | header.role = role.into(); 171 | header.tracing_context = tracing_context; 172 | } 173 | None => { 174 | self.header = Some(RequestHeader::new(member_id, role, tracing_context)); 175 | } 176 | } 177 | } 178 | } 179 | }; 180 | } 181 | 182 | gen_set_header!(HeartbeatRequest); 183 | gen_set_header!(RangeRequest); 184 | gen_set_header!(PutRequest); 185 | gen_set_header!(BatchGetRequest); 186 | gen_set_header!(BatchPutRequest); 187 | gen_set_header!(BatchDeleteRequest); 188 | gen_set_header!(CompareAndPutRequest); 189 | gen_set_header!(DeleteRangeRequest); 190 | gen_set_header!(LockRequest); 191 | gen_set_header!(UnlockRequest); 192 | gen_set_header!(DdlTaskRequest); 193 | gen_set_header!(MigrateRegionRequest); 194 | gen_set_header!(QueryProcedureRequest); 195 | gen_set_header!(ProcedureDetailRequest); 196 | 197 | #[cfg(test)] 198 | mod tests { 199 | use std::vec; 200 | 201 | use super::*; 202 | 203 | #[test] 204 | fn test_peer_dict() { 205 | let mut dict = PeerDict::default(); 206 | 207 | dict.get_or_insert(Peer { 208 | id: 1, 209 | addr: "111".to_string(), 210 | }); 211 | dict.get_or_insert(Peer { 212 | id: 2, 213 | addr: "222".to_string(), 214 | }); 215 | dict.get_or_insert(Peer { 216 | id: 1, 217 | addr: "111".to_string(), 218 | }); 219 | dict.get_or_insert(Peer { 220 | id: 1, 221 | addr: "111".to_string(), 222 | }); 223 | dict.get_or_insert(Peer { 224 | id: 1, 225 | addr: "111".to_string(), 226 | }); 227 | dict.get_or_insert(Peer { 228 | id: 1, 229 | addr: "111".to_string(), 230 | }); 231 | dict.get_or_insert(Peer { 232 | id: 2, 233 | addr: "222".to_string(), 234 | }); 235 | 236 | assert_eq!(2, dict.index); 237 | assert_eq!( 238 | vec![ 239 | Peer { 240 | id: 1, 241 | addr: "111".to_string(), 242 | }, 243 | Peer { 244 | id: 2, 245 | addr: "222".to_string(), 246 | } 247 | ], 248 | dict.into_peers() 249 | ); 250 | } 251 | } 252 | -------------------------------------------------------------------------------- /src/v1/meta/mailbox.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | use crate::v1::meta::mailbox_message::Payload; 16 | use crate::v1::meta::MailboxMessage; 17 | use serde::Serialize; 18 | use serde_json::Result; 19 | use std::fmt::{Display, Formatter}; 20 | 21 | impl MailboxMessage { 22 | pub fn json_message( 23 | subject: &str, 24 | from: &str, 25 | to: &str, 26 | timestamp_millis: i64, 27 | payload: &T, 28 | ) -> Result 29 | where 30 | T: ?Sized + Serialize + Display, 31 | { 32 | let payload = serde_json::to_string(payload)?; 33 | Ok(MailboxMessage { 34 | id: 0, // "id" will be set by the mailbox. 35 | subject: subject.to_string(), 36 | from: from.to_string(), 37 | to: to.to_string(), 38 | timestamp_millis, 39 | payload: Some(Payload::Json(payload)), 40 | }) 41 | } 42 | } 43 | 44 | impl Display for MailboxMessage { 45 | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { 46 | write!( 47 | f, 48 | "MailboxMessage(id={}, subject={}, from={}, to={}, timestamp_millis={}, payload={:?})", 49 | self.id, self.subject, self.from, self.to, self.timestamp_millis, self.payload 50 | ) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/v1/region.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2023 Greptime Team 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | tonic::include_proto!("greptime.v1.region"); 16 | 17 | #[cfg(test)] 18 | mod test { 19 | use crate::v1::region::region_request::Body as RegionRequest; 20 | use crate::v1::region::InsertRequests; 21 | 22 | #[test] 23 | fn test_region_request_name() { 24 | let request = RegionRequest::Inserts(InsertRequests { requests: vec![] }); 25 | assert_eq!("Inserts", request.as_ref()); 26 | } 27 | } 28 | --------------------------------------------------------------------------------