use crate::{
append_table::{AppendSegmentReadOutput, AppendTableSchema},
cache::SegmentCacheSnapshot,
projection::StorageRecoveryReport,
read_view::PublishedReadView,
relational::RelationalKey,
residency::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 supports_ordered_node_range(&self, _label: hawdb_core::LabelId, _property: &str) -> bool {
false
}
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::column_group::shadow::ColumnarShadowCheckpointReport>;
fn columnar_shadow_recovery_status(
&self,
) -> crate::column_group::shadow::ColumnarShadowRecoveryStatus;
fn projected_graph_statuses(&self) -> Vec<crate::projection::ProjectedGraphStatus>;
fn storage_pressure_snapshot(
&self,
oldest_reader_commit_epoch: Option<u64>,
) -> crate::pressure::StoragePressureSnapshot;
fn append_storage_residency_report(&self) -> crate::append_table::AppendStorageResidencyReport;
fn columnar_shadow_admission_bytes(&self) -> u64;
fn relational_index_recovery_report(
&self,
) -> Option<&crate::relational::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::projection::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::projection::SchemaMaintenancePlanItem>;
fn run_schema_maintenance(
&mut self,
catalog: &mut Catalog,
) -> Result<Vec<crate::projection::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::projection::PropertyIndexProjectionRebuildAction>;
fn scrub_storage(&mut self) -> Result<crate::backup::StorageScrubReport>;
fn backup_to(
&mut self,
catalog: &Catalog,
destination: impl AsRef<std::path::Path>,
) -> Result<crate::backup::StorageBackupReport>;
fn register_projected_graph(
&mut self,
name: &str,
definition: crate::projection::ProjectedGraphDefinition,
) -> Result<()>;
}