pub struct LearningClassifier { /* private fields */ }Expand description
Learning-based table classifier
Implementations§
Source§impl LearningClassifier
impl LearningClassifier
Sourcepub fn new(schema: Arc<SchemaRegistry>) -> Self
pub fn new(schema: Arc<SchemaRegistry>) -> Self
Create a new learning classifier
Sourcepub fn with_config(
schema: Arc<SchemaRegistry>,
config: ClassifierConfig,
) -> Self
pub fn with_config( schema: Arc<SchemaRegistry>, config: ClassifierConfig, ) -> Self
Create with custom configuration
Sourcepub fn record(&self, table: &str, query_type: QueryType, latency: Duration)
pub fn record(&self, table: &str, query_type: QueryType, latency: Duration)
Record a query execution
Sourcepub fn reclassify(&self, table: &str)
pub fn reclassify(&self, table: &str)
Manually trigger reclassification
Sourcepub fn get_classification(&self, table: &str) -> Option<TableClassification>
pub fn get_classification(&self, table: &str) -> Option<TableClassification>
Get current classification for a table
Sourcepub fn all_classifications(&self) -> Vec<TableClassification>
pub fn all_classifications(&self) -> Vec<TableClassification>
Get all classifications
Sourcepub fn update_thresholds(&self, thresholds: ModelThresholds)
pub fn update_thresholds(&self, thresholds: ModelThresholds)
Update model thresholds
Sourcepub fn get_history(&self, table: &str) -> Option<QueryHistory>
pub fn get_history(&self, table: &str) -> Option<QueryHistory>
Get query history for a table
Sourcepub fn clear_history(&self, table: &str)
pub fn clear_history(&self, table: &str)
Clear history for a table
Sourcepub fn query_count(&self) -> u64
pub fn query_count(&self) -> u64
Get query count for a table
Sourcepub fn suggest_temperature(&self, table: &str) -> Option<DataTemperature>
pub fn suggest_temperature(&self, table: &str) -> Option<DataTemperature>
Suggest temperature classification for a table
Sourcepub fn suggest_workload(&self, table: &str) -> Option<WorkloadType>
pub fn suggest_workload(&self, table: &str) -> Option<WorkloadType>
Suggest workload classification for a table
Sourcepub fn get_confidence(&self, table: &str) -> Option<f64>
pub fn get_confidence(&self, table: &str) -> Option<f64>
Get confidence for a table classification
Sourcepub fn classify_query(&self, sql: &str) -> Option<WorkloadType>
pub fn classify_query(&self, sql: &str) -> Option<WorkloadType>
Classify a query’s workload type
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LearningClassifier
impl !RefUnwindSafe for LearningClassifier
impl Send for LearningClassifier
impl Sync for LearningClassifier
impl Unpin for LearningClassifier
impl UnsafeUnpin for LearningClassifier
impl !UnwindSafe for LearningClassifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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