Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage Migrator: Benchmarking #641

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/main/src/bootstrap/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use super::{
start_app_manager_step::StartAppManagerStep,
start_communication_broker::{StartCommunicationBroker, StartOtherBrokers},
start_fbgateway_step::FireboltGatewayStep,
start_storage_migrator_step::StartStorageMigratorStep,
start_ws_step::StartWsStep,
};
/// Starts up Ripple uses `PlatformState` to manage State
Expand Down Expand Up @@ -72,6 +73,7 @@ pub async fn boot(state: BootstrapState) -> RippleResponse {
execute_step(LoadDistributorValuesStep, &bootstrap).await?;
execute_step(CheckLauncherStep, &bootstrap).await?;
execute_step(StartWsStep, &bootstrap).await?;
execute_step(StartStorageMigratorStep, &bootstrap).await?;
execute_step(FireboltGatewayStep, &bootstrap).await?;
Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions core/main/src/bootstrap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ pub mod setup_extn_client_step;
pub mod start_app_manager_step;
pub mod start_communication_broker;
pub mod start_fbgateway_step;
pub mod start_storage_migrator_step;
pub mod start_ws_step;
39 changes: 39 additions & 0 deletions core/main/src/bootstrap/start_storage_migrator_step.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2023 Comcast Cable Communications Management, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0
//

use ripple_sdk::async_trait::async_trait;
use ripple_sdk::{framework::bootstrap::Bootstep, tokio, utils::error::RippleError};

use crate::processor::storage::storage_migrator::StorageMigrator;
use crate::state::bootstrap_state::BootstrapState;

pub struct StartStorageMigratorStep;

#[async_trait]
impl Bootstep<BootstrapState> for StartStorageMigratorStep {
fn get_name(&self) -> String {
"StartStorageMigrator".into()
}

async fn setup(&self, bootstrap_state: BootstrapState) -> Result<(), RippleError> {
tokio::spawn(async move {
let mut migrator = StorageMigrator::new(&bootstrap_state.platform_state);
migrator.migration_test().await;
});
Ok(())
}
}
1 change: 1 addition & 0 deletions core/main/src/processor/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ pub mod default_storage_properties;
pub mod storage_manager;
pub mod storage_manager_processor;
pub mod storage_manager_utils;
pub mod storage_migrator;
Loading
Loading