Skip to main content

plugins/
standalone.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
15use common_base::Plugins;
16use common_meta::cache::CacheRegistryBuilder;
17use common_meta::kv_backend::KvBackendRef;
18use standalone::error::Result;
19use standalone::options::StandaloneOptions;
20
21use crate::options::PluginOptions;
22
23#[allow(unused_variables)]
24#[allow(unused_mut)]
25pub async fn setup_standalone_plugins(
26    plugins: &mut Plugins,
27    plugin_options: &[PluginOptions],
28    standalone_opts: &StandaloneOptions,
29    metadata_kvbackend: KvBackendRef,
30) -> Result<()> {
31    Ok(())
32}
33
34/// Allows standalone plugins to add cache invalidators to the layered registry.
35pub fn configure_cache_registry(_plugins: &Plugins) -> Option<CacheRegistryBuilder> {
36    None
37}
38
39pub mod context {
40    use std::sync::Arc;
41
42    use catalog::CatalogManagerRef;
43    use common_meta::kv_backend::KvBackendRef;
44    use flow::FrontendClient;
45
46    /// The context for [`common_meta::ddl_manager::DdlManagerConfiguratorRef`] in standalone.
47    pub struct DdlManagerConfigureContext {
48        pub kv_backend: KvBackendRef,
49        pub fe_client: Arc<FrontendClient>,
50        pub catalog_manager: CatalogManagerRef,
51    }
52}