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

Bulk stream support #585

Merged
merged 44 commits into from
Aug 21, 2019
Merged

Bulk stream support #585

merged 44 commits into from
Aug 21, 2019

Conversation

ealsur
Copy link
Member

@ealsur ealsur commented Jul 23, 2019

Pull Request Template

Description

This is the base for #584. A subsequent PR will contain the behavioral flag to leverage on the public API layer.

Bulk API Stream implementation allows for throughput optimized scenarios where the user can invoke the normal SDK APIs (Create/Update) and these will be dynamically sorted and dispatched through batches to the Bulk API without the user actively creating a batch.

There are 3 base classes and one executor implementation (operations on the same container):

  • “BatchAsyncOperationContext” is the one that maintains the context for each batch operation, it has the TaskCompletionSource and ItemBatchOperation.
  • “BatchAsyncBatcher” holds a batch of operations with TryAdd implementation and DispatchAsync implementation. DispatchAsync will call a Lambda executor passing it the current batch and complete the Tasks based on the outcome (Failing tasks if an exception occurred, or completing them with the expected result).
  • “BatchAsyncStreamer” has the AddAsync implementation, that leverages the Batcher and will call TryAdd and DispatchAsync as the batcher fills up. It also contains a Timer that dispatches batches that are not full but within a certain period of time.
  • Finally, “BatchAsyncContainerExecutor” is an implementation that handles batches for a single container, using BatchAsyncStreamers, one Streamer per PK Range. The implementation is similar to what the Friends assembly had with CrossPartitionKeyBatchExecutor, it will call AddAsync on the Streamer and pass an Execute implementation that, once the batch is signaled to be dispatched, it will leverage the PartitionKeyRangeBatchExecutor for that batch, and like the CrossPartitionKeyRangeBatchExecutor, taking into consideration possible splits.

Type of change

  • New feature (non-breaking change which adds functionality)

@ealsur ealsur added the feature-request New feature or request label Jul 23, 2019
@ealsur ealsur requested a review from abhijitpai July 23, 2019 14:50
@ealsur ealsur self-assigned this Jul 23, 2019
This was referenced Aug 14, 2019
@kirankumarkolli kirankumarkolli merged commit 5d75ce6 into master Aug 21, 2019
@kirankumarkolli kirankumarkolli deleted the users/ealsur/bulkstream branch August 21, 2019 14:37
@ealsur ealsur mentioned this pull request Sep 5, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants