This repository has been archived by the owner on Apr 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
hildebrand.streams
Moe Aboulkheir edited this page Aug 6, 2015
·
13 revisions
Functions for working with Dynamo Streams API. Function names are linked to the corresponding AWS API documentation.
(describe-stream! creds stream-arn
& [{:keys [limit]} {:keys [chan close?]}])
-
limit
applies to the list of shards included in the response - For the purpose of enumerating the shards in a stream, see hildebrand.streams.channeled/get-shards!
{:stream-arn "arn:aws:dynamodb:...",
:creation-request-date-time 1437398764358,
:key-schema [:user-id :game-title],
:shards
[{:sequence-number-range [100000000000042013365N nil],
:shard-id "shardId-00000001437398769772-bd6e16aa"}],
:stream-label "2015-07-20T13:26:04.362",
:stream-status :enabled,
:stream-view-type :new-and-old-images,
:table-name :hildebrand-test-table-indexed}
- As with the Dynamo functions in hildebrand.core, the key schema
representation is either
[hash-key]
or[hash-key range-key]
- Shard sequence numbers are represented as vectors of
[start end]
, with endnil
for open shards. Sequence numbers are parsed as bigints.
(get-records! creds shard-iterator
& [{:keys [limit]} {:keys [chan close?]}])
- See hildebrand.streams.channeled/get-records! for a more convenient approach
(get-shard-iterator! creds stream-arn shard-id iterator-type
& [{:keys [sequence-number]} {:keys [chan close?]}])
- Valid values for
iterator-type
are:at-sequence-number
,:after-sequence-number
,:trim-horizon
and:latest
. The first two require a:sequence-number
to be specified. -
stream-arn
can be obtained fromdescribe-stream!
, or by passing a table namelatest-stream-arn!
-
shard-id
is obtainable from hildebrand.streams.channeled/get-shards! or via describe-stream!
(list-streams! creds & [{:keys [limit table-name]} {:keys [chan close?]}])
- See hildebrand.streams.channeled/list-streams! for a more convenient implementation
(latest-stream-arn! creds table-name & [_ {:keys [chan close?]}])
- Returns the latest stream ARN for the Dynamo table with the given name
- Performs a describe-table! and returns the value of
:latest-stream-arn