use crate::{
AppendSegmentReadOutput, AppendTableSchema, PublishedReadView, RelationalKey,
SegmentCacheSnapshot, StorageRecoveryReport, StorageResidencyReport,
};
use hawdb_core::{BasicGraphStatistics, Catalog, GraphStatistics, Result};
pub trait GraphReadEngine {
fn storage_version(&self) -> &'static str;
fn commit_epoch(&self) -> u64;
fn storage_handle_poisoned(&self) -> bool;
fn published_read_view(&self) -> PublishedReadView;
fn basic_statistics(&self) -> BasicGraphStatistics;
fn statistics(&self, catalog: &Catalog) -> GraphStatistics;
fn storage_recovery_report(&self) -> StorageRecoveryReport;
fn segment_cache_snapshot(&self) -> Option<SegmentCacheSnapshot>;
fn storage_residency_report(&self) -> StorageResidencyReport;
fn adjacency_consistency_report(&self) -> crate::consistency::AdjacencyConsistencyReport;
fn adjacency_consolidation_plan(&self) -> crate::consistency::AdjacencyConsolidationPlan;
fn degree_statistics_consistency_report(
&self,
) -> crate::consistency::DegreeStatisticsConsistencyReport;
fn property_index_consistency_report(
&self,
catalog: &Catalog,
) -> crate::consistency::PropertyIndexConsistencyReport;
fn columnar_shadow_checkpoint_report(&self) -> Option<crate::ColumnarShadowCheckpointReport>;
fn columnar_shadow_recovery_status(&self) -> crate::ColumnarShadowRecoveryStatus;
fn projected_graph_statuses(&self) -> Vec<crate::ProjectedGraphStatus>;
fn storage_pressure_snapshot(
&self,
oldest_reader_commit_epoch: Option<u64>,
) -> crate::StoragePressureSnapshot;
fn append_storage_residency_report(&self) -> crate::AppendStorageResidencyReport;
fn columnar_shadow_admission_bytes(&self) -> u64;
fn relational_index_recovery_report(&self) -> Option<&crate::RelationalIndexRecoveryReport>;
fn relational_index_shadow_checkpoint_report(
&self,
) -> Option<&crate::relational::RelationalIndexShadowCheckpointReport>;
fn relational_index_shadow_recovery_status(
&self,
) -> &crate::relational::RelationalIndexShadowRecoveryStatus;
fn search_projection_changefeed_status(&self) -> crate::SearchProjectionChangefeedStatus;
fn append_table_schema(&self, table: &str) -> Option<&AppendTableSchema>;
fn initial_import_source_fingerprint(&self) -> Option<&str>;
fn read_append_partition_bounded(
&self,
table: &str,
partition: &RelationalKey,
after: Option<&RelationalKey>,
max_rows: usize,
max_payload_bytes: usize,
) -> Result<AppendSegmentReadOutput>;
fn node_records_owned(&self) -> crate::graph_overlay::GraphNodeIterator;
fn relationship_records_owned(&self) -> crate::graph_overlay::GraphRelationshipIterator;
}
pub trait GraphMutationEngine {
fn plan_schema_maintenance(&self, catalog: &Catalog) -> Vec<crate::SchemaMaintenancePlanItem>;
fn run_schema_maintenance(
&mut self,
catalog: &mut Catalog,
) -> Result<Vec<crate::SchemaMaintenanceAction>>;
fn rebuild_projected_graph_artifacts(&mut self, catalog: &Catalog) -> Result<()>;
fn rebuild_bounded_property_index_projections(
&mut self,
catalog: &Catalog,
max_estimated_operations: usize,
) -> Vec<crate::PropertyIndexProjectionRebuildAction>;
fn scrub_storage(&mut self) -> Result<crate::StorageScrubReport>;
fn backup_to(
&mut self,
catalog: &Catalog,
destination: impl AsRef<std::path::Path>,
) -> Result<crate::StorageBackupReport>;
fn register_projected_graph(
&mut self,
name: &str,
definition: crate::ProjectedGraphDefinition,
) -> Result<()>;
}