-
Notifications
You must be signed in to change notification settings - Fork 1
[XEN-3146] Upgrade to AWS SDK 2.x #43
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
Open
NotAPenguin0
wants to merge
14
commits into
master
Choose a base branch
from
XEN-3146-migrate
base: master
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
14 commits
Select commit
Hold shift + click to select a range
7c6c637
[XEN-3146] migrate to AWS SDK 2.x
NotAPenguin0 21eb695
[XEN-3146] fix first test
NotAPenguin0 a4b137c
[XEN-3146] fix create dir not setting correct content type
NotAPenguin0 2323ce6
[XEN-3146] fix test compilation in CI
NotAPenguin0 fd58e2f
[XEN-3146] remove unneeded init.gradle
NotAPenguin0 7bf66d3
[XEN-3146] remove confusion
NotAPenguin0 bcc59b9
[XEN-3146] remove debug print
NotAPenguin0 639b841
[XEN-3146] unrename properties
NotAPenguin0 b424f07
[XEN-3146] don't disable checksum validation
NotAPenguin0 9182aa4
[XEN-3146] use version variable and class-level getter annotation
NotAPenguin0 aa3be5f
[XEN-3146] port progress tracker properly
NotAPenguin0 8919691
[XEN-3146-migrate] only log progress events every N bytes
NotAPenguin0 f741c54
[XEN-3146] clarify progress tracker logic, swap to unboxed types and …
NotAPenguin0 122ef30
[XEN-3146] fix build with new getter names
NotAPenguin0 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
52 changes: 52 additions & 0 deletions
52
solr-backup/src/main/java/eu/xenit/solr/backup/s3/ProgressTrackingInputStream.java
This file contains hidden or 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 eu.xenit.solr.backup.s3; | ||
|
|
||
| import lombok.NonNull; | ||
|
|
||
| import java.io.FilterInputStream; | ||
| import java.io.IOException; | ||
| import java.io.InputStream; | ||
| import java.util.function.Consumer; | ||
|
|
||
| /** | ||
| * Custom InputStream wrapper that reports the number of bytes read to a listener. | ||
| */ | ||
| public class ProgressTrackingInputStream extends FilterInputStream { | ||
|
|
||
| private final @NonNull Consumer<Long> listener; | ||
| private long bytesRead = 0; | ||
|
|
||
| /** | ||
| * Creates a {@code FilterInputStream} | ||
| * by assigning the argument {@code in} | ||
| * to the field {@code this.in} so as | ||
| * to remember it for later use. | ||
| * | ||
| * @param in the underlying input stream, or {@code null} if | ||
| * this instance is to be created without an underlying stream. | ||
| * @param listener the listener to report the number of bytes read to | ||
| */ | ||
| protected ProgressTrackingInputStream(InputStream in, @NonNull Consumer<Long> listener) { | ||
| super(in); | ||
| this.listener = listener; | ||
| } | ||
|
|
||
| @Override | ||
| public int read() throws IOException { | ||
| int b = super.read(); | ||
| if (b != -1) { | ||
| bytesRead += 1; | ||
| listener.accept(bytesRead); | ||
| } | ||
| return b; | ||
| } | ||
|
|
||
| @Override | ||
| public int read(byte[] b, int off, int len) throws IOException { | ||
| int bytes = super.read(b, off, len); | ||
| if (bytes > 0) { | ||
| bytesRead += bytes; | ||
| listener.accept(bytesRead); | ||
| } | ||
| return bytes; | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.