pub fn new(
        confirmed_bank_receiver: Receiver<BankNotification>,
        accountsdb_plugin_config_files: &[PathBuf],
    ) -> Result<Self, AccountsdbPluginServiceError> {
        info!(
            "Starting AccountsDbPluginService from config files: {:?}",
            accountsdb_plugin_config_files
        );
        let mut plugin_manager = AccountsDbPluginManager::new();

        for accountsdb_plugin_config_file in accountsdb_plugin_config_files {
            Self::load_plugin(&mut plugin_manager, accountsdb_plugin_config_file)?;
        }
        let account_data_notifications_enabled =
            plugin_manager.account_data_notifications_enabled();
        let transaction_notifications_enabled = plugin_manager.transaction_notifications_enabled();

        let plugin_manager = Arc::new(RwLock::new(plugin_manager));

        let accounts_update_notifier: Option<AccountsUpdateNotifier> =
            if account_data_notifications_enabled {
                let accounts_update_notifier =
                    AccountsUpdateNotifierImpl::new(plugin_manager.clone());
                Some(Arc::new(RwLock::new(accounts_update_notifier)))
            } else {
                None
            };

        let transaction_notifier: Option<TransactionNotifierLock> =
            if transaction_notifications_enabled {
                let transaction_notifier = TransactionNotifierImpl::new(plugin_manager.clone());
                Some(Arc::new(RwLock::new(transaction_notifier)))
            } else {
                None
            };

        let (slot_status_observer, block_metadata_notifier): (
            Option<SlotStatusObserver>,
            Option<BlockMetadataNotifierLock>,
        ) = if account_data_notifications_enabled || transaction_notifications_enabled {
            let slot_status_notifier = SlotStatusNotifierImpl::new(plugin_manager.clone());
            let slot_status_notifier = Arc::new(RwLock::new(slot_status_notifier));
            (
                Some(SlotStatusObserver::new(
                    confirmed_bank_receiver,
                    slot_status_notifier,
                )),
                Some(Arc::new(RwLock::new(BlockMetadataNotifierImpl::new(
                    plugin_manager.clone(),
                )))),
            )
        } else {
            (None, None)
        };

        info!("Started AccountsDbPluginService");
        Ok(AccountsDbPluginService {
            slot_status_observer,
            plugin_manager,
            accounts_update_notifier,
            transaction_notifier,
            block_metadata_notifier,
        })
    }
/// Creates and returns the AccountsDbPluginService.
/// # Arguments
/// * `confirmed_bank_receiver` - The receiver for confirmed bank notification
/// * `accountsdb_plugin_config_file` - The config file path for the plugin. The
///    config file controls the plugin responsible
///    for transporting the data to external data stores. It is defined in JSON format.
///    The `libpath` field should be pointed to the full path of the dynamic shared library
///    (.so file) to be loaded. The shared library must implement the `AccountsDbPlugin`
///    trait. And the shared library shall export a `C` function `_create_plugin` which
///    shall create the implementation of `AccountsDbPlugin` and returns to the caller.
///    The rest of the JSON fields' definition is up to to the concrete plugin implementation
///    It is usually used to configure the connection information for the external data store.
Creates and returns the AccountsDbPluginService.
Creates and returns the AccountsDbPluginService .
pub fn new(
        confirmed_bank_receiver: Receiver<BankNotification>,
        accountsdb_plugin_config_files: &[PathBuf],
    ) -> Result<Self, AccountsdbPluginServiceError> {
        info!(
            "Starting AccountsDbPluginService from config files: {:?}",
            accountsdb_plugin_config_files
        );
        let mut plugin_manager = AccountsDbPluginManager::new();
        for accountsdb_plugin_config_file in accountsdb_plugin_config_files {
            Self::load_plugin(&mut plugin_manager, accountsdb_plugin_config_file)?;
        }
        let account_data_notifications_enabled =
            plugin_manager.account_data_notifications_enabled();
        let transaction_notifications_enabled = plugin_manager.transaction_notifications_enabled();
        let plugin_manager = Arc::new(RwLock::new(plugin_manager));
        let accounts_update_notifier: Option<AccountsUpdateNotifier> =
            if account_data_notifications_enabled {
                let accounts_update_notifier =
                    AccountsUpdateNotifierImpl::new(plugin_manager.clone());
                Some(Arc::new(RwLock::new(accounts_update_notifier)))
            } else {
                None
            };
        let transaction_notifier: Option<TransactionNotifierLock> =
            if transaction_notifications_enabled {
                let transaction_notifier = TransactionNotifierImpl::new(plugin_manager.clone());
                Some(Arc::new(RwLock::new(transaction_notifier)))
            } else {
                None
            };
        let (slot_status_observer, block_metadata_notifier): (
            Option<SlotStatusObserver>,
            Option<BlockMetadataNotifierLock>,
        ) = if account_data_notifications_enabled || transaction_notifications_enabled {
            let slot_status_notifier = SlotStatusNotifierImpl::new(plugin_manager.clone());
            let slot_status_notifier = Arc::new(RwLock::new(slot_status_notifier));
            (
                Some(SlotStatusObserver::new(
                    confirmed_bank_receiver,
                    slot_status_notifier,
                )),
                Some(Arc::new(RwLock::new(BlockMetadataNotifierImpl::new(
                    plugin_manager.clone(),
                )))),
            )
        } else {
            (None, None)
        };
        info!("Started AccountsDbPluginService");
        Ok(AccountsDbPluginService {
            slot_status_observer,
            plugin_manager,
            accounts_update_notifier,
            transaction_notifier,
            block_metadata_notifier,
        })
    }
