-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adjust MicroBatchSize dynamically based on throttling rate in BulkExecutor #22290
Merged
FabianMeiswinkel
merged 32 commits into
Azure:main
from
FabianMeiswinkel:users/fabianm/dynamicMicroBatchSize
Jun 23, 2021
Merged
Changes from 14 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
af621d7
Temp snapshot
FabianMeiswinkel cddd9ba
Adjusting MicroBatchSize dynamically in BulkExecutor.java
FabianMeiswinkel b35008a
Making sure Bulk Request 429 bubble up to the BulkExecutor so they ar…
FabianMeiswinkel 5d084a7
Adjusting targeted bulk throttling retry rate to be a range
FabianMeiswinkel e586150
Reducing lock contention in PartitionScopeThresholds.java
FabianMeiswinkel 2c80e70
Adding unit test coverage for dynamically changing micro batch size i…
FabianMeiswinkel 81f13c9
Adjusting log level in PartitionScopeThresholds
FabianMeiswinkel 7df608d
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-java …
FabianMeiswinkel 953cb75
Moving new API to V4_17_0 Beta annotation
FabianMeiswinkel 74b679a
Adding missing copyright header
FabianMeiswinkel d8bc67b
Removing 408 special-casing
FabianMeiswinkel 7fb889c
Reacting to code review feedback
FabianMeiswinkel c9dd8df
Reacting to code review feedback
FabianMeiswinkel 94afa94
Reenabling Direct tests
FabianMeiswinkel fd6fb01
Fixing a bug in the new buffering logic causing 400-BadRequest when t…
FabianMeiswinkel f342a90
Fixing type
FabianMeiswinkel b93d87a
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel 83b6be3
Fixes for merge conflicts
FabianMeiswinkel ba971bc
Dummy
FabianMeiswinkel 9938ad8
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel f20f814
Update BulkWriter.scala
FabianMeiswinkel fd5de14
Update BulkProcessingThresholds.java
FabianMeiswinkel ca6fc50
Reverting BridgeInternal changes
FabianMeiswinkel 986d925
Update BridgeInternal.java
FabianMeiswinkel b99113b
Update BulkProcessingOptionsTest.java
FabianMeiswinkel 62bfdba
Triggering flush on completion of input flux
FabianMeiswinkel 74a1d2d
Self-code review feedback :-)
FabianMeiswinkel 424d4d2
Update BulkProcessingThresholds.java
FabianMeiswinkel e169843
Fixing Nullref in BulkWriterTest
FabianMeiswinkel 63b1704
Making FlushBuffersItemOperation a singleton
FabianMeiswinkel 1cfb88e
Fixing build break
FabianMeiswinkel 3eb575f
Fixing test failure
FabianMeiswinkel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
21 changes: 21 additions & 0 deletions
21
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/BulkProcessingThresholds.java
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,21 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.cosmos; | ||
FabianMeiswinkel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import com.azure.cosmos.implementation.batch.PartitionScopeThresholds; | ||
|
||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.concurrent.ConcurrentMap; | ||
|
||
public class BulkProcessingThresholds<TContext> { | ||
FabianMeiswinkel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
private final ConcurrentMap<String, PartitionScopeThresholds<TContext>> partitionScopeThresholds; | ||
|
||
public BulkProcessingThresholds() { | ||
this.partitionScopeThresholds = new ConcurrentHashMap<>(); | ||
} | ||
|
||
ConcurrentMap<String, PartitionScopeThresholds<TContext>> getPartitionScopeThresholds() { | ||
return this.partitionScopeThresholds; | ||
} | ||
} |
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
30 changes: 30 additions & 0 deletions
30
...azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosDaemonThreadFactory.java
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,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.cosmos.implementation; | ||
|
||
import java.util.concurrent.ThreadFactory; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; | ||
import static com.azure.cosmos.implementation.guava27.Strings.lenientFormat; | ||
|
||
public class CosmosDaemonThreadFactory implements ThreadFactory { | ||
private static final String NAME_TEMPLATE = "cosmos-daemon-%s[%s]"; | ||
private final String namePrefix; | ||
private final AtomicInteger threadCount; | ||
|
||
public CosmosDaemonThreadFactory(String namePrefix) { | ||
checkNotNull(namePrefix, "Argument namePrefix must not be null."); | ||
this.namePrefix = namePrefix; | ||
this.threadCount = new AtomicInteger(0); | ||
} | ||
|
||
@Override | ||
public Thread newThread(Runnable r) { | ||
final String name = lenientFormat(NAME_TEMPLATE, this.namePrefix, this.threadCount.incrementAndGet()); | ||
Thread t = new Thread(r, name); | ||
t.setDaemon(true); | ||
return t; | ||
} | ||
} |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there is a specific reason why this is moved before the lock section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed offline, I think we might be having a deadlock due to retires