pub struct Client { /* private fields */ }Expand description
A rust client for oomstore, using the grpc protocol to communicate with oomagent server under the hood.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn connect<D>(dst: D) -> Result<Self>
pub async fn connect<D>(dst: D) -> Result<Self>
Connect to an oomagent instance running on the given endpoint.
Sourcepub async fn with_embedded_oomagent<P1, P2>(
bin_path: Option<P1>,
cfg_path: Option<P2>,
) -> Result<Self>
pub async fn with_embedded_oomagent<P1, P2>( bin_path: Option<P1>, cfg_path: Option<P2>, ) -> Result<Self>
Connect to an oomagent instance embedded with the client.
Sourcepub async fn with_default_embedded_oomagent() -> Result<Self>
pub async fn with_default_embedded_oomagent() -> Result<Self>
Connect to an embedded oomagent instance with default config.
Sourcepub async fn health_check(&mut self) -> Result<()>
pub async fn health_check(&mut self) -> Result<()>
Check if oomagent is ready to serve requests.
Sourcepub async fn online_get_raw(
&mut self,
entity_key: impl Into<String>,
features: Vec<String>,
) -> Result<FeatureValueMap>
pub async fn online_get_raw( &mut self, entity_key: impl Into<String>, features: Vec<String>, ) -> Result<FeatureValueMap>
Get online features for an entity without further conversion.
Sourcepub async fn online_get(
&mut self,
key: impl Into<String>,
features: Vec<String>,
) -> Result<HashMap<String, Option<Value>>>
pub async fn online_get( &mut self, key: impl Into<String>, features: Vec<String>, ) -> Result<HashMap<String, Option<Value>>>
Get online features for an entity.
Sourcepub async fn online_multi_get_raw(
&mut self,
entity_keys: Vec<String>,
features: Vec<String>,
) -> Result<HashMap<String, FeatureValueMap>>
pub async fn online_multi_get_raw( &mut self, entity_keys: Vec<String>, features: Vec<String>, ) -> Result<HashMap<String, FeatureValueMap>>
Get online features for multiple entities without further conversion.
Sourcepub async fn online_multi_get(
&mut self,
keys: Vec<String>,
features: Vec<String>,
) -> Result<HashMap<String, HashMap<String, Option<Value>>>>
pub async fn online_multi_get( &mut self, keys: Vec<String>, features: Vec<String>, ) -> Result<HashMap<String, HashMap<String, Option<Value>>>>
Get online features for multiple entities.
Sourcepub async fn sync(
&mut self,
group: impl Into<String>,
revision_id: impl Into<Option<u32>>,
purge_delay: u32,
) -> Result<()>
pub async fn sync( &mut self, group: impl Into<String>, revision_id: impl Into<Option<u32>>, purge_delay: u32, ) -> Result<()>
Sync a certain revision of batch features from offline to online store.
Sourcepub async fn channel_import(
&mut self,
group: impl Into<String>,
revision: impl Into<Option<i64>>,
description: impl Into<Option<String>>,
rows: impl Stream<Item = Vec<u8>> + Send + 'static,
) -> Result<u32>
pub async fn channel_import( &mut self, group: impl Into<String>, revision: impl Into<Option<i64>>, description: impl Into<Option<String>>, rows: impl Stream<Item = Vec<u8>> + Send + 'static, ) -> Result<u32>
Import features from external (batch and stream) data sources to offline store through channels.
Sourcepub async fn import(
&mut self,
group: impl Into<String>,
revision: impl Into<Option<i64>>,
description: impl Into<Option<String>>,
input_file: impl AsRef<Path>,
delimiter: impl Into<Option<char>>,
) -> Result<u32>
pub async fn import( &mut self, group: impl Into<String>, revision: impl Into<Option<i64>>, description: impl Into<Option<String>>, input_file: impl AsRef<Path>, delimiter: impl Into<Option<char>>, ) -> Result<u32>
Import features from external (batch and stream) data sources to offline store through files.
Sourcepub async fn push(
&mut self,
entity_key: impl Into<String>,
group: impl Into<String>,
kv_pairs: HashMap<String, Value>,
) -> Result<()>
pub async fn push( &mut self, entity_key: impl Into<String>, group: impl Into<String>, kv_pairs: HashMap<String, Value>, ) -> Result<()>
Push stream features from stream data source to both offline and online stores.
Sourcepub async fn channel_join(
&mut self,
join_features: Vec<String>,
existed_features: Vec<String>,
entity_rows: impl Stream<Item = EntityRow> + Send + 'static,
) -> Result<(Vec<String>, impl Stream<Item = Result<Vec<Option<Value>>>>)>
pub async fn channel_join( &mut self, join_features: Vec<String>, existed_features: Vec<String>, entity_rows: impl Stream<Item = EntityRow> + Send + 'static, ) -> Result<(Vec<String>, impl Stream<Item = Result<Vec<Option<Value>>>>)>
Point-in-Time Join features against labeled entity rows through channels.
Sourcepub async fn join(
&mut self,
features: Vec<String>,
input_file: impl AsRef<Path>,
output_file: impl AsRef<Path>,
) -> Result<()>
pub async fn join( &mut self, features: Vec<String>, input_file: impl AsRef<Path>, output_file: impl AsRef<Path>, ) -> Result<()>
Point-in-Time Join features against labeled entity rows through files.
Sourcepub async fn channel_export(
&mut self,
features: Vec<String>,
unix_milli: u64,
limit: impl Into<Option<usize>>,
) -> Result<(Vec<String>, impl Stream<Item = Result<Vec<Option<Value>>>>)>
pub async fn channel_export( &mut self, features: Vec<String>, unix_milli: u64, limit: impl Into<Option<usize>>, ) -> Result<(Vec<String>, impl Stream<Item = Result<Vec<Option<Value>>>>)>
Export certain features to a channel.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request