kinesis_client v1.0.0-rc.0 KinesisClient.Stream.AppState View Source

The AppState is where the information about Stream shards are stored. ShardConsumers will checkpoint the records, and the KinesisClient.Stream.Coordinator will check here to determine what shards to consume.

Link to this section Summary

Functions

Marks a ShardLease as completed.

Persists a new ShardInfo record. Returns an error if there is already a record for that shard_id

Get a KinesisClient.Stream.AppState.ShardInfo struct by shard_id. If there is not an existing record, returns :not_found.

Renew lease. Increments :lease_count.

Update the checkpoint of the shard with the last sequence number that was processed by a ShardConsumer. Will return {:error, :lead_invalid} if the lease does not match what is in ShardInfo and the checkpoint will not be updated.

Link to this section Functions

Link to this function

close_shard(app_name, shard_id, opts \\ [])

View Source

Marks a ShardLease as completed.

This indicates that all records for the shard have been processed by the app. KinesisClient.Stream.Shard processes will not be started for ShardLease's that are completed.

Link to this function

create_lease(app_name, shard_id, lease_owner, opts \\ [])

View Source

Persists a new ShardInfo record. Returns an error if there is already a record for that shard_id

Link to this function

get_lease(app_name, shard_id, opts \\ [])

View Source

Get a KinesisClient.Stream.AppState.ShardInfo struct by shard_id. If there is not an existing record, returns :not_found.

Link to this function

initialize(app_name, opts \\ [])

View Source
Link to this function

renew_lease(app_name, shard_lease, opts \\ [])

View Source

Renew lease. Increments :lease_count.

Link to this function

take_lease(app_name, shard_id, new_owner, lease_count, opts \\ [])

View Source
Link to this function

update_checkpoint(app_name, shard_id, lease, checkpoint, opts \\ [])

View Source

Update the checkpoint of the shard with the last sequence number that was processed by a ShardConsumer. Will return {:error, :lead_invalid} if the lease does not match what is in ShardInfo and the checkpoint will not be updated.