Client

Struct Client 

Source
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

Source

pub async fn connect<D>(dst: D) -> Result<Self>
where D: TryInto<Endpoint>, D::Error: Into<StdError>,

Connect to an oomagent instance running on the given endpoint.

Source

pub async fn with_embedded_oomagent<P1, P2>( bin_path: Option<P1>, cfg_path: Option<P2>, ) -> Result<Self>
where P1: AsRef<Path>, P2: AsRef<Path>,

Connect to an oomagent instance embedded with the client.

Source

pub async fn with_default_embedded_oomagent() -> Result<Self>

Connect to an embedded oomagent instance with default config.

Source

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

Check if oomagent is ready to serve requests.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn export( &mut self, features: Vec<String>, unix_milli: u64, output_file: impl AsRef<Path>, limit: impl Into<Option<usize>>, ) -> Result<()>

Export certain features to a file.

Source

pub async fn snapshot(&mut self, group: impl Into<String>) -> Result<()>

Take snapshot for a stream feature group in offline store.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

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

Formats the value using the given formatter. Read more

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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