use super::ImportValidationReport;
use crate::backend::native::types::{NativeBackendError, NativeResult};
use crate::backend::native::v2::export::ExportManifest;
use crate::backend::native::v2::wal::recovery::states::RecoveryState as ExplicitRecoveryState;
use std::path::PathBuf;
pub struct ImportValidator {
manifest: ExportManifest,
export_dir: PathBuf,
target_path: PathBuf,
}
impl ImportValidator {
pub fn new(manifest: ExportManifest, export_dir: PathBuf, target_path: PathBuf) -> Self {
Self {
manifest,
export_dir,
target_path,
}
}
pub fn validate_manifest(&self) -> NativeResult<()> {
Err(NativeBackendError::CorruptStringTable {
reason: "ImportValidator::validate_manifest not yet implemented".to_string(),
})
}
pub fn validate_files(&self) -> NativeResult<()> {
Err(NativeBackendError::CorruptStringTable {
reason: "ImportValidator::validate_files not yet implemented".to_string(),
})
}
pub fn validate_compatibility(&self) -> NativeResult<()> {
Err(NativeBackendError::CorruptStringTable {
reason: "ImportValidator::validate_compatibility not yet implemented".to_string(),
})
}
pub fn validate_target_compatibility(&self) -> NativeResult<()> {
Err(NativeBackendError::CorruptStringTable {
reason: "ImportValidator::validate_target_compatibility not yet implemented"
.to_string(),
})
}
pub fn validate(&self) -> NativeResult<ImportValidationReport> {
Err(NativeBackendError::CorruptStringTable {
reason: "ImportValidator::validate not yet implemented".to_string(),
})
}
}
pub struct PostImportValidator {
wal_path: PathBuf,
graph_path: PathBuf,
expected_lsn: u64,
expected_recovery_state: Option<ExplicitRecoveryState>,
}
impl PostImportValidator {
pub fn new(wal_path: PathBuf, graph_path: PathBuf, expected_lsn: u64) -> Self {
Self {
wal_path,
graph_path,
expected_lsn,
expected_recovery_state: None,
}
}
pub fn with_expected_recovery_state(mut self, state: ExplicitRecoveryState) -> Self {
self.expected_recovery_state = Some(state);
self
}
pub fn validate_recovery(&self) -> NativeResult<ExplicitRecoveryState> {
Err(NativeBackendError::CorruptStringTable {
reason: "PostImportValidator::validate_recovery not yet implemented".to_string(),
})
}
pub fn validate_consistency(&self) -> NativeResult<()> {
Err(NativeBackendError::CorruptStringTable {
reason: "PostImportValidator::validate_consistency not yet implemented".to_string(),
})
}
pub fn validate_lsn_boundaries(&self) -> NativeResult<()> {
Err(NativeBackendError::CorruptStringTable {
reason: "PostImportValidator::validate_lsn_boundaries not yet implemented".to_string(),
})
}
pub fn validate(&self) -> NativeResult<()> {
Err(NativeBackendError::CorruptStringTable {
reason: "PostImportValidator::validate not yet implemented".to_string(),
})
}
}
pub struct MergeCompatibilityChecker {
existing_path: PathBuf,
export_manifest: ExportManifest,
}
impl MergeCompatibilityChecker {
pub fn new(existing_path: PathBuf, export_manifest: ExportManifest) -> Self {
Self {
existing_path,
export_manifest,
}
}
pub fn is_compatible(&self) -> NativeResult<bool> {
Err(NativeBackendError::CorruptStringTable {
reason: "MergeCompatibilityChecker::is_compatible not yet implemented".to_string(),
})
}
pub fn incompatibility_reason(&self) -> NativeResult<String> {
Err(NativeBackendError::CorruptStringTable {
reason: "MergeCompatibilityChecker::incompatibility_reason not yet implemented"
.to_string(),
})
}
}