-
Notifications
You must be signed in to change notification settings - Fork 863
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
Add Progress Listener Invocation methods to Asynchronous and Synchronous code paths #5044
Open
anirudh9391
wants to merge
70
commits into
feature/anirudkr-progress-listener
Choose a base branch
from
dev/progress-listener
base: feature/anirudkr-progress-listener
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
588b102
Adding interfaces for Progress Listener and state capturing Progress …
anirudh9391 da26d3e
Modified Indentation
anirudh9391 99febb6
Added new change script
anirudh9391 7e70224
Revert "Added new change script"
anirudh9391 5e9057e
Added new change script
anirudh9391 e607d6c
Moved ProgressSnapshot to its own folder
anirudh9391 3d26526
Added sdkResponse to Progress Snapshot
anirudh9391 48a6617
Change totalTransferSize to totalBytes
anirudh9391 b096765
Modify return types of start and elapsedTime to Optional
anirudh9391 b558e6b
Progress Listener Interface definition
anirudh9391 07f2bfb
Address PR comments on Progress Listener
anirudh9391 d2a3253
Fix checkstyle issues
anirudh9391 eaf9470
Fix checkstyle issues
anirudh9391 276fb70
Implement Default Progress Snapshot
anirudh9391 7b24093
Revert "Implement Default Progress Snapshot"
anirudh9391 a943002
Revert "Revert "Implement Default Progress Snapshot""
anirudh9391 1d56ce2
Remove changes to pom
anirudh9391 7c1978b
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 2e66a9a
Add parameterized unit tests
anirudh9391 3ffbca2
fix failing tests
anirudh9391 2dfdef7
Defined ProgressListener invoker methods, along with success and fail…
anirudh9391 713f6c1
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 ba7b059
Address PR comments
anirudh9391 dbdd27d
Remove SDK Preview API annotations
anirudh9391 29259df
Fixed a typo with error logging
anirudh9391 16e06b7
Rectify typo in adding listeners to RequestOverrideConfiguration and …
anirudh9391 54caa47
Added Progress Updater Class to invoke listener methods
anirudh9391 ef05f6b
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 631f674
ProgressUpdater class
anirudh9391 700bd5e
Define ProgressUpdater and LoggingProgressListener
anirudh9391 06f811b
Added ProgressUpdater into ExecutionContext and removed asynchronous …
anirudh9391 3faf34e
Fixed checkstyle issues
anirudh9391 8946bc2
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 8f18496
Merged from master
anirudh9391 6eacf65
Added tests for attemptFailureResponseBytesReceived
anirudh9391 af77917
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 43dd6a2
Asynchronous Code Path Progress Listener WIP
anirudh9391 6b16403
Added Pre and Post Execution stages in Request Pipeline to update th…
joviegas 7a3db5a
Adding Pre, Post execution stages for tracking http requests invoked …
anirudh9391 3f0db6b
Add Progress Listener lifecycle methods to Asynchronous request path
anirudh9391 5d1fc49
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 d3efc8e
Fix rebase
anirudh9391 98a2a85
Fix method call
anirudh9391 51ac003
Remove unintentionally added test class
anirudh9391 210c8ed
Remove needles indentation changes
anirudh9391 6509782
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 944a76d
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 d5f1258
WIP
anirudh9391 582c724
Merge branch 'master' into feature/anirudkr-progress-listener
anirudh9391 55a9bd8
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 8756570
Fix PR comments, added an interface and abstract class to denote Uplo…
anirudh9391 06f2c2d
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 a604bd3
Remove incorrect modification of test class
anirudh9391 be2f663
Repurposed BytesReadTrackingPublisher
anirudh9391 a04b6eb
Merge branch 'master' into dev/progress-listener
anirudh9391 dea870b
Added testing for catching attempt failures
anirudh9391 e0e5e23
Added Tests for async exception reporting
anirudh9391 89b9f0a
Fixed checkstyle
anirudh9391 13a8461
Modified method call signatures
anirudh9391 fa580e4
Added comments to update BytesReadTrackingPublishee class
anirudh9391 2d9cfe7
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 b40b3e1
Revert "Merge branch 'feature/anirudkr-progress-listener' into dev/pr…
anirudh9391 ab9445d
Improve code quality
anirudh9391 3eb5af9
Progress Listener for sync codepath
anirudh9391 f6f2c25
Add response content length
anirudh9391 5239d3c
Merge branch 'master' into dev/progress-listener
anirudh9391 e807dab
Add a No-Op Progress Listener to avoid null checks
anirudh9391 3d472c1
Merge branch 'feature/anirudkr-progress-listener' into dev/progress-l…
anirudh9391 bb99253
Address Pr feedback. Class renaming and method refactoring
anirudh9391 430f198
Pass Response BytesRead as param for wrapping around bytetracking
anirudh9391 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
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
36 changes: 36 additions & 0 deletions
36
...mazon/awssdk/core/internal/http/pipeline/stages/AfterExecutionProgressReportingStage.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,36 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file 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. | ||
*/ | ||
|
||
package software.amazon.awssdk.core.internal.http.pipeline.stages; | ||
|
||
import software.amazon.awssdk.annotations.SdkInternalApi; | ||
import software.amazon.awssdk.core.SdkResponse; | ||
import software.amazon.awssdk.core.internal.http.RequestExecutionContext; | ||
import software.amazon.awssdk.core.internal.http.pipeline.RequestPipeline; | ||
import software.amazon.awssdk.core.internal.util.ProgressListenerUtils; | ||
|
||
@SdkInternalApi | ||
public class AfterExecutionProgressReportingStage<OutputT> implements RequestPipeline<OutputT, OutputT> { | ||
@Override | ||
public OutputT execute(OutputT input, RequestExecutionContext context) throws Exception { | ||
if (input instanceof SdkResponse) { | ||
ProgressListenerUtils.updateProgressListenersWithSuccessResponse((SdkResponse) input, context.progressUpdater()); | ||
} | ||
|
||
return input; | ||
} | ||
|
||
|
||
} |
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
47 changes: 47 additions & 0 deletions
47
...azon/awssdk/core/internal/http/pipeline/stages/BeforeExecutionProgressReportingStage.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,47 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file 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. | ||
*/ | ||
|
||
package software.amazon.awssdk.core.internal.http.pipeline.stages; | ||
|
||
import software.amazon.awssdk.annotations.SdkInternalApi; | ||
import software.amazon.awssdk.core.internal.http.RequestExecutionContext; | ||
import software.amazon.awssdk.core.internal.http.pipeline.RequestToRequestPipeline; | ||
import software.amazon.awssdk.core.internal.progress.listener.DefaultProgressUpdater; | ||
import software.amazon.awssdk.core.internal.progress.listener.NoOpProgressUpdater; | ||
import software.amazon.awssdk.core.internal.progress.listener.ProgressUpdater; | ||
import software.amazon.awssdk.core.internal.util.ProgressListenerUtils; | ||
import software.amazon.awssdk.http.SdkHttpFullRequest; | ||
|
||
@SdkInternalApi | ||
public class BeforeExecutionProgressReportingStage implements RequestToRequestPipeline { | ||
|
||
@Override | ||
public SdkHttpFullRequest execute(SdkHttpFullRequest input, RequestExecutionContext context) throws Exception { | ||
|
||
if (ProgressListenerUtils.progressListenerAttached(context.originalRequest())) { | ||
Long requestContentLength = | ||
(context.requestProvider() != null && context.requestProvider().contentLength().isPresent()) ? | ||
context.requestProvider().contentLength().get() : null; | ||
|
||
ProgressUpdater progressUpdater = new DefaultProgressUpdater(context.originalRequest(), requestContentLength); | ||
progressUpdater.requestPrepared(input); | ||
context.progressUpdater(progressUpdater); | ||
} else { | ||
context.progressUpdater(new NoOpProgressUpdater()); | ||
} | ||
|
||
return input; | ||
} | ||
} |
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
Oops, something went wrong.
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.
It seems requestProvider() returns AsyncRequestBody which is for async code path, what about sync?
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.
Yes, this is only to track the bytes published in the Async request code path; I still have not found a way to track the sync req. Wil put that out in the next pr