-
Notifications
You must be signed in to change notification settings - Fork 467
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
Adding rid to SubscribeToShard response for debugging. #678
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7dc6f37
Adding rid to SubscribeToShard response for debugging.
joshua-kim a459ec6
Addressing PR comments.
joshua-kim 0d45170
Addressing PR comments.
joshua-kim 3691237
Adding default.
joshua-kim 2f6e5d3
Removing unused imports.
joshua-kim dd15ea2
Addressing PR comments.
joshua-kim 67bbdfd
Fixing naming.
joshua-kim dee8bd5
Fixing order of logging.
joshua-kim 64db125
Addressing PR feedback.
joshua-kim 1a78155
Fixing bug in logging.
joshua-kim 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
52 changes: 52 additions & 0 deletions
52
amazon-kinesis-client/src/main/java/software/amazon/kinesis/common/RequestDetails.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,52 @@ | ||
package software.amazon.kinesis.common; | ||
|
||
import lombok.experimental.Accessors; | ||
|
||
import java.util.Optional; | ||
|
||
@Accessors(fluent=true) | ||
public class RequestDetails { | ||
|
||
/** | ||
* Placeholder for logging when no successful request has been made. | ||
*/ | ||
private static final String NONE = "NONE"; | ||
|
||
private final Optional<String> requestId; | ||
private final Optional<String> timestamp; | ||
|
||
public RequestDetails() { | ||
this.requestId = Optional.empty(); | ||
this.timestamp = Optional.empty(); | ||
} | ||
|
||
public RequestDetails(String requestId, String timestamp) { | ||
this.requestId = Optional.of(requestId); | ||
this.timestamp = Optional.of(timestamp); | ||
} | ||
|
||
/** | ||
* Gets last successful request's request id. | ||
* | ||
* @return requestId associated with last successful request. | ||
*/ | ||
public String getRequestId() { | ||
return requestId.orElse(NONE); | ||
} | ||
|
||
/** | ||
* Gets last successful request's timestamp. | ||
* | ||
* @return timestamp associated with last successful request. | ||
*/ | ||
public String getTimestamp() { | ||
return timestamp.orElse(NONE); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format("request id - %s, timestamp - %s", getRequestId(), getTimestamp()); | ||
} | ||
|
||
} | ||
|
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
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.
Similar to blocking publisher, let's update the requestId in DefaultGetRecordsCacheDeamon, makeRetrievalAttempt() method.
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.
Synced offline, this requires us to either add some unit test specific implementation/upgrade mockito major version since AwsResponseMetadata is a final class which we can't mock with older version of mockito.