@@ -32,7 +32,7 @@ use common_meta::cache::LayeredCacheRegistryBuilder;
3232use common_meta:: ddl:: flow_meta:: FlowMetadataAllocator ;
3333use common_meta:: ddl:: table_meta:: TableMetadataAllocator ;
3434use common_meta:: ddl:: { DdlContext , NoopRegionFailureDetectorControl } ;
35- use common_meta:: ddl_manager:: { DdlManager , DdlManagerConfiguratorRef , DdlManagerConfigureContext } ;
35+ use common_meta:: ddl_manager:: { DdlManager , DdlManagerConfiguratorRef } ;
3636use common_meta:: key:: flow:: FlowMetadataManager ;
3737use common_meta:: key:: { TableMetadataManager , TableMetadataManagerRef } ;
3838use common_meta:: kv_backend:: KvBackendRef ;
@@ -58,6 +58,10 @@ use frontend::instance::StandaloneDatanodeManager;
5858use frontend:: instance:: builder:: FrontendBuilder ;
5959use frontend:: server:: Services ;
6060use meta_srv:: metasrv:: { FLOW_ID_SEQ , TABLE_ID_SEQ } ;
61+ use plugins:: frontend:: context:: {
62+ CatalogManagerConfigureContext , StandaloneCatalogManagerConfigureContext ,
63+ } ;
64+ use plugins:: standalone:: context:: DdlManagerConfigureContext ;
6165use servers:: tls:: { TlsMode , TlsOption } ;
6266use snafu:: ResultExt ;
6367use standalone:: StandaloneInformationExtension ;
@@ -414,9 +418,10 @@ impl StartCommand {
414418 let builder = if let Some ( configurator) =
415419 plugins. get :: < CatalogManagerConfiguratorRef < CatalogManagerConfigureContext > > ( )
416420 {
417- let ctx = CatalogManagerConfigureContext {
421+ let ctx = StandaloneCatalogManagerConfigureContext {
418422 fe_client : frontend_client. clone ( ) ,
419423 } ;
424+ let ctx = CatalogManagerConfigureContext :: Standalone ( ctx) ;
420425 configurator
421426 . configure ( builder, ctx)
422427 . await
@@ -506,9 +511,13 @@ impl StartCommand {
506511 let ddl_manager = DdlManager :: try_new ( ddl_context, procedure_manager. clone ( ) , true )
507512 . context ( error:: InitDdlManagerSnafu ) ?;
508513
509- let ddl_manager = if let Some ( configurator) = plugins. get :: < DdlManagerConfiguratorRef > ( ) {
514+ let ddl_manager = if let Some ( configurator) =
515+ plugins. get :: < DdlManagerConfiguratorRef < DdlManagerConfigureContext > > ( )
516+ {
510517 let ctx = DdlManagerConfigureContext {
511518 kv_backend : kv_backend. clone ( ) ,
519+ fe_client : frontend_client. clone ( ) ,
520+ catalog_manager : catalog_manager. clone ( ) ,
512521 } ;
513522 configurator
514523 . configure ( ddl_manager, ctx)
@@ -595,11 +604,6 @@ impl StartCommand {
595604 }
596605}
597606
598- /// The context for [`CatalogManagerConfigratorRef`] in standalone.
599- pub struct CatalogManagerConfigureContext {
600- pub fe_client : Arc < FrontendClient > ,
601- }
602-
603607#[ cfg( test) ]
604608mod tests {
605609 use std:: default:: Default ;
0 commit comments