|
12 | 12 | // See the License for the specific language governing permissions and |
13 | 13 | // limitations under the License. |
14 | 14 |
|
15 | | -use std::collections::HashMap; |
16 | 15 | use std::result::Result; |
17 | 16 | use std::sync::Arc; |
18 | 17 |
|
19 | | -use catalog::CatalogManagerRef; |
20 | | -use catalog::information_schema::InformationSchemaTableFactoryRef; |
21 | 18 | use common_error::ext::BoxedError; |
22 | | -use common_meta::FlownodeId; |
23 | | -use common_meta::kv_backend::KvBackendRef; |
24 | | -use flow::FrontendClient; |
25 | 19 | use servers::grpc::builder::GrpcServerBuilder; |
26 | 20 |
|
27 | | -/// Provides additional information schema table factories beyond the built-in |
28 | | -/// ones. |
29 | | -/// |
30 | | -/// These are typically provided by enterprise or optional modules, such as: |
31 | | -/// - `information_schema.triggers` |
32 | | -/// - `information_schema.alerts` |
33 | | -#[async_trait::async_trait] |
34 | | -pub trait InformationSchemaTableFactories: Send + Sync { |
35 | | - async fn create_factories( |
36 | | - &self, |
37 | | - ctx: TableFactoryContext, |
38 | | - ) -> Result<HashMap<String, InformationSchemaTableFactoryRef>, BoxedError>; |
39 | | -} |
40 | | - |
41 | | -pub type InformationSchemaTableFactoriesRef = Arc<dyn InformationSchemaTableFactories>; |
42 | | - |
43 | | -/// Context for information schema table factory providers. |
44 | | -pub struct TableFactoryContext { |
45 | | - pub fe_client: Arc<FrontendClient>, |
46 | | -} |
47 | | - |
48 | 21 | /// Allows extending the gRPC server with additional services (e.g., enterprise |
49 | 22 | /// features). |
50 | 23 | #[async_trait::async_trait] |
51 | 24 | pub trait GrpcExtension: Send + Sync { |
52 | | - async fn extend_grpc_services( |
53 | | - &self, |
54 | | - builder: &mut GrpcServerBuilder, |
55 | | - ctx: GrpcExtensionContext, |
56 | | - ) -> Result<(), BoxedError>; |
57 | | -} |
58 | | - |
59 | | -/// Context provided to gRPC service extensions during server construction. |
60 | | -pub struct GrpcExtensionContext { |
61 | | - pub kv_backend: KvBackendRef, |
62 | | - pub fe_client: Arc<FrontendClient>, |
63 | | - pub flownode_id: FlownodeId, |
64 | | - pub catalog_manager: CatalogManagerRef, |
| 25 | + async fn extend_grpc_services(&self, builder: &mut GrpcServerBuilder) |
| 26 | + -> Result<(), BoxedError>; |
65 | 27 | } |
66 | 28 |
|
67 | 29 | pub type GrpcExtensionRef = Arc<dyn GrpcExtension>; |
0 commit comments