pub fn new ( confirmed_bank_receiver : Receiver < BankNotification > , accountsdb_plugin_config_files : & [ PathBuf ] , ) -> Result < Self , AccountsdbPluginServiceError > { info ! ( " " accountsdb_plugin_config_files ) ; let mut plugin_manager = AccountsDbPluginManager :: new ( ) ; for accountsdb_plugin_config_file in accountsdb_plugin_config_files { Self :: load_plugin ( & mut plugin_manager , accountsdb_plugin_config_file ) ? ; } let account_data_notifications_enabled = plugin_manager . account_data_notifications_enabled ( ) ; let transaction_notifications_enabled = plugin_manager . transaction_notifications_enabled ( ) ; let plugin_manager = Arc :: new ( RwLock :: new ( plugin_manager ) ) ; let accounts_update_notifier : Option < AccountsUpdateNotifier > = if account_data_notifications_enabled { let accounts_update_notifier = AccountsUpdateNotifierImpl :: new ( plugin_manager . clone ( ) ) ; Some ( Arc :: new ( RwLock :: new ( accounts_update_notifier ) ) ) } else { None } ; let transaction_notifier : Option < TransactionNotifierLock > = if transaction_notifications_enabled { let transaction_notifier = TransactionNotifierImpl :: new ( plugin_manager . clone ( ) ) ; Some ( Arc :: new ( RwLock :: new ( transaction_notifier ) ) ) } else { None } ; let ( slot_status_observer , block_metadata_notifier ) : ( Option < SlotStatusObserver > , Option < BlockMetadataNotifierLock > , ) = if account_data_notifications_enabled || transaction_notifications_enabled { let slot_status_notifier = SlotStatusNotifierImpl :: new ( plugin_manager . clone ( ) ) ; let slot_status_notifier = Arc :: new ( RwLock :: new ( slot_status_notifier ) ) ; ( Some ( SlotStatusObserver :: new ( confirmed_bank_receiver , slot_status_notifier , ) ) , Some ( Arc :: new ( RwLock :: new ( BlockMetadataNotifierImpl :: new ( plugin_manager . clone ( ) , ) ) ) ) , ) } else { ( None , None ) } ; info ! ( " " ) ; Ok ( AccountsDbPluginService { slot_status_observer , plugin_manager , accounts_update_notifier , transaction_notifier , block_metadata_notifier , } ) }
Creates and returns the AccountsDbPluginService.
Creates and returns the AccountsDbPluginService .
confirmed_bank_receiver
Receiver<BankNotification>
accountsdb_plugin_config_files
&[PathBuf]