GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(gax): wire up ResumableUploadProgressTracker by whowes · Pull Request #14427 · googleapis/google-cloud-java Conversation
|
|
/gemini review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/gemini review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This pull request introduces progress tracking capabilities for resumable uploads by adding a progress tracker to the upload coordinator and exposing listener registration and progress retrieval methods on the resumable upload future interface. Eager validation of the listener and executor arguments in the registration method is recommended to prevent potential null pointer exceptions.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| public void addProgressListener(ResumableUploadProgressListener listener, Executor executor) { | ||
| progressTracker.addListener(listener, executor); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
To prevent potential NullPointerExceptions or unexpected behavior when registering listeners, we should eagerly validate that both the listener and executor arguments are non-null using checkNotNull.
@Override public void addProgressListener(ResumableUploadProgressListener listener, Executor executor) { checkNotNull(listener, "listener must not be null"); checkNotNull(executor, "executor must not be null"); progressTracker.addListener(listener, executor); }
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
||
| public abstract @Nullable Duration getGlobalTimeout(); | ||
|
|
||
| public abstract Builder setProgressListener(ResumableUploadProgressListener progressListener); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can we mark the setter with @Nullable as well?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| public abstract @Nullable Duration getGlobalTimeout(); | ||
|
|
||
| public abstract Builder setProgressListener(ResumableUploadProgressListener progressListener); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
nit: This is probably a miss from previous PRs that we don't have javadocs on other setters. But usually we have Javadocs on both getters and setters. For example, ClientSettings
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Added Javadoc to the setters
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| public abstract @Nullable Duration getGlobalTimeout(); | ||
|
|
||
| /** | ||
| * Sets the listener notified of upload progress and state transitions. The listener first |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The listener first receives a snapshot of the current upload state
I think it would always be starting from Starting state now?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
True, adjusted javadoc to reflect this.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.