common_function/
admin.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
15mod flush_compact_region;
16mod flush_compact_table;
17mod migrate_region;
18mod reconcile_catalog;
19mod reconcile_database;
20mod reconcile_table;
21
22use flush_compact_region::{CompactRegionFunction, FlushRegionFunction};
23use flush_compact_table::{CompactTableFunction, FlushTableFunction};
24use migrate_region::MigrateRegionFunction;
25use reconcile_catalog::ReconcileCatalogFunction;
26use reconcile_database::ReconcileDatabaseFunction;
27use reconcile_table::ReconcileTableFunction;
28
29use crate::flush_flow::FlushFlowFunction;
30use crate::function_registry::FunctionRegistry;
31
32/// Administration functions
33pub(crate) struct AdminFunction;
34
35impl AdminFunction {
36    /// Register all admin functions to [`FunctionRegistry`].
37    pub fn register(registry: &FunctionRegistry) {
38        registry.register(MigrateRegionFunction::factory());
39        registry.register(FlushRegionFunction::factory());
40        registry.register(CompactRegionFunction::factory());
41        registry.register(FlushTableFunction::factory());
42        registry.register(CompactTableFunction::factory());
43        registry.register(FlushFlowFunction::factory());
44        registry.register(ReconcileCatalogFunction::factory());
45        registry.register(ReconcileDatabaseFunction::factory());
46        registry.register(ReconcileTableFunction::factory());
47    }
48}