Skip to main content

ControllerClient

Trait ControllerClient 

Source
pub trait ControllerClient: Send + Sync {
Show 27 methods // Required methods 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; fn scale_stream<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, stream: &'life1 ScopedStream, sealed_segments: &'life2 [Segment], new_key_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; 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;
}
Expand description

Controller APIs for administrative action for streams

Required Methods§

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 exist
  • when the controller executed the operation. In the case of a re-attempt to create the
  • same scope, the future completes with false to indicate that the scope existed when the
  • controller executed the operation.
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 exists
  • and a false if it does not exist.
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.
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.
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.
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. If
  • the scope contains at least one stream, then the delete request will fail.
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 not
  • exist when the controller executed the operation. In the case of a re-attempt to create
  • the same stream, the future completes with false to indicate that the stream existed when
  • the controller executed the operation.
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 exists
  • and a false if it does not exist.
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.
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.
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.
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 in
  • the stream segments which is consistent and covers the entire key range space.
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.
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.
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.
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.
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..
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.
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.
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 the
  • ordering guarantees specified in {@link EventStreamWriter}. Will fail if the transaction has
  • already been committed or aborted.
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 be
  • written. Will fail with if the transaction has already been committed or aborted.
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.
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 to
  • read and write, respectively. The result of this function can be cached until the endpoint is
  • unreachable or indicates it is no longer the owner.
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.
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_segments: &'life2 [Segment], new_key_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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§