pub struct ControllerClientImpl { /* private fields */ }

Implementations§

source§

impl ControllerClientImpl

source

pub fn new(config: ClientConfig, handle: &Handle) -> Self

Create a pooled connection to the controller. The pool size is decided by the ClientConfig. The requests will be load balanced across multiple connections and every connection supports multiplexing of requests.

source

pub async fn reset(&self)

reset method needs to be invoked in the case of ConnectionError. This logic can be removed once https://github.com/tower-rs/tower/issues/383 is fixed.

Trait Implementations§

source§

impl ControllerClient for ControllerClientImpl

source§

fn create_scope<'life0, 'life1, 'async_trait>( &'life0 self, scope: &'life1 Scope ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to create a scope. The future completes with true in the case the scope did not existwhen the controller executed the operation. In the case of a re-attempt to create thesame scope, the future completes with false to indicate that the scope existed when thecontroller executed the operation. Read more
source§

fn check_scope_exists<'life0, 'life1, 'async_trait>( &'life0 self, scope: &'life1 Scope ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to check if the scope exists. The future completes with true in case the scope existsand a false if it does not exist. Read more
source§

fn list_scopes<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 CToken ) -> Pin<Box<dyn Future<Output = ResultRetry<Option<(Vec<Scope>, CToken)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to list scopes given a continuation token..Use the pravega_controller_client::paginator::list_scopes to paginate over all the scopes. Read more
source§

fn list_streams<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, scope: &'life1 Scope, token: &'life2 CToken ) -> Pin<Box<dyn Future<Output = ResultRetry<Option<(Vec<ScopedStream>, CToken)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

API to list streams under a given scope and continuation token.Use the pravega_controller_client::paginator::list_streams to paginate over all the streams. Read more
source§

fn list_streams_for_tag<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, scope: &'life1 Scope, tag: &'life2 str, token: &'life3 CToken ) -> Pin<Box<dyn Future<Output = ResultRetry<Option<(Vec<ScopedStream>, CToken)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

API to list streams associated with the given tag under a given scope and continuation token.Use the pravega_controller_client::paginator::list_streams_for_tag to paginate over all the streams. Read more
source§

fn delete_scope<'life0, 'life1, 'async_trait>( &'life0 self, scope: &'life1 Scope ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to delete a scope. Note that a scope can only be deleted in the case is it empty. Ifthe scope contains at least one stream, then the delete request will fail. Read more
source§

fn create_stream<'life0, 'life1, 'async_trait>( &'life0 self, stream_config: &'life1 StreamConfiguration ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to create a stream. The future completes with true in the case the stream did notexist when the controller executed the operation. In the case of a re-attempt to createthe same stream, the future completes with false to indicate that the stream existed whenthe controller executed the operation. Read more
source§

fn check_stream_exists<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to check if the stream exists. The future completes with true in case the stream existsand a false if it does not exist. Read more
source§

fn update_stream<'life0, 'life1, 'async_trait>( &'life0 self, stream_config: &'life1 StreamConfiguration ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to update the configuration of a Stream. Read more
source§

fn get_stream_configuration<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream ) -> Pin<Box<dyn Future<Output = ResultRetry<StreamConfiguration>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to fetch the Stream Configuration of a Stream. Read more
source§

fn get_stream_tags<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream ) -> Pin<Box<dyn Future<Output = ResultRetry<Option<Vec<String>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to fetch the Tags for a Stream. Read more
source§

fn truncate_stream<'life0, 'life1, 'async_trait>( &'life0 self, stream_cut: &'life1 StreamCut ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to Truncate stream. This api takes a stream cut point which corresponds to a cut inthe stream segments which is consistent and covers the entire key range space. Read more
source§

fn seal_stream<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to seal a Stream. Read more
source§

fn delete_stream<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to delete a stream. Only a sealed stream can be deleted. Read more
source§

fn get_current_segments<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream ) -> Pin<Box<dyn Future<Output = ResultRetry<StreamSegments>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to get list of current segments for the stream to write to. Read more
source§

fn get_epoch_segments<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream, epoch: i32 ) -> Pin<Box<dyn Future<Output = ResultRetry<StreamSegments>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to get list of segments for a given stream and epoch. Read more
source§

fn get_head_segments<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream ) -> Pin<Box<dyn Future<Output = ResultRetry<HashMap<Segment, i64>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to get segments pointing to the HEAD of the stream.. Read more
source§

fn create_transaction<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream, lease: Duration ) -> Pin<Box<dyn Future<Output = ResultRetry<TxnSegments>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to create a new transaction. The transaction timeout is relative to the creation time. Read more
source§

fn ping_transaction<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream, tx_id: TxId, lease: Duration ) -> Pin<Box<dyn Future<Output = ResultRetry<PingStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

API to send transaction heartbeat and increase the transaction timeout by lease amount of milliseconds. Read more
source§

fn commit_transaction<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream, tx_id: TxId, writer_id: WriterId, time: Timestamp ) -> Pin<Box<dyn Future<Output = ResultRetry<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Commits a transaction, atomically committing all events to the stream, subject to theordering guarantees specified in {@link EventStreamWriter}. Will fail if the transaction hasalready been committed or aborted. Read more
source§

fn abort_transaction<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream, tx_id: TxId ) -> Pin<Box<dyn Future<Output = ResultRetry<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Aborts a transaction. No events written to it may be read, and no further events may bewritten. Will fail with if the transaction has already been committed or aborted. Read more
source§

fn check_transaction_status<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream, tx_id: TxId ) -> Pin<Box<dyn Future<Output = ResultRetry<TransactionStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the status of the specified transaction. Read more
source§

fn get_endpoint_for_segment<'life0, 'life1, 'async_trait>( &'life0 self, segment: &'life1 ScopedSegment ) -> Pin<Box<dyn Future<Output = ResultRetry<PravegaNodeUri>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Given a segment return the endpoint that currently is the owner of that segment.This is called when a reader or a writer needs to determine which host/server it needs to contact toread and write, respectively. The result of this function can be cached until the endpoint isunreachable or indicates it is no longer the owner. Read more
source§

fn get_or_refresh_delegation_token_for<'life0, 'async_trait>( &'life0 self, stream: ScopedStream ) -> Pin<Box<dyn Future<Output = ResultRetry<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Refreshes an expired/non-existent delegation token.@param scope Scope of the stream.@param streamName Name of the stream.@return The delegation token for the given stream. Read more
source§

fn get_successors<'life0, 'life1, 'async_trait>( &'life0 self, segment: &'life1 ScopedSegment ) -> Pin<Box<dyn Future<Output = ResultRetry<StreamSegmentsWithPredecessors>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the successors for a given Segment.
source§

fn scale_stream<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream, sealed_segment_ids: &'life2 [Segment], new_ranges: &'life3 [(f64, f64)] ) -> Pin<Box<dyn Future<Output = ResultRetry<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Scale a Stream to the new key ranges. This API returns a result once the scale operation has completed. This internally uses the check_scale API to verify the Stream Scaling status.
source§

fn check_scale<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream, scale_epoch: i32 ) -> Pin<Box<dyn Future<Output = ResultRetry<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check the status of a Stream Scale operation for a given scale epoch. It returns a true if the stream scaling operation has completed and false if the stream scaling is in progress.

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> 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

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