-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'shard_iterator_type' and 'iterator_timestamp' parameters to Asyn…
…cKinesisConsumer Add 'put_records' method to AsyncKinesisProducer Add tests
- Loading branch information
Nikita Makeev
committed
Jan 9, 2019
1 parent
98fa5c7
commit 7f52fae
Showing
9 changed files
with
244 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.3 | ||
0.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
aioboto3==6.0.1 | ||
multidict==4.5.2 | ||
multidict>=4.5.2 | ||
botocore==1.12.49 | ||
boto3==1.9.49 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ class CheckpointTimeoutException(Exception): | |
class DynamoDB: | ||
""" | ||
Class for checkpointing stream using async calls to DynamoDB | ||
Basically, state.py from kinesis-python client by Evan Borgstrom <[email protected]>, | ||
Based on state.py from kinesis-python client by Evan Borgstrom <[email protected]>, | ||
but with async calls and tailored for per-shard operations | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Next code block is essentially a slightly modified code from https://github.com/NerdWalletOSS/kinesis-python | ||
# and licensed under Apache 2.0 license. | ||
# | ||
# Copyright 2017 NerdWallet | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import collections | ||
import sys | ||
|
||
|
||
def _sizeof(obj, seen=None): | ||
"""Recursively and fully calculate the size of an object""" | ||
obj_id = id(obj) | ||
try: | ||
if obj_id in seen: | ||
return 0 | ||
except TypeError: | ||
seen = set() | ||
|
||
seen.add(obj_id) | ||
|
||
size = sys.getsizeof(obj) | ||
|
||
# since strings are iterables we return their size explicitly first | ||
if isinstance(obj, str): | ||
return size | ||
elif isinstance(obj, collections.Mapping): | ||
return size + sum( | ||
_sizeof(key, seen) + _sizeof(val, seen) | ||
for key, val in obj.items() | ||
) | ||
elif isinstance(obj, collections.Iterable): | ||
return size + sum( | ||
_sizeof(item, seen) | ||
for item in obj | ||
) | ||
|
||
return size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.