pub struct DynamoShareReader { /* private fields */ }
Expand description

ASSUMPTION: the writer only uses transactions to guarantee the consistency of the shared securables (i.e. share -> schema -> table).

| SHARE#ALL | share1 | … | SHARE#ALL | share2 | … | SHARE#share1 | schema1 | … | SHARE#share1 | schema2 | … | SHARE#share2 | schema1#table1 | … TableManager using AWS DynamoDB to store shared objects.

Table layout

| PK | SK | share_id | storage_path | table_id SHARE#{share_name}#SCHEMA#ALL#TABLE#ALL | SHARE | share1_id SHARE#{share_name}#SCHEMA#{schema_name}#TABLE#ALL | SCHEMA | SHARE#{share_name}#SCHEMA#{schema_name}#TABLE#{table_name} | TABLE | share1_id | s3://my-data-bucket/my-table-root/ | table1_id

Key

  1. KEY: PK+SK
  2. GSI: SK+PK

Implemented query patterns

  1. QUERY on GSI with SK = SHARE
  2. GET on KEY with PK = SHARE#{share_name}#SCHEMA#ALL#TABLE#ALL
  3. QUERY on GSI with SK = SCHEMA AND PK begins_with(SHARE#{share_name})
  4. QUERY on GSI with type = TABLE and SK begins_with(SHARE#{share_name}#SCHEMA#{schema_name})
  5. QUERY on GSI with type = TABLE and SK begins_with(SHARE#{share_name})
  6. GET on KEY with PK = SHARE#{share_name}#SCHEMA#{schema_name}#TABLE#{table_name} AND SK = TABLE

Query patterns

  1. Get a table by share_name, schema_name and table_name
  2. Get a share by share_name
  3. List all shares
  4. List all schemas in a share
  5. List all tables in a share
  6. List all tables in a schema

Implementations§

source§

impl DynamoShareReader

source

pub fn new(client: Client, table_name: String, index_name: String) -> Self

Create a new TableManager using the AWS DynamoDB client along with table_name and GSI index name.

source

pub fn create_table(&self) -> Result<(), DynamoError>

Create a new DynamoDB table to store shares, schemas and tables.

source

pub fn client(&self) -> &Client

Retrieve underlying DynamoDB SDK client.

source

pub async fn put_share(&self, share: Share) -> Result<Share, DynamoError>

Add a new share to the share store.

source

pub async fn get_share(&self, share_name: &str) -> Result<Share, DynamoError>

Retrieve a share from the share store.

source

pub async fn query_shares( &self, cursor: &ListCursor ) -> Result<List<Share>, DynamoError>

Retrieve a list of shares from the share store.

source

pub async fn put_schema(&self, schema: Schema) -> Result<Schema, DynamoError>

Add a new schema to the share store.

source

pub async fn get_schema( &self, share_name: &str, schema_name: &str ) -> Result<Schema, DynamoError>

Retrieve a schema from the share store.

source

pub async fn query_schemas( &self, share_name: &str, cursor: &ListCursor ) -> Result<List<Schema>, DynamoError>

Retrieve a list of schemas from the share store.

source

pub async fn put_table(&self, table: Table) -> Result<Table, DynamoError>

Add a new table to the share store.

source

pub async fn get_table( &self, share_name: &str, schema_name: &str, table_name: &str ) -> Result<Table, DynamoError>

Retrieve a table from the share store.

source

pub async fn query_tables_in_share( &self, share_name: &str, cursor: &ListCursor ) -> Result<List<Table>, DynamoError>

Retrieve a list of tables from the share store.

source

pub async fn query_tables_in_schema( &self, share_name: &str, schema_name: &str, cursor: &ListCursor ) -> Result<List<Table>, DynamoError>

Retrieve a list of tables from the share store.

Trait Implementations§

source§

impl Debug for DynamoShareReader

source§

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

Formats the value using the given formatter. Read more
source§

impl ShareReader for DynamoShareReader

source§

fn list_shares<'life0, 'life1, 'async_trait>( &'life0 self, pagination: &'life1 ListCursor ) -> Pin<Box<dyn Future<Output = Result<List<Share>, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a list of shares stored on the sharing server store. The list cursor is used to limit the amount of returned shares and to resume listing from a specified point in the collection.
source§

fn get_share<'life0, 'life1, 'async_trait>( &'life0 self, share_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Share, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get share details by name
source§

fn list_schemas<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, share_name: &'life1 str, pagination: &'life2 ListCursor ) -> Pin<Box<dyn Future<Output = Result<List<Schema>, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch a list of schemas stored on the sharing server store under a spcific share. The list cursor is used to limit the amount of returned schemas and to resume listing from a specified point in the collection.
source§

fn list_tables_in_share<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, share_name: &'life1 str, pagination: &'life2 ListCursor ) -> Pin<Box<dyn Future<Output = Result<List<Table>, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch a list of tables stored on the sharing server store under a spcific share combination. The list cursor is used to limit the amount of returned tables and to resume listing from a specified point in the collection.
source§

fn list_tables_in_schema<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, share_name: &'life1 str, schema_name: &'life2 str, pagination: &'life3 ListCursor ) -> Pin<Box<dyn Future<Output = Result<List<Table>, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Fetch a list of tables stored on the sharing server store under a spcific share + schema combination. The list cursor is used to limit the amount of returned tables and to resume listing from a specified point in the collection.
source§

fn get_table<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, share_name: &'life1 str, schema_name: &'life2 str, table_name: &'life3 str ) -> Pin<Box<dyn Future<Output = Result<Table, ShareIoError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Get table specifics for a combination of share + schema + name.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.
source§

impl<V, T> VZip<V> for Twhere 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