ClusterNode

Struct ClusterNode 

Source
pub struct ClusterNode { /* private fields */ }
Expand description

Cluster node implementation

Implementations§

Source§

impl ClusterNode

Source

pub async fn new(config: NodeConfig) -> Result<Self>

Create a new cluster node

Source

pub async fn start(&mut self) -> Result<()>

Start the cluster node

Source

pub async fn stop(&mut self) -> Result<()>

Stop the cluster node

Source

pub async fn is_leader(&self) -> bool

Check if this node is the leader

Source

pub async fn current_term(&self) -> u64

Get current consensus term

Source

pub async fn insert_triple( &self, subject: &str, predicate: &str, object: &str, ) -> Result<RdfResponse>

Insert a triple through distributed consensus

Source

pub async fn delete_triple( &self, subject: &str, predicate: &str, object: &str, ) -> Result<RdfResponse>

Delete a triple through distributed consensus

Source

pub async fn clear_store(&self) -> Result<RdfResponse>

Clear all triples through distributed consensus

Source

pub async fn begin_transaction(&self) -> Result<String>

Begin a distributed transaction

Source

pub async fn commit_transaction(&self, tx_id: &str) -> Result<RdfResponse>

Commit a distributed transaction

Source

pub async fn rollback_transaction(&self, tx_id: &str) -> Result<RdfResponse>

Rollback a distributed transaction

Source

pub async fn query_triples( &self, subject: Option<&str>, predicate: Option<&str>, object: Option<&str>, ) -> Vec<(String, String, String)>

Query triples (can be done on any node)

Source

pub async fn query_sparql(&self, sparql: &str) -> Result<Vec<String>>

Execute SPARQL query using distributed query processing

Source

pub async fn query_sparql_bindings( &self, sparql: &str, ) -> Result<Vec<ResultBinding>>

Execute SPARQL query and return structured results

Source

pub async fn get_query_statistics(&self) -> Result<HashMap<String, QueryStats>>

Get query execution statistics

Source

pub async fn clear_query_cache(&self) -> Result<()>

Clear query cache

Source

pub async fn len(&self) -> usize

Get the number of triples in the store

Source

pub async fn is_empty(&self) -> bool

Check if the store is empty

Source

pub async fn add_cluster_node( &mut self, node_id: OxirsNodeId, address: SocketAddr, ) -> Result<()>

Add a new node to the cluster

Source

pub async fn remove_cluster_node(&mut self, node_id: OxirsNodeId) -> Result<()>

Remove a node from the cluster

Source

pub async fn get_status(&self) -> ClusterStatus

Get comprehensive cluster status

Source

pub async fn add_node_with_consensus( &mut self, node_id: OxirsNodeId, address: SocketAddr, ) -> Result<()>

Add a new node to the cluster using consensus protocol

Source

pub async fn remove_node_with_consensus( &mut self, node_id: OxirsNodeId, ) -> Result<()>

Remove a node from the cluster using consensus protocol

Source

pub async fn graceful_shutdown(&mut self) -> Result<()>

Gracefully shutdown this node

Source

pub async fn transfer_leadership( &mut self, target_node: OxirsNodeId, ) -> Result<()>

Transfer leadership to another node

Source

pub async fn force_evict_node(&mut self, node_id: OxirsNodeId) -> Result<()>

Force evict a non-responsive node

Source

pub async fn check_cluster_health(&self) -> Result<Vec<NodeHealthStatus>>

Check health of all peer nodes

Source

pub async fn attempt_recovery(&mut self) -> Result<()>

Attempt recovery from partition or failure

Source

pub fn id(&self) -> OxirsNodeId

Get the node ID

Source

pub async fn count_triples(&self) -> Result<usize>

Count triples in the store

Source

pub async fn is_active(&self) -> Result<bool>

Check if the node is active (running and not isolated)

Source

pub async fn isolate_network(&self) -> Result<()>

Isolate the node from network (simulate network partition)

Source

pub async fn restore_network(&self) -> Result<()>

Restore network connectivity

Source

pub async fn enable_byzantine_mode(&self) -> Result<()>

Enable Byzantine behavior (for testing)

Source

pub async fn is_byzantine(&self) -> Result<bool>

Check if node is in Byzantine mode

Source

pub fn region_manager(&self) -> Option<&Arc<RegionManager>>

Get multi-region manager (if configured)

Source

pub fn is_multi_region_enabled(&self) -> bool

Check if multi-region deployment is enabled

Source

pub fn get_region_id(&self) -> Option<String>

Get current node’s region ID

Source

pub fn get_availability_zone_id(&self) -> Option<String>

Get current node’s availability zone ID

Source

pub async fn get_regional_peers(&self) -> Result<Vec<OxirsNodeId>>

Get nodes in the same region

Source

pub async fn get_regional_leader_candidates(&self) -> Result<Vec<OxirsNodeId>>

Get optimal leader candidates considering region affinity

Source

pub async fn get_cross_region_replication_targets(&self) -> Result<Vec<String>>

Calculate cross-region replication targets

Source

pub async fn monitor_region_latencies(&self) -> Result<()>

Monitor inter-region latencies and update metrics

Source

pub async fn get_region_health(&self, region_id: &str) -> Result<RegionHealth>

Get region health status

Source

pub async fn perform_region_failover( &self, failed_region: &str, target_region: &str, ) -> Result<()>

Perform region failover operation

Source

pub async fn get_region_topology(&self) -> Result<RegionTopology>

Get multi-region topology information

Source

pub async fn add_node_to_region( &self, node_id: OxirsNodeId, region_id: String, availability_zone_id: String, data_center: Option<String>, rack: Option<String>, ) -> Result<()>

Add a node to a specific region and availability zone

Source

pub fn conflict_resolver(&self) -> &Arc<ConflictResolver>

Get conflict resolver instance

Source

pub async fn get_vector_clock(&self) -> VectorClock

Get current vector clock value

Source

pub async fn update_vector_clock(&self, received_clock: &VectorClock)

Update vector clock with received clock

Source

pub async fn create_timestamped_operation( &self, operation: RdfOperation, priority: u32, ) -> TimestampedOperation

Create a timestamped operation with current vector clock

Source

pub async fn detect_operation_conflicts( &self, operations: &[TimestampedOperation], ) -> Result<Vec<ConflictType>>

Detect conflicts in a batch of operations

Source

pub async fn resolve_operation_conflicts( &self, conflicts: &[ConflictType], ) -> Result<Vec<ResolutionResult>>

Resolve conflicts using configured strategies

Source

pub async fn submit_conflict_aware_operation( &self, operation: RdfOperation, priority: u32, ) -> Result<RdfResponse>

Submit an operation for conflict-aware processing

Source

pub async fn get_conflict_resolution_statistics(&self) -> ResolutionStatistics

Get conflict resolution statistics

Trait Implementations§

Source§

impl Debug for ClusterNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ErasedDestructor for T
where T: 'static,