CompositeTable

meteor.api.hi.CompositeTable
case class CompositeTable[F[_], P, S](tableName: String, partitionKeyDef: KeyDef[P], sortKeyDef: KeyDef[S], jClient: DynamoDbAsyncClient)(implicit evidence$1: Async[F], evidence$2: Encoder[P], evidence$3: Encoder[S])

Represent a table where the index is composite keys (partition key and sort key).

Type parameters

P

partition key's type

S

sort key's type

Value parameters

jClient

DynamoDB java async client

partitionKeyDef

partition key definition

sortKeyDef

sort key definition

tableName

table's name

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def batchDelete(maxBatchWait: FiniteDuration, parallelism: Int, backoffStrategy: BackoffStrategy): (F, (P, S)) => Unit

Delete items by composite keys in batch. Max batch size is preset to 100 (maximum batch size permitted for batch get action), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Delete items by composite keys in batch. Max batch size is preset to 100 (maximum batch size permitted for batch get action), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Value parameters

backoffStrategy

backoff strategy in case of failure, default can be found at meteor.Client.BackoffStrategy.default.

maxBatchWait

time window to collect items into a batch

parallelism

number of connections that can be open at the same time

Attributes

Returns

a fs2 Pipe from composite keys P and S as a tuple to Unit

def batchGet[T : Decoder](consistentRead: Boolean, projection: Expression, maxBatchWait: FiniteDuration, parallelism: Int, backoffStrategy: BackoffStrategy): (F, (P, S)) => T

Get items by composite keys in batch. Max batch size is preset to 100 (maximum batch size permitted for batch get action), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Get items by composite keys in batch. Max batch size is preset to 100 (maximum batch size permitted for batch get action), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Type parameters

T

returned item's type

Value parameters

backoffStrategy

backoff strategy in case of failure, default can be found at meteor.Client.BackoffStrategy.default.

consistentRead

flag to enable strongly consistent read

maxBatchWait

time window to collect items into a batch

parallelism

number of connections that can be open at the same time

projection

projection expression

Attributes

Returns

a fs2 Pipe from composite keys P and S as a tuple to T

def batchPut[T : Encoder](maxBatchWait: FiniteDuration, backoffStrategy: BackoffStrategy): (F, T) => Unit

