Struct ControllerHandle

Source
pub struct ControllerHandle<A>
where A: 'static + Authority,
{ /* private fields */ }
Expand description

A handle to a Noria controller.

This handle is the primary mechanism for interacting with a running Noria instance, and lets you add and remove queries, retrieve handles for inserting or querying the underlying data, and to perform meta-operations such as fetching the dataflow’s GraphViz visualization.

To establish a new connection to Noria, use ControllerHandle::new, and pass in the appropriate Authority. In the likely case that you are using Zookeeper, use ControllerHandle::from_zk.

Note that whatever Tokio Runtime you use to execute the Future that resolves into the ControllerHandle will also be the one that executes all your reads and writes through View and Table. Make sure that that Runtime stays alive, and continues to be driven, otherwise none of your operations will ever complete! Furthermore, you must use the Runtime to execute any futures returned from ControllerHandle (that is, you cannot just call .wait() on them).

Implementations§

Source§

impl ControllerHandle<ZookeeperAuthority>

Source

pub async fn from_zk(zookeeper_address: &str) -> Result<Self, Error>

Fetch information about the current Soup controller from Zookeeper running at the given address, and create a ControllerHandle from that.

Source§

impl<A: Authority + 'static> ControllerHandle<A>

Source

pub fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Error>>

Check that the ControllerHandle can accept another request.

Note that this method must return Poll::Ready before any other methods that return a Future on ControllerHandle can be called.

Source

pub async fn ready(&mut self) -> Result<(), Error>

A future that resolves when the controller can accept more messages.

When this future resolves, you it is safe to call any methods that require poll_ready to have returned Poll::Ready.

Source

pub async fn new(authority: A) -> Result<Self, Error>
where A: Send + 'static,

Create a ControllerHandle that bootstraps a connection to Noria via the configuration stored in the given authority.

You probably want to use ControllerHandle::from_zk instead.

Source

pub fn inputs( &mut self, ) -> impl Future<Output = Result<BTreeMap<String, NodeIndex>, Error>>

Enumerate all known base tables.

These have all been created in response to a CREATE TABLE statement in a recipe.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn outputs( &mut self, ) -> impl Future<Output = Result<BTreeMap<String, NodeIndex>, Error>>

Enumerate all known external views.

These have all been created in response to a CREATE EXT VIEW statement in a recipe.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn view(&mut self, name: &str) -> impl Future<Output = Result<View, Error>>

Obtain a View that allows you to query the given external view.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn table( &mut self, name: &str, ) -> impl Future<Output = Result<Table, Error>>

Obtain a Table that allows you to perform writes, deletes, and other operations on the given base table.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn statistics(&mut self) -> impl Future<Output = Result<GraphStats, Error>>

Get statistics about the time spent processing different parts of the graph.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn flush_partial(&mut self) -> impl Future<Output = Result<(), Error>>

Flush all partial state, evicting all rows present.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn extend_recipe( &mut self, recipe_addition: &str, ) -> impl Future<Output = Result<ActivationResult, Error>>

Extend the existing recipe with the given set of queries.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn install_recipe( &mut self, new_recipe: &str, ) -> impl Future<Output = Result<ActivationResult, Error>>

Replace the existing recipe with this one.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn graphviz(&mut self) -> impl Future<Output = Result<String, Error>>

Fetch a graphviz description of the dataflow graph.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn simple_graphviz(&mut self) -> impl Future<Output = Result<String, Error>>

Fetch a simplified graphviz description of the dataflow graph.

Self::poll_ready must have returned Async::Ready before you call this method.

Source

pub fn remove_node( &mut self, view: NodeIndex, ) -> impl Future<Output = Result<(), Error>>

Remove the given external view from the graph.

Self::poll_ready must have returned Async::Ready before you call this method.

Trait Implementations§

Source§

impl<A> Clone for ControllerHandle<A>
where A: 'static + Authority,

Source§

fn clone(&self) -> Self

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

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

Performs copy-assignment from source. 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> 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> 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> Same for T

Source§

type Output = T

Should always be Self
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
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