RetryingInputEntity to retry on transient errors#8923
RetryingInputEntity to retry on transient errors#8923jihoonson merged 4 commits intoapache:masterfrom
Conversation
| import java.io.InputStream; | ||
| import java.net.URI; | ||
|
|
||
| public class RetryingInputEntity implements InputEntity |
There was a problem hiding this comment.
I changed my mind, I think this might be better as part of the InputEntity interface so we don't have to wrap RetryingInputEntity everywhere, e.g. swap the default to be for read() instead of read(long offset) and provide a default implementation for getRetryCondition that is always false?
There was a problem hiding this comment.
I think I like this more. 👍 Will update my pr soon.
|
This pull request introduces 1 alert when merging db25fa2 into dc6178d - view on LGTM.com new alerts:
|
| * Directly opens an {@link InputStream} starting at the given offset on the input entity. | ||
| * This is the basic way to read the given entity. | ||
| */ | ||
| InputStream readFrom(long offset) throws IOException; |
There was a problem hiding this comment.
Would there ever be cases where the offset type for an InputEntity might be something other than a long?
If not, can you add a comment about that?
There was a problem hiding this comment.
Hmm good question. It's hard for me to imagine an offset of other types since InputEntity abstracts an byte-representable entity. I added javadoc on it.
|
@clintropolis @jon-wei thanks for the review! |
* RetryingInputEntity to retry on transient errors * fix some javadoc and httpEntity * Make it interface * Javadoc for offset
Description
Reading from some inputSources such as S3 or GS should retry on transient errors.
This PR has:
This change is