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