Put items in batch, '''in ordered'''. Meaning batches are processed in '''serial''' to avoid race condition when writing items with the same composite keys. If your input doesn't have this constrain, you can use batchPutUnordered. Max batch size is preset to 25 (maximum batch size permitted from batch put actions), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Put items in batch, '''in ordered'''. Meaning batches are processed in '''serial''' to avoid race condition when writing items with the same composite keys. If your input doesn't have this constrain, you can use batchPutUnordered. Max batch size is preset to 25 (maximum batch size permitted from batch put actions), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Type parameters

T

returned item's type

Value parameters

backoffStrategy

backoff strategy in case of failure, default can be found at meteor.Client.BackoffStrategy.default.

maxBatchWait

time window to collect items into a batch

Attributes

Returns

a fs2 Pipe from T to Unit

def batchPutUnordered[T : Encoder](maxBatchWait: FiniteDuration, parallelism: Int, backoffStrategy: BackoffStrategy): (F, T) => Unit

Put items in batch, '''un-ordered'''. Meaning batches are processed in '''parallel''', hence, if your input has items with the same composite keys, this can cause a race condition, consider using batchPut instead. Max batch size is preset to 25 (maximum batch size permitted from batch put actions), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Put items in batch, '''un-ordered'''. Meaning batches are processed in '''parallel''', hence, if your input has items with the same composite keys, this can cause a race condition, consider using batchPut instead. Max batch size is preset to 25 (maximum batch size permitted from batch put actions), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Type parameters

T

returned item's type

Value parameters

backoffStrategy

backoff strategy in case of failure, default can be found at meteor.Client.BackoffStrategy.default.

maxBatchWait

time window to collect items into a batch

parallelism

number of connections that can be open at the same time

Attributes

Returns

a fs2 Pipe from T to Unit

def batchWrite[T : Encoder](maxBatchWait: FiniteDuration, backoffStrategy: BackoffStrategy): (F, Either[(P, S), T]) => Unit

Write items (put or delete) in batch, '''in ordered'''. Meaning batches are processed in '''serial''' to avoid race condition when writing items with the same composite keys. Max batch size is preset to 25 (maximum batch size permitted from batch write actions), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Write items (put or delete) in batch, '''in ordered'''. Meaning batches are processed in '''serial''' to avoid race condition when writing items with the same composite keys. Max batch size is preset to 25 (maximum batch size permitted from batch write actions), however, it is possible to control the rate of batching with maxBatchWait parameter. This uses fs2 .groupWithin internally. This returns a Pipe in order to cover broader use cases regardless of input can be fitted into memory or not. Duplicated items within a batch will be removed. Left over items within a batch will be reprocessed in the next batch.

Type parameters

T

returned item's type

Value parameters

backoffStrategy

backoff strategy in case of failure, default can be found at meteor.Client.BackoffStrategy.default.

maxBatchWait

time window to collect items into a batch

Attributes

Returns

a fs2 Pipe from Either[(P, S), T], represent deletion (Left) or put (Right) to Unit.

def delete(partitionKey: P, sortKey: S): F[Unit]

Delete an item by composite keys.

Delete an item by composite keys.

Value parameters

partitionKey

partition key

sortKey

sort key

Attributes

Returns

Unit

def get[T : Decoder](partitionKey: P, sortKey: S, consistentRead: Boolean): F[Option[T]]

Get a single item by composite keys.

Get a single item by composite keys.

Type parameters

T

returned item's type

Value parameters

consistentRead

flag to enable strongly consistent read

partitionKey

partition key

sortKey

sort key

Attributes

Returns

an optional item of type T

def put[T : Encoder](t: T, condition: Expression): F[Unit]

Put an item into a table.

Put an item into a table.

Type parameters

T

item's type

Value parameters

condition

conditional expression

t

item to be put

Attributes

Returns

Unit

def put[T : Encoder, U : Decoder](t: T, condition: Expression): F[Option[U]]

Put an item into a table and return previous value.

Put an item into a table and return previous value.

Type parameters

T

item's type

U

returned item's type

Value parameters

condition

conditional expression

t

item to be put

Attributes

Returns

an option item of type U

def retrieve[T : Decoder](partitionKey: P, consistentRead: Boolean)(implicit evidence$1: Decoder[T], RT: RaiseThrowable[F]): Stream[F, T]

Retrieve all items with the same partition key as a fs2 Stream. A Stream is returned instead of a list because the number of returned items can be very large.

Retrieve all items with the same partition key as a fs2 Stream. A Stream is returned instead of a list because the number of returned items can be very large.

Type parameters

T

returned item's type

Value parameters

RT

implicit evidence for RaiseThrowable

consistentRead

flag to enable strongly consistent read

partitionKey

partition key

Attributes

Returns

a fs2 Stream of items

def update(partitionKey: P, sortKey: S, update: Expression, condition: Expression): F[Unit]

Update an item by composite keys given an update expression when a condition expression is fulfilled. Return Unit.

Update an item by composite keys given an update expression when a condition expression is fulfilled. Return Unit.

Value parameters

condition

conditional expression

partitionKey

partition key

sortKey

sort key

update

update expression

Attributes

Returns

Unit

def update[T : Decoder](partitionKey: P, sortKey: S, returnValue: ReturnValue, update: Expression, condition: Expression): F[Option[T]]

Update an item by composite keys given an update expression when a condition expression is fulfilled. Return item is customizable via returnValue parameter.

Update an item by composite keys given an update expression when a condition expression is fulfilled. Return item is customizable via returnValue parameter.

Type parameters

T

returned item's type

Value parameters

condition

conditional expression

partitionKey

partition key

returnValue

flag to define which item to be returned

sortKey

sort key

update

update expression

Attributes

Returns

an optional item of type T

Deprecated methods

def retrieve[T : Decoder](partitionKey: P, consistentRead: Boolean, limit: Int)(implicit evidence$1: Decoder[T], RT: RaiseThrowable[F]): Stream[F, T]

Retrieve all items with the same partition key as a fs2 Stream. A Stream is returned instead of a list because the number of returned items can be very large.

Retrieve all items with the same partition key as a fs2 Stream. A Stream is returned instead of a list because the number of returned items can be very large.

Type parameters

T

returned item's type

Value parameters

RT

implicit evidence for RaiseThrowable

consistentRead

flag to enable strongly consistent read

limit

number of items to be returned per API call

partitionKey

partition key

Attributes

Returns

a fs2 Stream of items

Deprecated
true

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def retrieve[T : Decoder](query: Query[P, S], consistentRead: Boolean)(implicit evidence$1: Decoder[T], RT: RaiseThrowable[F]): Stream[F, T]

Retrieve items from a composite index, can be a secondary index or a table which has composite keys (partition key and sort key).

Retrieve items from a composite index, can be a secondary index or a table which has composite keys (partition key and sort key).

Type parameters

T

return item's type

Value parameters

RT

implicit evidence for RaiseThrowable

consistentRead

toggle to perform consistent read

query

a query to filter items by key condition

Attributes

Returns

a fs2 Stream of items

Inherited from:
CompositeIndex (hidden)

Deprecated and Inherited methods

def retrieve[T : Decoder](query: Query[P, S], consistentRead: Boolean, limit: Int)(implicit evidence$1: Decoder[T], RT: RaiseThrowable[F]): Stream[F, T]

Retrieve items from a composite index, can be a secondary index or a table which has composite keys (partition key and sort key).

Retrieve items from a composite index, can be a secondary index or a table which has composite keys (partition key and sort key).

Type parameters

T

return item's type

Value parameters

RT

implicit evidence for RaiseThrowable

consistentRead

toggle to perform consistent read

limit

limit the number of items to be returned per API call

query

a query to filter items by key condition

Attributes

Returns

a fs2 Stream of items

Deprecated
true
Inherited from:
CompositeIndex (hidden)

Concrete fields

val index: CompositeKeysIndex[P, S]