Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(generate-event): Add Kinesis Analytics events #667

Merged
merged 3 commits into from
Sep 27, 2018

Conversation

willyg302
Copy link
Contributor

Issue #, if available: NA

Description of changes: This adds 4 new events that work with the Kinesis Analytics blueprints. Although they are very similar, 4 are needed because the record data is encoded in different ways -- Base64 only, Base64-encoded DynamoDB record, .zip compressed, and aggregated via the KPL.

Ran the following tests:

tox
# Lots of tests failed presumably because I don't have Docker installed, but
# the generate-event test passed
SAM_CLI_DEV=1 make integ-test
# Verified output of the following:
samdev local generate-event kinesis analytics
samdev local generate-event kinesis analytics-compressed
samdev local generate-event kinesis analytics-dynamodb
samdev local generate-event kinesis analytics-kpl

I also took the generated events and invoked the Kinesis Analytics blueprints with them, and verified successful output.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

"shardId": "shardId-000000000001",
"partitionKey": "partitionKey-01",
"approximateArrivalTimestamp": 1505169657117,
"sequenceNumber": "49571347871967966406409637155186850213682522142927749122"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--sequence is in other Kinesis examples. Lets remain consistent across these events.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, the KPL event in particular is special in that it's useful to have two records (one aggregated and one not), which raises the question of how we would parameterize these -- I can't see --data1 and --data2 being very nice, nor just one record being customizable.

However, the others are very similar so I've deduped them and made --data a parameter (also now with encoding!).

"recordId": "49571347871967966406409637155186850213682522142927749122",
"kinesisStreamRecordMetadata": {
"shardId": "shardId-000000000001",
"partitionKey": "partitionKey-01",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--partition-key is in other Kinesis examples. Lets remain consistent across these events.

"approximateArrivalTimestamp": 1505169657117,
"sequenceNumber": "49571347871967966406409637155186850213682522142927749122"
},
"data": "84mawgoNMTUwNTE2OTY0NTI1MBIlODYwOTcwOTY1NTE0NjQwMzU1MjIwNTI5MjgyNDk2MzU3MTUzNxImNzk1MTM3MTQxMzM4MTE5NTU1OTExMzA1ODMxNDEyOTg2NTM2OTgaiAEIABAAGoEBNDAsYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWEKGogBCAAQARqBATQxLGFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhCkU/elbPye5g1wGkAmxGCNg="
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--data is in other Kinesis examples. Lets remain consistent across these events.
Please apply this across events.

@jfuss jfuss added stage/in-progress A fix is being worked on area/local/generate-event sam local generate-event command labels Sep 17, 2018
@jfuss jfuss merged commit 4c90d27 into aws:develop Sep 27, 2018
@sriram-mv sriram-mv mentioned this pull request Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/local/generate-event sam local generate-event command stage/in-progress A fix is being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants