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
34pub async fn start_standalone_plugins(_plugins: Plugins) -> Result<()> {
35    Ok(())
36}
37
38/// Allows standalone plugins to add cache invalidators to the layered registry.
39pub fn configure_cache_registry(_plugins: &Plugins) -> Option<CacheRegistryBuilder> {
40    None
41}
42
43pub mod context {
44    use std::sync::Arc;
45
46    use catalog::CatalogManagerRef;
47    use common_meta::kv_backend::KvBackendRef;
48    use flow::FrontendClient;
49
50    /// The context for [`common_meta::ddl_manager::DdlManagerConfiguratorRef`] in standalone.
51    pub struct DdlManagerConfigureContext {
52        pub kv_backend: KvBackendRef,
53        pub fe_client: Arc<FrontendClient>,
54        pub catalog_manager: CatalogManagerRef,
55    }
56}