FoldDB

Struct FoldDB 

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

The main database coordinator that manages schemas, permissions, and data storage.

Implementations§

Source§

impl FoldDB

Source

pub fn get_node_id(&self) -> Result<String, Error>

Retrieves or generates and persists the node identifier.

Source

pub fn get_schema_permissions(&self, node_id: &str) -> Vec<String>

Retrieves the list of permitted schemas for the given node.

Source

pub fn set_schema_permissions( &self, node_id: &str, schemas: &[String], ) -> Result<()>

Sets the permitted schemas for the given node.

Source

pub fn close(&self) -> Result<(), Error>

Properly close and flush the database to release all file locks

Source

pub fn new(path: &str) -> Result<Self>

Creates a new FoldDB instance with the specified storage path. All initializations happen here. This is the main entry point for the FoldDB system. Do not initialize anywhere else. updated by @tomtang2

Source

pub async fn new_with_s3(config: S3Config) -> Result<Self, StorageError>

Creates a new FoldDB instance with S3-backed storage. The database is downloaded from S3 on initialization and can be synced back with flush_to_s3().

Source

pub async fn flush_to_s3(&self) -> Result<(), StorageError>

Flushes local Sled database and syncs to S3 (if S3 storage is configured)

Source

pub fn has_s3_storage(&self) -> bool

Returns true if this FoldDB instance is configured with S3 storage

Source

pub fn get_indexing_status(&self) -> IndexingStatus

Get the current indexing status

Source

pub fn is_indexing(&self) -> bool

Check if indexing is currently in progress

Source

pub fn load_schema_from_json( &mut self, json_str: &str, ) -> Result<(), SchemaError>

Load schema from JSON string (creates Available schema)

Source

pub fn load_schema_from_file<P: AsRef<Path>>( &mut self, path: P, ) -> Result<(), SchemaError>

Load schema from file (creates Available schema)

Source

pub fn get_db_ops(&self) -> Arc<DbOperations>

Provides access to the underlying database operations

Source

pub fn get_event_statistics(&self) -> EventStatistics

Get current event statistics from the event monitor

Source

pub fn get_backfill_tracker(&self) -> Arc<BackfillTracker>

Get the backfill tracker

Source

pub fn get_all_backfills(&self) -> Vec<BackfillInfo>

Get all backfill information

Source

pub fn get_active_backfills(&self) -> Vec<BackfillInfo>

Get active (in-progress) backfills

Source

pub fn get_backfill(&self, transform_id: &str) -> Option<BackfillInfo>

Get specific backfill info

Source

pub fn message_bus(&self) -> Arc<MessageBus>

Get the message bus for publishing events (for testing)

Source

pub fn transform_manager(&self) -> Arc<TransformManager>

Get the transform manager for testing transform functionality

Source

pub fn schema_manager(&self) -> Arc<SchemaCore>

Get the schema manager for testing schema functionality

Search the native word index for a specific term

Source

pub fn native_search_all_classifications( &self, term: &str, ) -> Result<Vec<IndexResult>, SchemaError>

Search native index across all classification types and aggregate results This now includes field name matches via search_word

Source

pub fn transform_orchestrator(&self) -> Arc<TransformOrchestrator>

Get the transform orchestrator for managing transform execution

Auto Trait Implementations§

§

impl Freeze for FoldDB

§

impl !RefUnwindSafe for FoldDB

§

impl Send for FoldDB

§

impl Sync for FoldDB

§

impl Unpin for FoldDB

§

impl !UnwindSafe for FoldDB

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> 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<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<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
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, 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<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